public final class TrackGroup
extends java.lang.Object
implements android.os.Parcelable
MediaPeriod
.
A MediaPeriod
is only able to provide one SampleStream
corresponding to a
group at any given time, however this SampleStream
may adapt between multiple tracks
within the group.
Modifier and Type | Field and Description |
---|---|
static android.os.Parcelable.Creator<TrackGroup> |
CREATOR |
int |
length
The number of tracks in the group.
|
Constructor and Description |
---|
TrackGroup(Format... formats) |
Modifier and Type | Method and Description |
---|---|
int |
describeContents() |
boolean |
equals(java.lang.Object obj) |
Format |
getFormat(int index)
Returns the format of the track at a given index.
|
int |
hashCode() |
int |
indexOf(Format format)
Returns the index of the track with the given format in the group.
|
void |
writeToParcel(android.os.Parcel dest,
int flags) |
public final int length
public static final android.os.Parcelable.Creator<TrackGroup> CREATOR
public TrackGroup(Format... formats)
formats
- The track formats. Must not be null, contain null elements or be of length 0.public Format getFormat(int index)
index
- The index of the track.public int indexOf(Format format)
group.indexOf(group.getFormat(index)) == index
even if
multiple tracks have formats that contain the same values.format
- The format.C.INDEX_UNSET
if no such track exists.public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(@Nullable java.lang.Object obj)
equals
in class java.lang.Object
public int describeContents()
describeContents
in interface android.os.Parcelable
public void writeToParcel(android.os.Parcel dest, int flags)
writeToParcel
in interface android.os.Parcelable