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 interfaceTrackSelectionUtil.AdaptiveTrackSelectionFactoryDeprecated.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 TracksbuildTracks(MappingTrackSelector.MappedTrackInfo mappedTrackInfo, @NullableType TrackSelection[] selections)Deprecated.ReturnsTracksbuilt fromMappingTrackSelector.MappedTrackInfoandTrackSelectionsfor each renderer.static TracksbuildTracks(MappingTrackSelector.MappedTrackInfo mappedTrackInfo, List<? extends TrackSelection>[] selections)Deprecated.ReturnsTracksbuilt fromMappingTrackSelector.MappedTrackInfoandTrackSelectionsfor each renderer.static LoadErrorHandlingPolicy.FallbackOptionscreateFallbackOptions(ExoTrackSelection trackSelection)Deprecated.Returns theLoadErrorHandlingPolicy.FallbackOptionswith the tracks of the givenExoTrackSelectionand 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.ParametersupdateParametersWithOverride(DefaultTrackSelector.Parameters parameters, int rendererIndex, TrackGroupArray trackGroupArray, boolean isDisabled, DefaultTrackSelector.SelectionOverride override)Deprecated.UpdatesDefaultTrackSelector.Parameterswith 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
definitionsreturns null values.
-
updateParametersWithOverride
public static DefaultTrackSelector.Parameters updateParametersWithOverride(DefaultTrackSelector.Parameters parameters, int rendererIndex, TrackGroupArray trackGroupArray, boolean isDisabled, @Nullable DefaultTrackSelector.SelectionOverride override)
Deprecated.UpdatesDefaultTrackSelector.Parameterswith an override.- Parameters:
parameters- The currentDefaultTrackSelector.Parametersto build upon.rendererIndex- The renderer index to update.trackGroupArray- TheTrackGroupArrayof 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.FallbackOptionswith the tracks of the givenExoTrackSelectionand 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.FallbackOptionsfor the given track selection.
-
buildTracks
public static Tracks buildTracks(MappingTrackSelector.MappedTrackInfo mappedTrackInfo, @NullableType TrackSelection[] selections)
Deprecated.ReturnsTracksbuilt fromMappingTrackSelector.MappedTrackInfoandTrackSelectionsfor each renderer.- Parameters:
mappedTrackInfo- TheMappingTrackSelector.MappedTrackInfoselections- 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.ReturnsTracksbuilt fromMappingTrackSelector.MappedTrackInfoandTrackSelectionsfor each renderer.- Parameters:
mappedTrackInfo- TheMappingTrackSelector.MappedTrackInfoselections- 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.
-
-