MediaFormat

An immutable Parcelable object that can be used describe the format of media stream.

This is a derivative of the media format class in ExoPlayer 1 SDK.

Author

rsubramaniam

Properties

Link copied to clipboard
Specifies whether the format represents an adaptive track, meaning that the format of the actual media data may change (e.g.
Link copied to clipboard
The average bandwidth in bits per second, or NO_VALUE if unknown or not applicable.
Link copied to clipboard
The number of audio channels, or NO_VALUE if unknown or not applicable.
Link copied to clipboard
val CREATOR: Creator<MediaFormat>
Link copied to clipboard
The duration in microseconds, or UNKNOWN_TIME_US if the duration is unknown, or MATCH_LONGEST_US if the duration should match the duration of the longest track whose duration is known.
Link copied to clipboard
The number of samples to trim from the start of the decoded audio stream.
Link copied to clipboard
The number of samples to trim from the end of the decoded audio stream.
Link copied to clipboard
val height: Int
The height of the video in pixels, or NO_VALUE if unknown or not applicable.
Link copied to clipboard
Initialization data that must be provided to the decoder.
Link copied to clipboard
The language of the track, or null if unknown or not applicable
Link copied to clipboard
If the video is flagged adaptive, this is the maximum height of the video in pixels that will be encountered in the stream.
Link copied to clipboard
The maximum size of a buffer of data (typically one sample) in the format, or NO_VALUE if unknown or not applicable.
Link copied to clipboard
If the video is flagged adaptive, this is the maximum width of the video in pixels that will be encountered in the stream.
Link copied to clipboard
The mime type of the format.
Link copied to clipboard
Empty initialization data.
Link copied to clipboard
val OFFSET_SAMPLE_RELATIVE: Long = 9223372036854775807
A value for subSampleOffsetUs to indicate that sub-sample timestamps are relative to the timestamps of their parent samples.
Link copied to clipboard
The encoding for PCM audio streams.
Link copied to clipboard
The width to height ratio of pixels in the video, or NO_VALUE if unknown or not applicable.
Link copied to clipboard
The projection data for 360/VR video, or null if not applicable.
Link copied to clipboard
The clockwise rotation that should be applied to the video for it to be rendered in the correct orientation, or NO_VALUE if unknown or not applicable.
Link copied to clipboard
The audio sampling rate in Hz, or NO_VALUE if unknown or not applicable.
Link copied to clipboard
The stereo layout for 360/3D/VR video, or NO_VALUE if not applicable.
Link copied to clipboard
For samples that contain sub-samples, this is an offset that should be added to sub-sample timestamps.
Link copied to clipboard
The identifier for the track represented by the format, or null if unknown or not applicable.
Link copied to clipboard
val width: Int
The width of the video in pixels, or NO_VALUE if unknown or not applicable.

Functions

Link copied to clipboard
open fun copyAsAdaptive(trackId: String): MediaFormat
Link copied to clipboard
open fun copyWithDurationUs(durationUs: Long): MediaFormat
Link copied to clipboard
open fun copyWithFixedTrackInfo(trackId: String, bitrate: Int, width: Int, height: Int, language: String): MediaFormat
Link copied to clipboard
open fun copyWithGaplessInfo(encoderDelay: Int, encoderPadding: Int): MediaFormat
Link copied to clipboard
open fun copyWithLanguage(language: String): MediaFormat
Link copied to clipboard
open fun copyWithMaxInputSize(maxInputSize: Int): MediaFormat
Link copied to clipboard
open fun copyWithMaxVideoDimensions(maxWidth: Int, maxHeight: Int): MediaFormat
Link copied to clipboard
open fun copyWithSubSampleOffsetUs(subSampleOffsetUs: Long): MediaFormat
Link copied to clipboard
open fun createAudioFormat(trackId: String, mimeType: String, bitrate: Int, maxInputSize: Int, durationUs: Long, channelCount: Int, sampleRate: Int, initializationData: List<Array<Byte>>, language: String): MediaFormat
open fun createAudioFormat(trackId: String, mimeType: String, bitrate: Int, maxInputSize: Int, durationUs: Long, channelCount: Int, sampleRate: Int, initializationData: List<Array<Byte>>, language: String, pcmEncoding: Int): MediaFormat
Link copied to clipboard
open fun createFormatForMimeType(trackId: String, mimeType: String, bitrate: Int, durationUs: Long): MediaFormat
Link copied to clipboard
Link copied to clipboard
open fun createImageFormat(trackId: String, mimeType: String, bitrate: Int, durationUs: Long, initializationData: List<Array<Byte>>, language: String): MediaFormat
Link copied to clipboard
open fun createTextFormat(trackId: String, mimeType: String, bitrate: Int, durationUs: Long, language: String): MediaFormat
open fun createTextFormat(trackId: String, mimeType: String, bitrate: Int, durationUs: Long, language: String, subSampleOffsetUs: Long): MediaFormat
Link copied to clipboard
open fun createVideoFormat(trackId: String, mimeType: String, bitrate: Int, maxInputSize: Int, durationUs: Long, width: Int, height: Int, initializationData: List<Array<Byte>>): MediaFormat
open fun createVideoFormat(trackId: String, mimeType: String, bitrate: Int, maxInputSize: Int, durationUs: Long, width: Int, height: Int, initializationData: List<Array<Byte>>, rotationDegrees: Int, pixelWidthHeightRatio: Float): MediaFormat
open fun createVideoFormat(trackId: String, mimeType: String, bitrate: Int, maxInputSize: Int, durationUs: Long, width: Int, height: Int, initializationData: List<Array<Byte>>, rotationDegrees: Int, pixelWidthHeightRatio: Float, projectionData: Array<Byte>, stereoMode: Int): MediaFormat
Link copied to clipboard
open fun describeContents(): Int
Link copied to clipboard
open fun equals(obj: Any): Boolean
Link copied to clipboard
fun getFrameworkMediaFormatV16(): MediaFormat
Link copied to clipboard
open fun hashCode(): Int
Link copied to clipboard
open fun toString(): String
Link copied to clipboard
open fun writeToParcel(dest: Parcel, flags: Int)