Back to Exoplayer

MappingTrackSelector (ExoPlayer library)

docs/doc/reference/com/google/android/exoplayer2/trackselection/MappingTrackSelector.html

latest10.5 KB
Original Source

Package com.google.android.exoplayer2.trackselection

Class MappingTrackSelector


[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public abstract classMappingTrackSelectorextends[TrackSelector](TrackSelector.html "class in com.google.android.exoplayer2.trackselection")

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.

Base class for TrackSelectors that first establish a mapping between TrackGroups and Renderers, and then from that mapping create a ExoTrackSelection for each renderer.

Nested Class Summary

Nested Classes | Modifier and Type | Class | Description | | --- | --- | --- | | static class | MappingTrackSelector.MappedTrackInfo | Deprecated.

Provides mapped track information for each renderer. |

- 

Nested classes/interfaces inherited from class com.google.android.exoplayer2.trackselection.TrackSelector

TrackSelector.InvalidationListener

Constructor Summary

Constructors | Constructor | Description | | --- | --- | | MappingTrackSelector() | Deprecated. |

Method Summary

All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods | Modifier and Type | Method | Description | | --- | --- | --- | | MappingTrackSelector.MappedTrackInfo | getCurrentMappedTrackInfo() | Deprecated.

Returns the mapping information for the currently active track selection, or null if no selection is currently active. | | void | onSelectionActivated​(Object info) | Deprecated.

Called by the player when a TrackSelectorResult previously generated by TrackSelector.selectTracks(RendererCapabilities[], TrackGroupArray, MediaPeriodId, Timeline) is activated. | | TrackSelectorResult | selectTracks​(RendererCapabilities[] rendererCapabilities, TrackGroupArray trackGroups, MediaSource.MediaPeriodId periodId, Timeline timeline) | Deprecated.

Called by the player to perform a track selection. | | protected abstract Pair<@NullableType RendererConfiguration[],​@NullableType ExoTrackSelection[]> | selectTracks​(MappingTrackSelector.MappedTrackInfo mappedTrackInfo, @com.google.android.exoplayer2.RendererCapabilities.Capabilities int[][][] rendererFormatSupports, @com.google.android.exoplayer2.RendererCapabilities.AdaptiveSupport int[] rendererMixedMimeTypeAdaptationSupport, MediaSource.MediaPeriodId mediaPeriodId, Timeline timeline) | Deprecated.

Given mapped track information, returns a track selection and configuration for each renderer. |

- 

Methods inherited from class com.google.android.exoplayer2.trackselection.TrackSelector

getBandwidthMeter, getParameters, getRendererCapabilitiesListener, init, invalidate, invalidateForRendererCapabilitiesChange, isSetParametersSupported, release, setAudioAttributes, setParameters

- 

Methods inherited from class java.lang.Object

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

Constructor Detail

- 

MappingTrackSelector

public MappingTrackSelector()

Deprecated.

Method Detail

- 

getCurrentMappedTrackInfo

@Nullable
public final[MappingTrackSelector.MappedTrackInfo](MappingTrackSelector.MappedTrackInfo.html "class in com.google.android.exoplayer2.trackselection")getCurrentMappedTrackInfo()

Deprecated.

Returns the mapping information for the currently active track selection, or null if no selection is currently active.

- 

onSelectionActivated

public final void onSelectionActivated​(@Nullable[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")info)

Deprecated.

Description copied from class: TrackSelector

Called by the player when a TrackSelectorResult previously generated by TrackSelector.selectTracks(RendererCapabilities[], TrackGroupArray, MediaPeriodId, Timeline) is activated. Specified by:onSelectionActivated in class TrackSelectorParameters:info - The value of TrackSelectorResult.info in the activated selection.

- 

selectTracks

public final[TrackSelectorResult](TrackSelectorResult.html "class in com.google.android.exoplayer2.trackselection")selectTracks​([RendererCapabilities](../RendererCapabilities.html "interface in com.google.android.exoplayer2")[] rendererCapabilities,[TrackGroupArray](../source/TrackGroupArray.html "class in com.google.android.exoplayer2.source")trackGroups,[MediaSource.MediaPeriodId](../source/MediaSource.MediaPeriodId.html "class in com.google.android.exoplayer2.source")periodId,[Timeline](../Timeline.html "class in com.google.android.exoplayer2")timeline)
                                       throws[ExoPlaybackException](../ExoPlaybackException.html "class in com.google.android.exoplayer2")

Deprecated.

Description copied from class: TrackSelector

Called by the player to perform a track selection. Specified by:selectTracks in class TrackSelectorParameters:rendererCapabilities - The RendererCapabilities of the renderers for which tracks are to be selected.trackGroups - The available track groups.periodId - The MediaSource.MediaPeriodId of the period for which tracks are to be selected.timeline - The Timeline holding the period for which tracks are to be selected.Returns:A TrackSelectorResult describing the track selections.Throws:ExoPlaybackException - If an error occurs selecting tracks.

- 

selectTracks

protected abstract[Pair](https://developer.android.com/reference/android/util/Pair.html "class or interface in android.util")<@NullableType[RendererConfiguration](../RendererConfiguration.html "class in com.google.android.exoplayer2")[],​@NullableType[ExoTrackSelection](ExoTrackSelection.html "interface in com.google.android.exoplayer2.trackselection")[]> selectTracks​([MappingTrackSelector.MappedTrackInfo](MappingTrackSelector.MappedTrackInfo.html "class in com.google.android.exoplayer2.trackselection")mappedTrackInfo,
                                                                                                                    @com.google.android.exoplayer2.RendererCapabilities.Capabilities int[][][] rendererFormatSupports,
                                                                                                                    @com.google.android.exoplayer2.RendererCapabilities.AdaptiveSupport int[] rendererMixedMimeTypeAdaptationSupport,[MediaSource.MediaPeriodId](../source/MediaSource.MediaPeriodId.html "class in com.google.android.exoplayer2.source")mediaPeriodId,[Timeline](../Timeline.html "class in com.google.android.exoplayer2")timeline)
                                                                                                             throws[ExoPlaybackException](../ExoPlaybackException.html "class in com.google.android.exoplayer2")

Deprecated.

Given mapped track information, returns a track selection and configuration for each renderer. Parameters:mappedTrackInfo - Mapped track information.rendererFormatSupports - The RendererCapabilities.Capabilities for each mapped track, indexed by renderer, track group and track (in that order).rendererMixedMimeTypeAdaptationSupport - The RendererCapabilities.AdaptiveSupport for mixed MIME type adaptation for the renderer.mediaPeriodId - The MediaSource.MediaPeriodId of the period for which tracks are to be selected.timeline - The Timeline holding the period for which tracks are to be selected.Returns:A pair consisting of the track selections and configurations for each renderer. A null configuration indicates the renderer should be disabled, in which case the track selection will also be null. A track selection may also be null for a non-disabled renderer if RendererCapabilities.getTrackType() is C.TRACK_TYPE_NONE.Throws:ExoPlaybackException - If an error occurs while selecting the tracks.