public final class MediaCodecInfo extends Object
MediaCodec
for a given mime type.Modifier and Type | Field and Description |
---|---|
boolean |
adaptive
Whether the decoder supports seamless resolution switches.
|
String |
name
The name of the decoder.
|
Modifier and Type | Method and Description |
---|---|
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(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.
|
boolean |
isVideoSizeSupportedV21(int width,
int height)
Whether the decoder supports video with a specified width and height.
|
static MediaCodecInfo |
newInstance(String name,
String mimeType,
MediaCodecInfo.CodecCapabilities capabilities)
Creates an instance.
|
static MediaCodecInfo |
newPassthroughInstance(String name)
Creates an instance representing an audio passthrough decoder.
|
public final String name
May be passed to MediaCodec.createByCodecName(String)
to create an instance of the
decoder.
public final boolean adaptive
public static MediaCodecInfo newPassthroughInstance(String name)
name
- The name of the MediaCodec
.public static MediaCodecInfo newInstance(String name, String mimeType, 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 MediaCodecInfo.CodecProfileLevel[] getProfileLevels()
public boolean isCodecSupported(String codec)
codec
. If there is insufficient information to
decide, returns true.codec
- Codec string as defined in RFC 6381.public boolean isVideoSizeSupportedV21(int width, int height)
Must not be called if the device SDK version is less than 21.
width
- Width in pixels.height
- Height in pixels.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
- Frame rate in frames per second.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.