Clay Murphy | 536a25d | 2015-09-22 14:59:21 -0700 | [diff] [blame] | 1 | page.title=SoC Vendor Dependencies for Media Resource Manager |
| 2 | @jd:body |
| 3 | |
| 4 | <!-- |
| 5 | Copyright 2015 The Android Open Source Project |
| 6 | |
| 7 | Licensed under the Apache License, Version 2.0 (the "License"); |
| 8 | you may not use this file except in compliance with the License. |
| 9 | You may obtain a copy of the License at |
| 10 | |
| 11 | http://www.apache.org/licenses/LICENSE-2.0 |
| 12 | |
| 13 | Unless required by applicable law or agreed to in writing, software |
| 14 | distributed under the License is distributed on an "AS IS" BASIS, |
| 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 | See the License for the specific language governing permissions and |
| 17 | limitations under the License. |
| 18 | --> |
| 19 | <div id="qv-wrapper"> |
| 20 | <div id="qv"> |
| 21 | <h2>In this document</h2> |
| 22 | <ol id="auto-toc"> |
| 23 | </ol> |
| 24 | </div> |
| 25 | </div> |
| 26 | |
| 27 | <p>This document is intended to help system on chip vendors (SoCs) properly |
| 28 | implement support for priority, operating rate and the hooks needed for Android |
| 29 | media resource manager.</p> |
| 30 | |
| 31 | <h2 id=1_omx_errorinsufficientresources>1. OMX_ErrorInsufficientResources</h2> |
| 32 | |
| 33 | <p>The codec component should return |
| 34 | <code>OMX_ErrorInsufficientResources</code> on <code>GetHandle</code>, |
| 35 | <code>Init</code>, <code>UseBuffer</code>, <code>AllocateBuffer</code> or a |
| 36 | state transition if the failure is due to insufficient resource. The error code |
| 37 | will be used by the media resource manager as the indicator to potentially |
| 38 | preempt media resource from other lower priority process.</p> |
| 39 | |
| 40 | <p>An Android Compatibility Test Suite (CTS) test exists to allocate, configure |
| 41 | and start each codec repeatedly until <code>catching |
| 42 | OMX_ErrorInsufficientResources</code> (pass) or any other error (fail).</p> |
| 43 | |
| 44 | <h2 id=2_omx_indexconfigpriority>2. OMX_IndexConfigPriority</h2> |
| 45 | |
| 46 | <p>This configuration lets the application describe desired codec priority.</p> |
| 47 | |
| 48 | <p>The associated value is an integer. Higher value means lower priority. |
| 49 | Currently, only two levels are supported:</p> |
| 50 | |
| 51 | <ul> |
| 52 | <li>0: realtime priority - meaning that the codec shall support the given |
| 53 | performance configuration (e.g. framerate) at realtime. This will only be used |
| 54 | by media playback, capture, and possibly by realtime communication scenarios if |
| 55 | best effort performance is not suitable.</li> |
| 56 | <li>1: non-realtime priority (best effort). This is the default value.</li> |
| 57 | </ul> |
| 58 | |
| 59 | <p>Vendor is suggested to use this as a hint used at codec configuration and |
| 60 | resource planning - to understand the realtime requirements of the application.</p> |
| 61 | |
| 62 | <p>Don’t assume realtime priority unless it is configured to 0.</p> |
| 63 | |
| 64 | <h2 id=3_omx_indexconfigoperatingrate>3. OMX_IndexConfigOperatingRate</h2> |
| 65 | |
| 66 | <p>This configuration lets the application describe operating frame rate for |
| 67 | video or sample rate for audio at which the codec will need to operate.</p> |
| 68 | |
| 69 | <p>This is used for cases like high-speed/slow-motion video capture, where the |
| 70 | video encoder format contains the target playback rate (e.g. 30fps), but the |
| 71 | component must be able to handle the high operating capture rate (e.g. 240fps).</p> |
| 72 | |
| 73 | <p>This rate should be used for resource planning and setting the operating |
| 74 | points.</p> |