public class ContainerMediaChunk extends BaseMediaChunk implements ChunkExtractorWrapper.SingleTrackMetadataOutput
BaseMediaChunk
that uses an Extractor
to decode sample data.chunkIndex
dataSource, dataSpec, endTimeUs, startTimeUs, trackFormat, trackSelectionData, trackSelectionReason, type
Constructor and Description |
---|
ContainerMediaChunk(DataSource dataSource,
DataSpec dataSpec,
Format trackFormat,
int trackSelectionReason,
Object trackSelectionData,
long startTimeUs,
long endTimeUs,
int chunkIndex,
long sampleOffsetUs,
ChunkExtractorWrapper extractorWrapper,
Format sampleFormat) |
Modifier and Type | Method and Description |
---|---|
long |
bytesLoaded()
Returns the number of bytes that have been loaded.
|
void |
cancelLoad()
Cancels the load.
|
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.
|
void |
seekMap(SeekMap seekMap) |
getFirstSampleIndex, getTrackOutput, init
getNextChunkIndex
getDurationUs
public ContainerMediaChunk(DataSource dataSource, DataSpec dataSpec, Format trackFormat, int trackSelectionReason, Object trackSelectionData, long startTimeUs, long endTimeUs, int chunkIndex, long sampleOffsetUs, ChunkExtractorWrapper extractorWrapper, Format sampleFormat)
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.sampleOffsetUs
- An offset to add to the sample timestamps parsed by the extractor.extractorWrapper
- A wrapped extractor to use for parsing the data.sampleFormat
- The Format
of the samples in the chunk, if known. May be null if
the data is known to define its own sample format.public boolean isLoadCompleted()
MediaChunk
isLoadCompleted
in class MediaChunk
public final long bytesLoaded()
Chunk
bytesLoaded
in class Chunk
public final void seekMap(SeekMap seekMap)
seekMap
in interface ChunkExtractorWrapper.SingleTrackMetadataOutput
ExtractorOutput.seekMap(SeekMap)
public final void cancelLoad()
Loader.Loadable
cancelLoad
in interface Loader.Loadable
public final boolean isLoadCanceled()
Loader.Loadable
isLoadCanceled
in interface Loader.Loadable
public final void load() throws IOException, InterruptedException
Loader.Loadable
load
in interface Loader.Loadable
IOException
InterruptedException