MediaFormat MediaFormat Class

Definition

Encapsulates the information describing the format of media data, be it audio or video.

[Android.Runtime.Register("android/media/MediaFormat", ApiSince=16, DoNotGenerateAcw=true)]
public sealed class MediaFormat : Java.Lang.Object
type MediaFormat = class
    inherit Object
Inheritance
MediaFormatMediaFormat
Attributes

Remarks

Android platform documentation

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Constructors

MediaFormat() MediaFormat()

Creates an empty MediaFormat

Fields

ColorRangeFull ColorRangeFull
ColorRangeLimited ColorRangeLimited
ColorStandardBt2020 ColorStandardBt2020
ColorStandardBt601Ntsc ColorStandardBt601Ntsc
ColorStandardBt601Pal ColorStandardBt601Pal
ColorStandardBt709 ColorStandardBt709
ColorTransferHlg ColorTransferHlg
ColorTransferLinear ColorTransferLinear
ColorTransferSdrVideo ColorTransferSdrVideo
ColorTransferSt2084 ColorTransferSt2084
KeyAacDrcAttenuationFactor KeyAacDrcAttenuationFactor

A key describing the attenuation factor allowing to adapt the dynamics of the output to the actual listening requirements.

KeyAacDrcBoostFactor KeyAacDrcBoostFactor

A key describing the boost factor allowing to adapt the dynamics of the output to the actual listening requirements.

KeyAacDrcHeavyCompression KeyAacDrcHeavyCompression

A key describing the selection of the heavy compression profile for DRC.

KeyAacDrcTargetReferenceLevel KeyAacDrcTargetReferenceLevel

A key describing a gain to be applied so that the output loudness matches the Target Reference Level.

KeyAacEncodedTargetLevel KeyAacEncodedTargetLevel

A key describing the target reference level that was assumed at the encoder for calculation of attenuation gains for clipping prevention.

KeyAacMaxOutputChannelCount KeyAacMaxOutputChannelCount

A key describing the maximum number of channels that can be output by the AAC decoder.

KeyAacProfile KeyAacProfile

A key describing the AAC profile to be used (AAC audio formats only).

KeyAacSbrMode KeyAacSbrMode

A key describing the AAC SBR mode to be used (AAC audio formats only).

KeyAudioSessionId KeyAudioSessionId

A key describing the audio session ID of the AudioTrack associated to a tunneled video codec.

KeyBitRate KeyBitRate

A key describing the bitrate in bits/sec.

KeyBitrateMode KeyBitrateMode

A key describing the desired bitrate mode to be used by an encoder.

KeyCaptureRate KeyCaptureRate

A key describing the capture rate of a video format in frames/sec.

KeyChannelCount KeyChannelCount

A key describing the number of channels in an audio format.

KeyChannelMask KeyChannelMask

A key describing the channel composition of audio content.

KeyColorFormat KeyColorFormat

A key describing the color format of the content in a video format.

KeyColorRange KeyColorRange
KeyColorStandard KeyColorStandard
KeyColorTransfer KeyColorTransfer
KeyComplexity KeyComplexity

A key describing the encoding complexity.

KeyDuration KeyDuration

A key describing the duration (in microseconds) of the content.

KeyFlacCompressionLevel KeyFlacCompressionLevel

A key describing the FLAC compression level to be used (FLAC audio format only).

KeyFrameRate KeyFrameRate

A key describing the frame rate of a video format in frames/sec.

KeyHdrStaticInfo KeyHdrStaticInfo
KeyHeight KeyHeight

A key describing the height of the content in a video format.

KeyIFrameInterval KeyIFrameInterval

A key describing the frequency of I frames expressed in secs between I frames.

KeyIntraRefreshPeriod KeyIntraRefreshPeriod
KeyIsAdts KeyIsAdts

A key mapping to a value of 1 if the content is AAC audio and audio frames are prefixed with an ADTS header.

KeyIsAutoselect KeyIsAutoselect

A key for boolean AUTOSELECT behavior for the track.

KeyIsDefault KeyIsDefault

A key for boolean DEFAULT behavior for the track.

KeyIsForcedSubtitle KeyIsForcedSubtitle

A key for the FORCED field for subtitle tracks.

KeyLanguage KeyLanguage

A key describing the language of the content, using either ISO 639-1 or 639-2/T codes.

KeyLatency KeyLatency
KeyLevel KeyLevel
KeyMaxHeight KeyMaxHeight

A key describing the maximum expected height of the content in a video decoder format, in case there are resolution changes in the video content.

KeyMaxInputSize KeyMaxInputSize

A key describing the maximum size in bytes of a buffer of data described by this MediaFormat.

KeyMaxWidth KeyMaxWidth

A key describing the maximum expected width of the content in a video decoder format, in case there are resolution changes in the video content.

KeyMime KeyMime

A key describing the mime type of the MediaFormat.

KeyOperatingRate KeyOperatingRate
KeyPcmEncoding KeyPcmEncoding
KeyPriority KeyPriority
KeyProfile KeyProfile

A key describing the desired profile to be used by an encoder.

KeyPushBlankBuffersOnStop KeyPushBlankBuffersOnStop

If specified when configuring a video decoder rendering to a surface, causes the decoder to output "blank", i.e.

KeyRepeatPreviousFrameAfter KeyRepeatPreviousFrameAfter

Applies only when configuring a video encoder in "surface-input" mode.

KeyRotation KeyRotation
KeySampleRate KeySampleRate

A key describing the sample rate of an audio format.

KeySliceHeight KeySliceHeight
KeyStride KeyStride
KeyTemporalLayering KeyTemporalLayering

A key describing the temporal layering schema.

KeyTrackId KeyTrackId
KeyWidth KeyWidth

A key describing the width of the content in a video format.

MimetypeAudioAac MimetypeAudioAac
MimetypeAudioAc3 MimetypeAudioAc3
MimetypeAudioAmrNb MimetypeAudioAmrNb
MimetypeAudioAmrWb MimetypeAudioAmrWb
MimetypeAudioEac3 MimetypeAudioEac3
MimetypeAudioFlac MimetypeAudioFlac
MimetypeAudioG711Alaw MimetypeAudioG711Alaw
MimetypeAudioG711Mlaw MimetypeAudioG711Mlaw
MimetypeAudioMpeg MimetypeAudioMpeg
MimetypeAudioMsgsm MimetypeAudioMsgsm
MimetypeAudioOpus MimetypeAudioOpus
MimetypeAudioQcelp MimetypeAudioQcelp
MimetypeAudioRaw MimetypeAudioRaw
MimetypeAudioScrambled MimetypeAudioScrambled
MimetypeAudioVorbis MimetypeAudioVorbis
MimetypeTextCea608 MimetypeTextCea608

MIME type for CEA-608 closed caption data.

MimetypeTextVtt MimetypeTextVtt

MIME type for WebVTT subtitle data.

MimetypeVideoAvc MimetypeVideoAvc
MimetypeVideoDolbyVision MimetypeVideoDolbyVision
MimetypeVideoH263 MimetypeVideoH263
MimetypeVideoHevc MimetypeVideoHevc
MimetypeVideoMpeg2 MimetypeVideoMpeg2
MimetypeVideoMpeg4 MimetypeVideoMpeg4
MimetypeVideoRaw MimetypeVideoRaw
MimetypeVideoScrambled MimetypeVideoScrambled
MimetypeVideoVp8 MimetypeVideoVp8
MimetypeVideoVp9 MimetypeVideoVp9

Properties

Class Class

Returns the unique instance of Class that represents this object's class.

(Inherited from Object)
Handle Handle

The handle to the underlying Android instance.

(Inherited from Object)
IJavaObjectEx.IsProxy IJavaObjectEx.IsProxy Inherited from Object
IJavaObjectEx.KeyHandle IJavaObjectEx.KeyHandle Inherited from Object
IJavaObjectEx.NeedsActivation IJavaObjectEx.NeedsActivation Inherited from Object
IJavaPeerable.JniManagedPeerState IJavaPeerable.JniManagedPeerState Inherited from Object
JniIdentityHashCode JniIdentityHashCode Inherited from Object
JniPeerMembers JniPeerMembers
PeerReference PeerReference Inherited from Object
ThresholdClass ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

(Inherited from Object)
ThresholdType ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

(Inherited from Object)

Methods

Clone() Clone()

Creates and returns a copy of this Object.

(Inherited from Object)
ContainsKey(String) ContainsKey(String)

Returns true iff a key of the given name exists in the format.

CreateAudioFormat(String, Int32, Int32) CreateAudioFormat(String, Int32, Int32)

Creates a minimal audio format.

CreateSubtitleFormat(String, String) CreateSubtitleFormat(String, String)

Creates a minimal subtitle format.

CreateVideoFormat(String, Int32, Int32) CreateVideoFormat(String, Int32, Int32)

Creates a minimal video format.

Dispose() Dispose() Inherited from Object
Dispose(Boolean) Dispose(Boolean) Inherited from Object
Equals(Object) Equals(Object)

Compares this instance with the specified object and indicates if they are equal.

(Inherited from Object)
GetByteBuffer(String) GetByteBuffer(String)

Returns the value of a ByteBuffer key.

GetFeatureEnabled(String) GetFeatureEnabled(String)

Returns whether a feature is to be enabled (true) or disabled (false).

GetFloat(String) GetFloat(String)

Returns the value of a float key.

GetHashCode() GetHashCode()

Returns an integer hash code for this object.

(Inherited from Object)
GetInteger(String) GetInteger(String)

Returns the value of an integer key.

GetLong(String) GetLong(String)

Returns the value of a long key.

GetString(String) GetString(String)

Returns the value of a string key.

JavaFinalize() JavaFinalize()

Invoked when the garbage collector has detected that this instance is no longer reachable.

(Inherited from Object)
Notify() Notify()

Causes a thread which is waiting on this object's monitor (by means of calling one of the wait() methods) to be woken up.

(Inherited from Object)
NotifyAll() NotifyAll()

Causes all threads which are waiting on this object's monitor (by means of calling one of the wait() methods) to be woken up.

(Inherited from Object)
SetByteBuffer(String, ByteBuffer) SetByteBuffer(String, ByteBuffer)

Sets the value of a ByteBuffer key.

SetFeatureEnabled(String, Boolean) SetFeatureEnabled(String, Boolean)

Sets whether a feature is to be enabled (true) or disabled (false).

SetFloat(String, Single) SetFloat(String, Single)

Sets the value of a float key.

SetHandle(IntPtr, JniHandleOwnership) SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
SetInteger(String, Int32) SetInteger(String, Int32)

Sets the value of an integer key.

SetLong(String, Int64) SetLong(String, Int64)

Sets the value of a long key.

SetString(String, String) SetString(String, String)

Sets the value of a string key.

ToArray<T>() ToArray<T>() Inherited from Object
ToString() ToString()

Returns a string containing a concise, human-readable description of this object.

(Inherited from Object)
UnregisterFromRuntime() UnregisterFromRuntime() Inherited from Object
Wait() Wait()

Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object.

(Inherited from Object)
Wait(Int64) Wait(Int64)

Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the specified timeout expires.

(Inherited from Object)
Wait(Int64, Int32) Wait(Int64, Int32)

Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the specified timeout expires.

(Inherited from Object)

Explicit Interface Implementations

IJavaObjectEx.ToLocalJniHandle() IJavaObjectEx.ToLocalJniHandle() Inherited from Object
IJavaPeerable.Disposed() IJavaPeerable.Disposed() Inherited from Object
IJavaPeerable.DisposeUnlessReferenced() IJavaPeerable.DisposeUnlessReferenced() Inherited from Object
IJavaPeerable.Finalized() IJavaPeerable.Finalized() Inherited from Object
IJavaPeerable.SetJniIdentityHashCode(Int32) IJavaPeerable.SetJniIdentityHashCode(Int32) Inherited from Object
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) Inherited from Object
IJavaPeerable.SetPeerReference(JniObjectReference) IJavaPeerable.SetPeerReference(JniObjectReference) Inherited from Object

Extension Methods

JavaCast<TResult>(IJavaObject) JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject) JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable) GetJniTypeName(IJavaPeerable)

Applies to