Added in API level 16

CodecCapabilities


class CodecCapabilities
kotlin.Any
   ↳ android.media.MediaCodecInfo.CodecCapabilities

Encapsulates the capabilities of a given codec component. For example, what profile/level combinations it supports and what colorspaces it is capable of providing the decoded data in, as well as some codec-type specific capability flags.

You can get an instance for a given MediaCodecInfo object with getCapabilitiesForType(), passing a MIME type.

Summary

Constants
static Int

static Int

static Int

static Int

static Int

16 bits per pixel RGB color format, with 5-bit red & blue and 6-bit green component.

static Int

static Int

static Int

static Int

static Int

static Int

static Int

static Int

24 bits per pixel RGB color format, with 8-bit red, green & blue components.

static Int

static Int

static Int

32 bits per pixel RGBA color format, with 10-bit red, green, blue, and 2-bit alpha components.

static Int

32 bits per pixel RGBA color format, with 8-bit red, green, blue, and alpha components.

static Int

static Int

static Int

64 bits per pixel RGBA color format, with 16-bit signed floating point red, green, blue, and alpha components.

static Int

static Int

static Int

static Int

16 bits per pixel, little-endian Y color format.

static Int

static Int

static Int

32 bits per pixel, little-endian Y color format.

static Int

static Int

8 bits per pixel Y color format.

static Int

static Int

Flexible 32 bits per pixel RGBA color format with 8-bit red, green, blue, and alpha components.

static Int

Flexible 24 bits per pixel RGB color format with 8-bit red, green and blue components.

static Int

SMIA 10-bit Bayer format.

static Int

SMIA 8-bit Bayer format.

static Int

SMIA 8-bit compressed Bayer format.

static Int

static Int

static Int

static Int

static Int

static Int

Flexible 12 bits per pixel, subsampled YUV color format with 8-bit chroma and luma components.

static Int

static Int

static Int

static Int

static Int

Flexible 16 bits per pixel, subsampled YUV color format with 8-bit chroma and luma components.

static Int

static Int

static Int

static Int

static Int

Flexible 24 bits per pixel YUV color format with 8-bit chroma and luma components.

static Int

static Int

P010 is 10-bit-per component 4:2:0 YCbCr semiplanar format.

static Int

P210 is 10-bit-per component 4:2:2 YCbCr semiplanar format.

static Int

static Int

static String

video decoder only: codec supports seamless resolution changes.

static String

video decoder only: codec supports detaching the output surface when in Surface mode.

static String

video decoder only: codec supports dynamically changing color aspects.

static String

If true, the timestamp of each output buffer is derived from the timestamp of the input buffer that produced the output.

static String

video encoder only: codec supports exporting encoding statistics.

static String

decoder onlyIf true, the codec supports partial (including multiple) access units per input buffer.

static String

video encoder only: codec supports HDR editing.

static String

video encoder only: codec supports HLG editing.

static String

video encoder only: codec supports intra refresh.

static String

decoder only: codec supports low latency decoding.

static String

If true, the codec supports multiple access units (for decoding, or to output for encoders).

static String

video decoder only: codec supports queuing partial frames.

static String

video encoder only: codec supports quantization parameter bounds.

static String

video encoder only: codec supports region of interest encoding.

static String

video decoder only: codec supports secure decryption.

static String

video or audio decoder only: codec supports tunneled playback.

Public constructors

Public methods
static MediaCodecInfo.CodecCapabilities!
createFromProfileLevel(mime: String!, profile: Int, level: Int)

Retrieve the codec capabilities for a certain mime type, profile and level.

MediaCodecInfo.AudioCapabilities?

Returns the audio capabilities or null if this is not an audio codec.

MediaFormat!

Returns a MediaFormat object with default values for configurations that have defaults.

MediaCodecInfo.EncoderCapabilities?

Returns the encoding capabilities or null if this is not an encoder.

Int

Returns the max number of the supported concurrent codec instances.

String!

Returns the mime type for which this codec-capability object was created.

MediaCodecInfo.VideoCapabilities?

Returns the video capabilities or null if this is not a video codec.

Boolean

Query codec feature requirements.

Boolean

Query codec feature capabilities.

Boolean

Query whether codec supports a given MediaFormat.

Properties
IntArray!

The color format for the media.

Array<MediaCodecInfo.CodecProfileLevel!>!

Constants

COLOR_Format12bitRGB444

Added in API level 16
Deprecated in API level 23
static val COLOR_Format12bitRGB444: Int

Deprecated: Use COLOR_Format24bitBGR888.

Value: 3

COLOR_Format16bitARGB1555

Added in API level 16
Deprecated in API level 23
static val COLOR_Format16bitARGB1555: Int

Deprecated: Use COLOR_Format32bitABGR8888.

Value: 5

COLOR_Format16bitARGB4444

Added in API level 16
Deprecated in API level 23
static val COLOR_Format16bitARGB4444: Int

Deprecated: Use COLOR_Format32bitABGR8888.

Value: 4

COLOR_Format16bitBGR565

Added in API level 16
Deprecated in API level 23
static val COLOR_Format16bitBGR565: Int

Deprecated: Use COLOR_Format16bitRGB565.

Value: 7

COLOR_Format16bitRGB565

Added in API level 16
static val COLOR_Format16bitRGB565: Int

16 bits per pixel RGB color format, with 5-bit red & blue and 6-bit green component.

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
  bit
  
This format corresponds to android.graphics.PixelFormat#RGB_565 and android.graphics.ImageFormat#RGB_565.
Value: 6

COLOR_Format18BitBGR666

Added in API level 16
Deprecated in API level 23
static val COLOR_Format18BitBGR666: Int

Deprecated: Use COLOR_Format24bitBGR888.

Value: 41

COLOR_Format18bitARGB1665

Added in API level 16
Deprecated in API level 23
static val COLOR_Format18bitARGB1665: Int

Deprecated: Use COLOR_Format32bitABGR8888.

Value: 9

COLOR_Format18bitRGB666

Added in API level 16
Deprecated in API level 23
static val COLOR_Format18bitRGB666: Int

Deprecated: Use COLOR_Format24bitBGR888.

Value: 8

COLOR_Format19bitARGB1666

Added in API level 16
Deprecated in API level 23
static val COLOR_Format19bitARGB1666: Int

Deprecated: Use COLOR_Format32bitABGR8888.

Value: 10

COLOR_Format24BitABGR6666

Added in API level 16
Deprecated in API level 23
static val COLOR_Format24BitABGR6666: Int

Deprecated: Use COLOR_Format32bitABGR8888.

Value: 43

COLOR_Format24BitARGB6666

Added in API level 16
Deprecated in API level 23
static val COLOR_Format24BitARGB6666: Int

Deprecated: Use COLOR_Format32bitABGR8888.

Value: 42

COLOR_Format24bitARGB1887

Added in API level 16
Deprecated in API level 23
static val COLOR_Format24bitARGB1887: Int

Deprecated: Use COLOR_Format32bitABGR8888.

Value: 13

COLOR_Format24bitBGR888

Added in API level 16
static val COLOR_Format24bitBGR888: Int

24 bits per pixel RGB color format, with 8-bit red, green & blue components.

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 android.graphics.PixelFormat#RGB_888, and can also be represented as a flexible format by COLOR_FormatRGBFlexible.
Value: 12

COLOR_Format24bitRGB888

Added in API level 16
Deprecated in API level 23
static val COLOR_Format24bitRGB888: Int

Deprecated: Use COLOR_Format24bitBGR888 or COLOR_FormatRGBFlexible.

Value: 11

COLOR_Format25bitARGB1888

Added in API level 16
Deprecated in API level 23
static val COLOR_Format25bitARGB1888: Int

Deprecated: Use COLOR_Format32bitABGR8888.

Value: 14

COLOR_Format32bitABGR2101010

Added in API level 33
static val COLOR_Format32bitABGR2101010: Int

32 bits per pixel RGBA color format, with 10-bit red, green, blue, and 2-bit alpha components.

Using 32-bit little-endian representation, colors stored as Red 9:0, Green 19:10, Blue 29:20, and Alpha 31:30.

byte              byte             byte              byte
   <------ i -----> | <---- i+1 ----> | <---- i+2 ----> | <---- i+3 ----->
  +-----------------+---+-------------+-------+---------+-----------+-----+
  |       RED           |      GREEN          |       BLUE          |ALPHA|
  +-----------------+---+-------------+-------+---------+-----------+-----+
   0               7 0 1 2           7 0     3 4       7 0         5 6   7
  
This corresponds to android.graphics.PixelFormat#RGBA_1010102.
Value: 2130750114

COLOR_Format32bitABGR8888

Added in API level 23
static val COLOR_Format32bitABGR8888: Int

32 bits per pixel RGBA color format, with 8-bit red, green, blue, and alpha components.

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 android.graphics.PixelFormat#RGBA_8888.
Value: 2130747392

COLOR_Format32bitARGB8888

Added in API level 16
Deprecated in API level 23
static val COLOR_Format32bitARGB8888: Int

Deprecated: Use COLOR_Format32bitABGR8888 Or COLOR_FormatRGBAFlexible.

Value: 16

COLOR_Format32bitBGRA8888

Added in API level 16
Deprecated in API level 23
static val COLOR_Format32bitBGRA8888: Int

Deprecated: Use COLOR_Format32bitABGR8888 Or COLOR_FormatRGBAFlexible.

Value: 15

COLOR_Format64bitABGRFloat

Added in API level 33
static val COLOR_Format64bitABGRFloat: Int

64 bits per pixel RGBA color format, with 16-bit signed floating point red, green, blue, and alpha components.

byte              byte             byte              byte
   <-- i -->|<- i+1 ->|<- i+2 ->|<- i+3 ->|<- i+4 ->|<- i+5 ->|<- i+6 ->|<- i+7 ->
  +---------+---------+-------------------+---------+---------+---------+---------+
  |        RED        |       GREEN       |       BLUE        |       ALPHA       |
  +---------+---------+-------------------+---------+---------+---------+---------+
   0       7 0       7 0       7 0       7 0       7 0       7 0       7 0       7
  
This corresponds to android.graphics.PixelFormat#RGBA_F16.
Value: 2130710294

COLOR_Format8bitRGB332

Added in API level 16
Deprecated in API level 23
static val COLOR_Format8bitRGB332: Int

Deprecated: Use COLOR_Format24bitBGR888.

Value: 2

COLOR_FormatCbYCrY

Added in API level 16
Deprecated in API level 23
static val COLOR_FormatCbYCrY: Int

Deprecated: Use COLOR_FormatYUV422Flexible.

Value: 27

COLOR_FormatCrYCbY

Added in API level 16
Deprecated in API level 23
static val COLOR_FormatCrYCbY: Int

Deprecated: Use COLOR_FormatYUV422Flexible.

Value: 28

COLOR_FormatL16

Added in API level 16
static val COLOR_FormatL16: Int

16 bits per pixel, little-endian Y color format.

byte                   byte
   <--------- i --------> | <------ i + 1 ------>
  +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
  |                       Y                       |
  +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
   0                    7   0                    7
  bit
  
Value: 36

COLOR_FormatL2

Added in API level 16
Deprecated in API level 23
static val COLOR_FormatL2: Int

Deprecated: Use COLOR_FormatL8.

Value: 33

COLOR_FormatL24

Added in API level 16
Deprecated in API level 23
static val COLOR_FormatL24: Int

Deprecated: Use COLOR_FormatL16.

Value: 37

COLOR_FormatL32

Added in API level 16
Deprecated in API level 23
static val COLOR_FormatL32: Int

Deprecated: Use COLOR_FormatL16.

32 bits per pixel, little-endian Y color format.

byte              byte             byte              byte
   <------ i -----> | <---- i+1 ----> | <---- i+2 ----> | <---- i+3 ----->
  +-----------------+-----------------+-----------------+-----------------+
  |                                   Y                                   |
  +-----------------+-----------------+-----------------+-----------------+
   0               7 0               7 0               7 0               7
  bit
  
Value: 38

COLOR_FormatL4

Added in API level 16
Deprecated in API level 23
static val COLOR_FormatL4: Int

Deprecated: Use COLOR_FormatL8.

Value: 34

COLOR_FormatL8

Added in API level 16
static val COLOR_FormatL8: Int

8 bits per pixel Y color format.

Each byte contains a single pixel. This format corresponds to android.graphics.PixelFormat#L_8.

Value: 35

COLOR_FormatMonochrome

Added in API level 16
Deprecated in API level 23
static val COLOR_FormatMonochrome: Int

Deprecated: Use COLOR_Format24bitBGR888.

Value: 1

COLOR_FormatRGBAFlexible

Added in API level 23
static val COLOR_FormatRGBAFlexible: Int

Flexible 32 bits per pixel RGBA color format with 8-bit red, green, blue, and alpha components.

Use this format with Image. This format corresponds to android.graphics.ImageFormat#FLEX_RGBA_8888, and can represent COLOR_Format32bitBGRA8888, COLOR_Format32bitABGR8888 and COLOR_Format32bitARGB8888 formats.

Value: 2134288520

COLOR_FormatRGBFlexible

Added in API level 23
static val COLOR_FormatRGBFlexible: Int

Flexible 24 bits per pixel RGB color format with 8-bit red, green and blue components.

Use this format with Image. This format corresponds to android.graphics.ImageFormat#FLEX_RGB_888, and can represent COLOR_Format24bitBGR888 and COLOR_Format24bitRGB888 formats.

Value: 2134292616

COLOR_FormatRawBayer10bit

Added in API level 16
static val COLOR_FormatRawBayer10bit: Int

SMIA 10-bit Bayer format.

Value: 31

COLOR_FormatRawBayer8bit

Added in API level 16
static val COLOR_FormatRawBayer8bit: Int

SMIA 8-bit Bayer format. Each byte represents the top 8-bits of a 10-bit signal.

Value: 30

COLOR_FormatRawBayer8bitcompressed

Added in API level 16
static val COLOR_FormatRawBayer8bitcompressed: Int

SMIA 8-bit compressed Bayer format. Each byte represents a sample from the 10-bit signal that is compressed into 8-bits using DPCM/PCM compression, as defined by the SMIA Functional Specification.

Value: 32

COLOR_FormatSurface

Added in API level 18
static val COLOR_FormatSurface: Int
Value: 2130708361

COLOR_FormatYCbYCr

Added in API level 16
Deprecated in API level 23
static val COLOR_FormatYCbYCr: Int

Deprecated: Use COLOR_FormatYUV422Flexible.

Value: 25

COLOR_FormatYCrYCb

Added in API level 16
Deprecated in API level 23
static val COLOR_FormatYCrYCb: Int

Deprecated: Use COLOR_FormatYUV422Flexible.

Value: 26

COLOR_FormatYUV411PackedPlanar

Added in API level 16
Deprecated in API level 23
static val COLOR_FormatYUV411PackedPlanar: Int

Deprecated: Use COLOR_FormatYUV420Flexible.

Value: 18

COLOR_FormatYUV411Planar

Added in API level 16
Deprecated in API level 23
static val COLOR_FormatYUV411Planar: Int

Deprecated: Use COLOR_FormatYUV420Flexible.

Value: 17

COLOR_FormatYUV420Flexible

Added in API level 21
static val COLOR_FormatYUV420Flexible: Int

Flexible 12 bits per pixel, subsampled YUV color format with 8-bit chroma and luma components.

Chroma planes are subsampled by 2 both horizontally