public final class MediaCodecInfo
extends java.lang.Object
MediaCodec for a given mime type.| Modifier and Type | Field and Description |
|---|---|
boolean |
adaptive
Whether the decoder supports seamless resolution switches.
|
java.lang.String |
name
The name of the decoder.
|
boolean |
secure
Whether the decoder is secure.
|
static java.lang.String |
TAG |
boolean |
tunneling
Whether the decoder supports tunneling.
|
| Modifier and Type | Method and Description |
|---|---|
android.graphics.Point |
alignVideoSizeV21(int width,
int height)
Returns the smallest video size greater than or equal to a specified size that also satisfies
the
MediaCodec's width and height alignment requirements. |
android.media.MediaCodecInfo.CodecProfileLevel[] |
getProfileLevels()
The profile levels supported by the decoder.
|
boolean |
isAudioChannelCountSupportedV21(int channelCount)
Whether the decoder supports audio with a given channel count.
|
boolean |
isAudioSampleRateSupportedV21(int sampleRate)
Whether the decoder supports audio with a given sample rate.
|
boolean |
isCodecSupported(java.lang.String codec)
Whether the decoder supports the given
codec. |
boolean |
isVideoSizeAndRateSupportedV21(int width,
int height,
double frameRate)
Whether the decoder supports video with a given width, height and frame rate.
|
static MediaCodecInfo |
newInstance(java.lang.String name,
java.lang.String mimeType,
android.media.MediaCodecInfo.CodecCapabilities capabilities)
Creates an instance.
|
static MediaCodecInfo |
newInstance(java.lang.String name,
java.lang.String mimeType,
android.media.MediaCodecInfo.CodecCapabilities capabilities,
boolean forceDisableAdaptive,
boolean forceSecure)
Creates an instance.
|
static MediaCodecInfo |
newPassthroughInstance(java.lang.String name)
Creates an instance representing an audio passthrough decoder.
|
public static final java.lang.String TAG
public final java.lang.String name
May be passed to MediaCodec.createByCodecName(String) to create an instance of the
decoder.
public final boolean adaptive
MediaCodecInfo.CodecCapabilities.isFeatureSupported(String),
MediaCodecInfo.CodecCapabilities.FEATURE_AdaptivePlaybackpublic final boolean tunneling
MediaCodecInfo.CodecCapabilities.isFeatureSupported(String),
MediaCodecInfo.CodecCapabilities.FEATURE_TunneledPlaybackpublic final boolean secure
MediaCodecInfo.CodecCapabilities.isFeatureSupported(String),
MediaCodecInfo.CodecCapabilities.FEATURE_SecurePlaybackpublic static MediaCodecInfo newPassthroughInstance(java.lang.String name)
name - The name of the MediaCodec.public static MediaCodecInfo newInstance(java.lang.String name, java.lang.String mimeType, android.media.MediaCodecInfo.CodecCapabilities capabilities)
name - The name of the MediaCodec.mimeType - A mime type supported by the MediaCodec.capabilities - The capabilities of the MediaCodec for the specified mime type.public static MediaCodecInfo newInstance(java.lang.String name, java.lang.String mimeType, android.media.MediaCodecInfo.CodecCapabilities capabilities, boolean forceDisableAdaptive, boolean forceSecure)
name - The name of the MediaCodec.mimeType - A mime type supported by the MediaCodec.capabilities - The capabilities of the MediaCodec for the specified mime type.forceDisableAdaptive - Whether adaptive should be forced to false.forceSecure - Whether secure should be forced to true.public android.media.MediaCodecInfo.CodecProfileLevel[] getProfileLevels()
public boolean isCodecSupported(java.lang.String codec)
codec. If there is insufficient information to
decide, returns true.codec - Codec string as defined in RFC 6381.public boolean isVideoSizeAndRateSupportedV21(int width,
int height,
double frameRate)
Must not be called if the device SDK version is less than 21.
width - Width in pixels.height - Height in pixels.frameRate - Optional frame rate in frames per second. Ignored if set to
Format.NO_VALUE or any value less than or equal to 0.public android.graphics.Point alignVideoSizeV21(int width,
int height)
MediaCodec's width and height alignment requirements.
Must not be called if the device SDK version is less than 21.
width - Width in pixels.height - Height in pixels.MediaCodec's width and height alignment requirements, or null if not a video
codec.public boolean isAudioSampleRateSupportedV21(int sampleRate)
Must not be called if the device SDK version is less than 21.
sampleRate - The sample rate in Hz.public boolean isAudioChannelCountSupportedV21(int channelCount)
Must not be called if the device SDK version is less than 21.
channelCount - The channel count.