use of androidx.media3.extractor.PositionHolder in project ExoPlayer by google.
the class TsExtractorTest method testCustomInitialSectionReader.
public void testCustomInitialSectionReader() throws Exception {
CustomTsPayloadReaderFactory factory = new CustomTsPayloadReaderFactory(false, true);
TsExtractor tsExtractor = new TsExtractor(TsExtractor.MODE_NORMAL, new TimestampAdjuster(0), factory);
FakeExtractorInput input = new FakeExtractorInput.Builder().setData(TestUtil.getByteArray(getInstrumentation(), "ts/sample_with_sdt.ts")).setSimulateIOErrors(false).setSimulateUnknownLength(false).setSimulatePartialReads(false).build();
tsExtractor.init(new FakeExtractorOutput());
PositionHolder seekPositionHolder = new PositionHolder();
int readResult = Extractor.RESULT_CONTINUE;
while (readResult != Extractor.RESULT_END_OF_INPUT) {
readResult = tsExtractor.read(input, seekPositionHolder);
}
assertEquals(1, factory.sdtReader.consumedSdts);
}
use of androidx.media3.extractor.PositionHolder in project ExoPlayer by google.
the class PsDurationReaderTest method setUp.
@Before
public void setUp() {
tsDurationReader = new PsDurationReader();
seekPositionHolder = new PositionHolder();
}
use of androidx.media3.extractor.PositionHolder in project ExoPlayer by google.
the class PsExtractorSeekTest method setUp.
@Before
public void setUp() throws IOException {
expectedOutput = new FakeExtractorOutput();
positionHolder = new PositionHolder();
extractAllSamplesFromFileToExpectedOutput(ApplicationProvider.getApplicationContext(), PS_FILE_PATH);
expectedTrackOutput = expectedOutput.trackOutputs.get(VIDEO_TRACK_ID);
dataSource = new DefaultDataSource.Factory(ApplicationProvider.getApplicationContext()).createDataSource();
totalInputLength = readInputLength();
}
use of androidx.media3.extractor.PositionHolder in project ExoPlayer by google.
the class TsExtractorTest method customInitialSectionReader.
@Test
public void customInitialSectionReader() throws Exception {
CustomTsPayloadReaderFactory factory = new CustomTsPayloadReaderFactory(false, true);
TsExtractor tsExtractor = new TsExtractor(TsExtractor.MODE_MULTI_PMT, new TimestampAdjuster(0), factory);
FakeExtractorInput input = new FakeExtractorInput.Builder().setData(TestUtil.getByteArray(ApplicationProvider.getApplicationContext(), "media/ts/sample_with_sdt.ts")).setSimulateIOErrors(false).setSimulateUnknownLength(false).setSimulatePartialReads(false).build();
tsExtractor.init(new FakeExtractorOutput());
PositionHolder seekPositionHolder = new PositionHolder();
int readResult = Extractor.RESULT_CONTINUE;
while (readResult != Extractor.RESULT_END_OF_INPUT) {
readResult = tsExtractor.read(input, seekPositionHolder);
if (readResult == Extractor.RESULT_SEEK) {
input.setPosition((int) seekPositionHolder.position);
}
}
assertThat(factory.sdtReader.consumedSdts).isEqualTo(2);
}
use of androidx.media3.extractor.PositionHolder in project ExoPlayer by google.
the class TsExtractorSeekTest method setUp.
@Before
public void setUp() throws IOException {
positionHolder = new PositionHolder();
expectedTrackOutput = TestUtil.extractAllSamplesFromFile(new TsExtractor(), ApplicationProvider.getApplicationContext(), TEST_FILE).trackOutputs.get(AUDIO_TRACK_ID);
dataSource = new DefaultDataSource.Factory(ApplicationProvider.getApplicationContext()).createDataSource();
}
Aggregations