public final class MediaCodecUtil
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
MediaCodecUtil.DecoderQueryException
Thrown when an error occurs querying the device for its underlying media capabilities.
|
| Modifier and Type | Method and Description |
|---|---|
static android.util.Pair<java.lang.Integer,java.lang.Integer> |
getCodecProfileAndLevel(java.lang.String codec)
Returns profile and level (as defined by
MediaCodecInfo.CodecProfileLevel) corresponding to the given
codec description string (as defined by RFC 6381). |
static MediaCodecInfo |
getDecoderInfo(java.lang.String mimeType,
boolean secure)
Returns information about the preferred decoder for a given mime type.
|
static java.util.List<MediaCodecInfo> |
getDecoderInfos(java.lang.String mimeType,
boolean secure)
Returns all
MediaCodecInfos for the given mime type, in the order given by
MediaCodecList. |
static MediaCodecInfo |
getPassthroughDecoderInfo()
Returns information about a decoder suitable for audio passthrough.
|
static int |
maxH264DecodableFrameSize()
Returns the maximum frame size supported by the default H264 decoder.
|
static void |
warmDecoderInfoCache(java.lang.String mimeType,
boolean secure)
Optional call to warm the codec cache for a given mime type.
|
public static void warmDecoderInfoCache(java.lang.String mimeType,
boolean secure)
Calling this method may speed up subsequent calls to getDecoderInfo(String, boolean)
and getDecoderInfos(String, boolean).
mimeType - The mime type.secure - Whether the decoder is required to support secure decryption. Always pass false
unless secure decryption really is required.public static MediaCodecInfo getPassthroughDecoderInfo()
MediaCodecInfo describing the decoder, or null if no suitable decoder
exists.@Nullable public static MediaCodecInfo getDecoderInfo(java.lang.String mimeType, boolean secure) throws MediaCodecUtil.DecoderQueryException
mimeType - The mime type.secure - Whether the decoder is required to support secure decryption. Always pass false
unless secure decryption really is required.MediaCodecInfo describing the decoder, or null if no suitable decoder
exists.MediaCodecUtil.DecoderQueryException - If there was an error querying the available decoders.public static java.util.List<MediaCodecInfo> getDecoderInfos(java.lang.String mimeType, boolean secure) throws MediaCodecUtil.DecoderQueryException
MediaCodecInfos for the given mime type, in the order given by
MediaCodecList.mimeType - The mime type.secure - Whether the decoder is required to support secure decryption. Always pass false
unless secure decryption really is required.MediaCodecList.MediaCodecUtil.DecoderQueryException - If there was an error querying the available decoders.public static int maxH264DecodableFrameSize()
throws MediaCodecUtil.DecoderQueryException
MediaCodecUtil.DecoderQueryExceptionpublic static android.util.Pair<java.lang.Integer,java.lang.Integer> getCodecProfileAndLevel(java.lang.String codec)
MediaCodecInfo.CodecProfileLevel) corresponding to the given
codec description string (as defined by RFC 6381).codec - A codec description string, as defined by RFC 6381.codec is well-formed and
recognized, or null otherwise