public static final class MediaCodecInfo.CodecCapabilities extends Object
You can get an instance for a given MediaCodecInfo
object with
getCapabilitiesForType()
, passing a MIME type.
Modifier and Type | Field and Description |
---|---|
static int |
COLOR_Format12bitRGB444
Deprecated.
|
static int |
COLOR_Format16bitARGB1555
Deprecated.
|
static int |
COLOR_Format16bitARGB4444
Deprecated.
|
static int |
COLOR_Format16bitBGR565
Deprecated.
|
static int |
COLOR_Format16bitRGB565
16 bits per pixel RGB color format, with 5-bit red & blue and 6-bit green component.
|
static int |
COLOR_Format18bitARGB1665
Deprecated.
|
static int |
COLOR_Format18BitBGR666
Deprecated.
|
static int |
COLOR_Format18bitRGB666
Deprecated.
|
static int |
COLOR_Format19bitARGB1666
Deprecated.
|
static int |
COLOR_Format24BitABGR6666
Deprecated.
|
static int |
COLOR_Format24bitARGB1887
Deprecated.
|
static int |
COLOR_Format24BitARGB6666
Deprecated.
|
static int |
COLOR_Format24bitBGR888
24 bits per pixel RGB color format, with 8-bit red, green & blue components.
|
static int |
COLOR_Format24bitRGB888
Deprecated.
|
static int |
COLOR_Format25bitARGB1888
Deprecated.
|
static int |
COLOR_Format32bitABGR8888
32 bits per pixel RGBA color format, with 8-bit red, green, blue, and alpha components.
|
static int |
COLOR_Format32bitARGB8888
Deprecated.
|
static int |
COLOR_Format32bitBGRA8888
Deprecated.
|
static int |
COLOR_Format8bitRGB332
Deprecated.
|
static int |
COLOR_FormatCbYCrY
Deprecated.
|
static int |
COLOR_FormatCrYCbY
Deprecated.
|
static int |
COLOR_FormatL16
16 bits per pixel, little-endian Y color format.
|
static int |
COLOR_FormatL2
Deprecated.
Use
COLOR_FormatL8 . |
static int |
COLOR_FormatL24
Deprecated.
Use
COLOR_FormatL16 . |
static int |
COLOR_FormatL32
Deprecated.
Use
COLOR_FormatL16 . |
static int |
COLOR_FormatL4
Deprecated.
Use
COLOR_FormatL8 . |
static int |
COLOR_FormatL8
8 bits per pixel Y color format.
|
static int |
COLOR_FormatMonochrome
Deprecated.
|
static int |
COLOR_FormatRawBayer10bit
SMIA 10-bit Bayer format.
|
static int |
COLOR_FormatRawBayer8bit
SMIA 8-bit Bayer format.
|
static int |
COLOR_FormatRawBayer8bitcompressed
SMIA 8-bit compressed Bayer format.
|
static int |
COLOR_FormatRGBAFlexible
Flexible 32 bits per pixel RGBA color format with 8-bit red, green, blue, and alpha
components.
|
static int |
COLOR_FormatRGBFlexible
Flexible 24 bits per pixel RGB color format with 8-bit red, green and blue
components.
|
static int |
COLOR_FormatSurface |
static int |
COLOR_FormatYCbYCr
Deprecated.
|
static int |
COLOR_FormatYCrYCb
Deprecated.
|
static int |
COLOR_FormatYUV411PackedPlanar
Deprecated.
|
static int |
COLOR_FormatYUV411Planar
Deprecated.
|
static int |
COLOR_FormatYUV420Flexible
Flexible 12 bits per pixel, subsampled YUV color format with 8-bit chroma and luma
components.
|
static int |
COLOR_FormatYUV420PackedPlanar
Deprecated.
|
static int |
COLOR_FormatYUV420PackedSemiPlanar
Deprecated.
|
static int |
COLOR_FormatYUV420Planar
Deprecated.
|
static int |
COLOR_FormatYUV420SemiPlanar
Deprecated.
|
static int |
COLOR_FormatYUV422Flexible
Flexible 16 bits per pixel, subsampled YUV color format with 8-bit chroma and luma
components.
|
static int |
COLOR_FormatYUV422PackedPlanar
Deprecated.
|
static int |
COLOR_FormatYUV422PackedSemiPlanar
Deprecated.
|
static int |
COLOR_FormatYUV422Planar
Deprecated.
|
static int |
COLOR_FormatYUV422SemiPlanar
Deprecated.
|
static int |
COLOR_FormatYUV444Flexible
Flexible 24 bits per pixel YUV color format with 8-bit chroma and luma
components.
|
static int |
COLOR_FormatYUV444Interleaved
Deprecated.
|
static int |
COLOR_QCOM_FormatYUV420SemiPlanar
Deprecated.
|
static int |
COLOR_TI_FormatYUV420PackedSemiPlanar
Deprecated.
|
int[] |
colorFormats
Defined in the OpenMAX IL specs, color format values are drawn from
OMX_COLOR_FORMATTYPE.
|
static String |
FEATURE_AdaptivePlayback
video decoder only: codec supports seamless resolution changes.
|
static String |
FEATURE_IntraRefresh
video encoder only: codec supports intra refresh.
|
static String |
FEATURE_SecurePlayback
video decoder only: codec supports secure decryption.
|
static String |
FEATURE_TunneledPlayback
video or audio decoder only: codec supports tunneled playback.
|
MediaCodecInfo.CodecProfileLevel[] |
profileLevels |
Constructor and Description |
---|
CodecCapabilities() |
Modifier and Type | Method and Description |
---|---|
static MediaCodecInfo.CodecCapabilities |
createFromProfileLevel(String mime,
int profile,
int level)
Retrieve the codec capabilities for a certain
mime type , profile and level . |
MediaCodecInfo.CodecCapabilities |
dup() |
MediaCodecInfo.AudioCapabilities |
getAudioCapabilities()
Returns the audio capabilities or
null if this is not an audio codec. |
MediaFormat |
getDefaultFormat()
Returns a MediaFormat object with default values for configurations that have
defaults.
|
MediaCodecInfo.EncoderCapabilities |
getEncoderCapabilities()
Returns the encoding capabilities or
null if this is not an encoder. |
int |
getMaxSupportedInstances()
Returns the max number of the supported concurrent codec instances.
|
String |
getMimeType()
Returns the mime type for which this codec-capability object was created.
|
MediaCodecInfo.VideoCapabilities |
getVideoCapabilities()
Returns the video capabilities or
null if this is not a video codec. |
boolean |
isFeatureRequired(String name)
Query codec feature requirements.
|
boolean |
isFeatureSupported(String name)
Query codec feature capabilities.
|
boolean |
isFormatSupported(MediaFormat format)
Query whether codec supports a given
MediaFormat . |
boolean |
isRegular() |
String[] |
validFeatures() |
public MediaCodecInfo.CodecProfileLevel[] profileLevels
public static final int COLOR_FormatMonochrome
COLOR_Format24bitBGR888
.public static final int COLOR_Format8bitRGB332
COLOR_Format24bitBGR888
.public static final int COLOR_Format12bitRGB444
COLOR_Format24bitBGR888
.public static final int COLOR_Format16bitARGB4444
COLOR_Format32bitABGR8888
.public static final int COLOR_Format16bitARGB1555
COLOR_Format32bitABGR8888
.public static final int COLOR_Format16bitRGB565
Using 16-bit little-endian representation, colors stored as Red 15:11, Green 10:5, Blue 4:0.
byte byte <--------- i --------> | <------ i + 1 ------> +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | BLUE | GREEN | RED | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 0 4 5 7 0 2 3 7 bitThis format corresponds to
PixelFormat.RGB_565
and
ImageFormat.RGB_565
.public static final int COLOR_Format16bitBGR565
COLOR_Format16bitRGB565
.public static final int COLOR_Format18bitRGB666
COLOR_Format24bitBGR888
.public static final int COLOR_Format18bitARGB1665
COLOR_Format32bitABGR8888
.public static final int COLOR_Format19bitARGB1666
COLOR_Format32bitABGR8888
.public static final int COLOR_Format24bitRGB888
COLOR_Format24bitBGR888
or COLOR_FormatRGBFlexible
.public static final int COLOR_Format24bitBGR888
Using 24-bit little-endian representation, colors stored as Red 7:0, Green 15:8, Blue 23:16.
byte byte byte <------ i -----> | <---- i+1 ----> | <---- i+2 -----> +-----------------+-----------------+-----------------+ | RED | GREEN | BLUE | +-----------------+-----------------+-----------------+This format corresponds to
PixelFormat.RGB_888
, and can also be
represented as a flexible format by COLOR_FormatRGBFlexible
.public static final int COLOR_Format24bitARGB1887
COLOR_Format32bitABGR8888
.public static final int COLOR_Format25bitARGB1888
COLOR_Format32bitABGR8888
.public static final int COLOR_Format32bitBGRA8888
COLOR_Format32bitABGR8888
Or COLOR_FormatRGBAFlexible
.public static final int COLOR_Format32bitARGB8888
COLOR_Format32bitABGR8888
Or COLOR_FormatRGBAFlexible
.public static final int COLOR_FormatYUV411Planar
COLOR_FormatYUV420Flexible
.public static final int COLOR_FormatYUV411PackedPlanar
COLOR_FormatYUV420Flexible
.public static final int COLOR_FormatYUV420Planar
COLOR_FormatYUV420Flexible
.public static final int COLOR_FormatYUV420PackedPlanar
COLOR_FormatYUV420Flexible
.public static final int COLOR_FormatYUV420SemiPlanar
COLOR_FormatYUV420Flexible
.public static final int COLOR_FormatYUV422Planar
COLOR_FormatYUV422Flexible
.public static final int COLOR_FormatYUV422PackedPlanar
COLOR_FormatYUV422Flexible
.public static final int COLOR_FormatYUV422SemiPlanar
COLOR_FormatYUV422Flexible
.public static final int COLOR_FormatYCbYCr
COLOR_FormatYUV422Flexible
.public static final int COLOR_FormatYCrYCb
COLOR_FormatYUV422Flexible
.public static final int COLOR_FormatCbYCrY
COLOR_FormatYUV422Flexible
.public static final int COLOR_FormatCrYCbY
COLOR_FormatYUV422Flexible
.public static final int COLOR_FormatYUV444Interleaved
COLOR_FormatYUV444Flexible
.public static final int COLOR_FormatRawBayer8bit
public static final int COLOR_FormatRawBayer10bit
public static final int COLOR_FormatRawBayer8bitcompressed
public static final int COLOR_FormatL2
COLOR_FormatL8
.public static final int COLOR_FormatL4
COLOR_FormatL8
.public static final int COLOR_FormatL8
Each byte contains a single pixel.
This format corresponds to PixelFormat.L_8
.
public static final int COLOR_FormatL16
byte byte <--------- i --------> | <------ i + 1 ------> +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | Y | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 0 7 0 7 bit
public static final int COLOR_FormatL24
COLOR_FormatL16
.public static final int COLOR_FormatL32
COLOR_FormatL16
.
byte byte byte byte <------ i -----> | <---- i+1 ----> | <---- i+2 ----> | <---- i+3 -----> +-----------------+-----------------+-----------------+-----------------+ | Y | +-----------------+-----------------+-----------------+-----------------+ 0 7 0 7 0 7 0 7 bit
public static final int COLOR_FormatYUV420PackedSemiPlanar
COLOR_FormatYUV420Flexible
.public static final int COLOR_FormatYUV422PackedSemiPlanar
COLOR_FormatYUV422Flexible
.public static final int COLOR_Format18BitBGR666
COLOR_Format24bitBGR888
.public static final int COLOR_Format24BitARGB6666
COLOR_Format32bitABGR8888
.public static final int COLOR_Format24BitABGR6666
COLOR_Format32bitABGR8888
.public static final int COLOR_TI_FormatYUV420PackedSemiPlanar
COLOR_FormatYUV420Flexible
.public static final int COLOR_FormatSurface
public static final int COLOR_Format32bitABGR8888
Using 32-bit little-endian representation, colors stored as Red 7:0, Green 15:8, Blue 23:16, and Alpha 31:24.
byte byte byte byte <------ i -----> | <---- i+1 ----> | <---- i+2 ----> | <---- i+3 -----> +-----------------+-----------------+-----------------+-----------------+ | RED | GREEN | BLUE | ALPHA | +-----------------+-----------------+-----------------+-----------------+This corresponds to
PixelFormat.RGBA_8888
.public static final int COLOR_FormatYUV420Flexible
Chroma planes are subsampled by 2 both horizontally and vertically.
Use this format with Image
.
This format corresponds to ImageFormat.YUV_420_888
,
and can represent the COLOR_FormatYUV411Planar
,
COLOR_FormatYUV411PackedPlanar
, COLOR_FormatYUV420Planar
,
COLOR_FormatYUV420PackedPlanar
, COLOR_FormatYUV420SemiPlanar
and COLOR_FormatYUV420PackedSemiPlanar
formats.
Image.getFormat()
,
Constant Field Valuespublic static final int COLOR_FormatYUV422Flexible
Chroma planes are horizontally subsampled by 2. Use this format with Image
.
This format corresponds to ImageFormat.YUV_422_888
,
and can represent the COLOR_FormatYCbYCr
, COLOR_FormatYCrYCb
,
COLOR_FormatCbYCrY
, COLOR_FormatCrYCbY
,
COLOR_FormatYUV422Planar
, COLOR_FormatYUV422PackedPlanar
,
COLOR_FormatYUV422SemiPlanar
and COLOR_FormatYUV422PackedSemiPlanar
formats.
Image.getFormat()
,
Constant Field Valuespublic static final int COLOR_FormatYUV444Flexible
Chroma planes are not subsampled. Use this format with Image
.
This format corresponds to ImageFormat.YUV_444_888
,
and can represent the COLOR_FormatYUV444Interleaved
format.
Image.getFormat()
,
Constant Field Valuespublic static final int COLOR_FormatRGBFlexible
Use this format with Image
. This format corresponds to
ImageFormat.FLEX_RGB_888
, and can represent
COLOR_Format24bitBGR888
and COLOR_Format24bitRGB888
formats.
Image#getFormat.
,
Constant Field Valuespublic static final int COLOR_FormatRGBAFlexible
Use this format with Image
. This format corresponds to
ImageFormat.FLEX_RGBA_8888
, and can represent
COLOR_Format32bitBGRA8888
, COLOR_Format32bitABGR8888
and
COLOR_Format32bitARGB8888
formats.
Image.getFormat()
,
Constant Field Valuespublic static final int COLOR_QCOM_FormatYUV420SemiPlanar
COLOR_FormatYUV420Flexible
.public int[] colorFormats
public static final String FEATURE_AdaptivePlayback
public static final String FEATURE_SecurePlayback
public static final String FEATURE_TunneledPlayback
public static final String FEATURE_IntraRefresh
public final boolean isFeatureSupported(String name)
These features are supported to be used by the codec. These include optional features that can be turned on, as well as features that are always on.
public final boolean isFeatureRequired(String name)
These features are required to be used by the codec, and as such, they are always turned on.
public String[] validFeatures()
public boolean isRegular()
public final boolean isFormatSupported(MediaFormat format)
MediaFormat
.
Note: On Build.VERSION_CODES.LOLLIPOP
,
format
must not contain a frame rate. Use
format.setString(MediaFormat.KEY_FRAME_RATE, null)
to clear any existing frame rate setting in the format.
The following table summarizes the format keys considered by this method.
format
- media format with optional feature directives.IllegalArgumentException
- if format is not a valid media format.public MediaFormat getDefaultFormat()
public String getMimeType()
public int getMaxSupportedInstances()
This is a hint for an upper bound. Applications should not expect to successfully operate more instances than the returned value, but the actual number of concurrently operable instances may be less as it depends on the available resources at time of use.
public MediaCodecInfo.AudioCapabilities getAudioCapabilities()
null
if this is not an audio codec.public MediaCodecInfo.EncoderCapabilities getEncoderCapabilities()
null
if this is not an encoder.public MediaCodecInfo.VideoCapabilities getVideoCapabilities()
null
if this is not a video codec.public MediaCodecInfo.CodecCapabilities dup()
public static MediaCodecInfo.CodecCapabilities createFromProfileLevel(String mime, int profile, int level)
mime type
, profile
and level
. If the type, or profile-level combination
is not understood by the framework, it returns null.
In Build.VERSION_CODES.M
, calling this
method without calling any method of the MediaCodecList
class beforehand
results in a NullPointerException
.