Starting March 27, 2025, we recommend using android-latest-release
instead of aosp-main
to build and contribute to AOSP. For more information, see Changes to AOSP.
Low-latency decoding in MediaCodec
Stay organized with collections
Save and categorize content based on your preferences.
This feature was added in Android 11 to enable media decoding with low
latency, which is critical for real-time apps. The SoC partners need to provide a
decoder driver to support this feature. The media framework signals this mode using
Codec 2.0/OMX configuration parameters available in AOSP.
See the
reference implementation for enabling this feature.
Implementation
The SoC partners need to implement decoder drivers to support this feature. App
developers can use the new API to use the feature. Partners need to provide decoder
drivers. This is a new public API that hasn't been used. There's no need to implement a
system UI or an extension for this feature.
Customization
The API allows users to turn this feature on or off. If turned on, the decoder must return
decoded frames as soon as possible based on the coding standard
(without waiting for further input) and must stay awake. If turned off, the decoder
can use power optimizations that may result in decoded frames being returned later
than strictly necessary, and the decoder may power down when stalled.
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-06-12 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-06-12 UTC."],[],[],null,["# Low-latency decoding in MediaCodec\n\nThis feature was added in Android 11 to enable media decoding with low\nlatency, which is critical for real-time apps. The SoC partners need to provide a\ndecoder driver to support this feature. The media framework signals this mode using\nCodec 2.0/OMX configuration parameters available in AOSP.\nSee the [reference implementation](https://android.googlesource.com/platform/cts/+/android11-release/tests/tests/media/src/android/media/cts/DecoderTest.java) for enabling this feature.\n\nImplementation\n--------------\n\n\nThe SoC partners need to implement decoder drivers to support this feature. App\ndevelopers can use the new API to use the feature. Partners need to provide decoder\ndrivers. This is a new public API that hasn't been used. There's no need to implement a\nsystem UI or an extension for this feature.\n\nCustomization\n-------------\n\nThe API allows users to turn this feature on or off. If turned on, the decoder must return\ndecoded frames as soon as possible based on the coding standard\n(without waiting for further input) and must stay awake. If turned off, the decoder\ncan use power optimizations that may result in decoded frames being returned later\nthan strictly necessary, and the decoder may power down when stalled."]]