Add support for AC-3, AC-4, E-AC-3 and E-AC-3-JOC to playback tests

I added the TS playback tests for these assets without adding support
for the relevant MIME types to ShadowMediaCodec.

Also remove test assets with more than 2 audio channels - this isn't
currently supported by ShadowAudioSystem. I'll re-add these when support
is available.

PiperOrigin-RevId: 338023290
This commit is contained in:
ibaker 2020-10-20 10:28:25 +01:00 committed by Oliver Woodman
parent f54f763db5
commit 57e884b671
11 changed files with 72 additions and 6 deletions

View file

@ -41,22 +41,18 @@ import org.robolectric.annotation.Config;
@RunWith(ParameterizedRobolectricTestRunner.class)
public class TsPlaybackTest {
// TODO: Add samples with >2 audio channels when supported (sample.ac3, sample_ac3.ts,
// sample.eac3, sample_eac3joc.ec3, sample_eac3joc.ts, sample_eac3.ts).
@Parameters(name = "{0}")
public static ImmutableList<String[]> params() {
return ImmutableList.of(
new String[] {"bbb_2500ms.ts"},
new String[] {"elephants_dream.mpg"},
new String[] {"sample.ac3"},
new String[] {"sample_ac3.ts"},
new String[] {"sample.ac4"},
new String[] {"sample_ac4.ts"},
new String[] {"sample.adts"},
new String[] {"sample_ait.ts"},
new String[] {"sample_cbs_truncated.adts"},
new String[] {"sample.eac3"},
new String[] {"sample_eac3joc.ec3"},
new String[] {"sample_eac3joc.ts"},
new String[] {"sample_eac3.ts"},
new String[] {"sample_h262_mpeg_audio.ps"},
new String[] {"sample_h262_mpeg_audio.ts"},
new String[] {"sample_h263.ts"},

View file

@ -76,6 +76,10 @@ public final class ShadowMediaCodecConfig extends ExternalResource {
// Audio codecs
configureCodec("exotest.audio.aac", MimeTypes.AUDIO_AAC);
configureCodec("exotest.audio.ac3", MimeTypes.AUDIO_AC3);
configureCodec("exotest.audio.ac4", MimeTypes.AUDIO_AC4);
configureCodec("exotest.audio.eac3", MimeTypes.AUDIO_E_AC3);
configureCodec("exotest.audio.eac3joc", MimeTypes.AUDIO_E_AC3_JOC);
configureCodec("exotest.audio.flac", MimeTypes.AUDIO_FLAC);
configureCodec("exotest.audio.mpeg", MimeTypes.AUDIO_MPEG);
configureCodec("exotest.audio.mpegl2", MimeTypes.AUDIO_MPEG_L2);

View file

@ -0,0 +1,22 @@
MediaCodec (audio/ac4):
buffers.length = 20
buffers[0] = length 366, hash B4277F9E
buffers[1] = length 366, hash E8E0A142
buffers[2] = length 366, hash 2E5073D0
buffers[3] = length 366, hash 850E71D8
buffers[4] = length 366, hash 69CD444E
buffers[5] = length 366, hash BD24F36D
buffers[6] = length 366, hash E24F2490
buffers[7] = length 366, hash EE6F1F06
buffers[8] = length 366, hash 2DAB000F
buffers[9] = length 366, hash 8102B7EC
buffers[10] = length 366, hash 55BF59AC
buffers[11] = length 494, hash CBC2E09F
buffers[12] = length 519, hash 9DAF56E9
buffers[13] = length 598, hash 8169EE2
buffers[14] = length 435, hash 28C21246
buffers[15] = length 365, hash FF14716D
buffers[16] = length 392, hash 4CC96B29
buffers[17] = length 373, hash D7AC6D4E
buffers[18] = length 392, hash 99F2511F
buffers[19] = length 0, hash 1

View file

@ -0,0 +1,22 @@
MediaCodec (audio/ac4):
buffers.length = 20
buffers[0] = length 366, hash B4277F9E
buffers[1] = length 366, hash E8E0A142
buffers[2] = length 366, hash 2E5073D0
buffers[3] = length 366, hash 850E71D8
buffers[4] = length 366, hash 69CD444E
buffers[5] = length 366, hash BD24F36D
buffers[6] = length 366, hash E24F2490
buffers[7] = length 366, hash EE6F1F06
buffers[8] = length 366, hash 2DAB000F
buffers[9] = length 366, hash 8102B7EC
buffers[10] = length 366, hash 55BF59AC
buffers[11] = length 494, hash CBC2E09F
buffers[12] = length 519, hash 9DAF56E9
buffers[13] = length 598, hash 8169EE2
buffers[14] = length 435, hash 28C21246
buffers[15] = length 365, hash FF14716D
buffers[16] = length 392, hash 4CC96B29
buffers[17] = length 373, hash D7AC6D4E
buffers[18] = length 392, hash 99F2511F
buffers[19] = length 0, hash 1

View file

@ -1,3 +1,25 @@
MediaCodec (audio/eac3):
buffers.length = 20
buffers[0] = length 512, hash E47547D4
buffers[1] = length 512, hash F6A537AC
buffers[2] = length 512, hash 97391682
buffers[3] = length 512, hash CFD3B665
buffers[4] = length 512, hash 2E79A3AF
buffers[5] = length 512, hash 2C24E2A3
buffers[6] = length 512, hash 5BCB9661
buffers[7] = length 512, hash 943ACBF2
buffers[8] = length 512, hash B248E943
buffers[9] = length 512, hash EC2DD86F
buffers[10] = length 512, hash A659332F
buffers[11] = length 512, hash CB641607
buffers[12] = length 512, hash 157489A0
buffers[13] = length 512, hash A37CB66E
buffers[14] = length 512, hash 932F07D4
buffers[15] = length 512, hash 91F50161
buffers[16] = length 512, hash 7F9D6CCB
buffers[17] = length 512, hash 3955F015
buffers[18] = length 512, hash A8E5C938
buffers[19] = length 0, hash 1
MetadataOutput:
Metadata[0]:
entry[0] = AppInfoTable