use of com.google.android.exoplayer2.testutil.FakeExtractorOutput in project ExoPlayer by google.
the class WebvttExtractorTest method read_handlesLargeCueTimestamps.
@Test
public void read_handlesLargeCueTimestamps() throws Exception {
TimestampAdjuster timestampAdjuster = new TimestampAdjuster(/* firstSampleTimestampUs= */
0);
// Prime the TimestampAdjuster with a close-ish timestamp (5s before the first cue).
timestampAdjuster.adjustTsTimestamp(384615190);
WebvttExtractor extractor = new WebvttExtractor(/* language= */
null, timestampAdjuster);
// We can't use ExtractorAsserts because WebvttExtractor doesn't fulfill the whole Extractor
// interface (e.g. throws an exception from seek()).
FakeExtractorOutput output = TestUtil.extractAllSamplesFromFile(extractor, ApplicationProvider.getApplicationContext(), "media/webvtt/with_x-timestamp-map_header");
// The output has a ~5s sampleTime and a large, negative subsampleOffset because the cue
// timestamps are ~10 days ahead of the PTS (due to wrapping) so the offset is used to ensure
// they're rendered at the right time.
DumpFileAsserts.assertOutput(ApplicationProvider.getApplicationContext(), output, "extractordumps/webvtt/with_x-timestamp-map_header.dump");
}
Aggregations