Track
@UnstableApi
class Track
Encapsulates information describing an MP4 track.
Summary
Nested types |
|---|
class Track.BuilderBuilder for |
@DocumentedThe transformation to apply to samples in the track, if any. |
Constants |
|
|---|---|
const Long |
TIMESCALE_UNSET = -1An unset or unknown timescale. |
const Int |
A transformation for caption samples in cdat atoms. |
const Int |
A no-op sample transformation. |
Public constructors |
|---|
This function is deprecated. Use |
Public functions |
|
|---|---|
Track.Builder! |
Returns a new |
Track! |
This function is deprecated. Use |
Track! |
This function is deprecated. Use |
TrackEncryptionBox? |
getSampleDescriptionEncryptionBox(sampleDescriptionIndex: Int)Returns the |
Public properties |
|
|---|---|
Int |
The identifier of the associated chapter track, or |
Long |
The duration of the track in microseconds, or |
ImmutableLongArray? |
Durations of edit list segments in the |
ImmutableLongArray? |
Media times for edit list segments in the |
Format! |
The format. |
Int |
The track identifier. |
Long |
The duration of the media in microseconds, or |
Long |
The movie timescale, or |
Int |
The length in bytes of the NALUnitLength field in each sample. |
Int |
One of |
Boolean |
Whether the track should be exposed to the player. |
Long |
The track timescale, defined as the number of time units that pass in one second, or |
Int |
One of |
Constants
TRANSFORMATION_CEA608_CDAT
const val TRANSFORMATION_CEA608_CDAT = 1: Int
A transformation for caption samples in cdat atoms.
Public constructors
Track
Track(
id: Int,
@C.TrackType type: Int,
timescale: Long,
movieTimescale: Long,
durationUs: Long,
mediaDurationUs: Long,
format: Format!,
@Track.Transformation sampleTransformation: Int,
sampleDescriptionEncryptionBoxes: Array<TrackEncryptionBox!>?,
nalUnitLengthFieldLength: Int,
editListDurations: LongArray<Long>?,
editListMediaTimes: LongArray<Long>?,
shouldBeExposed: Boolean,
chapterTrackId: Int
)
Public functions
buildUpon
fun buildUpon(): Track.Builder!
Returns a new Builder initialized with the values of this instance.
getSampleDescriptionEncryptionBox
fun getSampleDescriptionEncryptionBox(sampleDescriptionIndex: Int): TrackEncryptionBox?
Returns the TrackEncryptionBox for the given sample description index.
| Parameters | |
|---|---|
sampleDescriptionIndex: Int |
The given sample description index |
| Returns | |
|---|---|
TrackEncryptionBox? |
The |
Public properties
chapterTrackId
val chapterTrackId: Int
The identifier of the associated chapter track, or INDEX_UNSET if there is none.
durationUs
val durationUs: Long
The duration of the track in microseconds, or TIME_UNSET if unknown.
editListDurations
val editListDurations: ImmutableLongArray?
Durations of edit list segments in the movie timescale, or
null if there is no edit list.
editListMediaTimes
val editListMediaTimes: ImmutableLongArray?
Media times for edit list segments in the track timescale, or
null if there is no edit list.
mediaDurationUs
val mediaDurationUs: Long
The duration of the media in microseconds, or TIME_UNSET if unknown.
nalUnitLengthFieldLength
val nalUnitLengthFieldLength: Int
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
val sampleTransformation: Int
One of TRANSFORMATION_*. Defines the transformation to apply before outputting each sample.
timescale
val timescale: Long
The track timescale, defined as the number of time units that pass in one second, or TIMESCALE_UNSET if unknown.