Back to Exoplayer

DefaultSsChunkSource (ExoPlayer library)

docs/doc/reference/com/google/android/exoplayer2/source/smoothstreaming/DefaultSsChunkSource.html

latest13.8 KB
Original Source

Package com.google.android.exoplayer2.source.smoothstreaming

Class DefaultSsChunkSource

  • java.lang.Object

    • com.google.android.exoplayer2.source.smoothstreaming.DefaultSsChunkSource
  • All Implemented Interfaces:ChunkSource, SsChunkSource


[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public classDefaultSsChunkSourceextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")implements[SsChunkSource](SsChunkSource.html "interface in com.google.android.exoplayer2.source.smoothstreaming")

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 default SsChunkSource implementation.

Nested Class Summary

Nested Classes | Modifier and Type | Class | Description | | --- | --- | --- | | static class | DefaultSsChunkSource.Factory | Deprecated. |

Constructor Summary

Constructors | Constructor | Description | | --- | --- | | DefaultSsChunkSource​(LoaderErrorThrower manifestLoaderErrorThrower, SsManifest manifest, int streamElementIndex, ExoTrackSelection trackSelection, DataSource dataSource, CmcdConfiguration cmcdConfiguration) | Deprecated. |

Method Summary

All Methods Instance Methods Concrete Methods Deprecated Methods | Modifier and Type | Method | Description | | --- | --- | --- | | long | getAdjustedSeekPositionUs​(long positionUs, SeekParameters seekParameters) | Deprecated.

Adjusts a seek position given the specified SeekParameters. | | void | getNextChunk​(long playbackPositionUs, long loadPositionUs, List<? extends MediaChunk> queue, ChunkHolder out) | Deprecated.

Returns the next chunk to load. | | int | getPreferredQueueSize​(long playbackPositionUs, List<? extends MediaChunk> queue) | Deprecated.

Evaluates whether MediaChunks should be removed from the back of the queue. | | void | maybeThrowError() | Deprecated.

If the source is currently having difficulty providing chunks, then this method throws the underlying error. | | void | onChunkLoadCompleted​(Chunk chunk) | Deprecated.

Called when the ChunkSampleStream has finished loading a chunk obtained from this source. | | boolean | onChunkLoadError​(Chunk chunk, boolean cancelable, LoadErrorHandlingPolicy.LoadErrorInfo loadErrorInfo, LoadErrorHandlingPolicy loadErrorHandlingPolicy) | Deprecated.

Called when the ChunkSampleStream encounters an error loading a chunk obtained from this source. | | void | release() | Deprecated.

Releases any held resources. | | boolean | shouldCancelLoad​(long playbackPositionUs, Chunk loadingChunk, List<? extends MediaChunk> queue) | Deprecated.

Returns whether an ongoing load of a chunk should be canceled. | | void | updateManifest​(SsManifest newManifest) | Deprecated.

Updates the manifest. | | void | updateTrackSelection​(ExoTrackSelection trackSelection) | Deprecated.

Updates the track selection. |

- 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

- 

DefaultSsChunkSource

public DefaultSsChunkSource​([LoaderErrorThrower](../../upstream/LoaderErrorThrower.html "interface in com.google.android.exoplayer2.upstream")manifestLoaderErrorThrower,[SsManifest](manifest/SsManifest.html "class in com.google.android.exoplayer2.source.smoothstreaming.manifest")manifest,
                            int streamElementIndex,[ExoTrackSelection](../../trackselection/ExoTrackSelection.html "interface in com.google.android.exoplayer2.trackselection")trackSelection,[DataSource](../../upstream/DataSource.html "interface in com.google.android.exoplayer2.upstream")dataSource,
                            @Nullable[CmcdConfiguration](../../upstream/CmcdConfiguration.html "class in com.google.android.exoplayer2.upstream")cmcdConfiguration)

Deprecated. Parameters:manifestLoaderErrorThrower - Throws errors affecting loading of manifests.manifest - The initial manifest.streamElementIndex - The index of the stream element in the manifest.trackSelection - The track selection.dataSource - A DataSource suitable for loading the media data.cmcdConfiguration - The CmcdConfiguration for this chunk source.

Method Detail

- 

getAdjustedSeekPositionUs

public long getAdjustedSeekPositionUs​(long positionUs,[SeekParameters](../../SeekParameters.html "class in com.google.android.exoplayer2")seekParameters)

Deprecated.

Description copied from interface: ChunkSource

Adjusts a seek position given the specified SeekParameters. Chunk boundaries are used as sync points. Specified by:getAdjustedSeekPositionUs in interface ChunkSourceParameters: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​([SsManifest](manifest/SsManifest.html "class in com.google.android.exoplayer2.source.smoothstreaming.manifest")newManifest)

Deprecated.

Description copied from interface: SsChunkSource

Updates the manifest. Specified by:updateManifest in interface SsChunkSourceParameters:newManifest - The new manifest.

- 

updateTrackSelection

public void updateTrackSelection​([ExoTrackSelection](../../trackselection/ExoTrackSelection.html "interface in com.google.android.exoplayer2.trackselection")trackSelection)

Deprecated.

Description copied from interface: SsChunkSource

Updates the track selection. Specified by:updateTrackSelection in interface SsChunkSourceParameters:trackSelection - The new track selection instance. Must be equivalent to the previous one.

- 

maybeThrowError

public void maybeThrowError()
                     throws[IOException](https://developer.android.com/reference/java/io/IOException.html "class or interface in java.io")

Deprecated.

Description copied from interface: ChunkSource

If the source is currently having difficulty providing chunks, then this method throws the underlying error. Otherwise does nothing. Specified by:maybeThrowError in interface ChunkSourceThrows:IOException - The underlying error.

- 

getPreferredQueueSize

public int getPreferredQueueSize​(long playbackPositionUs,[List](https://developer.android.com/reference/java/util/List.html "class or interface in java.util")<? extends[MediaChunk](../chunk/MediaChunk.html "class in com.google.android.exoplayer2.source.chunk")> queue)

Deprecated.

Description copied from interface: ChunkSource

Evaluates whether MediaChunks 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 MediaChunk in the queue is currently loading.

Specified by:getPreferredQueueSize in interface ChunkSourceParameters:playbackPositionUs - The current playback position, in microseconds.queue - The queue of buffered MediaChunks.Returns:The preferred queue size.

- 

shouldCancelLoad

public boolean shouldCancelLoad​(long playbackPositionUs,[Chunk](../chunk/Chunk.html "class in com.google.android.exoplayer2.source.chunk")loadingChunk,[List](https://developer.android.com/reference/java/util/List.html "class or interface in java.util")<? extends[MediaChunk](../chunk/MediaChunk.html "class in com.google.android.exoplayer2.source.chunk")> queue)

Deprecated.

Description copied from interface: ChunkSource

Returns whether an ongoing load of a chunk should be canceled. Specified by:shouldCancelLoad in interface ChunkSourceParameters:playbackPositionUs - The current playback position, in microseconds.loadingChunk - The currently loading Chunk.queue - The queue of buffered MediaChunks.Returns:Whether the ongoing load of loadingChunk should be canceled.

- 

getNextChunk

public final void getNextChunk​(long playbackPositionUs,
                               long loadPositionUs,[List](https://developer.android.com/reference/java/util/List.html "class or interface in java.util")<? extends[MediaChunk](../chunk/MediaChunk.html "class in com.google.android.exoplayer2.source.chunk")> queue,[ChunkHolder](../chunk/ChunkHolder.html "class in com.google.android.exoplayer2.source.chunk")out)

Deprecated.

Description copied from interface: ChunkSource

Returns the next chunk to load.

If a chunk is available then ChunkHolder.chunk is set. If the end of the stream has been reached then ChunkHolder.endOfStream is set. If a chunk is not available but the end of the stream has not been reached, the ChunkHolder is not modified.

Specified by:getNextChunk in interface ChunkSourceParameters: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. If queue is empty, this is the starting position from which chunks should be provided. Else it's equal to Chunk.endTimeUs of the last chunk in the queue.queue - The queue of buffered MediaChunks.out - A holder to populate.

- 

onChunkLoadCompleted

public void onChunkLoadCompleted​([Chunk](../chunk/Chunk.html "class in com.google.android.exoplayer2.source.chunk")chunk)

Deprecated.

Description copied from interface: ChunkSource

Called when the ChunkSampleStream has finished loading a chunk obtained from this source. Specified by:onChunkLoadCompleted in interface ChunkSourceParameters:chunk - The chunk whose load has been completed.

- 

onChunkLoadError

public boolean onChunkLoadError​([Chunk](../chunk/Chunk.html "class in com.google.android.exoplayer2.source.chunk")chunk,
                                boolean cancelable,[LoadErrorHandlingPolicy.LoadErrorInfo](../../upstream/LoadErrorHandlingPolicy.LoadErrorInfo.html "class in com.google.android.exoplayer2.upstream")loadErrorInfo,[LoadErrorHandlingPolicy](../../upstream/LoadErrorHandlingPolicy.html "interface in com.google.android.exoplayer2.upstream")loadErrorHandlingPolicy)

Deprecated.

Description copied from interface: ChunkSource

Called when the ChunkSampleStream encounters an error loading a chunk obtained from this source. Specified by:onChunkLoadError in interface ChunkSourceParameters: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 false if cancelable is false. If true, ChunkSource.getNextChunk(long, long, List, ChunkHolder) will be called to obtain the replacement chunk.

- 

release

public void release()

Deprecated.

Description copied from interface: ChunkSource

Releases any held resources. Specified by:release in interface ChunkSource