Class TrackSelectorResult
- java.lang.Object
-
- com.google.android.exoplayer2.trackselection.TrackSelectorResult
-
public final class TrackSelectorResult extends Object
The result of aTrackSelector
operation.
-
-
Field Summary
Fields Modifier and Type Field Description Object
info
An opaque object that will be returned toTrackSelector.onSelectionActivated(Object)
should the selections be activated.int
length
The number of selections in the result.@NullableType RendererConfiguration[]
rendererConfigurations
ARendererConfiguration
for each renderer.@NullableType ExoTrackSelection[]
selections
AExoTrackSelection
array containing the track selection for each renderer.TracksInfo
tracksInfo
Describe the tracks and which one were selected.
-
Constructor Summary
Constructors Constructor Description TrackSelectorResult(@NullableType RendererConfiguration[] rendererConfigurations, @NullableType ExoTrackSelection[] selections, TracksInfo tracksInfo, Object info)
TrackSelectorResult(@NullableType RendererConfiguration[] rendererConfigurations, @NullableType ExoTrackSelection[] selections, Object info)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isEquivalent(TrackSelectorResult other)
Returns whether this result is equivalent toother
for all renderers.boolean
isEquivalent(TrackSelectorResult other, int index)
Returns whether this result is equivalent toother
for the renderer at the given index.boolean
isRendererEnabled(int index)
Returns whether the renderer at the specified index is enabled.
-
-
-
Field Detail
-
length
public final int length
The number of selections in the result. Greater than or equal to zero.
-
rendererConfigurations
public final @NullableType RendererConfiguration[] rendererConfigurations
ARendererConfiguration
for each renderer. A null entry indicates the corresponding renderer should be disabled.
-
selections
public final @NullableType ExoTrackSelection[] selections
AExoTrackSelection
array containing the track selection for each renderer.
-
tracksInfo
public final TracksInfo tracksInfo
Describe the tracks and which one were selected.
-
info
@Nullable public final Object info
An opaque object that will be returned toTrackSelector.onSelectionActivated(Object)
should the selections be activated.
-
-
Constructor Detail
-
TrackSelectorResult
@Deprecated public TrackSelectorResult(@NullableType RendererConfiguration[] rendererConfigurations, @NullableType ExoTrackSelection[] selections, @Nullable Object info)
Deprecated.- Parameters:
rendererConfigurations
- ARendererConfiguration
for each renderer. A null entry indicates the corresponding renderer should be disabled.selections
- AExoTrackSelection
array containing the selection for each renderer.info
- An opaque object that will be returned toTrackSelector.onSelectionActivated(Object)
should the selection be activated. May benull
.
-
TrackSelectorResult
public TrackSelectorResult(@NullableType RendererConfiguration[] rendererConfigurations, @NullableType ExoTrackSelection[] selections, TracksInfo tracksInfo, @Nullable Object info)
- Parameters:
rendererConfigurations
- ARendererConfiguration
for each renderer. A null entry indicates the corresponding renderer should be disabled.selections
- AExoTrackSelection
array containing the selection for each renderer.tracksInfo
- Description of the available tracks and which one were selected.info
- An opaque object that will be returned toTrackSelector.onSelectionActivated(Object)
should the selection be activated. May benull
.
-
-
Method Detail
-
isRendererEnabled
public boolean isRendererEnabled(int index)
Returns whether the renderer at the specified index is enabled.
-
isEquivalent
public boolean isEquivalent(@Nullable TrackSelectorResult other)
Returns whether this result is equivalent toother
for all renderers.- Parameters:
other
- The otherTrackSelectorResult
. May be null, in which casefalse
will be returned.- Returns:
- Whether this result is equivalent to
other
for all renderers.
-
isEquivalent
public boolean isEquivalent(@Nullable TrackSelectorResult other, int index)
Returns whether this result is equivalent toother
for the renderer at the given index. The results are equivalent if they have equal track selections and configurations for the renderer.- Parameters:
other
- The otherTrackSelectorResult
. May be null, in which casefalse
will be returned.index
- The renderer index to check for equivalence.- Returns:
- Whether this result is equivalent to
other
for the renderer at the specified index.
-
-