diff --git a/libraries/test_data/src/test/assets/media/bitmap/sample_mp4_first_frame.png b/libraries/test_data/src/test/assets/media/bitmap/sample_mp4_first_frame.png index fc51b716a0..340accdaea 100644 Binary files a/libraries/test_data/src/test/assets/media/bitmap/sample_mp4_first_frame.png and b/libraries/test_data/src/test/assets/media/bitmap/sample_mp4_first_frame.png differ diff --git a/libraries/test_data/src/test/assets/media/bitmap/sample_mp4_first_frame_rotate90.png b/libraries/test_data/src/test/assets/media/bitmap/sample_mp4_first_frame_rotate90.png index ac721443c9..767f3b8580 100644 Binary files a/libraries/test_data/src/test/assets/media/bitmap/sample_mp4_first_frame_rotate90.png and b/libraries/test_data/src/test/assets/media/bitmap/sample_mp4_first_frame_rotate90.png differ diff --git a/libraries/test_data/src/test/assets/media/bitmap/sample_mp4_first_frame_scale_narrow.png b/libraries/test_data/src/test/assets/media/bitmap/sample_mp4_first_frame_scale_narrow.png index 0c53022a09..b4b734bb27 100644 Binary files a/libraries/test_data/src/test/assets/media/bitmap/sample_mp4_first_frame_scale_narrow.png and b/libraries/test_data/src/test/assets/media/bitmap/sample_mp4_first_frame_scale_narrow.png differ diff --git a/libraries/test_data/src/test/assets/media/bitmap/sample_mp4_first_frame_translate_right.png b/libraries/test_data/src/test/assets/media/bitmap/sample_mp4_first_frame_translate_right.png index 8ad95fe043..0d1905cca7 100644 Binary files a/libraries/test_data/src/test/assets/media/bitmap/sample_mp4_first_frame_translate_right.png and b/libraries/test_data/src/test/assets/media/bitmap/sample_mp4_first_frame_translate_right.png differ diff --git a/libraries/transformer/src/androidTest/java/androidx/media3/transformer/FrameEditorDataProcessingTest.java b/libraries/transformer/src/androidTest/java/androidx/media3/transformer/FrameEditorDataProcessingTest.java index 8b95a7b0c6..527f4568c1 100644 --- a/libraries/transformer/src/androidTest/java/androidx/media3/transformer/FrameEditorDataProcessingTest.java +++ b/libraries/transformer/src/androidTest/java/androidx/media3/transformer/FrameEditorDataProcessingTest.java @@ -48,9 +48,11 @@ import org.junit.Test; import org.junit.runner.RunWith; /** - * Pixel test for frame processing via {@link FrameEditor#processData()}. Expected images are taken - * from emulators, so tests on physical devices may fail. To test on physical devices, please modify - * the MAXIMUM_AVERAGE_PIXEL_ABSOLUTE_DIFFERENCE. + * Pixel test for frame processing via {@link FrameEditor#processData()}. + * + *
Expected images are taken from an emulator, so tests on different emulators or physical + * devices may fail. To test on other devices, please increase the {@link + * #MAXIMUM_AVERAGE_PIXEL_ABSOLUTE_DIFFERENCE} and/or inspect the saved output bitmaps. */ @RunWith(AndroidJUnit4.class) public final class FrameEditorDataProcessingTest { @@ -60,18 +62,7 @@ public final class FrameEditorDataProcessingTest { // Input MP4 file to transform. private static final String INPUT_MP4_ASSET_STRING = "media/mp4/sample.mp4"; - /* Expected first frames after transformation. - * To generate new "expected" assets: - * 1. Insert this code into a test, to download some editedBitmap. - * + try (FileOutputStream fileOutputStream = new FileOutputStream("/sdcard/tmp.png")) { - * + // quality is ignored - * + editedBitmap.compress(Bitmap.CompressFormat.PNG, 100, fileOutputStream); - * + } - * 2. Run the test on a "Nexus 6P API 23" emulator. Emulators are preferred as the automated - * presubmit that will run this test will also be an emulator. API versions 29+ have storage - * restrictions that complicate file generation. - * 3. Open the "Device File Explorer", find "/sdcard/tmp.png", and "Save As..." the file. - */ + /* Expected first frames after transformation. */ private static final String NO_EDITS_EXPECTED_OUTPUT_PNG_ASSET_STRING = "media/bitmap/sample_mp4_first_frame.png"; private static final String TRANSLATE_RIGHT_EXPECTED_OUTPUT_PNG_ASSET_STRING =