blob: 50fc1648e8c0a699826ef0c80ea3ae310aea5267 [file] [log] [blame]
<html devsite><head>
<title>媒体资源管理器的 SoC 供应商依赖关系</title>
<meta name="project_path" value="/_project.yaml"/>
<meta name="book_path" value="/_book.yaml"/>
</head>
<body>
<!--
Copyright 2017 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<p>本文档旨在帮助系统芯片供应商 (SoC) 正确实现对 Android 媒体资源管理器所需的优先级、运营率和钩子的支持。</p>
<h2 id="1_omx_errorinsufficientresources">1. OMX_ErrorInsufficientResources</h2>
<p>如果失败的原因是资源不足,则编解码器组件应返回 <code>GetHandle</code> 上的 <code>OMX_ErrorInsufficientResources</code><code>Init</code><code>UseBuffer</code><code>AllocateBuffer</code> 或状态转换。媒体资源管理器会将该错误代码用作指示符(意味着可能会从其他优先级较低的进程抢占媒体资源)。</p>
<p>Android 兼容性测试套件 (CTS) 测试存在的目的是重复分配、配置和启动每一个编解码器,直到出现 <code>catching
OMX_ErrorInsufficientResources</code>(通过)结果或任何其他错误(失败)。</p>
<h2 id="2_omx_indexconfigpriority">2. OMX_IndexConfigPriority</h2>
<p>通过此配置,应用可以说明所需的编解码器优先级。</p>
<p>关联值为整数。值越高,优先级越低。
目前仅支持两种级别:</p>
<ul>
<li>0:实时优先级 - 指的是编解码器应该实时支持指定的性能配置(如帧速率)。该优先级只能用于媒体播放、捕获,而且在可提供的最佳性能不合适时,还可能用于实时通信场景。</li>
<li>1:非实时优先级(可提供的最佳性能)。这是默认值。</li>
</ul>
<p>建议供应商将此用作编解码器配置和资源规划提示,以便了解应用的实时要求。</p>
<p>请勿假设实时优先级(除非优先级配置为 0)。</p>
<h2 id="3_omx_indexconfigoperatingrate">3. OMX_IndexConfigOperatingRate</h2>
<p>通过此配置,应用可以说明编解码器需要操作的视频的操作帧速率或音频的采样率。</p>
<p>该配置的其中一种使用情况为高速/慢动作视频捕获;在这种情况下,视频编码器格式包含目标播放速率(如 30 帧/秒),但组件必须能够处理较高的操作捕获速率(如 240 帧/秒)。</p>
<p>此速率应该用于资源规划和设置操作点。</p>
</body></html>