Class Track
- java.lang.Object
-
- com.google.android.exoplayer2.extractor.mp4.Track
-
public final class Track extends Object
Encapsulates information describing an MP4 track.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceTrack.TransformationThe transformation to apply to samples in the track, if any.
-
Field Summary
Fields Modifier and Type Field Description longdurationUsThe duration of the track in microseconds, orC.TIME_UNSETif unknown.long[]editListDurationsDurations of edit list segments in the movie timescale.long[]editListMediaTimesMedia times for edit list segments in the track timescale.FormatformatThe format.intidThe track identifier.longmovieTimescaleThe movie timescale.intnalUnitLengthFieldLengthFor H264 video tracks, the length in bytes of the NALUnitLength field in each sample.@com.google.android.exoplayer2.extractor.mp4.Track.Transformation intsampleTransformationOne ofTRANSFORMATION_*.longtimescaleThe track timescale, defined as the number of time units that pass in one second.static intTRANSFORMATION_CEA608_CDATA transformation for caption samples in cdat atoms.static intTRANSFORMATION_NONEA no-op sample transformation.@com.google.android.exoplayer2.C.TrackType inttype
-
Constructor Summary
Constructors Constructor Description Track(int id, @com.google.android.exoplayer2.C.TrackType int type, long timescale, long movieTimescale, long durationUs, Format format, @com.google.android.exoplayer2.extractor.mp4.Track.Transformation int sampleTransformation, TrackEncryptionBox[] sampleDescriptionEncryptionBoxes, int nalUnitLengthFieldLength, long[] editListDurations, long[] editListMediaTimes)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TrackcopyWithFormat(Format format)TrackEncryptionBoxgetSampleDescriptionEncryptionBox(int sampleDescriptionIndex)Returns theTrackEncryptionBoxfor the given sample description index.
-
-
-
Field Detail
-
TRANSFORMATION_NONE
public static final int TRANSFORMATION_NONE
A no-op sample transformation.- See Also:
- Constant Field Values
-
TRANSFORMATION_CEA608_CDAT
public static final int TRANSFORMATION_CEA608_CDAT
A transformation for caption samples in cdat atoms.- See Also:
- Constant Field Values
-
id
public final int id
The track identifier.
-
type
public final @com.google.android.exoplayer2.C.TrackType int type
-
timescale
public final long timescale
The track timescale, defined as the number of time units that pass in one second.
-
movieTimescale
public final long movieTimescale
The movie timescale.
-
durationUs
public final long durationUs
The duration of the track in microseconds, orC.TIME_UNSETif unknown.
-
format
public final Format format
The format.
-
sampleTransformation
public final @com.google.android.exoplayer2.extractor.mp4.Track.Transformation int sampleTransformation
One ofTRANSFORMATION_*. Defines the transformation to apply before outputting each sample.
-
editListDurations
@Nullable public final long[] editListDurations
Durations of edit list segments in the movie timescale. Null if there is no edit list.
-
editListMediaTimes
@Nullable public final long[] editListMediaTimes
Media times for edit list segments in the track timescale. Null if there is no edit list.
-
nalUnitLengthFieldLength
public final int nalUnitLengthFieldLength
For H264 video tracks, the length in bytes of the NALUnitLength field in each sample. 0 for other track types.
-
-
Constructor Detail
-
Track
public Track(int id, @com.google.android.exoplayer2.C.TrackType int type, long timescale, long movieTimescale, long durationUs, Format format, @com.google.android.exoplayer2.extractor.mp4.Track.Transformation int sampleTransformation, @Nullable TrackEncryptionBox[] sampleDescriptionEncryptionBoxes, int nalUnitLengthFieldLength, @Nullable long[] editListDurations, @Nullable long[] editListMediaTimes)
-
-
Method Detail
-
getSampleDescriptionEncryptionBox
@Nullable public TrackEncryptionBox getSampleDescriptionEncryptionBox(int sampleDescriptionIndex)
Returns theTrackEncryptionBoxfor the given sample description index.- Parameters:
sampleDescriptionIndex- The given sample description index- Returns:
- The
TrackEncryptionBoxfor the given sample description index. Maybe null if no such entry exists.
-
-