Interface TrackSelection
-
- All Known Subinterfaces:
ExoTrackSelection
- All Known Implementing Classes:
AdaptiveTrackSelection,BaseTrackSelection,FakeTrackSelection,FixedTrackSelection,RandomTrackSelection
public interface TrackSelectionA track selection consisting of a static subset of selected tracks belonging to aTrackGroup.Tracks belonging to the subset are exposed in decreasing bandwidth order.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceTrackSelection.TypeRepresents a type track selection.
-
Field Summary
Fields Modifier and Type Field Description static intTYPE_CUSTOM_BASEThe first value that can be used for application specific track selection types.static intTYPE_UNSETAn unspecified track selection type.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description FormatgetFormat(int index)Returns the format of the track at a given index in the selection.intgetIndexInTrackGroup(int index)Returns the index in the track group of the track at a given index in the selection.TrackGroupgetTrackGroup()Returns theTrackGroupto which the selected tracks belong.@com.google.android.exoplayer2.trackselection.TrackSelection.Type intgetType()Returns an integer specifying the type of the selection, orTYPE_UNSETif not specified.intindexOf(int indexInTrackGroup)Returns the index in the selection of the track with the specified index in the track group.intindexOf(Format format)Returns the index in the selection of the track with the specified format.intlength()Returns the number of tracks in the selection.
-
-
-
Field Detail
-
TYPE_UNSET
static final int TYPE_UNSET
An unspecified track selection type.- See Also:
- Constant Field Values
-
TYPE_CUSTOM_BASE
static final int TYPE_CUSTOM_BASE
The first value that can be used for application specific track selection types.- See Also:
- Constant Field Values
-
-
Method Detail
-
getType
@com.google.android.exoplayer2.trackselection.TrackSelection.Type int getType()
Returns an integer specifying the type of the selection, orTYPE_UNSETif not specified.Track selection types are specific to individual applications, but should be defined starting from
TYPE_CUSTOM_BASEto ensure they don't conflict with any types that may be added to the library in the future.
-
getTrackGroup
TrackGroup getTrackGroup()
Returns theTrackGroupto which the selected tracks belong.
-
length
int length()
Returns the number of tracks in the selection.
-
getFormat
Format getFormat(int index)
Returns the format of the track at a given index in the selection.- Parameters:
index- The index in the selection.- Returns:
- The format of the selected track.
-
getIndexInTrackGroup
int getIndexInTrackGroup(int index)
Returns the index in the track group of the track at a given index in the selection.- Parameters:
index- The index in the selection.- Returns:
- The index of the selected track.
-
indexOf
int indexOf(Format format)
Returns the index in the selection of the track with the specified format. The format is located by identity so, for example,selection.indexOf(selection.getFormat(index)) == indexeven if multiple selected tracks have formats that contain the same values.- Parameters:
format- The format.- Returns:
- The index in the selection, or
C.INDEX_UNSETif the track with the specified format is not part of the selection.
-
indexOf
int indexOf(int indexInTrackGroup)
Returns the index in the selection of the track with the specified index in the track group.- Parameters:
indexInTrackGroup- The index in the track group.- Returns:
- The index in the selection, or
C.INDEX_UNSETif the track with the specified index is not part of the selection.
-
-