MediaCodecSelector


@UnstableApi
interface MediaCodecSelector


Selector of MediaCodec instances.

Summary

Constants

const MediaCodecSelector!

Default implementation of MediaCodecSelector, which returns the preferred decoder for the given format.

Public functions

(Mutable)List<MediaCodecInfo!>!
getDecoderInfos(
    mimeType: String!,
    requiresSecureDecoder: Boolean,
    requiresTunnelingDecoder: Boolean
)

Returns a list of decoders that can decode media in the specified MIME type, in priority order.

Constants

DEFAULT

const val DEFAULTMediaCodecSelector!

Default implementation of MediaCodecSelector, which returns the preferred decoder for the given format.

Public functions

getDecoderInfos

fun getDecoderInfos(
    mimeType: String!,
    requiresSecureDecoder: Boolean,
    requiresTunnelingDecoder: Boolean
): (Mutable)List<MediaCodecInfo!>!

Returns a list of decoders that can decode media in the specified MIME type, in priority order.

Parameters
mimeType: String!

The MIME type for which a decoder is required.

requiresSecureDecoder: Boolean

Whether a secure decoder is required.

requiresTunnelingDecoder: Boolean

Whether a tunneling decoder is required.

Returns
(Mutable)List<MediaCodecInfo!>!

An unmodifiable list of MediaCodecInfos corresponding to decoders. May be empty.

Throws
androidx.media3.exoplayer.mediacodec.MediaCodecUtil.DecoderQueryException

Thrown if there was an error querying decoders.