# MediaCodec.MetricsConstants

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# MetricsConstants

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/media/MediaCodec.MetricsConstants "View this page in Java")  

```
class MetricsConstants
```

|---|----------------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                                         ||
| ↳ | [android.media.MediaCodec.MetricsConstants](https://developer.android.com/reference/kotlin/android/media/MediaCodec.MetricsConstants#) |

## Summary

|                                                                                                                                                                                                                   Constants                                                                                                                                                                                                                   ||
|----------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| static[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [CODEC](https://developer.android.com/reference/kotlin/android/media/MediaCodec.MetricsConstants#CODEC:kotlin.String) Key to extract the codec being used from the[MediaCodec.getMetrics](https://developer.android.com/reference/kotlin/android/media/MediaCodec#getMetrics())return value.                                                          |
| static[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [ENCODER](https://developer.android.com/reference/kotlin/android/media/MediaCodec.MetricsConstants#ENCODER:kotlin.String) Key to extract the flag indicating whether the codec is running as an encoder or decoder from the[MediaCodec.getMetrics](https://developer.android.com/reference/kotlin/android/media/MediaCodec#getMetrics())return value. |
| static[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [HEIGHT](https://developer.android.com/reference/kotlin/android/media/MediaCodec.MetricsConstants#HEIGHT:kotlin.String) Key to extract the height (in pixels) of the video track from the[MediaCodec.getMetrics](https://developer.android.com/reference/kotlin/android/media/MediaCodec#getMetrics())return value.                                   |
| static[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [MIME_TYPE](https://developer.android.com/reference/kotlin/android/media/MediaCodec.MetricsConstants#MIME_TYPE:kotlin.String) Key to extract the MIME type from the[MediaCodec.getMetrics](https://developer.android.com/reference/kotlin/android/media/MediaCodec#getMetrics())return value.                                                         |
| static[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [MODE](https://developer.android.com/reference/kotlin/android/media/MediaCodec.MetricsConstants#MODE:kotlin.String) Key to extract what the codec mode from the[MediaCodec.getMetrics](https://developer.android.com/reference/kotlin/android/media/MediaCodec#getMetrics())return value.                                                             |
| static[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [MODE_AUDIO](https://developer.android.com/reference/kotlin/android/media/MediaCodec.MetricsConstants#MODE_AUDIO:kotlin.String) The value returned for the key[MODE](https://developer.android.com/reference/kotlin/android/media/MediaCodec.MetricsConstants#MODE:kotlin.String)when the codec is a audio codec.                                     |
| static[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [MODE_VIDEO](https://developer.android.com/reference/kotlin/android/media/MediaCodec.MetricsConstants#MODE_VIDEO:kotlin.String) The value returned for the key[MODE](https://developer.android.com/reference/kotlin/android/media/MediaCodec.MetricsConstants#MODE:kotlin.String)when the codec is a video codec.                                     |
| static[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [ROTATION](https://developer.android.com/reference/kotlin/android/media/MediaCodec.MetricsConstants#ROTATION:kotlin.String) Key to extract the rotation (in degrees) to properly orient the video from the[MediaCodec.getMetrics](https://developer.android.com/reference/kotlin/android/media/MediaCodec#getMetrics())return.                        |
| static[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [SECURE](https://developer.android.com/reference/kotlin/android/media/MediaCodec.MetricsConstants#SECURE:kotlin.String) Key to extract the flag indicating whether the codec is running in secure (DRM) mode from the[MediaCodec.getMetrics](https://developer.android.com/reference/kotlin/android/media/MediaCodec#getMetrics())return value.       |
| static[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [WIDTH](https://developer.android.com/reference/kotlin/android/media/MediaCodec.MetricsConstants#WIDTH:kotlin.String) Key to extract the width (in pixels) of the video track from the[MediaCodec.getMetrics](https://developer.android.com/reference/kotlin/android/media/MediaCodec#getMetrics())return value.                                      |

## Constants

### CODEC

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val CODEC: String
```

Key to extract the codec being used from the[MediaCodec.getMetrics](https://developer.android.com/reference/kotlin/android/media/MediaCodec#getMetrics())return value. The value is a String.  

    Value: "android.media.mediacodec.codec"

### ENCODER

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val ENCODER: String
```

Key to extract the flag indicating whether the codec is running as an encoder or decoder from the[MediaCodec.getMetrics](https://developer.android.com/reference/kotlin/android/media/MediaCodec#getMetrics())return value. The value is an integer. A 0 indicates decoder; 1 indicates encoder.  

    Value: "android.media.mediacodec.encoder"

### HEIGHT

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val HEIGHT: String
```

Key to extract the height (in pixels) of the video track from the[MediaCodec.getMetrics](https://developer.android.com/reference/kotlin/android/media/MediaCodec#getMetrics())return value. The value is an integer.  

    Value: "android.media.mediacodec.height"

### MIME_TYPE

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val MIME_TYPE: String
```

Key to extract the MIME type from the[MediaCodec.getMetrics](https://developer.android.com/reference/kotlin/android/media/MediaCodec#getMetrics())return value. The value is a String.  

    Value: "android.media.mediacodec.mime"

### MODE

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val MODE: String
```

Key to extract what the codec mode from the[MediaCodec.getMetrics](https://developer.android.com/reference/kotlin/android/media/MediaCodec#getMetrics())return value. The value is a String. Values will be one of the constants[MODE_AUDIO](https://developer.android.com/reference/kotlin/android/media/MediaCodec.MetricsConstants#MODE_AUDIO:kotlin.String)or[MODE_VIDEO](https://developer.android.com/reference/kotlin/android/media/MediaCodec.MetricsConstants#MODE_VIDEO:kotlin.String).  

    Value: "android.media.mediacodec.mode"

### MODE_AUDIO

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val MODE_AUDIO: String
```

The value returned for the key[MODE](https://developer.android.com/reference/kotlin/android/media/MediaCodec.MetricsConstants#MODE:kotlin.String)when the codec is a audio codec.  

    Value: "audio"

### MODE_VIDEO

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val MODE_VIDEO: String
```

The value returned for the key[MODE](https://developer.android.com/reference/kotlin/android/media/MediaCodec.MetricsConstants#MODE:kotlin.String)when the codec is a video codec.  

    Value: "video"

### ROTATION

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val ROTATION: String
```

Key to extract the rotation (in degrees) to properly orient the video from the[MediaCodec.getMetrics](https://developer.android.com/reference/kotlin/android/media/MediaCodec#getMetrics())return. The value is a integer.  

    Value: "android.media.mediacodec.rotation"

### SECURE

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val SECURE: String
```

Key to extract the flag indicating whether the codec is running in secure (DRM) mode from the[MediaCodec.getMetrics](https://developer.android.com/reference/kotlin/android/media/MediaCodec#getMetrics())return value. The value is an integer.  

    Value: "android.media.mediacodec.secure"

### WIDTH

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val WIDTH: String
```

Key to extract the width (in pixels) of the video track from the[MediaCodec.getMetrics](https://developer.android.com/reference/kotlin/android/media/MediaCodec#getMetrics())return value. The value is an integer.  

    Value: "android.media.mediacodec.width"