Class TrackSelectionUtil
- java.lang.Object
-
- com.google.android.exoplayer2.trackselection.TrackSelectionUtil
-
@Deprecated public final class TrackSelectionUtil extends Object
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.Track selection related utility methods.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
TrackSelectionUtil.AdaptiveTrackSelectionFactory
Deprecated.Functional interface to create a single adaptive track selection.
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static Tracks
buildTracks(MappingTrackSelector.MappedTrackInfo mappedTrackInfo, @NullableType TrackSelection[] selections)
Deprecated.ReturnsTracks
built fromMappingTrackSelector.MappedTrackInfo
andTrackSelections
for each renderer.static Tracks
buildTracks(MappingTrackSelector.MappedTrackInfo mappedTrackInfo, List<? extends TrackSelection>[] selections)
Deprecated.ReturnsTracks
built fromMappingTrackSelector.MappedTrackInfo
andTrackSelections
for each renderer.static LoadErrorHandlingPolicy.FallbackOptions
createFallbackOptions(ExoTrackSelection trackSelection)
Deprecated.Returns theLoadErrorHandlingPolicy.FallbackOptions
with the tracks of the givenExoTrackSelection
and with a single location option indicating that there are no alternative locations available.static @NullableType ExoTrackSelection[]
createTrackSelectionsForDefinitions(@NullableType ExoTrackSelection.Definition[] definitions, TrackSelectionUtil.AdaptiveTrackSelectionFactory adaptiveTrackSelectionFactory)
Deprecated.Creates track selections for an array of track selection definitions, with at most one multi-track adaptive selection.static DefaultTrackSelector.Parameters
updateParametersWithOverride(DefaultTrackSelector.Parameters parameters, int rendererIndex, TrackGroupArray trackGroupArray, boolean isDisabled, DefaultTrackSelector.SelectionOverride override)
Deprecated.UpdatesDefaultTrackSelector.Parameters
with an override.
-
-
-
Method Detail
-
createTrackSelectionsForDefinitions
public static @NullableType ExoTrackSelection[] createTrackSelectionsForDefinitions(@NullableType ExoTrackSelection.Definition[] definitions, TrackSelectionUtil.AdaptiveTrackSelectionFactory adaptiveTrackSelectionFactory)
Deprecated.Creates track selections for an array of track selection definitions, with at most one multi-track adaptive selection.- Parameters:
definitions
- The list of track selectiondefinitions
. May include null values.adaptiveTrackSelectionFactory
- A factory for the multi-track adaptive track selection.- Returns:
- The array of created track selection. For null entries in
definitions
returns null values.
-
updateParametersWithOverride
public static DefaultTrackSelector.Parameters updateParametersWithOverride(DefaultTrackSelector.Parameters parameters, int rendererIndex, TrackGroupArray trackGroupArray, boolean isDisabled, @Nullable DefaultTrackSelector.SelectionOverride override)
Deprecated.UpdatesDefaultTrackSelector.Parameters
with an override.- Parameters:
parameters
- The currentDefaultTrackSelector.Parameters
to build upon.rendererIndex
- The renderer index to update.trackGroupArray
- TheTrackGroupArray
of the renderer.isDisabled
- Whether the renderer should be set disabled.override
- An optional override for the renderer. If null, no override will be set and an existing override for this renderer will be cleared.- Returns:
- The updated
DefaultTrackSelector.Parameters
.
-
createFallbackOptions
public static LoadErrorHandlingPolicy.FallbackOptions createFallbackOptions(ExoTrackSelection trackSelection)
Deprecated.Returns theLoadErrorHandlingPolicy.FallbackOptions
with the tracks of the givenExoTrackSelection
and with a single location option indicating that there are no alternative locations available.- Parameters:
trackSelection
- The track selection to get the number of total and excluded tracks.- Returns:
- The
LoadErrorHandlingPolicy.FallbackOptions
for the given track selection.
-
buildTracks
public static Tracks buildTracks(MappingTrackSelector.MappedTrackInfo mappedTrackInfo, @NullableType TrackSelection[] selections)
Deprecated.ReturnsTracks
built fromMappingTrackSelector.MappedTrackInfo
andTrackSelections
for each renderer.- Parameters:
mappedTrackInfo
- TheMappingTrackSelector.MappedTrackInfo
selections
- The track selections, indexed by renderer. A null entry indicates that a renderer does not have any selected tracks.- Returns:
- The corresponding
Tracks
.
-
buildTracks
public static Tracks buildTracks(MappingTrackSelector.MappedTrackInfo mappedTrackInfo, List<? extends TrackSelection>[] selections)
Deprecated.ReturnsTracks
built fromMappingTrackSelector.MappedTrackInfo
andTrackSelections
for each renderer.- Parameters:
mappedTrackInfo
- TheMappingTrackSelector.MappedTrackInfo
selections
- The track selections, indexed by renderer. Null entries are not permitted. An empty list indicates that a renderer does not have any selected tracks.- Returns:
- The corresponding
Tracks
.
-
-