Class StreamKey
- java.lang.Object
-
- com.google.android.exoplayer2.offline.StreamKey
-
- All Implemented Interfaces:
Parcelable,Comparable<StreamKey>
public final class StreamKey extends Object implements Comparable<StreamKey>, Parcelable
A key for a subset of media that can be separately loaded (a "stream").The stream key consists of a period index, a group index within the period and a stream index within the group. The interpretation of these indices depends on the type of media for which the stream key is used. Note that they are not the same as track group and track indices, because multiple tracks can be multiplexed into a single stream.
Application code should not generally attempt to build StreamKey instances directly. Instead,
DownloadHelper.getDownloadRequestcan be used to generate download requests with the correct StreamKeys for the track selections that have been configured on the helper.MediaPeriod.getStreamKeysprovides a lower level way of generating StreamKeys corresponding to a particular track selection.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface android.os.Parcelable
Parcelable.ClassLoaderCreator<T extends Object>, Parcelable.Creator<T extends Object>
-
-
Field Summary
Fields Modifier and Type Field Description static Parcelable.Creator<StreamKey>CREATORintgroupIndexThe group index.intperiodIndexThe period index.intstreamIndexThe stream index.inttrackIndexDeprecated.UsestreamIndex.-
Fields inherited from interface android.os.Parcelable
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
-
-
Constructor Summary
Constructors Constructor Description StreamKey(int groupIndex, int streamIndex)Creates an instance withperiodIndexset to 0.StreamKey(int periodIndex, int groupIndex, int streamIndex)Creates an instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(StreamKey o)intdescribeContents()booleanequals(Object o)inthashCode()StringtoString()voidwriteToParcel(Parcel dest, int flags)
-
-
-
Field Detail
-
periodIndex
public final int periodIndex
The period index.
-
groupIndex
public final int groupIndex
The group index.
-
streamIndex
public final int streamIndex
The stream index.
-
trackIndex
@Deprecated public final int trackIndex
Deprecated.UsestreamIndex.
-
CREATOR
public static final Parcelable.Creator<StreamKey> CREATOR
-
-
Constructor Detail
-
StreamKey
public StreamKey(int groupIndex, int streamIndex)Creates an instance withperiodIndexset to 0.- Parameters:
groupIndex- The group index.streamIndex- The stream index.
-
StreamKey
public StreamKey(int periodIndex, int groupIndex, int streamIndex)Creates an instance.- Parameters:
periodIndex- The period index.groupIndex- The group index.streamIndex- The stream index.
-
-
Method Detail
-
compareTo
public int compareTo(StreamKey o)
- Specified by:
compareToin interfaceComparable<StreamKey>
-
describeContents
public int describeContents()
- Specified by:
describeContentsin interfaceParcelable
-
writeToParcel
public void writeToParcel(Parcel dest, int flags)
- Specified by:
writeToParcelin interfaceParcelable
-
-