Encapsulates the information describing the format of media data,
be it audio or video.
The format of the media data is specified as string/value pairs.
Keys common to all audio/video formats, all keys not marked optional are mandatory:
to enable
adaptive playback (seamless resolution change) for a video decoder that
supports it (
).
The values are used as hints for the codec: they are the maximum expected
resolution to prepare for. Depending on codec support, preparing for larger
maximum resolution may require more memory even if that resolution is never
reached. These fields have no effect for codecs that do not support adaptive
playback.
Name | Value Type | Description |
---|
MediaFormat.KeyChannelCount | Integer | |
MediaFormat.KeySampleRate | Integer | |
MediaFormat.KeyIsAdts | Integer | optional, if decoding AAC audio content, setting this key to 1 indicates that each audio frame is prefixed by the ADTS header. |
MediaFormat.KeyAacProfile | Integer | encoder-only, optional, if content is AAC audio, specifies the desired profile. |
MediaFormat.KeyAacSbrMode | Integer | encoder-only, optional, if content is AAC audio, specifies the desired SBR mode. |
MediaFormat.KeyAacDrcTargetReferenceLevel | Integer | decoder-only, optional, if content is AAC audio, specifies the target reference level. |
MediaFormat.KeyAacEncodedTargetLevel | Integer | decoder-only, optional, if content is AAC audio, specifies the target reference level used at encoder. |
MediaFormat.KeyAacDrcBoostFactor | Integer | decoder-only, optional, if content is AAC audio, specifies the DRC boost factor. |
MediaFormat.KeyAacDrcAttenuationFactor | Integer | decoder-only, optional, if content is AAC audio, specifies the DRC attenuation factor. |
MediaFormat.KeyAacDrcHeavyCompression | Integer | decoder-only, optional, if content is AAC audio, specifies whether to use heavy compression. |
MediaFormat.KeyAacMaxOutputChannelCount | Integer | decoder-only, optional, if content is AAC audio, specifies the maximum number of channels the decoder outputs. |
MediaFormat.KeyChannelMask | Integer | optional, a mask of audio channel assignments |
MediaFormat.KeyFlacCompressionLevel | Integer | encoder-only, optional, if content is FLAC audio, specifies the desired compression level. |