Class DefaultDashChunkSource
- java.lang.Object
-
- com.google.android.exoplayer2.source.dash.DefaultDashChunkSource
-
- All Implemented Interfaces:
ChunkSource,DashChunkSource
@Deprecated public class DefaultDashChunkSource extends Object implements DashChunkSource
Deprecated.com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.A defaultDashChunkSourceimplementation.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDefaultDashChunkSource.FactoryDeprecated.protected static classDefaultDashChunkSource.RepresentationHolderDeprecated.Holds information about a snapshot of a singleRepresentation.protected static classDefaultDashChunkSource.RepresentationSegmentIteratorDeprecated.
-
Field Summary
Fields Modifier and Type Field Description protected DefaultDashChunkSource.RepresentationHolder[]representationHoldersDeprecated.
-
Constructor Summary
Constructors Constructor Description DefaultDashChunkSource(ChunkExtractor.Factory chunkExtractorFactory, LoaderErrorThrower manifestLoaderErrorThrower, DashManifest manifest, BaseUrlExclusionList baseUrlExclusionList, int periodIndex, int[] adaptationSetIndices, ExoTrackSelection trackSelection, @com.google.android.exoplayer2.C.TrackType int trackType, DataSource dataSource, long elapsedRealtimeOffsetMs, int maxSegmentsPerLoad, boolean enableEventMessageTrack, List<Format> closedCaptionFormats, PlayerEmsgHandler.PlayerTrackEmsgHandler playerTrackEmsgHandler, PlayerId playerId, CmcdConfiguration cmcdConfiguration)Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description longgetAdjustedSeekPositionUs(long positionUs, SeekParameters seekParameters)Deprecated.Adjusts a seek position given the specifiedSeekParameters.voidgetNextChunk(long playbackPositionUs, long loadPositionUs, List<? extends MediaChunk> queue, ChunkHolder out)Deprecated.Returns the next chunk to load.intgetPreferredQueueSize(long playbackPositionUs, List<? extends MediaChunk> queue)Deprecated.Evaluates whetherMediaChunks should be removed from the back of the queue.voidmaybeThrowError()Deprecated.If the source is currently having difficulty providing chunks, then this method throws the underlying error.protected ChunknewInitializationChunk(DefaultDashChunkSource.RepresentationHolder representationHolder, DataSource dataSource, Format trackFormat, @com.google.android.exoplayer2.C.SelectionReason int trackSelectionReason, Object trackSelectionData, RangedUri initializationUri, RangedUri indexUri, CmcdHeadersFactory cmcdHeadersFactory)Deprecated.protected ChunknewMediaChunk(DefaultDashChunkSource.RepresentationHolder representationHolder, DataSource dataSource, @com.google.android.exoplayer2.C.TrackType int trackType, Format trackFormat, @com.google.android.exoplayer2.C.SelectionReason int trackSelectionReason, Object trackSelectionData, long firstSegmentNum, int maxSegmentCount, long seekTimeUs, long nowPeriodTimeUs, CmcdHeadersFactory cmcdHeadersFactory)Deprecated.voidonChunkLoadCompleted(Chunk chunk)Deprecated.Called when theChunkSampleStreamhas finished loading a chunk obtained from this source.booleanonChunkLoadError(Chunk chunk, boolean cancelable, LoadErrorHandlingPolicy.LoadErrorInfo loadErrorInfo, LoadErrorHandlingPolicy loadErrorHandlingPolicy)Deprecated.Called when theChunkSampleStreamencounters an error loading a chunk obtained from this source.voidrelease()Deprecated.Releases any held resources.booleanshouldCancelLoad(long playbackPositionUs, Chunk loadingChunk, List<? extends MediaChunk> queue)Deprecated.Returns whether an ongoing load of a chunk should be canceled.voidupdateManifest(DashManifest newManifest, int newPeriodIndex)Deprecated.Updates the manifest.voidupdateTrackSelection(ExoTrackSelection trackSelection)Deprecated.Updates the track selection.
-
-
-
Field Detail
-
representationHolders
protected final DefaultDashChunkSource.RepresentationHolder[] representationHolders
Deprecated.
-
-
Constructor Detail
-
DefaultDashChunkSource
public DefaultDashChunkSource(ChunkExtractor.Factory chunkExtractorFactory, LoaderErrorThrower manifestLoaderErrorThrower, DashManifest manifest, BaseUrlExclusionList baseUrlExclusionList, int periodIndex, int[] adaptationSetIndices, ExoTrackSelection trackSelection, @com.google.android.exoplayer2.C.TrackType int trackType, DataSource dataSource, long elapsedRealtimeOffsetMs, int maxSegmentsPerLoad, boolean enableEventMessageTrack, List<Format> closedCaptionFormats, @Nullable PlayerEmsgHandler.PlayerTrackEmsgHandler playerTrackEmsgHandler, PlayerId playerId, @Nullable CmcdConfiguration cmcdConfiguration)
Deprecated.- Parameters:
chunkExtractorFactory- CreatesChunkExtractorinstances to use for extracting chunks.manifestLoaderErrorThrower- Throws errors affecting loading of manifests.manifest- The initial manifest.baseUrlExclusionList- The base URL exclusion list.periodIndex- The index of the period in the manifest.adaptationSetIndices- The indices of the adaptation sets in the period.trackSelection- The track selection.trackType- Thetypeof the tracks in the selection.dataSource- ADataSourcesuitable for loading the media data.elapsedRealtimeOffsetMs- If known, an estimate of the instantaneous difference between server-side unix time andSystemClock.elapsedRealtime()in milliseconds, specified as the server's unix time minus the local elapsed time. OrC.TIME_UNSETif unknown.maxSegmentsPerLoad- The maximum number of segments to combine into a single request. Note that segments will only be combined if theirUris are the same and if their data ranges are adjacent.enableEventMessageTrack- Whether to output an event message track.closedCaptionFormats- TheFormatsof closed caption tracks to be output.playerTrackEmsgHandler- ThePlayerEmsgHandler.PlayerTrackEmsgHandlerinstance to handle emsg messages targeting the player. Maybe null if this is not necessary.playerId- ThePlayerIdof the player using this chunk source.cmcdConfiguration- TheCmcdConfigurationfor this chunk source.
-
-
Method Detail
-
getAdjustedSeekPositionUs
public long getAdjustedSeekPositionUs(long positionUs, SeekParameters seekParameters)Deprecated.Description copied from interface:ChunkSourceAdjusts a seek position given the specifiedSeekParameters. Chunk boundaries are used as sync points.- Specified by:
getAdjustedSeekPositionUsin interfaceChunkSource- Parameters:
positionUs- The seek position in microseconds.seekParameters- Parameters that control how the seek is performed.- Returns:
- The adjusted seek position, in microseconds.
-
updateManifest
public void updateManifest(DashManifest newManifest, int newPeriodIndex)
Deprecated.Description copied from interface:DashChunkSourceUpdates the manifest.- Specified by:
updateManifestin interfaceDashChunkSource- Parameters:
newManifest- The new manifest.newPeriodIndex- The index of the period covered bynewManifest.
-
updateTrackSelection
public void updateTrackSelection(ExoTrackSelection trackSelection)
Deprecated.Description copied from interface:DashChunkSourceUpdates the track selection.- Specified by:
updateTrackSelectionin interfaceDashChunkSource- Parameters:
trackSelection- The new track selection instance. Must be equivalent to the previous one.
-
maybeThrowError
public void maybeThrowError() throws IOExceptionDeprecated.Description copied from interface:ChunkSourceIf the source is currently having difficulty providing chunks, then this method throws the underlying error. Otherwise does nothing.- Specified by:
maybeThrowErrorin interfaceChunkSource- Throws:
IOException- The underlying error.
-
getPreferredQueueSize
public int getPreferredQueueSize(long playbackPositionUs, List<? extends MediaChunk> queue)Deprecated.Description copied from interface:ChunkSourceEvaluates whetherMediaChunks should be removed from the back of the queue.Removing
MediaChunks from the back of the queue can be useful if they could be replaced with chunks of a significantly higher quality (e.g. because the available bandwidth has substantially increased).Will only be called if no
MediaChunkin the queue is currently loading.- Specified by:
getPreferredQueueSizein interfaceChunkSource- Parameters:
playbackPositionUs- The current playback position, in microseconds.queue- The queue of bufferedMediaChunks.- Returns:
- The preferred queue size.
-
shouldCancelLoad
public boolean shouldCancelLoad(long playbackPositionUs, Chunk loadingChunk, List<? extends MediaChunk> queue)Deprecated.Description copied from interface:ChunkSourceReturns whether an ongoing load of a chunk should be canceled.- Specified by:
shouldCancelLoadin interfaceChunkSource- Parameters:
playbackPositionUs- The current playback position, in microseconds.loadingChunk- The currently loadingChunk.queue- The queue of bufferedMediaChunks.- Returns:
- Whether the ongoing load of
loadingChunkshould be canceled.
-
getNextChunk
public void getNextChunk(long playbackPositionUs, long loadPositionUs, List<? extends MediaChunk> queue, ChunkHolder out)Deprecated.Description copied from interface:ChunkSourceReturns the next chunk to load.If a chunk is available then
ChunkHolder.chunkis set. If the end of the stream has been reached thenChunkHolder.endOfStreamis set. If a chunk is not available but the end of the stream has not been reached, theChunkHolderis not modified.- Specified by:
getNextChunkin interfaceChunkSource- Parameters:
playbackPositionUs- The current playback position in microseconds. If playback of the period to which this chunk source belongs has not yet started, the value will be the starting position in the period minus the duration of any media in previous periods still to be played.loadPositionUs- The current load position in microseconds. Ifqueueis empty, this is the starting position from which chunks should be provided. Else it's equal toChunk.endTimeUsof the last chunk in thequeue.queue- The queue of bufferedMediaChunks.out- A holder to populate.
-
onChunkLoadCompleted
public void onChunkLoadCompleted(Chunk chunk)
Deprecated.Description copied from interface:ChunkSourceCalled when theChunkSampleStreamhas finished loading a chunk obtained from this source.- Specified by:
onChunkLoadCompletedin interfaceChunkSource- Parameters:
chunk- The chunk whose load has been completed.
-
onChunkLoadError
public boolean onChunkLoadError(Chunk chunk, boolean cancelable, LoadErrorHandlingPolicy.LoadErrorInfo loadErrorInfo, LoadErrorHandlingPolicy loadErrorHandlingPolicy)
Deprecated.Description copied from interface:ChunkSourceCalled when theChunkSampleStreamencounters an error loading a chunk obtained from this source.- Specified by:
onChunkLoadErrorin interfaceChunkSource- Parameters:
chunk- The chunk whose load encountered the error.cancelable- Whether the load can be canceled.loadErrorInfo- The load error info.loadErrorHandlingPolicy- The load error handling policy to customize the behaviour of handling the load error.- Returns:
- Whether the load should be canceled so that a replacement chunk can be loaded instead.
Must be
falseifcancelableisfalse. Iftrue,ChunkSource.getNextChunk(long, long, List, ChunkHolder)will be called to obtain the replacement chunk.
-
release
public void release()
Deprecated.Description copied from interface:ChunkSourceReleases any held resources.- Specified by:
releasein interfaceChunkSource
-
newInitializationChunk
protected Chunk newInitializationChunk(DefaultDashChunkSource.RepresentationHolder representationHolder, DataSource dataSource, Format trackFormat, @com.google.android.exoplayer2.C.SelectionReason int trackSelectionReason, @Nullable Object trackSelectionData, @Nullable RangedUri initializationUri, @Nullable RangedUri indexUri, @Nullable CmcdHeadersFactory cmcdHeadersFactory)
Deprecated.
-
newMediaChunk
protected Chunk newMediaChunk(DefaultDashChunkSource.RepresentationHolder representationHolder, DataSource dataSource, @com.google.android.exoplayer2.C.TrackType int trackType, Format trackFormat, @com.google.android.exoplayer2.C.SelectionReason int trackSelectionReason, Object trackSelectionData, long firstSegmentNum, int maxSegmentCount, long seekTimeUs, long nowPeriodTimeUs, @Nullable CmcdHeadersFactory cmcdHeadersFactory)
Deprecated.
-
-