public abstract class BaseMediaChunk extends MediaChunk
MediaChunk
, for chunks that contain a single track.
Loaded samples are output to a DefaultTrackOutput
.
chunkIndex
dataSource, dataSpec, endTimeUs, startTimeUs, trackFormat, trackSelectionData, trackSelectionReason, type
Constructor and Description |
---|
BaseMediaChunk(DataSource dataSource,
DataSpec dataSpec,
Format trackFormat,
int trackSelectionReason,
Object trackSelectionData,
long startTimeUs,
long endTimeUs,
int chunkIndex) |
Modifier and Type | Method and Description |
---|---|
int |
getFirstSampleIndex()
Returns the index of the first sample in the output that was passed to
init(DefaultTrackOutput) that will originate from this chunk. |
protected DefaultTrackOutput |
getTrackOutput()
Returns the track output most recently passed to
init(DefaultTrackOutput) . |
void |
init(DefaultTrackOutput trackOutput)
Initializes the chunk for loading, setting the
DefaultTrackOutput that will receive
samples as they are loaded. |
getNextChunkIndex, isLoadCompleted
bytesLoaded, getDurationUs
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
cancelLoad, isLoadCanceled, load
public BaseMediaChunk(DataSource dataSource, DataSpec dataSpec, Format trackFormat, int trackSelectionReason, Object trackSelectionData, long startTimeUs, long endTimeUs, int chunkIndex)
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.public void init(DefaultTrackOutput trackOutput)
DefaultTrackOutput
that will receive
samples as they are loaded.trackOutput
- The output that will receive the loaded samples.public final int getFirstSampleIndex()
init(DefaultTrackOutput)
that will originate from this chunk.protected final DefaultTrackOutput getTrackOutput()
init(DefaultTrackOutput)
.