Search in sources :

Example 1 with RunnableFutureTask

use of androidx.media3.common.util.RunnableFutureTask in project media by androidx.

the class DashDownloader method getSegmentIndex.

@Nullable
private DashSegmentIndex getSegmentIndex(DataSource dataSource, int trackType, Representation representation, boolean removing) throws IOException, InterruptedException {
    DashSegmentIndex index = representation.getIndex();
    if (index != null) {
        return index;
    }
    RunnableFutureTask<@NullableType ChunkIndex, IOException> runnable = new RunnableFutureTask<@NullableType ChunkIndex, IOException>() {

        @Override
        @NullableType
        protected ChunkIndex doWork() throws IOException {
            return DashUtil.loadChunkIndex(dataSource, trackType, representation);
        }
    };
    @Nullable ChunkIndex seekMap = execute(runnable, removing);
    return seekMap == null ? null : new DashWrappingSegmentIndex(seekMap, representation.presentationTimeOffsetUs);
}
Also used : DashWrappingSegmentIndex(androidx.media3.exoplayer.dash.DashWrappingSegmentIndex) RunnableFutureTask(androidx.media3.common.util.RunnableFutureTask) IOException(java.io.IOException) NullableType(org.checkerframework.checker.nullness.compatqual.NullableType) DashSegmentIndex(androidx.media3.exoplayer.dash.DashSegmentIndex) ChunkIndex(androidx.media3.extractor.ChunkIndex) Nullable(androidx.annotation.Nullable) Nullable(androidx.annotation.Nullable)

Aggregations

Nullable (androidx.annotation.Nullable)1 RunnableFutureTask (androidx.media3.common.util.RunnableFutureTask)1 DashSegmentIndex (androidx.media3.exoplayer.dash.DashSegmentIndex)1 DashWrappingSegmentIndex (androidx.media3.exoplayer.dash.DashWrappingSegmentIndex)1 ChunkIndex (androidx.media3.extractor.ChunkIndex)1 IOException (java.io.IOException)1 NullableType (org.checkerframework.checker.nullness.compatqual.NullableType)1