Class Track


  • @Deprecated
    public final class Track
    extends Object
    Deprecated.
    com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.
    Encapsulates information describing an MP4 track.
    • Field Detail

      • TRANSFORMATION_NONE

        public static final int TRANSFORMATION_NONE
        Deprecated.
        A no-op sample transformation.
        See Also:
        Constant Field Values
      • TRANSFORMATION_CEA608_CDAT

        public static final int TRANSFORMATION_CEA608_CDAT
        Deprecated.
        A transformation for caption samples in cdat atoms.
        See Also:
        Constant Field Values
      • id

        public final int id
        Deprecated.
        The track identifier.
      • timescale

        public final long timescale
        Deprecated.
        The track timescale, defined as the number of time units that pass in one second.
      • movieTimescale

        public final long movieTimescale
        Deprecated.
        The movie timescale.
      • durationUs

        public final long durationUs
        Deprecated.
        The duration of the track in microseconds, or C.TIME_UNSET if unknown.
      • format

        public final Format format
        Deprecated.
        The format.
      • sampleTransformation

        public final @com.google.android.exoplayer2.extractor.mp4.Track.Transformation int sampleTransformation
        Deprecated.
        One of TRANSFORMATION_*. Defines the transformation to apply before outputting each sample.
      • editListDurations

        @Nullable
        public final long[] editListDurations
        Deprecated.
        Durations of edit list segments in the movie timescale. Null if there is no edit list.
      • editListMediaTimes

        @Nullable
        public final long[] editListMediaTimes
        Deprecated.
        Media times for edit list segments in the track timescale. Null if there is no edit list.
      • nalUnitLengthFieldLength

        public final int nalUnitLengthFieldLength
        Deprecated.
        The length in bytes of the NALUnitLength field in each sample. 0 for tracks that don't use length-delimited NAL units.
    • 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)
        Deprecated.
    • Method Detail

      • getSampleDescriptionEncryptionBox

        @Nullable
        public TrackEncryptionBox getSampleDescriptionEncryptionBox​(int sampleDescriptionIndex)
        Deprecated.
        Returns the TrackEncryptionBox for the given sample description index.
        Parameters:
        sampleDescriptionIndex - The given sample description index
        Returns:
        The TrackEncryptionBox for the given sample description index. Maybe null if no such entry exists.
      • copyWithFormat

        public Track copyWithFormat​(Format format)
        Deprecated.