From 803cf64a0617245b486905fa295f75837914c20e Mon Sep 17 00:00:00 2001 From: claincly Date: Mon, 11 Apr 2022 14:50:40 +0100 Subject: [PATCH] Removing using the test asset that has Mp3 audio track. The stream with the mp3 track is added because - We only encode to AAC - We only encode when the source track is not AAC Now that we have a way to force encoding, we no longer need the mp3 track. The test asset is kept for later parameterized testing. PiperOrigin-RevId: 440876080 --- .../RepeatedTranscodeTransformationTest.java | 26 +++++++------------ 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/libraries/transformer/src/androidTest/java/androidx/media3/transformer/mh/RepeatedTranscodeTransformationTest.java b/libraries/transformer/src/androidTest/java/androidx/media3/transformer/mh/RepeatedTranscodeTransformationTest.java index a02be1f3e9..1baa4d4098 100644 --- a/libraries/transformer/src/androidTest/java/androidx/media3/transformer/mh/RepeatedTranscodeTransformationTest.java +++ b/libraries/transformer/src/androidTest/java/androidx/media3/transformer/mh/RepeatedTranscodeTransformationTest.java @@ -19,7 +19,6 @@ import static androidx.media3.common.util.Assertions.checkNotNull; import static com.google.common.truth.Truth.assertWithMessage; import android.content.Context; -import androidx.media3.common.MimeTypes; import androidx.media3.transformer.AndroidTestUtil; import androidx.media3.transformer.TransformationRequest; import androidx.media3.transformer.TransformationTestResult; @@ -46,11 +45,8 @@ public final class RepeatedTranscodeTransformationTest { context, new Transformer.Builder(context) .setTransformationRequest( - new TransformationRequest.Builder() - .setRotationDegrees(45) - // Video MIME type is H264. - .setAudioMimeType(MimeTypes.AUDIO_AAC) - .build()) + new TransformationRequest.Builder().setRotationDegrees(45).build()) + .setEncoderFactory(AndroidTestUtil.FORCE_ENCODE_ENCODER_FACTORY) .build()) .build(); @@ -60,7 +56,7 @@ public final class RepeatedTranscodeTransformationTest { TransformationTestResult testResult = transformerRunner.run( /* testId= */ "repeatedTranscode_givesConsistentLengthOutput_" + i, - AndroidTestUtil.MP4_REMOTE_H264_MP3_URI_STRING); + AndroidTestUtil.MP4_REMOTE_10_SECONDS_URI_STRING); differentOutputSizesBytes.add(checkNotNull(testResult.transformationResult.fileSizeBytes)); } @@ -79,10 +75,8 @@ public final class RepeatedTranscodeTransformationTest { new Transformer.Builder(context) .setRemoveAudio(true) .setTransformationRequest( - new TransformationRequest.Builder() - // Video MIME type is H264. - .setRotationDegrees(45) - .build()) + new TransformationRequest.Builder().setRotationDegrees(45).build()) + .setEncoderFactory(AndroidTestUtil.FORCE_ENCODE_ENCODER_FACTORY) .build()) .build(); @@ -92,7 +86,7 @@ public final class RepeatedTranscodeTransformationTest { TransformationTestResult testResult = transformerRunner.run( /* testId= */ "repeatedTranscodeNoAudio_givesConsistentLengthOutput_" + i, - AndroidTestUtil.MP4_REMOTE_H264_MP3_URI_STRING); + AndroidTestUtil.MP4_REMOTE_10_SECONDS_URI_STRING); differentOutputSizesBytes.add(checkNotNull(testResult.transformationResult.fileSizeBytes)); } @@ -110,10 +104,8 @@ public final class RepeatedTranscodeTransformationTest { context, new Transformer.Builder(context) .setRemoveVideo(true) - .setTransformationRequest( - new TransformationRequest.Builder() - .setAudioMimeType(MimeTypes.AUDIO_AAC) - .build()) + .setTransformationRequest(new TransformationRequest.Builder().build()) + .setEncoderFactory(AndroidTestUtil.FORCE_ENCODE_ENCODER_FACTORY) .build()) .build(); @@ -123,7 +115,7 @@ public final class RepeatedTranscodeTransformationTest { TransformationTestResult testResult = transformerRunner.run( /* testId= */ "repeatedTranscodeNoVideo_givesConsistentLengthOutput_" + i, - AndroidTestUtil.MP4_REMOTE_H264_MP3_URI_STRING); + AndroidTestUtil.MP4_REMOTE_10_SECONDS_URI_STRING); differentOutputSizesBytes.add(checkNotNull(testResult.transformationResult.fileSizeBytes)); }