use of androidx.media3.extractor.PositionHolder in project media by androidx.
the class TsDurationReaderTest method setUp.
@Before
public void setUp() {
tsDurationReader = new TsDurationReader(TsExtractor.DEFAULT_TIMESTAMP_SEARCH_BYTES);
seekPositionHolder = new PositionHolder();
}
use of androidx.media3.extractor.PositionHolder in project media by androidx.
the class TsExtractorSeekTest method readInputFileOnce.
// Internal methods
private void readInputFileOnce(TsExtractor extractor, FakeExtractorOutput extractorOutput, Uri fileUri) throws IOException {
extractor.init(extractorOutput);
int readResult = Extractor.RESULT_CONTINUE;
ExtractorInput input = TestUtil.getExtractorInputFromPosition(dataSource, 0, fileUri);
while (readResult != Extractor.RESULT_END_OF_INPUT) {
try {
while (readResult == Extractor.RESULT_CONTINUE) {
readResult = extractor.read(input, positionHolder);
}
} finally {
DataSourceUtil.closeQuietly(dataSource);
}
if (readResult == Extractor.RESULT_SEEK) {
input = TestUtil.getExtractorInputFromPosition(dataSource, positionHolder.position, fileUri);
readResult = Extractor.RESULT_CONTINUE;
}
}
}
Aggregations