Stay organized with collections
Save and categorize content based on your preferences.
MetricsConstants
class MetricsConstants
Summary
Constants
CODEC
static val CODEC: String
Key to extract the codec being used from the MediaCodec.getMetrics
return value. The value is a String.
Value: "android.media.mediacodec.codec"
ENCODER
static val ENCODER: String
Key to extract the flag indicating whether the codec is running as an encoder or decoder from the MediaCodec.getMetrics
return value. The value is an integer. A 0 indicates decoder; 1 indicates encoder.
Value: "android.media.mediacodec.encoder"
HEIGHT
static val HEIGHT: String
Key to extract the height (in pixels) of the video track from the MediaCodec.getMetrics
return value. The value is an integer.
Value: "android.media.mediacodec.height"
MIME_TYPE
static val MIME_TYPE: String
Key to extract the MIME type from the MediaCodec.getMetrics
return value. The value is a String.
Value: "android.media.mediacodec.mime"
MODE_AUDIO
static val MODE_AUDIO: String
The value returned for the key MODE
when the codec is a audio codec.
Value: "audio"
MODE_VIDEO
static val MODE_VIDEO: String
The value returned for the key MODE
when the codec is a video codec.
Value: "video"
ROTATION
static val ROTATION: String
Key to extract the rotation (in degrees) to properly orient the video from the MediaCodec.getMetrics
return. The value is a integer.
Value: "android.media.mediacodec.rotation"
SECURE
static val SECURE: String
Key to extract the flag indicating whether the codec is running in secure (DRM) mode from the MediaCodec.getMetrics
return value. The value is an integer.
Value: "android.media.mediacodec.secure"
WIDTH
static val WIDTH: String
Key to extract the width (in pixels) of the video track from the MediaCodec.getMetrics
return value. The value is an integer.
Value: "android.media.mediacodec.width"
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# MediaCodec.MetricsConstants\n\nAdded in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nMetricsConstants\n================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/media/MediaCodec.MetricsConstants \"View this page in Java\") \n\n```\nclass MetricsConstants\n```\n\n|---|------------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.media.MediaCodec.MetricsConstants](#) |\n\nSummary\n-------\n\n| Constants ||\n|-----------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [CODEC](#CODEC:kotlin.String) Key to extract the codec being used from the [MediaCodec.getMetrics](/reference/kotlin/android/media/MediaCodec#getMetrics()) return value. |\n| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [ENCODER](#ENCODER:kotlin.String) Key to extract the flag indicating whether the codec is running as an encoder or decoder from the [MediaCodec.getMetrics](/reference/kotlin/android/media/MediaCodec#getMetrics()) return value. |\n| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [HEIGHT](#HEIGHT:kotlin.String) Key to extract the height (in pixels) of the video track from the [MediaCodec.getMetrics](/reference/kotlin/android/media/MediaCodec#getMetrics()) return value. |\n| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [MIME_TYPE](#MIME_TYPE:kotlin.String) Key to extract the MIME type from the [MediaCodec.getMetrics](/reference/kotlin/android/media/MediaCodec#getMetrics()) return value. |\n| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [MODE](#MODE:kotlin.String) Key to extract what the codec mode from the [MediaCodec.getMetrics](/reference/kotlin/android/media/MediaCodec#getMetrics()) return value. |\n| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [MODE_AUDIO](#MODE_AUDIO:kotlin.String) The value returned for the key [MODE](#MODE:kotlin.String) when the codec is a audio codec. |\n| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [MODE_VIDEO](#MODE_VIDEO:kotlin.String) The value returned for the key [MODE](#MODE:kotlin.String) when the codec is a video codec. |\n| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [ROTATION](#ROTATION:kotlin.String) Key to extract the rotation (in degrees) to properly orient the video from the [MediaCodec.getMetrics](/reference/kotlin/android/media/MediaCodec#getMetrics()) return. |\n| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [SECURE](#SECURE:kotlin.String) Key to extract the flag indicating whether the codec is running in secure (DRM) mode from the [MediaCodec.getMetrics](/reference/kotlin/android/media/MediaCodec#getMetrics()) return value. |\n| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [WIDTH](#WIDTH:kotlin.String) Key to extract the width (in pixels) of the video track from the [MediaCodec.getMetrics](/reference/kotlin/android/media/MediaCodec#getMetrics()) return value. |\n\nConstants\n---------\n\n### CODEC\n\nAdded in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val CODEC: String\n```\n\nKey to extract the codec being used from the [MediaCodec.getMetrics](/reference/kotlin/android/media/MediaCodec#getMetrics()) return value. The value is a String. \n\n Value: \"android.media.mediacodec.codec\"\n\n### ENCODER\n\nAdded in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val ENCODER: String\n```\n\nKey to extract the flag indicating whether the codec is running as an encoder or decoder from the [MediaCodec.getMetrics](/reference/kotlin/android/media/MediaCodec#getMetrics()) return value. The value is an integer. A 0 indicates decoder; 1 indicates encoder. \n\n Value: \"android.media.mediacodec.encoder\"\n\n### HEIGHT\n\nAdded in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val HEIGHT: String\n```\n\nKey to extract the height (in pixels) of the video track from the [MediaCodec.getMetrics](/reference/kotlin/android/media/MediaCodec#getMetrics()) return value. The value is an integer. \n\n Value: \"android.media.mediacodec.height\"\n\n### MIME_TYPE\n\nAdded in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val MIME_TYPE: String\n```\n\nKey to extract the MIME type from the [MediaCodec.getMetrics](/reference/kotlin/android/media/MediaCodec#getMetrics()) return value. The value is a String. \n\n Value: \"android.media.mediacodec.mime\"\n\n### MODE\n\nAdded in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val MODE: String\n```\n\nKey to extract what the codec mode from the [MediaCodec.getMetrics](/reference/kotlin/android/media/MediaCodec#getMetrics()) return value. The value is a String. Values will be one of the constants [MODE_AUDIO](#MODE_AUDIO:kotlin.String) or [MODE_VIDEO](#MODE_VIDEO:kotlin.String). \n\n Value: \"android.media.mediacodec.mode\"\n\n### MODE_AUDIO\n\nAdded in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val MODE_AUDIO: String\n```\n\nThe value returned for the key [MODE](#MODE:kotlin.String) when the codec is a audio codec. \n\n Value: \"audio\"\n\n### MODE_VIDEO\n\nAdded in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val MODE_VIDEO: String\n```\n\nThe value returned for the key [MODE](#MODE:kotlin.String) when the codec is a video codec. \n\n Value: \"video\"\n\n### ROTATION\n\nAdded in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val ROTATION: String\n```\n\nKey to extract the rotation (in degrees) to properly orient the video from the [MediaCodec.getMetrics](/reference/kotlin/android/media/MediaCodec#getMetrics()) return. The value is a integer. \n\n Value: \"android.media.mediacodec.rotation\"\n\n### SECURE\n\nAdded in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val SECURE: String\n```\n\nKey to extract the flag indicating whether the codec is running in secure (DRM) mode from the [MediaCodec.getMetrics](/reference/kotlin/android/media/MediaCodec#getMetrics()) return value. The value is an integer. \n\n Value: \"android.media.mediacodec.secure\"\n\n### WIDTH\n\nAdded in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val WIDTH: String\n```\n\nKey to extract the width (in pixels) of the video track from the [MediaCodec.getMetrics](/reference/kotlin/android/media/MediaCodec#getMetrics()) return value. The value is an integer. \n\n Value: \"android.media.mediacodec.width\""]]