Commit 12a61833 by kimvde Committed by Andrew Lewis

Make sure that VideoSamplePipeline is picked for image input

PiperOrigin-RevId: 511449658
parent cb7a8d2d
......@@ -253,4 +253,22 @@ public class ExportTest {
.build()
.run(testId, editedMediaItem);
}
@Test
public void exportImage() throws Exception {
// TODO(b/262693274): consider removing this test when Robolectric tests have been added for
// image input.
String testId = TAG + "_exportImage";
Context context = ApplicationProvider.getApplicationContext();
Transformer transformer = new Transformer.Builder(context).build();
String imageUri = "https://storage.googleapis.com/exoplayer-test-media-1/jpg/london.jpg";
EditedMediaItem editedMediaItem =
new EditedMediaItem.Builder(MediaItem.fromUri(imageUri))
.setDurationUs(1_000_000)
.setFrameRate(30)
.build();
new TransformerAndroidTestRunner.Builder(context, transformer)
.build()
.run(testId, editedMediaItem);
}
}
......@@ -441,9 +441,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
encoderFactory,
muxerWrapper,
fallbackListener);
}
if (MimeTypes.isVideo(firstInputFormat.sampleMimeType)) {
} else { // MIME type is video or image.
return new VideoSamplePipeline(
context,
firstInputFormat,
......@@ -459,7 +457,6 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
debugViewProvider);
}
}
return new EncodedSamplePipeline(
firstInputFormat,
streamStartPositionUs,
......
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