Add DASH CEA-608 playback test

This was generated by combining the existing `ts/bbb_2500ms.ts` test
asset and a temporary `.srt` file using
https://cloud.google.com/transcoder/docs/how-to/captions-and-subtitles

This doesn't directly reproduce the problem fixed by
7ca26f898d,
because the CEA-608 subs are structured differently to the stream I
discovered the problem with (from Issue: androidx/media#887). However this test
does fail if that fix is reverted after
486230fbd7.

I'm also not able to repro the character duplication reported in
Issue: androidx/media#887 by just changing the manifest in this CL. I'm not yet
sure on the exact differences between the stream provided on GitHub
and this stream.

This stream does provide some regression protection, because it
currently fails with 'new' subtitle parsing
(`DashMediaSource.Factory.experimentalParseSubtitlesDuringExtraction(true)`),
though I'm not sure on the exact reason for that yet.

PiperOrigin-RevId: 592476328
This commit is contained in:
ibaker 2023-12-20 01:10:24 -08:00 committed by Copybara-Service
parent 36b7a49d52
commit 8b9bf5e7cd
5 changed files with 1646 additions and 0 deletions

View File

@ -167,6 +167,33 @@ public final class DashPlaybackTest {
applicationContext, playbackOutput, "playbackdumps/dash/ttml-in-mp4.dump");
}
@Test
public void cea608() throws Exception {
Context applicationContext = ApplicationProvider.getApplicationContext();
CapturingRenderersFactory capturingRenderersFactory =
new CapturingRenderersFactory(applicationContext);
// TODO(b/181312195): Opt this test into the new subtitle parsing when it works.
ExoPlayer player =
new ExoPlayer.Builder(applicationContext, capturingRenderersFactory)
.setClock(new FakeClock(/* isAutoAdvancing= */ true))
.build();
player.setVideoSurface(new Surface(new SurfaceTexture(/* texName= */ 1)));
PlaybackOutput playbackOutput = PlaybackOutput.register(player, capturingRenderersFactory);
// Ensure the subtitle track is selected.
DefaultTrackSelector trackSelector =
checkNotNull((DefaultTrackSelector) player.getTrackSelector());
trackSelector.setParameters(trackSelector.buildUponParameters().setPreferredTextLanguage("en"));
player.setMediaItem(MediaItem.fromUri("asset:///media/dash/cea608/manifest.mpd"));
player.prepare();
player.play();
TestPlayerRunHelper.runUntilPlaybackState(player, Player.STATE_ENDED);
player.release();
DumpFileAsserts.assertOutput(
applicationContext, playbackOutput, "playbackdumps/dash/cea608.dump");
}
// https://github.com/google/ExoPlayer/issues/8710
@Test
public void emsgNearToPeriodBoundary() throws Exception {

View File

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" minBufferTime="PT1.500000S" type="static" xmlns:cenc="urn:mpeg:cenc:2013" mediaPresentationDuration="PT0H0M2.500S" profiles="urn:mpeg:dash:profile:isoff-on-demand:2011">
<Period id="0" duration="PT2.500S">
<AdaptationSet mimeType="video/mp4">
<Accessibility schemeIdUri="urn:scte:dash:cc:cea-608:2015" value="CC1=eng"/>
<Representation codecs="avc1.64001e" width="640" height="360" bandwidth="742564" id="sd-dash">
<BaseURL>sd-dash0000000000.m4s</BaseURL>
<SegmentList presentationTimeOffset="0" duration="24998" timescale="10000">
<Initialization range="0-671"/>
<SegmentURL mediaRange="672-232714"/>
</SegmentList>
</Representation>
</AdaptationSet>
<AdaptationSet mimeType="audio/mp4">
<Representation codecs="mp4a.40.2" audioSamplingRate="48000" bandwidth="73273" id="audio-dash">
<BaseURL>audio-dash0000000000.m4s</BaseURL>
<SegmentList presentationTimeOffset="0" duration="116736" timescale="48000">
<Initialization range="0-593"/>
<SegmentURL mediaRange="594-22869"/>
</SegmentList>
</Representation>
</AdaptationSet>
</Period>
</MPD>

File diff suppressed because it is too large Load Diff