public class DefaultDashChunkSource extends java.lang.Object implements DashChunkSource
DashChunkSource implementation.| Modifier and Type | Class and Description |
|---|---|
static class |
DefaultDashChunkSource.Factory |
protected static class |
DefaultDashChunkSource.RepresentationHolder
Holds information about a snapshot of a single
Representation. |
protected static class |
DefaultDashChunkSource.RepresentationSegmentIterator
MediaChunkIterator wrapping a DefaultDashChunkSource.RepresentationHolder. |
| Modifier and Type | Field and Description |
|---|---|
protected DefaultDashChunkSource.RepresentationHolder[] |
representationHolders |
| Constructor and Description |
|---|
DefaultDashChunkSource(com.google.android.exoplayer2.upstream.LoaderErrorThrower manifestLoaderErrorThrower,
DashManifest manifest,
int periodIndex,
int[] adaptationSetIndices,
com.google.android.exoplayer2.trackselection.TrackSelection trackSelection,
int trackType,
com.google.android.exoplayer2.upstream.DataSource dataSource,
long elapsedRealtimeOffsetMs,
int maxSegmentsPerLoad,
boolean enableEventMessageTrack,
boolean enableCea608Track,
PlayerEmsgHandler.PlayerTrackEmsgHandler playerTrackEmsgHandler) |
| Modifier and Type | Method and Description |
|---|---|
long |
getAdjustedSeekPositionUs(long positionUs,
com.google.android.exoplayer2.SeekParameters seekParameters) |
void |
getNextChunk(long playbackPositionUs,
long loadPositionUs,
java.util.List<? extends com.google.android.exoplayer2.source.chunk.MediaChunk> queue,
com.google.android.exoplayer2.source.chunk.ChunkHolder out) |
int |
getPreferredQueueSize(long playbackPositionUs,
java.util.List<? extends com.google.android.exoplayer2.source.chunk.MediaChunk> queue) |
void |
maybeThrowError() |
protected com.google.android.exoplayer2.source.chunk.Chunk |
newInitializationChunk(DefaultDashChunkSource.RepresentationHolder representationHolder,
com.google.android.exoplayer2.upstream.DataSource dataSource,
com.google.android.exoplayer2.Format trackFormat,
int trackSelectionReason,
java.lang.Object trackSelectionData,
RangedUri initializationUri,
RangedUri indexUri) |
protected com.google.android.exoplayer2.source.chunk.Chunk |
newMediaChunk(DefaultDashChunkSource.RepresentationHolder representationHolder,
com.google.android.exoplayer2.upstream.DataSource dataSource,
int trackType,
com.google.android.exoplayer2.Format trackFormat,
int trackSelectionReason,
java.lang.Object trackSelectionData,
long firstSegmentNum,
int maxSegmentCount,
long seekTimeUs) |
void |
onChunkLoadCompleted(com.google.android.exoplayer2.source.chunk.Chunk chunk) |
boolean |
onChunkLoadError(com.google.android.exoplayer2.source.chunk.Chunk chunk,
boolean cancelable,
java.lang.Exception e,
long blacklistDurationMs) |
void |
updateManifest(DashManifest newManifest,
int newPeriodIndex)
Updates the manifest.
|
protected final DefaultDashChunkSource.RepresentationHolder[] representationHolders
public DefaultDashChunkSource(com.google.android.exoplayer2.upstream.LoaderErrorThrower manifestLoaderErrorThrower,
DashManifest manifest,
int periodIndex,
int[] adaptationSetIndices,
com.google.android.exoplayer2.trackselection.TrackSelection trackSelection,
int trackType,
com.google.android.exoplayer2.upstream.DataSource dataSource,
long elapsedRealtimeOffsetMs,
int maxSegmentsPerLoad,
boolean enableEventMessageTrack,
boolean enableCea608Track,
@Nullable
PlayerEmsgHandler.PlayerTrackEmsgHandler playerTrackEmsgHandler)
manifestLoaderErrorThrower - Throws errors affecting loading of manifests.manifest - The initial manifest.periodIndex - The index of the period in the manifest.adaptationSetIndices - The indices of the adaptation sets in the period.trackSelection - The track selection.trackType - The type of the tracks in the selection.dataSource - A DataSource suitable for loading the media data.elapsedRealtimeOffsetMs - If known, an estimate of the instantaneous difference between
server-side unix time and SystemClock.elapsedRealtime() in milliseconds, specified
as the server's unix time minus the local elapsed time. If unknown, set to 0.maxSegmentsPerLoad - The maximum number of segments to combine into a single request. Note
that segments will only be combined if their Uris are the same and if their data
ranges are adjacent.enableEventMessageTrack - Whether the chunks generated by the source may output an event
message track.enableCea608Track - Whether the chunks generated by the source may output a CEA-608 track.playerTrackEmsgHandler - The PlayerEmsgHandler.PlayerTrackEmsgHandler instance to handle emsg
messages targeting the player. Maybe null if this is not necessary.public long getAdjustedSeekPositionUs(long positionUs,
com.google.android.exoplayer2.SeekParameters seekParameters)
getAdjustedSeekPositionUs in interface com.google.android.exoplayer2.source.chunk.ChunkSourcepublic void updateManifest(DashManifest newManifest, int newPeriodIndex)
DashChunkSourceupdateManifest in interface DashChunkSourcenewManifest - The new manifest.public void maybeThrowError()
throws java.io.IOException
maybeThrowError in interface com.google.android.exoplayer2.source.chunk.ChunkSourcejava.io.IOExceptionpublic int getPreferredQueueSize(long playbackPositionUs,
java.util.List<? extends com.google.android.exoplayer2.source.chunk.MediaChunk> queue)
getPreferredQueueSize in interface com.google.android.exoplayer2.source.chunk.ChunkSourcepublic void getNextChunk(long playbackPositionUs,
long loadPositionUs,
java.util.List<? extends com.google.android.exoplayer2.source.chunk.MediaChunk> queue,
com.google.android.exoplayer2.source.chunk.ChunkHolder out)
getNextChunk in interface com.google.android.exoplayer2.source.chunk.ChunkSourcepublic void onChunkLoadCompleted(com.google.android.exoplayer2.source.chunk.Chunk chunk)
onChunkLoadCompleted in interface com.google.android.exoplayer2.source.chunk.ChunkSourcepublic boolean onChunkLoadError(com.google.android.exoplayer2.source.chunk.Chunk chunk,
boolean cancelable,
java.lang.Exception e,
long blacklistDurationMs)
onChunkLoadError in interface com.google.android.exoplayer2.source.chunk.ChunkSourceprotected com.google.android.exoplayer2.source.chunk.Chunk newInitializationChunk(DefaultDashChunkSource.RepresentationHolder representationHolder, com.google.android.exoplayer2.upstream.DataSource dataSource, com.google.android.exoplayer2.Format trackFormat, int trackSelectionReason, java.lang.Object trackSelectionData, RangedUri initializationUri, RangedUri indexUri)
protected com.google.android.exoplayer2.source.chunk.Chunk newMediaChunk(DefaultDashChunkSource.RepresentationHolder representationHolder, com.google.android.exoplayer2.upstream.DataSource dataSource, int trackType, com.google.android.exoplayer2.Format trackFormat, int trackSelectionReason, java.lang.Object trackSelectionData, long firstSegmentNum, int maxSegmentCount, long seekTimeUs)