use of com.google.android.exoplayer2.transformer.Transformer in project ExoPlayer by google.
the class TransformerEndToEndTest method startTransformation_removeVideo_completesSuccessfully.
@Test
public void startTransformation_removeVideo_completesSuccessfully() throws Exception {
Transformer transformer = createTransformerBuilder().setRemoveVideo(true).build();
MediaItem mediaItem = MediaItem.fromUri(URI_PREFIX + FILE_AUDIO_VIDEO);
transformer.startTransformation(mediaItem, outputPath);
TransformerTestRunner.runUntilCompleted(transformer);
DumpFileAsserts.assertOutput(context, testMuxer, getDumpFileName(FILE_AUDIO_VIDEO + ".novideo"));
}
use of com.google.android.exoplayer2.transformer.Transformer in project ExoPlayer by google.
the class TransformerEndToEndTest method startTransformation_videoOnlyPassthrough_completesSuccessfully.
@Test
public void startTransformation_videoOnlyPassthrough_completesSuccessfully() throws Exception {
Transformer transformer = createTransformerBuilder().build();
MediaItem mediaItem = MediaItem.fromUri(URI_PREFIX + FILE_VIDEO_ONLY);
transformer.startTransformation(mediaItem, outputPath);
TransformerTestRunner.runUntilCompleted(transformer);
DumpFileAsserts.assertOutput(context, testMuxer, getDumpFileName(FILE_VIDEO_ONLY));
}
use of com.google.android.exoplayer2.transformer.Transformer in project ExoPlayer by google.
the class TransformerEndToEndTest method startTransformation_withVideoEncoderFormatUnsupported_completesWithError.
@Test
public void startTransformation_withVideoEncoderFormatUnsupported_completesWithError() throws Exception {
Transformer transformer = createTransformerBuilder().setTransformationRequest(new TransformationRequest.Builder().setVideoMimeType(// unsupported encoder MIME type
MimeTypes.VIDEO_H263).build()).build();
MediaItem mediaItem = MediaItem.fromUri(URI_PREFIX + FILE_VIDEO_ONLY);
transformer.startTransformation(mediaItem, outputPath);
TransformationException exception = TransformerTestRunner.runUntilError(transformer);
assertThat(exception).hasCauseThat().isInstanceOf(IllegalArgumentException.class);
assertThat(exception.errorCode).isEqualTo(TransformationException.ERROR_CODE_OUTPUT_FORMAT_UNSUPPORTED);
}
use of com.google.android.exoplayer2.transformer.Transformer in project ExoPlayer by google.
the class TransformerEndToEndTest method startTransformation_withAudioDecoderFormatUnsupported_completesWithError.
@Test
public void startTransformation_withAudioDecoderFormatUnsupported_completesWithError() throws Exception {
Transformer transformer = createTransformerBuilder().setTransformationRequest(new TransformationRequest.Builder().setAudioMimeType(// supported by encoder and muxer
MimeTypes.AUDIO_AAC).build()).build();
MediaItem mediaItem = MediaItem.fromUri(URI_PREFIX + FILE_AUDIO_UNSUPPORTED_BY_DECODER);
transformer.startTransformation(mediaItem, outputPath);
TransformationException exception = TransformerTestRunner.runUntilError(transformer);
assertThat(exception).hasCauseThat().isInstanceOf(IllegalArgumentException.class);
assertThat(exception.errorCode).isEqualTo(TransformationException.ERROR_CODE_DECODING_FORMAT_UNSUPPORTED);
}
use of com.google.android.exoplayer2.transformer.Transformer in project ExoPlayer by google.
the class TransformerEndToEndTest method startTransformation_flattenForSlowMotion_completesSuccessfully.
@Test
public void startTransformation_flattenForSlowMotion_completesSuccessfully() throws Exception {
Transformer transformer = createTransformerBuilder().setTransformationRequest(new TransformationRequest.Builder().setFlattenForSlowMotion(true).build()).build();
MediaItem mediaItem = MediaItem.fromUri(URI_PREFIX + FILE_WITH_SEF_SLOW_MOTION);
transformer.startTransformation(mediaItem, outputPath);
TransformerTestRunner.runUntilCompleted(transformer);
DumpFileAsserts.assertOutput(context, testMuxer, getDumpFileName(FILE_WITH_SEF_SLOW_MOTION));
}
Aggregations