Class MappingTrackSelector
- java.lang.Object
-
- com.google.android.exoplayer2.trackselection.TrackSelector
-
- com.google.android.exoplayer2.trackselection.MappingTrackSelector
-
- Direct Known Subclasses:
DefaultTrackSelector
@Deprecated public abstract class MappingTrackSelector extends TrackSelector
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 forTrackSelector
s that first establish a mapping betweenTrackGroup
s andRenderer
s, and then from that mapping create aExoTrackSelection
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 aTrackSelectorResult
previously generated byTrackSelector.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
-
-
-
-
Method Detail
-
getCurrentMappedTrackInfo
@Nullable public final MappingTrackSelector.MappedTrackInfo 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 info)
Deprecated.Description copied from class:TrackSelector
Called by the player when aTrackSelectorResult
previously generated byTrackSelector.selectTracks(RendererCapabilities[], TrackGroupArray, MediaPeriodId, Timeline)
is activated.- Specified by:
onSelectionActivated
in classTrackSelector
- Parameters:
info
- The value ofTrackSelectorResult.info
in the activated selection.
-
selectTracks
public final TrackSelectorResult selectTracks(RendererCapabilities[] rendererCapabilities, TrackGroupArray trackGroups, MediaSource.MediaPeriodId periodId, Timeline timeline) throws ExoPlaybackException
Deprecated.Description copied from class:TrackSelector
Called by the player to perform a track selection.- Specified by:
selectTracks
in classTrackSelector
- Parameters:
rendererCapabilities
- TheRendererCapabilities
of the renderers for which tracks are to be selected.trackGroups
- The available track groups.periodId
- TheMediaSource.MediaPeriodId
of the period for which tracks are to be selected.timeline
- TheTimeline
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<@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) throws ExoPlaybackException
Deprecated.Given mapped track information, returns a track selection and configuration for each renderer.- Parameters:
mappedTrackInfo
- Mapped track information.rendererFormatSupports
- TheRendererCapabilities.Capabilities
for each mapped track, indexed by renderer, track group and track (in that order).rendererMixedMimeTypeAdaptationSupport
- TheRendererCapabilities.AdaptiveSupport
for mixed MIME type adaptation for the renderer.mediaPeriodId
- TheMediaSource.MediaPeriodId
of the period for which tracks are to be selected.timeline
- TheTimeline
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()
isC.TRACK_TYPE_NONE
. - Throws:
ExoPlaybackException
- If an error occurs while selecting the tracks.
-
-