MediaCodecSelector


@UnstableApi
public interface MediaCodecSelector


Selector of MediaCodec instances.

Summary

Constants

default static final MediaCodecSelector

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

Public methods

abstract List<MediaCodecInfo>
getDecoderInfos(
    String mimeType,
    boolean requiresSecureDecoder,
    boolean requiresTunnelingDecoder
)

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

Constants

DEFAULT

default static final MediaCodecSelector DEFAULT

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

Public methods

getDecoderInfos

abstract List<MediaCodecInfogetDecoderInfos(
    String mimeType,
    boolean requiresSecureDecoder,
    boolean requiresTunnelingDecoder
)

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

Parameters
String mimeType

The MIME type for which a decoder is required.

boolean requiresSecureDecoder

Whether a secure decoder is required.

boolean requiresTunnelingDecoder

Whether a tunneling decoder is required.

Returns
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.