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
This commit is contained in:
claincly 2022-04-11 14:50:40 +01:00 committed by Ian Baker
parent c007068ddb
commit 803cf64a06

View File

@ -19,7 +19,6 @@ import static androidx.media3.common.util.Assertions.checkNotNull;
import static com.google.common.truth.Truth.assertWithMessage; import static com.google.common.truth.Truth.assertWithMessage;
import android.content.Context; import android.content.Context;
import androidx.media3.common.MimeTypes;
import androidx.media3.transformer.AndroidTestUtil; import androidx.media3.transformer.AndroidTestUtil;
import androidx.media3.transformer.TransformationRequest; import androidx.media3.transformer.TransformationRequest;
import androidx.media3.transformer.TransformationTestResult; import androidx.media3.transformer.TransformationTestResult;
@ -46,11 +45,8 @@ public final class RepeatedTranscodeTransformationTest {
context, context,
new Transformer.Builder(context) new Transformer.Builder(context)
.setTransformationRequest( .setTransformationRequest(
new TransformationRequest.Builder() new TransformationRequest.Builder().setRotationDegrees(45).build())
.setRotationDegrees(45) .setEncoderFactory(AndroidTestUtil.FORCE_ENCODE_ENCODER_FACTORY)
// Video MIME type is H264.
.setAudioMimeType(MimeTypes.AUDIO_AAC)
.build())
.build()) .build())
.build(); .build();
@ -60,7 +56,7 @@ public final class RepeatedTranscodeTransformationTest {
TransformationTestResult testResult = TransformationTestResult testResult =
transformerRunner.run( transformerRunner.run(
/* testId= */ "repeatedTranscode_givesConsistentLengthOutput_" + i, /* testId= */ "repeatedTranscode_givesConsistentLengthOutput_" + i,
AndroidTestUtil.MP4_REMOTE_H264_MP3_URI_STRING); AndroidTestUtil.MP4_REMOTE_10_SECONDS_URI_STRING);
differentOutputSizesBytes.add(checkNotNull(testResult.transformationResult.fileSizeBytes)); differentOutputSizesBytes.add(checkNotNull(testResult.transformationResult.fileSizeBytes));
} }
@ -79,10 +75,8 @@ public final class RepeatedTranscodeTransformationTest {
new Transformer.Builder(context) new Transformer.Builder(context)
.setRemoveAudio(true) .setRemoveAudio(true)
.setTransformationRequest( .setTransformationRequest(
new TransformationRequest.Builder() new TransformationRequest.Builder().setRotationDegrees(45).build())
// Video MIME type is H264. .setEncoderFactory(AndroidTestUtil.FORCE_ENCODE_ENCODER_FACTORY)
.setRotationDegrees(45)
.build())
.build()) .build())
.build(); .build();
@ -92,7 +86,7 @@ public final class RepeatedTranscodeTransformationTest {
TransformationTestResult testResult = TransformationTestResult testResult =
transformerRunner.run( transformerRunner.run(
/* testId= */ "repeatedTranscodeNoAudio_givesConsistentLengthOutput_" + i, /* testId= */ "repeatedTranscodeNoAudio_givesConsistentLengthOutput_" + i,
AndroidTestUtil.MP4_REMOTE_H264_MP3_URI_STRING); AndroidTestUtil.MP4_REMOTE_10_SECONDS_URI_STRING);
differentOutputSizesBytes.add(checkNotNull(testResult.transformationResult.fileSizeBytes)); differentOutputSizesBytes.add(checkNotNull(testResult.transformationResult.fileSizeBytes));
} }
@ -110,10 +104,8 @@ public final class RepeatedTranscodeTransformationTest {
context, context,
new Transformer.Builder(context) new Transformer.Builder(context)
.setRemoveVideo(true) .setRemoveVideo(true)
.setTransformationRequest( .setTransformationRequest(new TransformationRequest.Builder().build())
new TransformationRequest.Builder() .setEncoderFactory(AndroidTestUtil.FORCE_ENCODE_ENCODER_FACTORY)
.setAudioMimeType(MimeTypes.AUDIO_AAC)
.build())
.build()) .build())
.build(); .build();
@ -123,7 +115,7 @@ public final class RepeatedTranscodeTransformationTest {
TransformationTestResult testResult = TransformationTestResult testResult =
transformerRunner.run( transformerRunner.run(
/* testId= */ "repeatedTranscodeNoVideo_givesConsistentLengthOutput_" + i, /* testId= */ "repeatedTranscodeNoVideo_givesConsistentLengthOutput_" + i,
AndroidTestUtil.MP4_REMOTE_H264_MP3_URI_STRING); AndroidTestUtil.MP4_REMOTE_10_SECONDS_URI_STRING);
differentOutputSizesBytes.add(checkNotNull(testResult.transformationResult.fileSizeBytes)); differentOutputSizesBytes.add(checkNotNull(testResult.transformationResult.fileSizeBytes));
} }