public final class SingleSampleMediaChunk extends BaseMediaChunk
BaseMediaChunk for chunks consisting of a single raw sample.seekTimeUschunkIndexdataSource, dataSpec, endTimeUs, startTimeUs, trackFormat, trackSelectionData, trackSelectionReason, type| Constructor and Description |
|---|
SingleSampleMediaChunk(DataSource dataSource,
DataSpec dataSpec,
Format trackFormat,
int trackSelectionReason,
java.lang.Object trackSelectionData,
long startTimeUs,
long endTimeUs,
long chunkIndex,
int trackType,
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 |
isLoadCompleted()
Returns whether the chunk has been fully loaded.
|
void |
load()
Performs the load, returning on completion or cancellation.
|
getFirstSampleIndex, getOutput, initgetNextChunkIndexgetDurationUspublic SingleSampleMediaChunk(DataSource dataSource, DataSpec dataSpec, Format trackFormat, int trackSelectionReason, java.lang.Object trackSelectionData, long startTimeUs, long endTimeUs, long chunkIndex, int trackType, 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, or C.INDEX_UNSET if it is not known.trackType - The type of the chunk. Typically one of the C TRACK_TYPE_*
constants.sampleFormat - The Format of the sample in the chunk.public boolean isLoadCompleted()
MediaChunkisLoadCompleted in class MediaChunkpublic long bytesLoaded()
ChunkbytesLoaded in class Chunkpublic void cancelLoad()
Loader.Loadablepublic 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.