MediaCodecList.FindDecoderForFormat(MediaFormat) Method

Definition

Find a decoder supporting a given MediaFormat in the list of media-codecs.

[Android.Runtime.Register("findDecoderForFormat", "(Landroid/media/MediaFormat;)Ljava/lang/String;", "")]
public string? FindDecoderForFormat (Android.Media.MediaFormat? format);
[<Android.Runtime.Register("findDecoderForFormat", "(Landroid/media/MediaFormat;)Ljava/lang/String;", "")>]
member this.FindDecoderForFormat : Android.Media.MediaFormat -> string

Parameters

format
MediaFormat

A decoder media format with optional feature directives.

Returns

the name of a decoder that supports the given format and feature requests, or null if no such codec has been found.

Attributes

Exceptions

if format is not a valid media format.

if format is null.

Remarks

Find a decoder supporting a given MediaFormat in the list of media-codecs.

<p class=note> <strong>Note:</strong> On android.os.Build.VERSION_CODES#LOLLIPOP, format must not contain a MediaFormat#KEY_FRAME_RATE frame rate. Use format.setString(MediaFormat.KEY_FRAME_RATE, null) to clear any existing frame rate setting in the format.

Java documentation for android.media.MediaCodecList.findDecoderForFormat(android.media.MediaFormat).

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.

Applies to