diff options
author | Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> | 2024-05-18 08:01:33 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2024-05-18 08:01:33 +0000 |
commit | c712a6c6fbf6f2f699a4d4d48513c06b7e3f4829 (patch) | |
tree | 20f0002451630f0e40902f473cff53d8082b1527 | |
parent | 31ff8184c052fdb0446a4e02aee336d3636e0727 (diff) | |
parent | c651ddbc23ea6651c4fe5ef3e2d2cfcb514c6b3d (diff) | |
download | cts-main.tar.gz |
Merge "mediav2 CTS: keep params with standard samplerate and channel counts" into mainHEADmastermain
-rw-r--r-- | tests/media/src/android/mediav2/cts/CodecEncoderBlockModelMultiAccessUnitTest.java | 53 | ||||
-rw-r--r-- | tests/media/src/android/mediav2/cts/CodecEncoderMultiAccessUnitTest.java | 51 |
2 files changed, 54 insertions, 50 deletions
diff --git a/tests/media/src/android/mediav2/cts/CodecEncoderBlockModelMultiAccessUnitTest.java b/tests/media/src/android/mediav2/cts/CodecEncoderBlockModelMultiAccessUnitTest.java index 5f57dc753b7..acdbdae1238 100644 --- a/tests/media/src/android/mediav2/cts/CodecEncoderBlockModelMultiAccessUnitTest.java +++ b/tests/media/src/android/mediav2/cts/CodecEncoderBlockModelMultiAccessUnitTest.java @@ -25,7 +25,6 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; -import static org.junit.Assume.assumeTrue; import android.media.AudioFormat; import android.media.MediaCodec; @@ -96,28 +95,35 @@ public class CodecEncoderBlockModelMultiAccessUnitTest extends CodecEncoderBlock @Parameterized.Parameters(name = "{index}_{0}_{1}_{3}") public static Collection<Object[]> input() { List<Object[]> defArgsList = new ArrayList<>(Arrays.asList(new Object[][]{ - // mediaType, arrays of bit-rates, sample rates, channel counts, pcm encoding - {MediaFormat.MIMETYPE_AUDIO_AAC, new int[]{64000, 128000}, new int[]{8000, 12000, - 16000, 22050, 24000, 32000, 44100, 48000}, new int[]{1, 2}, - AudioFormat.ENCODING_PCM_16BIT}, - {MediaFormat.MIMETYPE_AUDIO_OPUS, new int[]{64000, 128000}, new int[]{8000, 12000, - 16000, 24000, 48000}, new int[]{1, 2}, - AudioFormat.ENCODING_PCM_16BIT}, - {MediaFormat.MIMETYPE_AUDIO_AMR_NB, new int[]{4750, 5150, 5900, 6700, 7400, 7950, - 10200, 12200}, new int[]{8000}, new int[]{1}, - AudioFormat.ENCODING_PCM_16BIT}, - {MediaFormat.MIMETYPE_AUDIO_AMR_WB, new int[]{6600, 8850, 12650, 14250, 15850, - 18250, 19850, 23050, 23850}, new int[]{16000}, new int[]{1}, - AudioFormat.ENCODING_PCM_16BIT}, - {MediaFormat.MIMETYPE_AUDIO_FLAC, new int[]{0, 1, 2, 3, 4, 5, 6, 7, 8}, - new int[]{8000, 16000, 32000, 48000, 96000, 192000}, new int[]{1, 2}, - AudioFormat.ENCODING_PCM_16BIT}, - {MediaFormat.MIMETYPE_AUDIO_FLAC, new int[]{0, 1, 2, 3, 4, 5, 6, 7, 8}, - new int[]{8000, 16000, 32000, 48000, 96000, 192000}, new int[]{1, 2}, - AudioFormat.ENCODING_PCM_FLOAT}, + // mediaType, arrays of bit-rates, sample rate, channel counts, pcm encoding + + // mono testing @ common sample rates, pcm encoding + {MediaFormat.MIMETYPE_AUDIO_AAC, new int[]{64000}, new int[]{8000, 16000}, + new int[]{1}, AudioFormat.ENCODING_PCM_16BIT}, + {MediaFormat.MIMETYPE_AUDIO_OPUS, new int[]{64000}, new int[]{8000, 16000}, + new int[]{1}, AudioFormat.ENCODING_PCM_16BIT}, + {MediaFormat.MIMETYPE_AUDIO_AMR_NB, new int[]{4750, 12200}, new int[]{8000}, + new int[]{1}, AudioFormat.ENCODING_PCM_16BIT}, + {MediaFormat.MIMETYPE_AUDIO_AMR_WB, new int[]{6600, 23850}, new int[]{16000}, + new int[]{1}, AudioFormat.ENCODING_PCM_16BIT}, + {MediaFormat.MIMETYPE_AUDIO_FLAC, new int[]{0, 7}, new int[]{8000, 16000}, + new int[]{1}, AudioFormat.ENCODING_PCM_16BIT}, + {MediaFormat.MIMETYPE_AUDIO_FLAC, new int[]{0, 7}, new int[]{8000, 16000}, + new int[]{1}, AudioFormat.ENCODING_PCM_FLOAT}, + + // stereo testing @ common sample rates, pcm encoding + {MediaFormat.MIMETYPE_AUDIO_AAC, new int[]{128000}, new int[]{44100, 48000}, + new int[]{2}, AudioFormat.ENCODING_PCM_16BIT}, + {MediaFormat.MIMETYPE_AUDIO_OPUS, new int[]{128000}, new int[]{48000}, + new int[]{2}, AudioFormat.ENCODING_PCM_16BIT}, + {MediaFormat.MIMETYPE_AUDIO_FLAC, new int[]{0, 7}, new int[]{48000, 192000}, + new int[]{2}, AudioFormat.ENCODING_PCM_16BIT}, + {MediaFormat.MIMETYPE_AUDIO_FLAC, new int[]{0, 7}, new int[]{48000, 192000}, + new int[]{2}, AudioFormat.ENCODING_PCM_FLOAT}, })); List<Object[]> argsList = flattenParams(defArgsList); - return prepareParamList(argsList, true, true, false, true); + return prepareParamList(argsList, true, true, false, true, ComponentClass.ALL, + new String[]{FEATURE_MultipleFrames}); } public CodecEncoderBlockModelMultiAccessUnitTest(String encoder, String mediaType, @@ -297,11 +303,6 @@ public class CodecEncoderBlockModelMultiAccessUnitTest extends CodecEncoderBlock @LargeTest @Test(timeout = PER_TEST_TIMEOUT_LARGE_TEST_MS) public void testSimpleEncode() throws IOException, InterruptedException { - assumeTrue(mCodecName + " does not support FEATURE_MultipleFrames", - isFeatureSupported(mCodecName, mMediaType, FEATURE_MultipleFrames)); - assumeTrue(mCodecName + " is not compatible with LinearBlocks", - MediaCodec.LinearBlock.isCodecCopyFreeCompatible(new String[]{mCodecName})); - CodecEncoderTestBase referenceBase = new CodecEncoderTestBase(mCodecName, mMediaType, new EncoderConfigParams[]{mActiveEncCfg}, mAllTestParams); referenceBase.encodeToMemory(mCodecName, mActiveEncCfg, mActiveRawRes, Integer.MAX_VALUE, diff --git a/tests/media/src/android/mediav2/cts/CodecEncoderMultiAccessUnitTest.java b/tests/media/src/android/mediav2/cts/CodecEncoderMultiAccessUnitTest.java index ed55b72a476..2dfcd087669 100644 --- a/tests/media/src/android/mediav2/cts/CodecEncoderMultiAccessUnitTest.java +++ b/tests/media/src/android/mediav2/cts/CodecEncoderMultiAccessUnitTest.java @@ -24,7 +24,6 @@ import static android.mediav2.cts.CodecDecoderMultiAccessUnitTest.getCompression import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; -import static org.junit.Assume.assumeTrue; import android.media.AudioFormat; import android.media.MediaCodec; @@ -93,28 +92,35 @@ public class CodecEncoderMultiAccessUnitTest extends CodecEncoderTestBase { @Parameterized.Parameters(name = "{index}_{0}_{1}_{3}") public static Collection<Object[]> input() { List<Object[]> defArgsList = new ArrayList<>(Arrays.asList(new Object[][]{ - // mediaType, arrays of bit-rates, sample rates, channel counts, pcm encoding - {MediaFormat.MIMETYPE_AUDIO_AAC, new int[]{64000, 128000}, new int[]{8000, 12000, - 16000, 22050, 24000, 32000, 44100, 48000}, new int[]{1, 2}, - AudioFormat.ENCODING_PCM_16BIT}, - {MediaFormat.MIMETYPE_AUDIO_OPUS, new int[]{64000, 128000}, new int[]{8000, 12000, - 16000, 24000, 48000}, new int[]{1, 2}, - AudioFormat.ENCODING_PCM_16BIT}, - {MediaFormat.MIMETYPE_AUDIO_AMR_NB, new int[]{4750, 5150, 5900, 6700, 7400, 7950, - 10200, 12200}, new int[]{8000}, new int[]{1}, - AudioFormat.ENCODING_PCM_16BIT}, - {MediaFormat.MIMETYPE_AUDIO_AMR_WB, new int[]{6600, 8850, 12650, 14250, 15850, - 18250, 19850, 23050, 23850}, new int[]{16000}, new int[]{1}, - AudioFormat.ENCODING_PCM_16BIT}, - {MediaFormat.MIMETYPE_AUDIO_FLAC, new int[]{0, 1, 2, 3, 4, 5, 6, 7, 8}, - new int[]{8000, 16000, 32000, 48000, 96000, 192000}, new int[]{1, 2}, - AudioFormat.ENCODING_PCM_16BIT}, - {MediaFormat.MIMETYPE_AUDIO_FLAC, new int[]{0, 1, 2, 3, 4, 5, 6, 7, 8}, - new int[]{8000, 16000, 32000, 48000, 96000, 192000}, new int[]{1, 2}, - AudioFormat.ENCODING_PCM_FLOAT}, + // mediaType, arrays of bit-rates, sample rate, channel counts, pcm encoding + + // mono testing @ common sample rates, pcm encoding + {MediaFormat.MIMETYPE_AUDIO_AAC, new int[]{64000}, new int[]{8000, 16000}, + new int[]{1}, AudioFormat.ENCODING_PCM_16BIT}, + {MediaFormat.MIMETYPE_AUDIO_OPUS, new int[]{64000}, new int[]{8000, 16000}, + new int[]{1}, AudioFormat.ENCODING_PCM_16BIT}, + {MediaFormat.MIMETYPE_AUDIO_AMR_NB, new int[]{4750, 12200}, new int[]{8000}, + new int[]{1}, AudioFormat.ENCODING_PCM_16BIT}, + {MediaFormat.MIMETYPE_AUDIO_AMR_WB, new int[]{6600, 23850}, new int[]{16000}, + new int[]{1}, AudioFormat.ENCODING_PCM_16BIT}, + {MediaFormat.MIMETYPE_AUDIO_FLAC, new int[]{0, 7}, new int[]{8000, 16000}, + new int[]{1}, AudioFormat.ENCODING_PCM_16BIT}, + {MediaFormat.MIMETYPE_AUDIO_FLAC, new int[]{0, 7}, new int[]{8000, 16000}, + new int[]{1}, AudioFormat.ENCODING_PCM_FLOAT}, + + // stereo testing @ common sample rates, pcm encoding + {MediaFormat.MIMETYPE_AUDIO_AAC, new int[]{128000}, new int[]{44100, 48000}, + new int[]{2}, AudioFormat.ENCODING_PCM_16BIT}, + {MediaFormat.MIMETYPE_AUDIO_OPUS, new int[]{128000}, new int[]{48000}, + new int[]{2}, AudioFormat.ENCODING_PCM_16BIT}, + {MediaFormat.MIMETYPE_AUDIO_FLAC, new int[]{0, 7}, new int[]{48000, 192000}, + new int[]{2}, AudioFormat.ENCODING_PCM_16BIT}, + {MediaFormat.MIMETYPE_AUDIO_FLAC, new int[]{0, 7}, new int[]{48000, 192000}, + new int[]{2}, AudioFormat.ENCODING_PCM_FLOAT}, })); List<Object[]> argsList = flattenParams(defArgsList); - return prepareParamList(argsList, true, true, false, true); + return prepareParamList(argsList, true, true, false, true, ComponentClass.ALL, + new String[]{FEATURE_MultipleFrames}); } public CodecEncoderMultiAccessUnitTest(String encoder, String mediaType, @@ -285,9 +291,6 @@ public class CodecEncoderMultiAccessUnitTest extends CodecEncoderTestBase { @LargeTest @Test(timeout = PER_TEST_TIMEOUT_LARGE_TEST_MS) public void testSimpleEncode() throws IOException, InterruptedException { - assumeTrue(mCodecName + " does not support FEATURE_MultipleFrames", - isFeatureSupported(mCodecName, mMediaType, FEATURE_MultipleFrames)); - CodecEncoderTestBase cetb = new CodecEncoderTestBase(mCodecName, mMediaType, new EncoderConfigParams[]{mActiveEncCfg}, mAllTestParams); cetb.encodeToMemory(mCodecName, mActiveEncCfg, mActiveRawRes, Integer.MAX_VALUE, true, |