Class Format

    • Field Detail

      • NO_VALUE

        public static final int NO_VALUE
        A value for various fields to indicate that the field's value is unknown or not applicable.
        See Also:
        Constant Field Values
      • OFFSET_SAMPLE_RELATIVE

        public static final long OFFSET_SAMPLE_RELATIVE
        A value for subsampleOffsetUs to indicate that subsample timestamps are relative to the timestamps of their parent samples.
        See Also:
        Constant Field Values
      • id

        @Nullable
        public final String id
        An identifier for the format, or null if unknown or not applicable.
      • label

        @Nullable
        public final String label
        The human readable label, or null if unknown or not applicable.
      • language

        @Nullable
        public final String language
        The language as an IETF BCP 47 conformant tag, or null if unknown or not applicable.
      • selectionFlags

        @SelectionFlags
        public final int selectionFlags
        Track selection flags.
      • roleFlags

        @RoleFlags
        public final int roleFlags
        Track role flags.
      • averageBitrate

        public final int averageBitrate
        The average bitrate in bits per second, or NO_VALUE if unknown or not applicable. The way in which this field is populated depends on the type of media to which the format corresponds:
        • DASH representations: Always NO_VALUE.
        • HLS variants: The AVERAGE-BANDWIDTH attribute defined on the corresponding EXT-X-STREAM-INF tag in the master playlist, or NO_VALUE if not present.
        • SmoothStreaming track elements: The Bitrate attribute defined on the corresponding TrackElement in the manifest, or NO_VALUE if not present.
        • Progressive container formats: Often NO_VALUE, but may be populated with the average bitrate of the container if known.
        • Sample formats: Often NO_VALUE, but may be populated with the average bitrate of the stream of samples with type sampleMimeType if known. Note that if sampleMimeType is a compressed format (e.g., MimeTypes.AUDIO_AAC), then this bitrate is for the stream of still compressed samples.
      • peakBitrate

        public final int peakBitrate
        The peak bitrate in bits per second, or NO_VALUE if unknown or not applicable. The way in which this field is populated depends on the type of media to which the format corresponds:
        • DASH representations: The @bandwidth attribute of the corresponding Representation element in the manifest.
        • HLS variants: The BANDWIDTH attribute defined on the corresponding EXT-X-STREAM-INF tag.
        • SmoothStreaming track elements: Always NO_VALUE.
        • Progressive container formats: Often NO_VALUE, but may be populated with the peak bitrate of the container if known.
        • Sample formats: Often NO_VALUE, but may be populated with the peak bitrate of the stream of samples with type sampleMimeType if known. Note that if sampleMimeType is a compressed format (e.g., MimeTypes.AUDIO_AAC), then this bitrate is for the stream of still compressed samples.
      • bitrate

        public final int bitrate
        The bitrate in bits per second. This is the peak bitrate if known, or else the average bitrate if known, or else NO_VALUE. Equivalent to: peakBitrate != NO_VALUE ? peakBitrate : averageBitrate.
      • codecs

        @Nullable
        public final String codecs
        Codecs of the format as described in RFC 6381, or null if unknown or not applicable.
      • metadata

        @Nullable
        public final Metadata metadata
        Metadata, or null if unknown or not applicable.
      • containerMimeType

        @Nullable
        public final String containerMimeType
        The mime type of the container, or null if unknown or not applicable.
      • sampleMimeType

        @Nullable
        public final String sampleMimeType
        The sample mime type, or null if unknown or not applicable.
      • maxInputSize

        public final int maxInputSize
        The maximum size of a buffer of data (typically one sample), or NO_VALUE if unknown or not applicable.
      • initializationData

        public final List<byte[]> initializationData
        Initialization data that must be provided to the decoder. Will not be null, but may be empty if initialization data is not required.
      • drmInitData

        @Nullable
        public final DrmInitData drmInitData
        DRM initialization data if the stream is protected, or null otherwise.
      • subsampleOffsetUs

        public final long subsampleOffsetUs
        For samples that contain subsamples, this is an offset that should be added to subsample timestamps. A value of OFFSET_SAMPLE_RELATIVE indicates that subsample timestamps are relative to the timestamps of their parent samples.
      • width

        public final int width
        The width of the video in pixels, or NO_VALUE if unknown or not applicable.
      • height

        public final int height
        The height of the video in pixels, or NO_VALUE if unknown or not applicable.
      • frameRate

        public final float frameRate
        The frame rate in frames per second, or NO_VALUE if unknown or not applicable.
      • rotationDegrees

        public final int rotationDegrees
        The clockwise rotation that should be applied to the video for it to be rendered in the correct orientation, or 0 if unknown or not applicable. Only 0, 90, 180 and 270 are supported.
      • pixelWidthHeightRatio

        public final float pixelWidthHeightRatio
        The width to height ratio of pixels in the video, or 1.0 if unknown or not applicable.
      • projectionData

        @Nullable
        public final byte[] projectionData
        The projection data for 360/VR video, or null if not applicable.
      • colorInfo

        @Nullable
        public final ColorInfo colorInfo
        The color metadata associated with the video, or null if not applicable.
      • channelCount

        public final int channelCount
        The number of audio channels, or NO_VALUE if unknown or not applicable.
      • sampleRate

        public final int sampleRate
        The audio sampling rate in Hz, or NO_VALUE if unknown or not applicable.
      • encoderDelay

        public final int encoderDelay
        The number of frames to trim from the start of the decoded audio stream, or 0 if not applicable.
      • encoderPadding

        public final int encoderPadding
        The number of frames to trim from the end of the decoded audio stream, or 0 if not applicable.
      • accessibilityChannel

        public final int accessibilityChannel
        The Accessibility channel, or NO_VALUE if not known or applicable.
      • exoMediaCryptoType

        @Nullable
        public final Class<? extends ExoMediaCrypto> exoMediaCryptoType
        The type of ExoMediaCrypto that will be associated with the content this format describes, or null if the content is not encrypted. Cannot be null if drmInitData is non-null.