Commit fcc11a08 by tofunmi Committed by Tofunmi Adigun-Hameed

Update mixed input test to include images of different aspect ratios

Makes this test a little more thorough.

PiperOrigin-RevId: 532386515
(cherry picked from commit 8ab38dc3f97330ecb823f0beb0dc16e79da89d17)
parent 05c2ff34
...@@ -64,6 +64,7 @@ public final class AndroidTestUtil { ...@@ -64,6 +64,7 @@ public final class AndroidTestUtil {
public static final String PNG_ASSET_URI_STRING = public static final String PNG_ASSET_URI_STRING =
"asset:///media/bitmap/input_images/media3test.png"; "asset:///media/bitmap/input_images/media3test.png";
public static final String JPG_ASSET_URI_STRING = "asset:///media/bitmap/input_images/london.jpg";
public static final String MP4_ASSET_URI_STRING = "asset:///media/mp4/sample.mp4"; public static final String MP4_ASSET_URI_STRING = "asset:///media/mp4/sample.mp4";
public static final Format MP4_ASSET_FORMAT = public static final Format MP4_ASSET_FORMAT =
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
package com.google.android.exoplayer2.transformer; package com.google.android.exoplayer2.transformer;
import static com.google.android.exoplayer2.transformer.AndroidTestUtil.JPG_ASSET_URI_STRING;
import static com.google.android.exoplayer2.transformer.AndroidTestUtil.MP4_ASSET_URI_STRING; import static com.google.android.exoplayer2.transformer.AndroidTestUtil.MP4_ASSET_URI_STRING;
import static com.google.android.exoplayer2.transformer.AndroidTestUtil.PNG_ASSET_URI_STRING; import static com.google.android.exoplayer2.transformer.AndroidTestUtil.PNG_ASSET_URI_STRING;
import static com.google.common.truth.Truth.assertThat; import static com.google.common.truth.Truth.assertThat;
...@@ -89,8 +90,6 @@ public class TransformerMixedInputEndToEndTest { ...@@ -89,8 +90,6 @@ public class TransformerMixedInputEndToEndTest {
int imageFrameCount = 32; int imageFrameCount = 32;
EditedMediaItem imageEditedMediaItem = EditedMediaItem imageEditedMediaItem =
createImageEditedMediaItem(PNG_ASSET_URI_STRING, /* frameCount= */ imageFrameCount); createImageEditedMediaItem(PNG_ASSET_URI_STRING, /* frameCount= */ imageFrameCount);
// Result of the following command:
// ffprobe -count_frames -select_streams v:0 -show_entries stream=nb_read_frames sample.mp4
EditedMediaItem videoEditedMediaItem = EditedMediaItem videoEditedMediaItem =
createVideoEditedMediaItem(MP4_ASSET_URI_STRING, /* height= */ 480); createVideoEditedMediaItem(MP4_ASSET_URI_STRING, /* height= */ 480);
ExportTestResult result = ExportTestResult result =
...@@ -117,10 +116,10 @@ public class TransformerMixedInputEndToEndTest { ...@@ -117,10 +116,10 @@ public class TransformerMixedInputEndToEndTest {
.build(); .build();
int imageFrameCount = 33; int imageFrameCount = 33;
EditedMediaItem imageEditedMediaItem = EditedMediaItem imageEditedMediaItem1 =
createImageEditedMediaItem(PNG_ASSET_URI_STRING, /* frameCount= */ imageFrameCount); createImageEditedMediaItem(PNG_ASSET_URI_STRING, /* frameCount= */ imageFrameCount);
// Result of the following command: EditedMediaItem imageEditedMediaItem2 =
// ffprobe -count_frames -select_streams v:0 -show_entries stream=nb_read_frames sample.mp4 createImageEditedMediaItem(JPG_ASSET_URI_STRING, /* frameCount= */ imageFrameCount);
EditedMediaItem videoEditedMediaItem = EditedMediaItem videoEditedMediaItem =
createVideoEditedMediaItem(MP4_ASSET_URI_STRING, /* height= */ 360); createVideoEditedMediaItem(MP4_ASSET_URI_STRING, /* height= */ 360);
ExportTestResult result = ExportTestResult result =
...@@ -132,10 +131,10 @@ public class TransformerMixedInputEndToEndTest { ...@@ -132,10 +131,10 @@ public class TransformerMixedInputEndToEndTest {
ImmutableList.of( ImmutableList.of(
videoEditedMediaItem, videoEditedMediaItem,
videoEditedMediaItem, videoEditedMediaItem,
imageEditedMediaItem, imageEditedMediaItem1,
imageEditedMediaItem, imageEditedMediaItem2,
videoEditedMediaItem, videoEditedMediaItem,
imageEditedMediaItem, imageEditedMediaItem1,
videoEditedMediaItem))); videoEditedMediaItem)));
assertThat(result.exportResult.videoFrameCount) assertThat(result.exportResult.videoFrameCount)
......
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