public final class TsChunk extends MediaChunk
| Modifier and Type | Field and Description |
|---|---|
int |
discontinuitySequenceNumber
The discontinuity sequence number of the chunk.
|
HlsExtractorWrapper |
extractorWrapper
The wrapped extractor into which this chunk is being consumed.
|
chunkIndex, 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 |
|---|
TsChunk(DataSource dataSource,
DataSpec dataSpec,
int trigger,
Format format,
long startTimeUs,
long endTimeUs,
int chunkIndex,
int discontinuitySequenceNumber,
HlsExtractorWrapper extractorWrapper,
byte[] encryptionKey,
byte[] encryptionIv) |
| Modifier and Type | Method and Description |
|---|---|
long |
bytesLoaded()
Gets the number of bytes that have been loaded.
|
void |
cancelLoad()
Cancels the load.
|
long |
getAdjustedEndTimeUs() |
boolean |
isLoadCanceled()
Whether the load has been canceled.
|
void |
load()
Performs the load, returning on completion or cancelation.
|
getDurationUs, getNextChunkIndexpublic final int discontinuitySequenceNumber
public final HlsExtractorWrapper extractorWrapper
public TsChunk(DataSource dataSource, DataSpec dataSpec, int trigger, Format format, long startTimeUs, long endTimeUs, int chunkIndex, int discontinuitySequenceNumber, HlsExtractorWrapper extractorWrapper, byte[] encryptionKey, byte[] encryptionIv)
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.discontinuitySequenceNumber - The discontinuity sequence number of the chunk.chunkIndex - The index of the chunk.extractorWrapper - A wrapped extractor to parse samples from the data.encryptionKey - For AES encryption chunks, the encryption key.encryptionIv - For AES encryption chunks, the encryption initialization vector.public long bytesLoaded()
ChunkbytesLoaded in class Chunkpublic void cancelLoad()
Loader.Loadablepublic boolean isLoadCanceled()
Loader.Loadablepublic void load()
throws IOException,
InterruptedException
Loader.LoadableIOExceptionInterruptedExceptionpublic long getAdjustedEndTimeUs()