diff --git a/library/common/src/main/java/com/google/android/exoplayer2/util/FrameProcessor.java b/library/common/src/main/java/com/google/android/exoplayer2/util/FrameProcessor.java index 133b5de38e..e883b2ec14 100644 --- a/library/common/src/main/java/com/google/android/exoplayer2/util/FrameProcessor.java +++ b/library/common/src/main/java/com/google/android/exoplayer2/util/FrameProcessor.java @@ -136,6 +136,7 @@ public interface FrameProcessor { * @param inputBitmap The {@link Bitmap} queued to the {@link FrameProcessor}. * @param durationUs The duration for which to display the {@code inputBitmap}, in microseconds. * @param frameRate The frame rate at which to display the {@code inputBitmap}, in frames per + * second. */ // TODO(b/262693274): Remove duration and frameRate parameters when EditedMediaItem can be // signalled down to the processors. diff --git a/library/effect/src/androidTest/java/com/google/android/exoplayer2/effect/CropPixelTest.java b/library/effect/src/androidTest/java/com/google/android/exoplayer2/effect/CropPixelTest.java index 173ee666b4..f0c23cf348 100644 --- a/library/effect/src/androidTest/java/com/google/android/exoplayer2/effect/CropPixelTest.java +++ b/library/effect/src/androidTest/java/com/google/android/exoplayer2/effect/CropPixelTest.java @@ -106,7 +106,7 @@ public final class CropPixelTest { createArgb8888BitmapFromCurrentGlFramebuffer(outputSize.getWidth(), outputSize.getHeight()); maybeSaveTestBitmapToCacheDirectory(testId, /* bitmapLabel= */ "actual", actualBitmap); - // TODO(b/207848601): switch to using proper tooling for testing against golden data. + // TODO(b/207848601): Switch to using proper tooling for testing against golden data. float averagePixelAbsoluteDifference = getBitmapAveragePixelAbsoluteDifferenceArgb8888(expectedBitmap, actualBitmap, testId); assertThat(averagePixelAbsoluteDifference).isAtMost(MAXIMUM_AVERAGE_PIXEL_ABSOLUTE_DIFFERENCE); @@ -127,7 +127,7 @@ public final class CropPixelTest { createArgb8888BitmapFromCurrentGlFramebuffer(outputSize.getWidth(), outputSize.getHeight()); maybeSaveTestBitmapToCacheDirectory(testId, /* bitmapLabel= */ "actual", actualBitmap); - // TODO(b/207848601): switch to using proper tooling for testing against golden data. + // TODO(b/207848601): Switch to using proper tooling for testing against golden data. float averagePixelAbsoluteDifference = getBitmapAveragePixelAbsoluteDifferenceArgb8888(expectedBitmap, actualBitmap, testId); assertThat(averagePixelAbsoluteDifference).isAtMost(MAXIMUM_AVERAGE_PIXEL_ABSOLUTE_DIFFERENCE); @@ -148,7 +148,7 @@ public final class CropPixelTest { createArgb8888BitmapFromCurrentGlFramebuffer(outputSize.getWidth(), outputSize.getHeight()); maybeSaveTestBitmapToCacheDirectory(testId, /* bitmapLabel= */ "actual", actualBitmap); - // TODO(b/207848601): switch to using proper tooling for testing against golden data. + // TODO(b/207848601): Switch to using proper tooling for testing against golden data. float averagePixelAbsoluteDifference = getBitmapAveragePixelAbsoluteDifferenceArgb8888(expectedBitmap, actualBitmap, testId); assertThat(averagePixelAbsoluteDifference).isAtMost(MAXIMUM_AVERAGE_PIXEL_ABSOLUTE_DIFFERENCE); diff --git a/library/effect/src/androidTest/java/com/google/android/exoplayer2/effect/GlEffectsFrameProcessorPixelTest.java b/library/effect/src/androidTest/java/com/google/android/exoplayer2/effect/GlEffectsFrameProcessorPixelTest.java index c26c0b1ac4..1d19843281 100644 --- a/library/effect/src/androidTest/java/com/google/android/exoplayer2/effect/GlEffectsFrameProcessorPixelTest.java +++ b/library/effect/src/androidTest/java/com/google/android/exoplayer2/effect/GlEffectsFrameProcessorPixelTest.java @@ -96,7 +96,7 @@ public final class GlEffectsFrameProcessorPixelTest { Bitmap actualBitmap = frameProcessorTestRunner.processFirstFrameAndEnd(); - // TODO(b/207848601): switch to using proper tooling for testing against golden data. + // TODO(b/207848601): Switch to using proper tooling for testing against golden data. float averagePixelAbsoluteDifference = getBitmapAveragePixelAbsoluteDifferenceArgb8888(expectedBitmap, actualBitmap, testId); assertThat(averagePixelAbsoluteDifference).isAtMost(MAXIMUM_AVERAGE_PIXEL_ABSOLUTE_DIFFERENCE); @@ -111,7 +111,7 @@ public final class GlEffectsFrameProcessorPixelTest { Bitmap actualBitmap = frameProcessorTestRunner.processImageFrameAndEnd(expectedBitmap); - // TODO(b/207848601): switch to using proper tooling for testing against golden data. + // TODO(b/207848601): Switch to using proper tooling for testing against golden data. float averagePixelAbsoluteDifference = getBitmapAveragePixelAbsoluteDifferenceArgb8888(expectedBitmap, actualBitmap, testId); assertThat(averagePixelAbsoluteDifference).isAtMost(MAXIMUM_AVERAGE_PIXEL_ABSOLUTE_DIFFERENCE); @@ -136,14 +136,14 @@ public final class GlEffectsFrameProcessorPixelTest { Bitmap actualBitmap = frameProcessorTestRunner.processImageFrameAndEnd(originalBitmap); - // TODO(b/207848601): switch to using proper tooling for testing against golden data. + // TODO(b/207848601): Switch to using proper tooling for testing against golden data. float averagePixelAbsoluteDifference = getBitmapAveragePixelAbsoluteDifferenceArgb8888(expectedBitmap, actualBitmap, testId); assertThat(averagePixelAbsoluteDifference).isAtMost(MAXIMUM_AVERAGE_PIXEL_ABSOLUTE_DIFFERENCE); } // TODO(b/262693274): Once texture deletion is added to InternalTextureManager.java, add a test - // queuing multiple input bitmaps to ensure successfully completion without errors, ensuring the - // correct number of frames haas been queued. + // queuing multiple input bitmaps to ensure the operation successfully completes and that the + // correct number of frames has been queued. @Test public void noEffects_withFrameCache_matchesGoldenFile() throws Exception { @@ -156,7 +156,7 @@ public final class GlEffectsFrameProcessorPixelTest { Bitmap actualBitmap = frameProcessorTestRunner.processFirstFrameAndEnd(); - // TODO(b/207848601): switch to using proper tooling for testing against golden data. + // TODO(b/207848601): Switch to using proper tooling for testing against golden data. float averagePixelAbsoluteDifference = getBitmapAveragePixelAbsoluteDifferenceArgb8888(expectedBitmap, actualBitmap, testId); assertThat(averagePixelAbsoluteDifference).isAtMost(MAXIMUM_AVERAGE_PIXEL_ABSOLUTE_DIFFERENCE); @@ -171,7 +171,7 @@ public final class GlEffectsFrameProcessorPixelTest { Bitmap actualBitmap = frameProcessorTestRunner.processFirstFrameAndEnd(); - // TODO(b/207848601): switch to using proper tooling for testing against golden data. + // TODO(b/207848601): Switch to using proper tooling for testing against golden data. float averagePixelAbsoluteDifference = getBitmapAveragePixelAbsoluteDifferenceArgb8888(expectedBitmap, actualBitmap, testId); assertThat(averagePixelAbsoluteDifference).isAtMost(MAXIMUM_AVERAGE_PIXEL_ABSOLUTE_DIFFERENCE); @@ -190,7 +190,7 @@ public final class GlEffectsFrameProcessorPixelTest { Bitmap actualBitmap = frameProcessorTestRunner.processFirstFrameAndEnd(); - // TODO(b/207848601): switch to using proper tooling for testing against golden data. + // TODO(b/207848601): Switch to using proper tooling for testing against golden data. float averagePixelAbsoluteDifference = getBitmapAveragePixelAbsoluteDifferenceArgb8888(expectedBitmap, actualBitmap, testId); assertThat(averagePixelAbsoluteDifference).isAtMost(MAXIMUM_AVERAGE_PIXEL_ABSOLUTE_DIFFERENCE); @@ -211,7 +211,7 @@ public final class GlEffectsFrameProcessorPixelTest { Bitmap actualBitmap = frameProcessorTestRunner.processFirstFrameAndEnd(); - // TODO(b/207848601): switch to using proper tooling for testing against golden data. + // TODO(b/207848601): Switch to using proper tooling for testing against golden data. float averagePixelAbsoluteDifference = getBitmapAveragePixelAbsoluteDifferenceArgb8888(expectedBitmap, actualBitmap, testId); assertThat(averagePixelAbsoluteDifference).isAtMost(MAXIMUM_AVERAGE_PIXEL_ABSOLUTE_DIFFERENCE); @@ -230,7 +230,7 @@ public final class GlEffectsFrameProcessorPixelTest { Bitmap actualBitmap = frameProcessorTestRunner.processFirstFrameAndEnd(); - // TODO(b/207848601): switch to using proper tooling for testing against golden data. + // TODO(b/207848601): Switch to using proper tooling for testing against golden data. float averagePixelAbsoluteDifference = getBitmapAveragePixelAbsoluteDifferenceArgb8888(expectedBitmap, actualBitmap, testId); assertThat(averagePixelAbsoluteDifference).isAtMost(MAXIMUM_AVERAGE_PIXEL_ABSOLUTE_DIFFERENCE); @@ -251,7 +251,7 @@ public final class GlEffectsFrameProcessorPixelTest { Bitmap actualBitmap = frameProcessorTestRunner.processFirstFrameAndEnd(); - // TODO(b/207848601): switch to using proper tooling for testing against golden data. + // TODO(b/207848601): Switch to using proper tooling for testing against golden data. float averagePixelAbsoluteDifference = getBitmapAveragePixelAbsoluteDifferenceArgb8888(expectedBitmap, actualBitmap, testId); assertThat(averagePixelAbsoluteDifference).isAtMost(MAXIMUM_AVERAGE_PIXEL_ABSOLUTE_DIFFERENCE); @@ -268,7 +268,7 @@ public final class GlEffectsFrameProcessorPixelTest { Bitmap actualBitmap = frameProcessorTestRunner.processFirstFrameAndEnd(); - // TODO(b/207848601): switch to using proper tooling for testing against golden data. + // TODO(b/207848601): Switch to using proper tooling for testing against golden data. float averagePixelAbsoluteDifference = getBitmapAveragePixelAbsoluteDifferenceArgb8888(expectedBitmap, actualBitmap, testId); assertThat(averagePixelAbsoluteDifference).isAtMost(MAXIMUM_AVERAGE_PIXEL_ABSOLUTE_DIFFERENCE); @@ -289,7 +289,7 @@ public final class GlEffectsFrameProcessorPixelTest { Bitmap actualBitmap = frameProcessorTestRunner.processFirstFrameAndEnd(); - // TODO(b/207848601): switch to using proper tooling for testing against golden data. + // TODO(b/207848601): Switch to using proper tooling for testing against golden data. float averagePixelAbsoluteDifference = getBitmapAveragePixelAbsoluteDifferenceArgb8888(expectedBitmap, actualBitmap, testId); assertThat(averagePixelAbsoluteDifference).isAtMost(MAXIMUM_AVERAGE_PIXEL_ABSOLUTE_DIFFERENCE); @@ -306,7 +306,7 @@ public final class GlEffectsFrameProcessorPixelTest { Bitmap actualBitmap = frameProcessorTestRunner.processFirstFrameAndEnd(); - // TODO(b/207848601): switch to using proper tooling for testing against golden data. + // TODO(b/207848601): Switch to using proper tooling for testing against golden data. float averagePixelAbsoluteDifference = getBitmapAveragePixelAbsoluteDifferenceArgb8888(expectedBitmap, actualBitmap, testId); assertThat(averagePixelAbsoluteDifference).isAtMost(MAXIMUM_AVERAGE_PIXEL_ABSOLUTE_DIFFERENCE); @@ -329,7 +329,7 @@ public final class GlEffectsFrameProcessorPixelTest { Bitmap actualBitmap = frameProcessorTestRunner.processFirstFrameAndEnd(); - // TODO(b/207848601): switch to using proper tooling for testing against golden data. + // TODO(b/207848601): Switch to using proper tooling for testing against golden data. float averagePixelAbsoluteDifference = getBitmapAveragePixelAbsoluteDifferenceArgb8888(expectedBitmap, actualBitmap, testId); assertThat(averagePixelAbsoluteDifference).isAtMost(MAXIMUM_AVERAGE_PIXEL_ABSOLUTE_DIFFERENCE); @@ -361,7 +361,7 @@ public final class GlEffectsFrameProcessorPixelTest { Bitmap fullRotationAndCenterCropResultBitmap = frameProcessorTestRunner.processFirstFrameAndEnd(); - // TODO(b/207848601): switch to using proper tooling for testing against golden data. + // TODO(b/207848601): Switch to using proper tooling for testing against golden data. float averagePixelAbsoluteDifference = getBitmapAveragePixelAbsoluteDifferenceArgb8888( centerCropResultBitmap, fullRotationAndCenterCropResultBitmap, testId); @@ -377,7 +377,7 @@ public final class GlEffectsFrameProcessorPixelTest { Bitmap actualBitmap = frameProcessorTestRunner.processFirstFrameAndEnd(); - // TODO(b/207848601): switch to using proper tooling for testing against golden data. + // TODO(b/207848601): Switch to using proper tooling for testing against golden data. float averagePixelAbsoluteDifference = getBitmapAveragePixelAbsoluteDifferenceArgb8888(expectedBitmap, actualBitmap, testId); assertThat(averagePixelAbsoluteDifference).isAtMost(MAXIMUM_AVERAGE_PIXEL_ABSOLUTE_DIFFERENCE); @@ -418,7 +418,7 @@ public final class GlEffectsFrameProcessorPixelTest { Bitmap fullRotationBrightnessIncreaseAndCenterCropResultBitmap = frameProcessorTestRunner.processFirstFrameAndEnd(); - // TODO(b/207848601): switch to using proper tooling for testing against golden data. + // TODO(b/207848601): Switch to using proper tooling for testing against golden data. float averagePixelAbsoluteDifference = getBitmapAveragePixelAbsoluteDifferenceArgb8888( centerCropAndBrightnessIncreaseResultBitmap, @@ -465,7 +465,7 @@ public final class GlEffectsFrameProcessorPixelTest { Bitmap fullRotationBrightnessIncreaseAndCenterCropResultBitmap = frameProcessorTestRunner.processFirstFrameAndEnd(); - // TODO(b/207848601): switch to using proper tooling for testing against golden data. + // TODO(b/207848601): Switch to using proper tooling for testing against golden data. float averagePixelAbsoluteDifference = getBitmapAveragePixelAbsoluteDifferenceArgb8888( centerCropAndBrightnessIncreaseResultBitmap, @@ -487,7 +487,7 @@ public final class GlEffectsFrameProcessorPixelTest { Bitmap actualBitmap = frameProcessorTestRunner.processFirstFrameAndEnd(); - // TODO(b/207848601): switch to using proper tooling for testing against golden data. + // TODO(b/207848601): Switch to using proper tooling for testing against golden data. float averagePixelAbsoluteDifference = getBitmapAveragePixelAbsoluteDifferenceArgb8888(expectedBitmap, actualBitmap, testId); assertThat(averagePixelAbsoluteDifference).isAtMost(MAXIMUM_AVERAGE_PIXEL_ABSOLUTE_DIFFERENCE); diff --git a/library/effect/src/androidTest/java/com/google/android/exoplayer2/effect/MatrixShaderProgramPixelTest.java b/library/effect/src/androidTest/java/com/google/android/exoplayer2/effect/MatrixShaderProgramPixelTest.java index f6c85bdf00..21f0d7e4d6 100644 --- a/library/effect/src/androidTest/java/com/google/android/exoplayer2/effect/MatrixShaderProgramPixelTest.java +++ b/library/effect/src/androidTest/java/com/google/android/exoplayer2/effect/MatrixShaderProgramPixelTest.java @@ -109,7 +109,7 @@ public final class MatrixShaderProgramPixelTest { Bitmap actualBitmap = createArgb8888BitmapFromCurrentGlFramebuffer(inputWidth, inputHeight); maybeSaveTestBitmapToCacheDirectory(testId, /* bitmapLabel= */ "actual", actualBitmap); - // TODO(b/207848601): switch to using proper tooling for testing against golden data. + // TODO(b/207848601): Switch to using proper tooling for testing against golden data. float averagePixelAbsoluteDifference = getBitmapAveragePixelAbsoluteDifferenceArgb8888(expectedBitmap, actualBitmap, testId); assertThat(averagePixelAbsoluteDifference).isAtMost(MAXIMUM_AVERAGE_PIXEL_ABSOLUTE_DIFFERENCE); @@ -131,7 +131,7 @@ public final class MatrixShaderProgramPixelTest { Bitmap actualBitmap = createArgb8888BitmapFromCurrentGlFramebuffer(inputWidth, inputHeight); maybeSaveTestBitmapToCacheDirectory(testId, /* bitmapLabel= */ "actual", actualBitmap); - // TODO(b/207848601): switch to using proper tooling for testing against golden data. + // TODO(b/207848601): Switch to using proper tooling for testing against golden data. float averagePixelAbsoluteDifference = getBitmapAveragePixelAbsoluteDifferenceArgb8888(expectedBitmap, actualBitmap, testId); assertThat(averagePixelAbsoluteDifference).isAtMost(MAXIMUM_AVERAGE_PIXEL_ABSOLUTE_DIFFERENCE); @@ -151,7 +151,7 @@ public final class MatrixShaderProgramPixelTest { Bitmap actualBitmap = createArgb8888BitmapFromCurrentGlFramebuffer(inputWidth, inputHeight); maybeSaveTestBitmapToCacheDirectory(testId, /* bitmapLabel= */ "actual", actualBitmap); - // TODO(b/207848601): switch to using proper tooling for testing against golden data. + // TODO(b/207848601): Switch to using proper tooling for testing against golden data. float averagePixelAbsoluteDifference = getBitmapAveragePixelAbsoluteDifferenceArgb8888(expectedBitmap, actualBitmap, testId); assertThat(averagePixelAbsoluteDifference).isAtMost(MAXIMUM_AVERAGE_PIXEL_ABSOLUTE_DIFFERENCE); @@ -171,7 +171,7 @@ public final class MatrixShaderProgramPixelTest { Bitmap actualBitmap = createArgb8888BitmapFromCurrentGlFramebuffer(inputWidth, inputHeight); maybeSaveTestBitmapToCacheDirectory(testId, /* bitmapLabel= */ "actual", actualBitmap); - // TODO(b/207848601): switch to using proper tooling for testing against golden data. + // TODO(b/207848601): Switch to using proper tooling for testing against golden data. float averagePixelAbsoluteDifference = getBitmapAveragePixelAbsoluteDifferenceArgb8888(expectedBitmap, actualBitmap, testId); assertThat(averagePixelAbsoluteDifference).isAtMost(MAXIMUM_AVERAGE_PIXEL_ABSOLUTE_DIFFERENCE); diff --git a/library/effect/src/androidTest/java/com/google/android/exoplayer2/effect/PresentationPixelTest.java b/library/effect/src/androidTest/java/com/google/android/exoplayer2/effect/PresentationPixelTest.java index c6f37daea6..9fbf92c604 100644 --- a/library/effect/src/androidTest/java/com/google/android/exoplayer2/effect/PresentationPixelTest.java +++ b/library/effect/src/androidTest/java/com/google/android/exoplayer2/effect/PresentationPixelTest.java @@ -115,7 +115,7 @@ public final class PresentationPixelTest { createArgb8888BitmapFromCurrentGlFramebuffer(outputSize.getWidth(), outputSize.getHeight()); maybeSaveTestBitmapToCacheDirectory(testId, /* bitmapLabel= */ "actual", actualBitmap); - // TODO(b/207848601): switch to using proper tooling for testing against golden data. + // TODO(b/207848601): Switch to using proper tooling for testing against golden data. float averagePixelAbsoluteDifference = getBitmapAveragePixelAbsoluteDifferenceArgb8888(expectedBitmap, actualBitmap, testId); assertThat(averagePixelAbsoluteDifference).isAtMost(MAXIMUM_AVERAGE_PIXEL_ABSOLUTE_DIFFERENCE); @@ -136,7 +136,7 @@ public final class PresentationPixelTest { createArgb8888BitmapFromCurrentGlFramebuffer(outputSize.getWidth(), outputSize.getHeight()); maybeSaveTestBitmapToCacheDirectory(testId, /* bitmapLabel= */ "actual", actualBitmap); - // TODO(b/207848601): switch to using proper tooling for testing against golden data. + // TODO(b/207848601): Switch to using proper tooling for testing against golden data. float averagePixelAbsoluteDifference = getBitmapAveragePixelAbsoluteDifferenceArgb8888(expectedBitmap, actualBitmap, testId); assertThat(averagePixelAbsoluteDifference).isAtMost(MAXIMUM_AVERAGE_PIXEL_ABSOLUTE_DIFFERENCE); @@ -157,7 +157,7 @@ public final class PresentationPixelTest { createArgb8888BitmapFromCurrentGlFramebuffer(outputSize.getWidth(), outputSize.getHeight()); maybeSaveTestBitmapToCacheDirectory(testId, /* bitmapLabel= */ "actual", actualBitmap); - // TODO(b/207848601): switch to using proper tooling for testing against golden data. + // TODO(b/207848601): Switch to using proper tooling for testing against golden data. float averagePixelAbsoluteDifference = getBitmapAveragePixelAbsoluteDifferenceArgb8888(expectedBitmap, actualBitmap, testId); assertThat(averagePixelAbsoluteDifference).isAtMost(MAXIMUM_AVERAGE_PIXEL_ABSOLUTE_DIFFERENCE); @@ -180,7 +180,7 @@ public final class PresentationPixelTest { createArgb8888BitmapFromCurrentGlFramebuffer(outputSize.getWidth(), outputSize.getHeight()); maybeSaveTestBitmapToCacheDirectory(testId, /* bitmapLabel= */ "actual", actualBitmap); - // TODO(b/207848601): switch to using proper tooling for testing against golden data. + // TODO(b/207848601): Switch to using proper tooling for testing against golden data. float averagePixelAbsoluteDifference = getBitmapAveragePixelAbsoluteDifferenceArgb8888(expectedBitmap, actualBitmap, testId); assertThat(averagePixelAbsoluteDifference).isAtMost(MAXIMUM_AVERAGE_PIXEL_ABSOLUTE_DIFFERENCE); @@ -203,7 +203,7 @@ public final class PresentationPixelTest { createArgb8888BitmapFromCurrentGlFramebuffer(outputSize.getWidth(), outputSize.getHeight()); maybeSaveTestBitmapToCacheDirectory(testId, /* bitmapLabel= */ "actual", actualBitmap); - // TODO(b/207848601): switch to using proper tooling for testing against golden data. + // TODO(b/207848601): Switch to using proper tooling for testing against golden data. float averagePixelAbsoluteDifference = getBitmapAveragePixelAbsoluteDifferenceArgb8888(expectedBitmap, actualBitmap, testId); assertThat(averagePixelAbsoluteDifference).isAtMost(MAXIMUM_AVERAGE_PIXEL_ABSOLUTE_DIFFERENCE); @@ -224,7 +224,7 @@ public final class PresentationPixelTest { createArgb8888BitmapFromCurrentGlFramebuffer(outputSize.getWidth(), outputSize.getHeight()); maybeSaveTestBitmapToCacheDirectory(testId, /* bitmapLabel= */ "actual", actualBitmap); - // TODO(b/207848601): switch to using proper tooling for testing against golden data. + // TODO(b/207848601): Switch to using proper tooling for testing against golden data. float averagePixelAbsoluteDifference = getBitmapAveragePixelAbsoluteDifferenceArgb8888(expectedBitmap, actualBitmap, testId); assertThat(averagePixelAbsoluteDifference).isAtMost(MAXIMUM_AVERAGE_PIXEL_ABSOLUTE_DIFFERENCE); @@ -245,7 +245,7 @@ public final class PresentationPixelTest { createArgb8888BitmapFromCurrentGlFramebuffer(outputSize.getWidth(), outputSize.getHeight()); maybeSaveTestBitmapToCacheDirectory(testId, /* bitmapLabel= */ "actual", actualBitmap); - // TODO(b/207848601): switch to using proper tooling for testing against golden data. + // TODO(b/207848601): Switch to using proper tooling for testing against golden data. float averagePixelAbsoluteDifference = getBitmapAveragePixelAbsoluteDifferenceArgb8888(expectedBitmap, actualBitmap, testId); assertThat(averagePixelAbsoluteDifference).isAtMost(MAXIMUM_AVERAGE_PIXEL_ABSOLUTE_DIFFERENCE); diff --git a/library/effect/src/main/java/com/google/android/exoplayer2/effect/ExternalTextureManager.java b/library/effect/src/main/java/com/google/android/exoplayer2/effect/ExternalTextureManager.java index 1d8102cd2b..3b94892278 100644 --- a/library/effect/src/main/java/com/google/android/exoplayer2/effect/ExternalTextureManager.java +++ b/library/effect/src/main/java/com/google/android/exoplayer2/effect/ExternalTextureManager.java @@ -35,7 +35,7 @@ import java.util.concurrent.atomic.AtomicInteger; * Forwards externally produced frames that become available via a {@link SurfaceTexture} to an * {@link ExternalShaderProgram} for consumption. */ -/* package */ class ExternalTextureManager implements InputListener { +/* package */ final class ExternalTextureManager implements InputListener { private final FrameProcessingTaskExecutor frameProcessingTaskExecutor; private final ExternalShaderProgram externalShaderProgram; diff --git a/library/effect/src/main/java/com/google/android/exoplayer2/effect/FrameCache.java b/library/effect/src/main/java/com/google/android/exoplayer2/effect/FrameCache.java index 2adac83952..9d4e14c1e9 100644 --- a/library/effect/src/main/java/com/google/android/exoplayer2/effect/FrameCache.java +++ b/library/effect/src/main/java/com/google/android/exoplayer2/effect/FrameCache.java @@ -27,7 +27,7 @@ import com.google.android.exoplayer2.util.FrameProcessingException; *
Example usage: cache the processed frames when presenting them on screen, to accommodate for * the possible fluctuation in frame processing time between frames. */ -public class FrameCache implements GlEffect { +public final class FrameCache implements GlEffect { /** The capacity of the frame cache. */ public final int capacity; diff --git a/library/effect/src/main/java/com/google/android/exoplayer2/effect/FrameCacheShaderProgram.java b/library/effect/src/main/java/com/google/android/exoplayer2/effect/FrameCacheShaderProgram.java index 564fb20f31..2cb0dce666 100644 --- a/library/effect/src/main/java/com/google/android/exoplayer2/effect/FrameCacheShaderProgram.java +++ b/library/effect/src/main/java/com/google/android/exoplayer2/effect/FrameCacheShaderProgram.java @@ -35,7 +35,7 @@ import java.util.concurrent.Executor; * *
Implements {@link FrameCache}. */ -/* package */ class FrameCacheShaderProgram implements GlShaderProgram { +/* package */ final class FrameCacheShaderProgram implements GlShaderProgram { private static final String VERTEX_SHADER_TRANSFORMATION_ES2_PATH = "shaders/vertex_shader_transformation_es2.glsl"; private static final String FRAGMENT_SHADER_TRANSFORMATION_ES2_PATH = diff --git a/library/effect/src/main/java/com/google/android/exoplayer2/effect/InternalTextureManager.java b/library/effect/src/main/java/com/google/android/exoplayer2/effect/InternalTextureManager.java index 148db71bd1..4ef9078aff 100644 --- a/library/effect/src/main/java/com/google/android/exoplayer2/effect/InternalTextureManager.java +++ b/library/effect/src/main/java/com/google/android/exoplayer2/effect/InternalTextureManager.java @@ -30,11 +30,11 @@ import java.util.Queue; import java.util.concurrent.LinkedBlockingQueue; /** - * Forwards a frame produced from a {@link Bitmap} to a {@link GlShaderProgram} for consumption + * Forwards a frame produced from a {@link Bitmap} to a {@link GlShaderProgram} for consumption. * *
Methods in this class can be called from any thread.
*/
-/* package */ class InternalTextureManager implements GlShaderProgram.InputListener {
+/* package */ final class InternalTextureManager implements GlShaderProgram.InputListener {
private final GlShaderProgram shaderProgram;
private final FrameProcessingTaskExecutor frameProcessingTaskExecutor;
// The queue holds all bitmaps with one or more frames pending to be sent downstream.
@@ -94,7 +94,7 @@ import java.util.concurrent.LinkedBlockingQueue;
frameProcessingTaskExecutor.submit(
() -> {
inputEnded = true;
- signalEndOfOutput();
+ maybeSignalEndOfOutput();
});
}
@@ -145,12 +145,12 @@ import java.util.concurrent.LinkedBlockingQueue;
currentPresentationTimeUs += currentBitmap.frameDurationUs;
if (framesToQueueForCurrentBitmap == 0) {
pendingBitmaps.remove();
- signalEndOfOutput();
+ maybeSignalEndOfOutput();
}
}
@WorkerThread
- private void signalEndOfOutput() {
+ private void maybeSignalEndOfOutput() {
if (framesToQueueForCurrentBitmap == 0
&& pendingBitmaps.isEmpty()
&& inputEnded
@@ -160,10 +160,7 @@ import java.util.concurrent.LinkedBlockingQueue;
}
}
- /**
- * Value class specifying information to generate all the frames associated with a specific {@link
- * Bitmap}.
- */
+ /** Information to generate all the frames associated with a specific {@link Bitmap}. */
private static final class BitmapFrameSequenceInfo {
public final TextureInfo textureInfo;
public final long frameDurationUs;
diff --git a/library/effect/src/main/java/com/google/android/exoplayer2/effect/OverlaySettings.java b/library/effect/src/main/java/com/google/android/exoplayer2/effect/OverlaySettings.java
index 2e6f6041fd..05af025d8d 100644
--- a/library/effect/src/main/java/com/google/android/exoplayer2/effect/OverlaySettings.java
+++ b/library/effect/src/main/java/com/google/android/exoplayer2/effect/OverlaySettings.java
@@ -38,12 +38,13 @@ public final class OverlaySettings {
/** A builder for {@link OverlaySettings} instances. */
public static final class Builder {
private boolean useHdr;
- private float alpha = 1;
+ private float alpha;
private float[] matrix;
private Pair The coordinates are specified in Normalised Device Coordinates (NDCs). Set to always
* return {@code (0,0)} (the center) by default.
*
- * @param x the NDC x-coordinate.
- * @param y the NDC y-coordinate.
+ * @param x The NDC x-coordinate in the range [-1, 1].
+ * @param y The NDC y-coordinate in the range [-1, 1].
*/
@CanIgnoreReturnValue
public Builder setAnchor(
@FloatRange(from = -1, to = 1) float x, @FloatRange(from = -1, to = 1) float y) {
- checkArgument(
- -1 <= x && x <= 1,
- "x needs to be specified in terms of NDCs which lie in the interval [-1, 1].");
- checkArgument(
- -1 <= y && y <= 1,
- "y needs to be specified in terms of NDCs which lie in the interval [-1, 1].");
+ checkArgument(-1 <= x && x <= 1);
+ checkArgument(-1 <= y && y <= 1);
this.anchor = Pair.create(x, y);
return this;
}
diff --git a/library/transformer/src/androidTest/java/com/google/android/exoplayer2/transformer/mh/ToneMapHdrToSdrUsingOpenGlPixelTest.java b/library/transformer/src/androidTest/java/com/google/android/exoplayer2/transformer/mh/ToneMapHdrToSdrUsingOpenGlPixelTest.java
index 4c57ae4eb7..cd5e3ace80 100644
--- a/library/transformer/src/androidTest/java/com/google/android/exoplayer2/transformer/mh/ToneMapHdrToSdrUsingOpenGlPixelTest.java
+++ b/library/transformer/src/androidTest/java/com/google/android/exoplayer2/transformer/mh/ToneMapHdrToSdrUsingOpenGlPixelTest.java
@@ -139,7 +139,7 @@ public final class ToneMapHdrToSdrUsingOpenGlPixelTest {
}
Log.i(TAG, "Successfully tone mapped.");
- // TODO(b/207848601): switch to using proper tooling for testing against golden data.
+ // TODO(b/207848601): Switch to using proper tooling for testing against golden data.
float averagePixelAbsoluteDifference =
getBitmapAveragePixelAbsoluteDifferenceArgb8888(expectedBitmap, actualBitmap, testId);
assertThat(averagePixelAbsoluteDifference)
@@ -202,7 +202,7 @@ public final class ToneMapHdrToSdrUsingOpenGlPixelTest {
}
Log.i(TAG, "Successfully tone mapped.");
- // TODO(b/207848601): switch to using proper tooling for testing against golden data.
+ // TODO(b/207848601): Switch to using proper tooling for testing against golden data.
float averagePixelAbsoluteDifference =
getBitmapAveragePixelAbsoluteDifferenceArgb8888(expectedBitmap, actualBitmap, testId);
assertThat(averagePixelAbsoluteDifference)
diff --git a/library/transformer/src/androidTest/java/com/google/android/exoplayer2/transformer/mh/ToneMapHdrToSdrUsingOpenGlTest.java b/library/transformer/src/androidTest/java/com/google/android/exoplayer2/transformer/mh/ToneMapHdrToSdrUsingOpenGlTest.java
index d033892df4..ee65e5a71b 100644
--- a/library/transformer/src/androidTest/java/com/google/android/exoplayer2/transformer/mh/ToneMapHdrToSdrUsingOpenGlTest.java
+++ b/library/transformer/src/androidTest/java/com/google/android/exoplayer2/transformer/mh/ToneMapHdrToSdrUsingOpenGlTest.java
@@ -22,7 +22,6 @@ import static com.google.android.exoplayer2.transformer.AndroidTestUtil.MP4_ASSE
import static com.google.android.exoplayer2.transformer.AndroidTestUtil.MP4_ASSET_1080P_5_SECOND_HLG10_FORMAT;
import static com.google.android.exoplayer2.transformer.AndroidTestUtil.recordTestSkipped;
import static com.google.android.exoplayer2.transformer.mh.FileUtil.assertFileHasColorTransfer;
-import static com.google.android.exoplayer2.util.Assertions.checkNotNull;
import android.content.Context;
import android.net.Uri;
@@ -91,10 +90,9 @@ public class ToneMapHdrToSdrUsingOpenGlTest {
new TransformerAndroidTestRunner.Builder(context, transformer)
.build()
.run(testId, mediaItem);
- Log.i(TAG, "Tone mapped.");
assertFileHasColorTransfer(exportTestResult.filePath, C.COLOR_TRANSFER_SDR);
} catch (TransformationException exception) {
- Log.i(TAG, checkNotNull(exception.getCause()).toString());
+ Log.e(TAG, "Error during transformation.", exception);
if (exception.errorCode != TransformationException.ERROR_CODE_DECODING_FORMAT_UNSUPPORTED) {
throw exception;
}
@@ -142,10 +140,9 @@ public class ToneMapHdrToSdrUsingOpenGlTest {
new TransformerAndroidTestRunner.Builder(context, transformer)
.build()
.run(testId, mediaItem);
- Log.i(TAG, "Tone mapped.");
assertFileHasColorTransfer(exportTestResult.filePath, C.COLOR_TRANSFER_SDR);
} catch (TransformationException exception) {
- Log.i(TAG, checkNotNull(exception.getCause()).toString());
+ Log.e(TAG, "Error during transformation.", exception);
if (exception.errorCode != TransformationException.ERROR_CODE_DECODING_FORMAT_UNSUPPORTED) {
throw exception;
}
diff --git a/library/transformer/src/main/java/com/google/android/exoplayer2/transformer/ExoPlayerAssetLoader.java b/library/transformer/src/main/java/com/google/android/exoplayer2/transformer/ExoPlayerAssetLoader.java
index 4cb0690c89..ce40abd7d1 100644
--- a/library/transformer/src/main/java/com/google/android/exoplayer2/transformer/ExoPlayerAssetLoader.java
+++ b/library/transformer/src/main/java/com/google/android/exoplayer2/transformer/ExoPlayerAssetLoader.java
@@ -299,18 +299,18 @@ public final class ExoPlayerAssetLoader implements AssetLoader {
if (tracks.isTypeSelected(C.TRACK_TYPE_VIDEO)) {
trackCount++;
}
- if (trackCount == 0) {
+
+ if (trackCount > 0) {
+ assetLoaderListener.onTrackCount(trackCount);
+ // Start the renderers after having registered all the tracks to make sure the AssetLoader
+ // listener callbacks are called in the right order.
+ player.play();
+ } else {
assetLoaderListener.onError(
TransformationException.createForAssetLoader(
new IllegalStateException("The asset loader has no track to output."),
ERROR_CODE_FAILED_RUNTIME_CHECK));
- return;
- } else {
- assetLoaderListener.onTrackCount(trackCount);
}
- // Start the renderers after having registered all the tracks to make sure the AssetLoader
- // listener callbacks are called in the right order.
- player.play();
}
@Override
diff --git a/library/transformer/src/main/java/com/google/android/exoplayer2/transformer/Transformer.java b/library/transformer/src/main/java/com/google/android/exoplayer2/transformer/Transformer.java
index 0526d002db..38d902d475 100644
--- a/library/transformer/src/main/java/com/google/android/exoplayer2/transformer/Transformer.java
+++ b/library/transformer/src/main/java/com/google/android/exoplayer2/transformer/Transformer.java
@@ -399,7 +399,7 @@ public final class Transformer {
*