Commit 5c32c5ce by tofunmi Committed by Tofunmi Adigun-Hameed

DefaultVideoFrameProcessorMultipleTextureOutputPixelTest fixes & cleanup

PiperOrigin-RevId: 538495675
(cherry picked from commit 85bfc08595c40f646e8090dd81c7ae79080cf70f)
parent a2467d4d
...@@ -75,11 +75,12 @@ public class DefaultVideoFrameProcessorMultipleTextureOutputPixelTest { ...@@ -75,11 +75,12 @@ public class DefaultVideoFrameProcessorMultipleTextureOutputPixelTest {
/* frameRate= */ 1); /* frameRate= */ 1);
videoFrameProcessorTestRunner.endFrameProcessing(); videoFrameProcessorTestRunner.endFrameProcessing();
Set<Long> outputTimestamps = checkNotNull(textureBitmapReader).getOutputTimestamps(); TextureBitmapReader textureBitmapReader = checkNotNull(this.textureBitmapReader);
Set<Long> outputTimestamps = textureBitmapReader.getOutputTimestamps();
assertThat(outputTimestamps) assertThat(outputTimestamps)
.containsExactly( .containsExactly(
offsetUs, offsetUs + C.MICROS_PER_SECOND, offsetUs + 2 * C.MICROS_PER_SECOND); offsetUs, offsetUs + C.MICROS_PER_SECOND, offsetUs + 2 * C.MICROS_PER_SECOND);
Bitmap actualBitmap = checkNotNull(textureBitmapReader).getBitmap(offsetUs); Bitmap actualBitmap = textureBitmapReader.getBitmap(offsetUs);
maybeSaveTestBitmap(testId, /* bitmapLabel= */ "actual", actualBitmap, /* path= */ null); maybeSaveTestBitmap(testId, /* bitmapLabel= */ "actual", actualBitmap, /* path= */ null);
float averagePixelAbsoluteDifference = float averagePixelAbsoluteDifference =
BitmapPixelTestUtil.getBitmapAveragePixelAbsoluteDifferenceArgb8888( BitmapPixelTestUtil.getBitmapAveragePixelAbsoluteDifferenceArgb8888(
...@@ -107,7 +108,8 @@ public class DefaultVideoFrameProcessorMultipleTextureOutputPixelTest { ...@@ -107,7 +108,8 @@ public class DefaultVideoFrameProcessorMultipleTextureOutputPixelTest {
/* frameRate= */ 1); /* frameRate= */ 1);
videoFrameProcessorTestRunner.endFrameProcessing(); videoFrameProcessorTestRunner.endFrameProcessing();
Set<Long> outputTimestamps = checkNotNull(textureBitmapReader).getOutputTimestamps(); TextureBitmapReader textureBitmapReader = checkNotNull(this.textureBitmapReader);
Set<Long> outputTimestamps = textureBitmapReader.getOutputTimestamps();
assertThat(outputTimestamps) assertThat(outputTimestamps)
.containsExactly( .containsExactly(
offsetUs1, offsetUs1,
...@@ -115,9 +117,9 @@ public class DefaultVideoFrameProcessorMultipleTextureOutputPixelTest { ...@@ -115,9 +117,9 @@ public class DefaultVideoFrameProcessorMultipleTextureOutputPixelTest {
offsetUs2, offsetUs2,
offsetUs2 + C.MICROS_PER_SECOND, offsetUs2 + C.MICROS_PER_SECOND,
offsetUs2 + 2 * C.MICROS_PER_SECOND); offsetUs2 + 2 * C.MICROS_PER_SECOND);
Bitmap actualBitmap1 = checkNotNull(textureBitmapReader).getBitmap(offsetUs1); Bitmap actualBitmap1 = textureBitmapReader.getBitmap(offsetUs1);
maybeSaveTestBitmap(testId, /* bitmapLabel= */ "actual1", actualBitmap1, /* path= */ null); maybeSaveTestBitmap(testId, /* bitmapLabel= */ "actual1", actualBitmap1, /* path= */ null);
Bitmap actualBitmap2 = checkNotNull(textureBitmapReader).getBitmap(offsetUs2); Bitmap actualBitmap2 = textureBitmapReader.getBitmap(offsetUs2);
maybeSaveTestBitmap(testId, /* bitmapLabel= */ "actual2", actualBitmap2, /* path= */ null); maybeSaveTestBitmap(testId, /* bitmapLabel= */ "actual2", actualBitmap2, /* path= */ null);
float averagePixelAbsoluteDifference1 = float averagePixelAbsoluteDifference1 =
BitmapPixelTestUtil.getBitmapAveragePixelAbsoluteDifferenceArgb8888( BitmapPixelTestUtil.getBitmapAveragePixelAbsoluteDifferenceArgb8888(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment