Track
@UnstableApi
public final class Track
Encapsulates information describing an MP4 track.
Summary
Nested types |
|---|
@DocumentedThe transformation to apply to samples in the track, if any. |
Constants |
|
|---|---|
static final int |
A transformation for caption samples in cdat atoms. |
static final int |
A no-op sample transformation. |
Public fields |
|
|---|---|
final long |
The duration of the track in microseconds, or |
final @Nullable long[] |
Durations of edit list segments in the movie timescale. |
final @Nullable long[] |
Media times for edit list segments in the track timescale. |
final Format |
The format. |
final int |
The track identifier. |
final long |
The duration of the media in microseconds, or |
final long |
The movie timescale. |
final int |
The length in bytes of the NALUnitLength field in each sample. |
final int |
One of |
final long |
The track timescale, defined as the number of time units that pass in one second. |
final int |
One of |
Public constructors |
|---|
Track( |
Public methods |
|
|---|---|
Track |
copyWithFormat(Format format) |
Track |
|
@Nullable TrackEncryptionBox |
getSampleDescriptionEncryptionBox(int sampleDescriptionIndex)Returns the |
Constants
TRANSFORMATION_CEA608_CDAT
public static final int TRANSFORMATION_CEA608_CDAT = 1
A transformation for caption samples in cdat atoms.
Public fields
durationUs
public final long durationUs
The duration of the track in microseconds, or TIME_UNSET if unknown.
editListDurations
public final @Nullable long[] editListDurations
Durations of edit list segments in the movie timescale. Null if there is no edit list.
editListMediaTimes
public final @Nullable long[] editListMediaTimes
Media times for edit list segments in the track timescale. Null if there is no edit list.
mediaDurationUs
public final long mediaDurationUs
The duration of the media in microseconds, or TIME_UNSET if unknown.
nalUnitLengthFieldLength
public final int nalUnitLengthFieldLength
The length in bytes of the NALUnitLength field in each sample. 0 for tracks that don't use length-delimited NAL units.
sampleTransformation
@Track.Transformation
public final int sampleTransformation
One of TRANSFORMATION_*. Defines the transformation to apply before outputting each sample.
timescale
public final long timescale
The track timescale, defined as the number of time units that pass in one second.
type
@C.TrackType
public final int type
One of TRACK_TYPE_AUDIO, TRACK_TYPE_VIDEO and TRACK_TYPE_TEXT.
Public constructors
Track
public Track(
int id,
@C.TrackType int type,
long timescale,
long movieTimescale,
long durationUs,
long mediaDurationUs,
Format format,
@Track.Transformation int sampleTransformation,
@Nullable TrackEncryptionBox[] sampleDescriptionEncryptionBoxes,
int nalUnitLengthFieldLength,
@Nullable long[] editListDurations,
@Nullable long[] editListMediaTimes
)
Public methods
getSampleDescriptionEncryptionBox
public @Nullable TrackEncryptionBox getSampleDescriptionEncryptionBox(int sampleDescriptionIndex)
Returns the TrackEncryptionBox for the given sample description index.
| Parameters | |
|---|---|
int sampleDescriptionIndex |
The given sample description index |
| Returns | |
|---|---|
@Nullable TrackEncryptionBox |
The |