public interface MediaCodecSelector
MediaCodec instances.| Modifier and Type | Field and Description |
|---|---|
static MediaCodecSelector |
DEFAULT
Default implementation of
MediaCodecSelector, which returns the preferred decoder for
the given format. |
static MediaCodecSelector |
DEFAULT_WITH_FALLBACK
A
MediaCodecSelector that returns a list of decoders in priority order, allowing
fallback to less preferred decoders if initialization fails. |
| Modifier and Type | Method and Description |
|---|---|
java.util.List<MediaCodecInfo> |
getDecoderInfos(java.lang.String mimeType,
boolean requiresSecureDecoder)
Returns a list of decoders that can decode media in the specified MIME type, in priority order.
|
MediaCodecInfo |
getPassthroughDecoderInfo()
Selects a decoder to instantiate for audio passthrough.
|
static final MediaCodecSelector DEFAULT
MediaCodecSelector, which returns the preferred decoder for
the given format.static final MediaCodecSelector DEFAULT_WITH_FALLBACK
MediaCodecSelector that returns a list of decoders in priority order, allowing
fallback to less preferred decoders if initialization fails.
Note: if a hardware-accelerated video decoder fails to initialize, this selector may provide a software video decoder to use as a fallback. Using software decoding can be inefficient, and the decoder may be too slow to keep up with the playback position.
java.util.List<MediaCodecInfo> getDecoderInfos(java.lang.String mimeType, boolean requiresSecureDecoder) throws MediaCodecUtil.DecoderQueryException
mimeType - The MIME type for which a decoder is required.requiresSecureDecoder - Whether a secure decoder is required.MediaCodecInfos corresponding to decoders. May be empty.MediaCodecUtil.DecoderQueryException - Thrown if there was an error querying decoders.@Nullable MediaCodecInfo getPassthroughDecoderInfo() throws MediaCodecUtil.DecoderQueryException
MediaCodecInfo describing the decoder, or null if no suitable decoder exists.MediaCodecUtil.DecoderQueryException - Thrown if there was an error querying decoders.