Freigeben über


MediaCodecList.FindEncoderForFormat(MediaFormat) Method

Definition

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

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

Parameters

format
MediaFormat

An encoder media format with optional feature directives.

Returns

the name of an encoder 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 an encoder 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.findEncoderForFormat(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