public final class SingleSampleMediaChunk extends BaseMediaChunk
BaseMediaChunk for chunks consisting of a single raw sample.isMediaFormatFinalchunkIndex, endTimeUs, startTimeUsdataSource, dataSpec, format, NO_PARENT_ID, parentId, trigger, TRIGGER_ADAPTIVE, TRIGGER_CUSTOM_BASE, TRIGGER_INITIAL, TRIGGER_MANUAL, TRIGGER_TRICK_PLAY, TRIGGER_UNSPECIFIED, type, TYPE_CUSTOM_BASE, TYPE_DRM, TYPE_MANIFEST, TYPE_MEDIA, TYPE_MEDIA_INITIALIZATION, TYPE_UNSPECIFIED| Constructor and Description |
|---|
SingleSampleMediaChunk(DataSource dataSource,
DataSpec dataSpec,
int trigger,
Format format,
long startTimeUs,
long endTimeUs,
int chunkIndex,
MediaFormat sampleFormat,
DrmInitData sampleDrmInitData,
int parentId) |
| Modifier and Type | Method and Description |
|---|---|
long |
bytesLoaded()
Gets the number of bytes that have been loaded.
|
void |
cancelLoad()
Cancels the load.
|
DrmInitData |
getDrmInitData()
Gets the
DrmInitData corresponding to the chunk. |
MediaFormat |
getMediaFormat()
Gets the
MediaFormat corresponding to the chunk. |
boolean |
isLoadCanceled()
Whether the load has been canceled.
|
void |
load()
Performs the load, returning on completion or cancelation.
|
getFirstSampleIndex, getOutput, initgetDurationUs, getNextChunkIndexpublic SingleSampleMediaChunk(DataSource dataSource, DataSpec dataSpec, int trigger, Format format, long startTimeUs, long endTimeUs, int chunkIndex, MediaFormat sampleFormat, DrmInitData sampleDrmInitData, int parentId)
dataSource - A DataSource for loading the data.dataSpec - Defines the data to be loaded.trigger - The reason for this chunk being selected.format - The format of the stream to which this chunk belongs.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.sampleFormat - The format of the sample.sampleDrmInitData - The DrmInitData for the sample. Null if the sample is not drm
protected.parentId - Identifier for a parent from which this chunk originates.public long bytesLoaded()
ChunkbytesLoaded in class Chunkpublic MediaFormat getMediaFormat()
BaseMediaChunkMediaFormat corresponding to the chunk.
See BaseMediaChunk.isMediaFormatFinal for information about when this method is guaranteed to return
correct data.
getMediaFormat in class BaseMediaChunkMediaFormat corresponding to this chunk.public DrmInitData getDrmInitData()
BaseMediaChunkDrmInitData corresponding to the chunk.
See BaseMediaChunk.isMediaFormatFinal for information about when this method is guaranteed to return
correct data.
getDrmInitData in class BaseMediaChunkDrmInitData corresponding to this chunk.public void cancelLoad()
Loader.Loadablepublic boolean isLoadCanceled()
Loader.Loadablepublic void load()
throws IOException,
InterruptedException
Loader.LoadableIOExceptionInterruptedException