本文整理汇总了Java中com.google.android.exoplayer.extractor.Extractor.RESULT_SEEK属性的典型用法代码示例。如果您正苦于以下问题:Java Extractor.RESULT_SEEK属性的具体用法?Java Extractor.RESULT_SEEK怎么用?Java Extractor.RESULT_SEEK使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.google.android.exoplayer.extractor.Extractor
的用法示例。
在下文中一共展示了Extractor.RESULT_SEEK属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: read
@Override
public int read(ExtractorInput input, PositionHolder seekPosition) throws IOException,
InterruptedException {
sampleRead = false;
boolean continueReading = true;
while (continueReading && !sampleRead) {
continueReading = reader.read(input);
if (continueReading && maybeSeekForCues(seekPosition, input.getPosition())) {
return Extractor.RESULT_SEEK;
}
}
return continueReading ? Extractor.RESULT_CONTINUE : Extractor.RESULT_END_OF_INPUT;
}
示例2: consumeTestData
public static void consumeTestData(Extractor extractor, byte[] data)
throws IOException, InterruptedException {
FakeExtractorInput input = new FakeExtractorInput.Builder().setData(data).build();
PositionHolder seekPositionHolder = new PositionHolder();
int readResult = Extractor.RESULT_CONTINUE;
while (readResult != Extractor.RESULT_END_OF_INPUT) {
readResult = extractor.read(input, seekPositionHolder);
if (readResult == Extractor.RESULT_SEEK) {
long seekPosition = seekPositionHolder.position;
Assertions.checkState(0 < seekPosition && seekPosition <= Integer.MAX_VALUE);
input.setPosition((int) seekPosition);
}
}
}
示例3: consumeTestData
public static void consumeTestData(Extractor extractor, byte[] data)
throws IOException, InterruptedException {
ExtractorInput input = createTestExtractorInput(data);
PositionHolder seekPositionHolder = new PositionHolder();
int readResult = Extractor.RESULT_CONTINUE;
while (readResult != Extractor.RESULT_END_OF_INPUT) {
readResult = extractor.read(input, seekPositionHolder);
if (readResult == Extractor.RESULT_SEEK) {
input = createTestExtractorInput(data, (int) seekPositionHolder.position);
}
}
}