自 2025 年 3 月 27 日起,我们建议您使用 android-latest-release
而非 aosp-main
构建 AOSP 并为其做出贡献。如需了解详情,请参阅 AOSP 的变更。
媒体资源管理器的 SoC 供应商依赖项
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
本文档旨在帮助系统芯片供应商 (SoC) 正确实现对 Android 媒体资源管理器所需的优先级、操作速率和钩子的支持。
OMX_ErrorInsufficientResources
如果失败的原因是资源不足,则编解码器组件应针对 GetHandle
、Init
、UseBuffer
、AllocateBuffer
或状态转换返回 OMX_ErrorInsufficientResources
。媒体资源管理器会将该错误代码用作指示符(意味着可能会从其他优先级较低的进程抢占媒体资源)。
Android 兼容性测试套件 (CTS) 中的相关测试会重复分配、配置和启动每一个编解码器,直到出现 catching
OMX_ErrorInsufficientResources
(通过)结果或任何其他错误(失败)。
OMX_IndexConfigPriority
通过此项配置,应用可以说明其所需的编解码器优先级。
关联值为整数。值越高,优先级越低。目前仅支持两种级别:
- 0:实时优先级 - 指的是编解码器应该实时支持指定的性能配置(如帧速率)。该优先级只能用于媒体播放、捕获,另外还可能用于实时通信场景(如果“可提供的最佳性能”选项不适用)。
- 1:非实时优先级(可提供的最佳性能)。这是默认值。
建议供应商将此用作编解码器配置和资源规划提示,以便了解应用的实时要求。
请勿假设实时优先级(除非优先级配置为 0)。
OMX_IndexConfigOperatingRate
通过此项配置,应用可以说明编解码器在进行操作时所需的视频操作帧速率或音频采样率。
该配置的其中一种使用情况为高速/慢动作视频捕获;在这种情况下,视频编码器格式包含目标播放速率(如 30 帧/秒),但组件必须能够处理较高的操作捕获速率(如 240 帧/秒)。
此速率应该用于规划资源和设置操作点。
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-27。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-07-27。"],[],[],null,["# SoC vendor dependencies for media resource manager\n\nThis document is intended to help system on chip vendors (SoCs) properly\nimplement support for priority, operating rate and the hooks needed for Android\nmedia resource manager.\n\nOMX_ErrorInsufficientResources\n------------------------------\n\nThe codec component should return\n`OMX_ErrorInsufficientResources` on `GetHandle`,\n`Init`, `UseBuffer`, `AllocateBuffer` or a\nstate transition if the failure is due to insufficient resource. The error code\nwill be used by the media resource manager as the indicator to potentially\npreempt media resource from other lower priority process.\n\nAn Android Compatibility Test Suite (CTS) test exists to allocate, configure\nand start each codec repeatedly until `catching\nOMX_ErrorInsufficientResources` (pass) or any other error (fail).\n\nOMX_IndexConfigPriority\n-----------------------\n\nThis configuration lets the application describe desired codec priority.\n\nThe associated value is an integer. Higher value means lower priority.\nCurrently, only two levels are supported:\n\n- 0: realtime priority - meaning that the codec shall support the given performance configuration (e.g. framerate) at realtime. This will only be used by media playback, capture, and possibly by realtime communication scenarios if best effort performance is not suitable.\n- 1: non-realtime priority (best effort). This is the default value.\n\nVendor is suggested to use this as a hint used at codec configuration and\nresource planning - to understand the realtime requirements of the application.\n\nDon't assume realtime priority unless it is configured to 0.\n\nOMX_IndexConfigOperatingRate\n----------------------------\n\nThis configuration lets the application describe operating frame rate for\nvideo or sample rate for audio at which the codec will need to operate.\n\nThis is used for cases like high-speed/slow-motion video capture, where the\nvideo encoder format contains the target playback rate (e.g. 30fps), but the\ncomponent must be able to handle the high operating capture rate (e.g. 240fps).\n\nThis rate should be used for resource planning and setting the operating\npoints."]]