public class ContainerMediaChunk extends BaseMediaChunk
BaseMediaChunk that uses an Extractor to decode sample data.chunkIndexdataSource, dataSpec, endTimeUs, startTimeUs, trackFormat, trackSelectionData, trackSelectionReason, type| Constructor and Description |
|---|
ContainerMediaChunk(DataSource dataSource,
DataSpec dataSpec,
Format trackFormat,
int trackSelectionReason,
java.lang.Object trackSelectionData,
long startTimeUs,
long endTimeUs,
long chunkIndex,
int chunkCount,
long sampleOffsetUs,
ChunkExtractorWrapper extractorWrapper) |
| Modifier and Type | Method and Description |
|---|---|
long |
bytesLoaded()
Returns the number of bytes that have been loaded.
|
void |
cancelLoad()
Cancels the load.
|
long |
getNextChunkIndex()
Returns the next chunk index.
|
boolean |
isLoadCanceled()
Returns whether the load has been canceled.
|
boolean |
isLoadCompleted()
Returns whether the chunk has been fully loaded.
|
void |
load()
Performs the load, returning on completion or cancellation.
|
getFirstSampleIndex, getOutput, initgetDurationUspublic ContainerMediaChunk(DataSource dataSource, DataSpec dataSpec, Format trackFormat, int trackSelectionReason, java.lang.Object trackSelectionData, long startTimeUs, long endTimeUs, long chunkIndex, int chunkCount, long sampleOffsetUs, ChunkExtractorWrapper extractorWrapper)
dataSource - The source from which the data should be loaded.dataSpec - Defines the data to be loaded.trackFormat - See Chunk.trackFormat.trackSelectionReason - See Chunk.trackSelectionReason.trackSelectionData - See Chunk.trackSelectionData.startTimeUs - The start time of the media contained by the chunk, in microseconds.endTimeUs - The end time of the media contained by the chunk, in microseconds.chunkIndex - The index of the chunk.chunkCount - The number of chunks in the underlying media that are spanned by this
instance. Normally equal to one, but may be larger if multiple chunks as defined by the
underlying media are being merged into a single load.sampleOffsetUs - An offset to add to the sample timestamps parsed by the extractor.extractorWrapper - A wrapped extractor to use for parsing the data.public long getNextChunkIndex()
MediaChunkgetNextChunkIndex in class MediaChunkpublic boolean isLoadCompleted()
MediaChunkisLoadCompleted in class MediaChunkpublic final long bytesLoaded()
ChunkbytesLoaded in class Chunkpublic final void cancelLoad()
Loader.Loadablepublic final boolean isLoadCanceled()
Loader.Loadablepublic final void load()
throws java.io.IOException,
java.lang.InterruptedException
Loader.Loadablejava.io.IOException - If the input could not be loaded.java.lang.InterruptedException - If the thread was interrupted.