1334de520b0369215b7931fefa424fb92d295f0ebJames Dong/* ------------------------------------------------------------------
2334de520b0369215b7931fefa424fb92d295f0ebJames Dong * Copyright (C) 1998-2009 PacketVideo
3334de520b0369215b7931fefa424fb92d295f0ebJames Dong *
4334de520b0369215b7931fefa424fb92d295f0ebJames Dong * Licensed under the Apache License, Version 2.0 (the "License");
5334de520b0369215b7931fefa424fb92d295f0ebJames Dong * you may not use this file except in compliance with the License.
6334de520b0369215b7931fefa424fb92d295f0ebJames Dong * You may obtain a copy of the License at
7334de520b0369215b7931fefa424fb92d295f0ebJames Dong *
8334de520b0369215b7931fefa424fb92d295f0ebJames Dong *      http://www.apache.org/licenses/LICENSE-2.0
9334de520b0369215b7931fefa424fb92d295f0ebJames Dong *
10334de520b0369215b7931fefa424fb92d295f0ebJames Dong * Unless required by applicable law or agreed to in writing, software
11334de520b0369215b7931fefa424fb92d295f0ebJames Dong * distributed under the License is distributed on an "AS IS" BASIS,
12334de520b0369215b7931fefa424fb92d295f0ebJames Dong * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
13334de520b0369215b7931fefa424fb92d295f0ebJames Dong * express or implied.
14334de520b0369215b7931fefa424fb92d295f0ebJames Dong * See the License for the specific language governing permissions
15334de520b0369215b7931fefa424fb92d295f0ebJames Dong * and limitations under the License.
16334de520b0369215b7931fefa424fb92d295f0ebJames Dong * -------------------------------------------------------------------
17334de520b0369215b7931fefa424fb92d295f0ebJames Dong */
18334de520b0369215b7931fefa424fb92d295f0ebJames Dong/*
19a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar * Copyright (c) 2008 The Khronos Group Inc.
20a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar *
21334de520b0369215b7931fefa424fb92d295f0ebJames Dong * Permission is hereby granted, free of charge, to any person obtaining
22334de520b0369215b7931fefa424fb92d295f0ebJames Dong * a copy of this software and associated documentation files (the
23334de520b0369215b7931fefa424fb92d295f0ebJames Dong * "Software"), to deal in the Software without restriction, including
24334de520b0369215b7931fefa424fb92d295f0ebJames Dong * without limitation the rights to use, copy, modify, merge, publish,
25334de520b0369215b7931fefa424fb92d295f0ebJames Dong * distribute, sublicense, and/or sell copies of the Software, and to
26334de520b0369215b7931fefa424fb92d295f0ebJames Dong * permit persons to whom the Software is furnished to do so, subject
27a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar * to the following conditions:
28334de520b0369215b7931fefa424fb92d295f0ebJames Dong * The above copyright notice and this permission notice shall be included
29a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar * in all copies or substantial portions of the Software.
30a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar *
31334de520b0369215b7931fefa424fb92d295f0ebJames Dong * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
32334de520b0369215b7931fefa424fb92d295f0ebJames Dong * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
33334de520b0369215b7931fefa424fb92d295f0ebJames Dong * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
34334de520b0369215b7931fefa424fb92d295f0ebJames Dong * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
35334de520b0369215b7931fefa424fb92d295f0ebJames Dong * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
36334de520b0369215b7931fefa424fb92d295f0ebJames Dong * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
37a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
38334de520b0369215b7931fefa424fb92d295f0ebJames Dong *
39334de520b0369215b7931fefa424fb92d295f0ebJames Dong */
40334de520b0369215b7931fefa424fb92d295f0ebJames Dong
41334de520b0369215b7931fefa424fb92d295f0ebJames Dong/** OMX_Core.h - OpenMax IL version 1.1.2
42334de520b0369215b7931fefa424fb92d295f0ebJames Dong *  The OMX_Core header file contains the definitions used by both the
43334de520b0369215b7931fefa424fb92d295f0ebJames Dong *  application and the component to access common items.
44334de520b0369215b7931fefa424fb92d295f0ebJames Dong */
45334de520b0369215b7931fefa424fb92d295f0ebJames Dong
46334de520b0369215b7931fefa424fb92d295f0ebJames Dong#ifndef OMX_Core_h
47334de520b0369215b7931fefa424fb92d295f0ebJames Dong#define OMX_Core_h
48334de520b0369215b7931fefa424fb92d295f0ebJames Dong
49334de520b0369215b7931fefa424fb92d295f0ebJames Dong#ifdef __cplusplus
50334de520b0369215b7931fefa424fb92d295f0ebJames Dongextern "C" {
51334de520b0369215b7931fefa424fb92d295f0ebJames Dong#endif /* __cplusplus */
52334de520b0369215b7931fefa424fb92d295f0ebJames Dong
53334de520b0369215b7931fefa424fb92d295f0ebJames Dong
54334de520b0369215b7931fefa424fb92d295f0ebJames Dong/* Each OMX header shall include all required header files to allow the
55334de520b0369215b7931fefa424fb92d295f0ebJames Dong *  header to compile without errors.  The includes below are required
56a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar *  for this header file to compile successfully
57334de520b0369215b7931fefa424fb92d295f0ebJames Dong */
58334de520b0369215b7931fefa424fb92d295f0ebJames Dong
59334de520b0369215b7931fefa424fb92d295f0ebJames Dong#include <OMX_Index.h>
60334de520b0369215b7931fefa424fb92d295f0ebJames Dong
61334de520b0369215b7931fefa424fb92d295f0ebJames Dong
62334de520b0369215b7931fefa424fb92d295f0ebJames Dong/** The OMX_COMMANDTYPE enumeration is used to specify the action in the
63a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar *  OMX_SendCommand macro.
64334de520b0369215b7931fefa424fb92d295f0ebJames Dong *  @ingroup core
65334de520b0369215b7931fefa424fb92d295f0ebJames Dong */
66334de520b0369215b7931fefa424fb92d295f0ebJames Dongtypedef enum OMX_COMMANDTYPE
67334de520b0369215b7931fefa424fb92d295f0ebJames Dong{
68334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_CommandStateSet,    /**< Change the component state */
69334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_CommandFlush,       /**< Flush the data queue(s) of a component */
70334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_CommandPortDisable, /**< Disable a port on a component. */
71334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_CommandPortEnable,  /**< Enable a port on a component. */
72334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_CommandMarkBuffer,  /**< Mark a component/buffer for observation */
73a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar    OMX_CommandKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
74334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_CommandVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
75334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_CommandMax = 0X7FFFFFFF
76334de520b0369215b7931fefa424fb92d295f0ebJames Dong} OMX_COMMANDTYPE;
77334de520b0369215b7931fefa424fb92d295f0ebJames Dong
78334de520b0369215b7931fefa424fb92d295f0ebJames Dong
79334de520b0369215b7931fefa424fb92d295f0ebJames Dong
80334de520b0369215b7931fefa424fb92d295f0ebJames Dong/** The OMX_STATETYPE enumeration is used to indicate or change the component
81334de520b0369215b7931fefa424fb92d295f0ebJames Dong *  state.  This enumeration reflects the current state of the component when
82334de520b0369215b7931fefa424fb92d295f0ebJames Dong *  used with the OMX_GetState macro or becomes the parameter in a state change
83334de520b0369215b7931fefa424fb92d295f0ebJames Dong *  command when used with the OMX_SendCommand macro.
84334de520b0369215b7931fefa424fb92d295f0ebJames Dong *
85334de520b0369215b7931fefa424fb92d295f0ebJames Dong *  The component will be in the Loaded state after the component is initially
86334de520b0369215b7931fefa424fb92d295f0ebJames Dong *  loaded into memory.  In the Loaded state, the component is not allowed to
87334de520b0369215b7931fefa424fb92d295f0ebJames Dong *  allocate or hold resources other than to build it's internal parameter
88334de520b0369215b7931fefa424fb92d295f0ebJames Dong *  and configuration tables.  The application will send one or more
89334de520b0369215b7931fefa424fb92d295f0ebJames Dong *  SetParameters/GetParameters and SetConfig/GetConfig commands to the
90334de520b0369215b7931fefa424fb92d295f0ebJames Dong *  component and the component will record each of these parameter and
91334de520b0369215b7931fefa424fb92d295f0ebJames Dong *  configuration changes for use later.  When the application sends the
92334de520b0369215b7931fefa424fb92d295f0ebJames Dong *  Idle command, the component will acquire the resources needed for the
93334de520b0369215b7931fefa424fb92d295f0ebJames Dong *  specified configuration and will transition to the idle state if the
94334de520b0369215b7931fefa424fb92d295f0ebJames Dong *  allocation is successful.  If the component cannot successfully
95334de520b0369215b7931fefa424fb92d295f0ebJames Dong *  transition to the idle state for any reason, the state of the component
96a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar *  shall be fully rolled back to the Loaded state (e.g. all allocated
97334de520b0369215b7931fefa424fb92d295f0ebJames Dong *  resources shall be released).  When the component receives the command
98334de520b0369215b7931fefa424fb92d295f0ebJames Dong *  to go to the Executing state, it shall begin processing buffers by
99334de520b0369215b7931fefa424fb92d295f0ebJames Dong *  sending all input buffers it holds to the application.  While
100334de520b0369215b7931fefa424fb92d295f0ebJames Dong *  the component is in the Idle state, the application may also send the
101334de520b0369215b7931fefa424fb92d295f0ebJames Dong *  Pause command.  If the component receives the pause command while in the
102a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar *  Idle state, the component shall send all input buffers it holds to the
103334de520b0369215b7931fefa424fb92d295f0ebJames Dong *  application, but shall not begin processing buffers.  This will allow the
104334de520b0369215b7931fefa424fb92d295f0ebJames Dong *  application to prefill buffers.
105a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar *
106334de520b0369215b7931fefa424fb92d295f0ebJames Dong *  @ingroup comp
107334de520b0369215b7931fefa424fb92d295f0ebJames Dong */
108334de520b0369215b7931fefa424fb92d295f0ebJames Dong
109334de520b0369215b7931fefa424fb92d295f0ebJames Dongtypedef enum OMX_STATETYPE
110334de520b0369215b7931fefa424fb92d295f0ebJames Dong{
111a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar    OMX_StateInvalid,      /**< component has detected that it's internal data
112334de520b0369215b7931fefa424fb92d295f0ebJames Dong                                structures are corrupted to the point that
113334de520b0369215b7931fefa424fb92d295f0ebJames Dong                                it cannot determine it's state properly */
114334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_StateLoaded,      /**< component has been loaded but has not completed
115334de520b0369215b7931fefa424fb92d295f0ebJames Dong                                initialization.  The OMX_SetParameter macro
116a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar                                and the OMX_GetParameter macro are the only
117a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar                                valid macros allowed to be sent to the
118334de520b0369215b7931fefa424fb92d295f0ebJames Dong                                component in this state. */
119334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_StateIdle,        /**< component initialization has been completed
120334de520b0369215b7931fefa424fb92d295f0ebJames Dong                                successfully and the component is ready to
121334de520b0369215b7931fefa424fb92d295f0ebJames Dong                                to start. */
122334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_StateExecuting,   /**< component has accepted the start command and
123334de520b0369215b7931fefa424fb92d295f0ebJames Dong                                is processing data (if data is available) */
124334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_StatePause,       /**< component has received pause command */
125a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar    OMX_StateWaitForResources, /**< component is waiting for resources, either after
126334de520b0369215b7931fefa424fb92d295f0ebJames Dong                                preemption or before it gets the resources requested.
127334de520b0369215b7931fefa424fb92d295f0ebJames Dong                                See specification for complete details. */
128a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar    OMX_StateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
129334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_StateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
130334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_StateMax = 0X7FFFFFFF
131334de520b0369215b7931fefa424fb92d295f0ebJames Dong} OMX_STATETYPE;
132334de520b0369215b7931fefa424fb92d295f0ebJames Dong
133a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar/** The OMX_ERRORTYPE enumeration defines the standard OMX Errors.  These
134a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar *  errors should cover most of the common failure cases.  However,
135a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar *  vendors are free to add additional error messages of their own as
136334de520b0369215b7931fefa424fb92d295f0ebJames Dong *  long as they follow these rules:
137334de520b0369215b7931fefa424fb92d295f0ebJames Dong *  1.  Vendor error messages shall be in the range of 0x90000000 to
138334de520b0369215b7931fefa424fb92d295f0ebJames Dong *      0x9000FFFF.
139334de520b0369215b7931fefa424fb92d295f0ebJames Dong *  2.  Vendor error messages shall be defined in a header file provided
140334de520b0369215b7931fefa424fb92d295f0ebJames Dong *      with the component.  No error messages are allowed that are
141334de520b0369215b7931fefa424fb92d295f0ebJames Dong *      not defined.
142334de520b0369215b7931fefa424fb92d295f0ebJames Dong */
143334de520b0369215b7931fefa424fb92d295f0ebJames Dongtypedef enum OMX_ERRORTYPE
144334de520b0369215b7931fefa424fb92d295f0ebJames Dong{
145334de520b0369215b7931fefa424fb92d295f0ebJames Dong  OMX_ErrorNone = 0,
146334de520b0369215b7931fefa424fb92d295f0ebJames Dong
147334de520b0369215b7931fefa424fb92d295f0ebJames Dong  /** There were insufficient resources to perform the requested operation */
148334de520b0369215b7931fefa424fb92d295f0ebJames Dong  OMX_ErrorInsufficientResources = (OMX_S32) 0x80001000,
149334de520b0369215b7931fefa424fb92d295f0ebJames Dong
150334de520b0369215b7931fefa424fb92d295f0ebJames Dong  /** There was an error, but the cause of the error could not be determined */
151334de520b0369215b7931fefa424fb92d295f0ebJames Dong  OMX_ErrorUndefined = (OMX_S32) 0x80001001,
152334de520b0369215b7931fefa424fb92d295f0ebJames Dong
153334de520b0369215b7931fefa424fb92d295f0ebJames Dong  /** The component name string was not valid */
154334de520b0369215b7931fefa424fb92d295f0ebJames Dong  OMX_ErrorInvalidComponentName = (OMX_S32) 0x80001002,
155334de520b0369215b7931fefa424fb92d295f0ebJames Dong
156334de520b0369215b7931fefa424fb92d295f0ebJames Dong  /** No component with the specified name string was found */
157334de520b0369215b7931fefa424fb92d295f0ebJames Dong  OMX_ErrorComponentNotFound = (OMX_S32) 0x80001003,
158334de520b0369215b7931fefa424fb92d295f0ebJames Dong
159334de520b0369215b7931fefa424fb92d295f0ebJames Dong  /** The component specified did not have a "OMX_ComponentInit" or
160334de520b0369215b7931fefa424fb92d295f0ebJames Dong      "OMX_ComponentDeInit entry point */
161334de520b0369215b7931fefa424fb92d295f0ebJames Dong  OMX_ErrorInvalidComponent = (OMX_S32) 0x80001004,
162334de520b0369215b7931fefa424fb92d295f0ebJames Dong
163334de520b0369215b7931fefa424fb92d295f0ebJames Dong  /** One or more parameters were not valid */
164334de520b0369215b7931fefa424fb92d295f0ebJames Dong  OMX_ErrorBadParameter = (OMX_S32) 0x80001005,
165334de520b0369215b7931fefa424fb92d295f0ebJames Dong
166334de520b0369215b7931fefa424fb92d295f0ebJames Dong  /** The requested function is not implemented */
167334de520b0369215b7931fefa424fb92d295f0ebJames Dong  OMX_ErrorNotImplemented = (OMX_S32) 0x80001006,
168334de520b0369215b7931fefa424fb92d295f0ebJames Dong
169334de520b0369215b7931fefa424fb92d295f0ebJames Dong  /** The buffer was emptied before the next buffer was ready */
170334de520b0369215b7931fefa424fb92d295f0ebJames Dong  OMX_ErrorUnderflow = (OMX_S32) 0x80001007,
171334de520b0369215b7931fefa424fb92d295f0ebJames Dong
172334de520b0369215b7931fefa424fb92d295f0ebJames Dong  /** The buffer was not available when it was needed */
173334de520b0369215b7931fefa424fb92d295f0ebJames Dong  OMX_ErrorOverflow = (OMX_S32) 0x80001008,
174334de520b0369215b7931fefa424fb92d295f0ebJames Dong
175334de520b0369215b7931fefa424fb92d295f0ebJames Dong  /** The hardware failed to respond as expected */
176334de520b0369215b7931fefa424fb92d295f0ebJames Dong  OMX_ErrorHardware = (OMX_S32) 0x80001009,
177334de520b0369215b7931fefa424fb92d295f0ebJames Dong
178334de520b0369215b7931fefa424fb92d295f0ebJames Dong  /** The component is in the state OMX_StateInvalid */
179334de520b0369215b7931fefa424fb92d295f0ebJames Dong  OMX_ErrorInvalidState = (OMX_S32) 0x8000100A,
180334de520b0369215b7931fefa424fb92d295f0ebJames Dong
181334de520b0369215b7931fefa424fb92d295f0ebJames Dong  /** Stream is found to be corrupt */
182334de520b0369215b7931fefa424fb92d295f0ebJames Dong  OMX_ErrorStreamCorrupt = (OMX_S32) 0x8000100B,
183334de520b0369215b7931fefa424fb92d295f0ebJames Dong
184334de520b0369215b7931fefa424fb92d295f0ebJames Dong  /** Ports being connected are not compatible */
185334de520b0369215b7931fefa424fb92d295f0ebJames Dong  OMX_ErrorPortsNotCompatible = (OMX_S32) 0x8000100C,
186334de520b0369215b7931fefa424fb92d295f0ebJames Dong
187334de520b0369215b7931fefa424fb92d295f0ebJames Dong  /** Resources allocated to an idle component have been
188334de520b0369215b7931fefa424fb92d295f0ebJames Dong      lost resulting in the component returning to the loaded state */
189334de520b0369215b7931fefa424fb92d295f0ebJames Dong  OMX_ErrorResourcesLost = (OMX_S32) 0x8000100D,
190334de520b0369215b7931fefa424fb92d295f0ebJames Dong
191334de520b0369215b7931fefa424fb92d295f0ebJames Dong  /** No more indicies can be enumerated */
192334de520b0369215b7931fefa424fb92d295f0ebJames Dong  OMX_ErrorNoMore = (OMX_S32) 0x8000100E,
193334de520b0369215b7931fefa424fb92d295f0ebJames Dong
194334de520b0369215b7931fefa424fb92d295f0ebJames Dong  /** The component detected a version mismatch */
195334de520b0369215b7931fefa424fb92d295f0ebJames Dong  OMX_ErrorVersionMismatch = (OMX_S32) 0x8000100F,
196334de520b0369215b7931fefa424fb92d295f0ebJames Dong
197334de520b0369215b7931fefa424fb92d295f0ebJames Dong  /** The component is not ready to return data at this time */
198334de520b0369215b7931fefa424fb92d295f0ebJames Dong  OMX_ErrorNotReady = (OMX_S32) 0x80001010,
199334de520b0369215b7931fefa424fb92d295f0ebJames Dong
200334de520b0369215b7931fefa424fb92d295f0ebJames Dong  /** There was a timeout that occurred */
201334de520b0369215b7931fefa424fb92d295f0ebJames Dong  OMX_ErrorTimeout = (OMX_S32) 0x80001011,
202334de520b0369215b7931fefa424fb92d295f0ebJames Dong
203334de520b0369215b7931fefa424fb92d295f0ebJames Dong  /** This error occurs when trying to transition into the state you are already in */
204334de520b0369215b7931fefa424fb92d295f0ebJames Dong  OMX_ErrorSameState = (OMX_S32) 0x80001012,
205334de520b0369215b7931fefa424fb92d295f0ebJames Dong
206a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar  /** Resources allocated to an executing or paused component have been
207334de520b0369215b7931fefa424fb92d295f0ebJames Dong      preempted, causing the component to return to the idle state */
208a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar  OMX_ErrorResourcesPreempted = (OMX_S32) 0x80001013,
209334de520b0369215b7931fefa424fb92d295f0ebJames Dong
210a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar  /** A non-supplier port sends this error to the IL client (via the EventHandler callback)
211334de520b0369215b7931fefa424fb92d295f0ebJames Dong      during the allocation of buffers (on a transition from the LOADED to the IDLE state or
212a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar      on a port restart) when it deems that it has waited an unusually long time for the supplier
213334de520b0369215b7931fefa424fb92d295f0ebJames Dong      to send it an allocated buffer via a UseBuffer call. */
214334de520b0369215b7931fefa424fb92d295f0ebJames Dong  OMX_ErrorPortUnresponsiveDuringAllocation = (OMX_S32) 0x80001014,
215334de520b0369215b7931fefa424fb92d295f0ebJames Dong
216a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar  /** A non-supplier port sends this error to the IL client (via the EventHandler callback)
217a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar      during the deallocation of buffers (on a transition from the IDLE to LOADED state or
218a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar      on a port stop) when it deems that it has waited an unusually long time for the supplier
219334de520b0369215b7931fefa424fb92d295f0ebJames Dong      to request the deallocation of a buffer header via a FreeBuffer call. */
220334de520b0369215b7931fefa424fb92d295f0ebJames Dong  OMX_ErrorPortUnresponsiveDuringDeallocation = (OMX_S32) 0x80001015,
221334de520b0369215b7931fefa424fb92d295f0ebJames Dong
222a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar  /** A supplier port sends this error to the IL client (via the EventHandler callback)
223a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar      during the stopping of a port (either on a transition from the IDLE to LOADED
224a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar      state or a port stop) when it deems that it has waited an unusually long time for
225334de520b0369215b7931fefa424fb92d295f0ebJames Dong      the non-supplier to return a buffer via an EmptyThisBuffer or FillThisBuffer call. */
226334de520b0369215b7931fefa424fb92d295f0ebJames Dong  OMX_ErrorPortUnresponsiveDuringStop = (OMX_S32) 0x80001016,
227334de520b0369215b7931fefa424fb92d295f0ebJames Dong
228334de520b0369215b7931fefa424fb92d295f0ebJames Dong  /** Attempting a state transtion that is not allowed */
229334de520b0369215b7931fefa424fb92d295f0ebJames Dong  OMX_ErrorIncorrectStateTransition = (OMX_S32) 0x80001017,
230334de520b0369215b7931fefa424fb92d295f0ebJames Dong
231334de520b0369215b7931fefa424fb92d295f0ebJames Dong  /* Attempting a command that is not allowed during the present state. */
232a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar  OMX_ErrorIncorrectStateOperation = (OMX_S32) 0x80001018,
233334de520b0369215b7931fefa424fb92d295f0ebJames Dong
234334de520b0369215b7931fefa424fb92d295f0ebJames Dong  /** The values encapsulated in the parameter or config structure are not supported. */
235334de520b0369215b7931fefa424fb92d295f0ebJames Dong  OMX_ErrorUnsupportedSetting = (OMX_S32) 0x80001019,
236334de520b0369215b7931fefa424fb92d295f0ebJames Dong
237334de520b0369215b7931fefa424fb92d295f0ebJames Dong  /** The parameter or config indicated by the given index is not supported. */
238334de520b0369215b7931fefa424fb92d295f0ebJames Dong  OMX_ErrorUnsupportedIndex = (OMX_S32) 0x8000101A,
239334de520b0369215b7931fefa424fb92d295f0ebJames Dong
240334de520b0369215b7931fefa424fb92d295f0ebJames Dong  /** The port index supplied is incorrect. */
241334de520b0369215b7931fefa424fb92d295f0ebJames Dong  OMX_ErrorBadPortIndex = (OMX_S32) 0x8000101B,
242334de520b0369215b7931fefa424fb92d295f0ebJames Dong
243334de520b0369215b7931fefa424fb92d295f0ebJames Dong  /** The port has lost one or more of its buffers and it thus unpopulated. */
244334de520b0369215b7931fefa424fb92d295f0ebJames Dong  OMX_ErrorPortUnpopulated = (OMX_S32) 0x8000101C,
245334de520b0369215b7931fefa424fb92d295f0ebJames Dong
246334de520b0369215b7931fefa424fb92d295f0ebJames Dong  /** Component suspended due to temporary loss of resources */
247334de520b0369215b7931fefa424fb92d295f0ebJames Dong  OMX_ErrorComponentSuspended = (OMX_S32) 0x8000101D,
248334de520b0369215b7931fefa424fb92d295f0ebJames Dong
249334de520b0369215b7931fefa424fb92d295f0ebJames Dong  /** Component suspended due to an inability to acquire dynamic resources */
250334de520b0369215b7931fefa424fb92d295f0ebJames Dong  OMX_ErrorDynamicResourcesUnavailable = (OMX_S32) 0x8000101E,
251334de520b0369215b7931fefa424fb92d295f0ebJames Dong
252a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar  /** When the macroblock error reporting is enabled the component returns new error
253334de520b0369215b7931fefa424fb92d295f0ebJames Dong  for every frame that has errors */
254334de520b0369215b7931fefa424fb92d295f0ebJames Dong  OMX_ErrorMbErrorsInFrame = (OMX_S32) 0x8000101F,
255334de520b0369215b7931fefa424fb92d295f0ebJames Dong
256334de520b0369215b7931fefa424fb92d295f0ebJames Dong  /** A component reports this error when it cannot parse or determine the format of an input stream. */
257a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar  OMX_ErrorFormatNotDetected = (OMX_S32) 0x80001020,
258334de520b0369215b7931fefa424fb92d295f0ebJames Dong
259334de520b0369215b7931fefa424fb92d295f0ebJames Dong  /** The content open operation failed. */
260334de520b0369215b7931fefa424fb92d295f0ebJames Dong  OMX_ErrorContentPipeOpenFailed = (OMX_S32) 0x80001021,
261334de520b0369215b7931fefa424fb92d295f0ebJames Dong
262334de520b0369215b7931fefa424fb92d295f0ebJames Dong  /** The content creation operation failed. */
263334de520b0369215b7931fefa424fb92d295f0ebJames Dong  OMX_ErrorContentPipeCreationFailed = (OMX_S32) 0x80001022,
264334de520b0369215b7931fefa424fb92d295f0ebJames Dong
265334de520b0369215b7931fefa424fb92d295f0ebJames Dong  /** Separate table information is being used */
266334de520b0369215b7931fefa424fb92d295f0ebJames Dong  OMX_ErrorSeperateTablesUsed = (OMX_S32) 0x80001023,
267334de520b0369215b7931fefa424fb92d295f0ebJames Dong
268334de520b0369215b7931fefa424fb92d295f0ebJames Dong  /** Tunneling is unsupported by the component*/
269334de520b0369215b7931fefa424fb92d295f0ebJames Dong  OMX_ErrorTunnelingUnsupported = (OMX_S32) 0x80001024,
270334de520b0369215b7931fefa424fb92d295f0ebJames Dong
271a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar  OMX_ErrorKhronosExtensions = (OMX_S32)0x8F000000, /**< Reserved region for introducing Khronos Standard Extensions */
272334de520b0369215b7931fefa424fb92d295f0ebJames Dong  OMX_ErrorVendorStartUnused = (OMX_S32)0x90000000, /**< Reserved region for introducing Vendor Extensions */
273334de520b0369215b7931fefa424fb92d295f0ebJames Dong  OMX_ErrorMax = 0x7FFFFFFF
274334de520b0369215b7931fefa424fb92d295f0ebJames Dong} OMX_ERRORTYPE;
275334de520b0369215b7931fefa424fb92d295f0ebJames Dong
276334de520b0369215b7931fefa424fb92d295f0ebJames Dong/** @ingroup core */
277334de520b0369215b7931fefa424fb92d295f0ebJames Dongtypedef OMX_ERRORTYPE (* OMX_COMPONENTINITTYPE)(OMX_IN  OMX_HANDLETYPE hComponent);
278334de520b0369215b7931fefa424fb92d295f0ebJames Dong
279334de520b0369215b7931fefa424fb92d295f0ebJames Dong/** @ingroup core */
280334de520b0369215b7931fefa424fb92d295f0ebJames Dongtypedef struct OMX_COMPONENTREGISTERTYPE
281334de520b0369215b7931fefa424fb92d295f0ebJames Dong{
282334de520b0369215b7931fefa424fb92d295f0ebJames Dong  const char          * pName;       /* Component name, 128 byte limit (including '\0') applies */
283334de520b0369215b7931fefa424fb92d295f0ebJames Dong  OMX_COMPONENTINITTYPE pInitialize; /* Component instance initialization function */
284334de520b0369215b7931fefa424fb92d295f0ebJames Dong} OMX_COMPONENTREGISTERTYPE;
285334de520b0369215b7931fefa424fb92d295f0ebJames Dong
286334de520b0369215b7931fefa424fb92d295f0ebJames Dong/** @ingroup core */
287334de520b0369215b7931fefa424fb92d295f0ebJames Dongextern OMX_COMPONENTREGISTERTYPE OMX_ComponentRegistered[];
288334de520b0369215b7931fefa424fb92d295f0ebJames Dong
289334de520b0369215b7931fefa424fb92d295f0ebJames Dong/** @ingroup rpm */
290334de520b0369215b7931fefa424fb92d295f0ebJames Dongtypedef struct OMX_PRIORITYMGMTTYPE {
291334de520b0369215b7931fefa424fb92d295f0ebJames Dong OMX_U32 nSize;             /**< size of the structure in bytes */
292334de520b0369215b7931fefa424fb92d295f0ebJames Dong OMX_VERSIONTYPE nVersion;  /**< OMX specification version information */
293334de520b0369215b7931fefa424fb92d295f0ebJames Dong OMX_U32 nGroupPriority;            /**< Priority of the component group */
294334de520b0369215b7931fefa424fb92d295f0ebJames Dong OMX_U32 nGroupID;                  /**< ID of the component group */
295334de520b0369215b7931fefa424fb92d295f0ebJames Dong} OMX_PRIORITYMGMTTYPE;
296334de520b0369215b7931fefa424fb92d295f0ebJames Dong
297334de520b0369215b7931fefa424fb92d295f0ebJames Dong/* Component name and Role names are limited to 128 characters including the terminating '\0'. */
298334de520b0369215b7931fefa424fb92d295f0ebJames Dong#define OMX_MAX_STRINGNAME_SIZE 128
299334de520b0369215b7931fefa424fb92d295f0ebJames Dong
300334de520b0369215b7931fefa424fb92d295f0ebJames Dong/** @ingroup comp */
301334de520b0369215b7931fefa424fb92d295f0ebJames Dongtypedef struct OMX_PARAM_COMPONENTROLETYPE {
302334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_U32 nSize;              /**< size of the structure in bytes */
303334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_VERSIONTYPE nVersion;   /**< OMX specification version information */
304334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_U8 cRole[OMX_MAX_STRINGNAME_SIZE];  /**< name of standard component which defines component role */
305334de520b0369215b7931fefa424fb92d295f0ebJames Dong} OMX_PARAM_COMPONENTROLETYPE;
306334de520b0369215b7931fefa424fb92d295f0ebJames Dong
307a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar/** End of Stream Buffer Flag:
308334de520b0369215b7931fefa424fb92d295f0ebJames Dong  *
309a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar  * A component sets EOS when it has no more data to emit on a particular
310a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar  * output port. Thus an output port shall set EOS on the last buffer it
311a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar  * emits. A component's determination of when an output port should
312334de520b0369215b7931fefa424fb92d295f0ebJames Dong  * cease sending data is implemenation specific.
313334de520b0369215b7931fefa424fb92d295f0ebJames Dong  * @ingroup buf
314334de520b0369215b7931fefa424fb92d295f0ebJames Dong  */
315334de520b0369215b7931fefa424fb92d295f0ebJames Dong
316a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar#define OMX_BUFFERFLAG_EOS 0x00000001
317334de520b0369215b7931fefa424fb92d295f0ebJames Dong
318a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar/** Start Time Buffer Flag:
319334de520b0369215b7931fefa424fb92d295f0ebJames Dong *
320334de520b0369215b7931fefa424fb92d295f0ebJames Dong * The source of a stream (e.g. a demux component) sets the STARTTIME
321334de520b0369215b7931fefa424fb92d295f0ebJames Dong * flag on the buffer that contains the starting timestamp for the
322334de520b0369215b7931fefa424fb92d295f0ebJames Dong * stream. The starting timestamp corresponds to the first data that
323334de520b0369215b7931fefa424fb92d295f0ebJames Dong * should be displayed at startup or after a seek.
324334de520b0369215b7931fefa424fb92d295f0ebJames Dong * The first timestamp of the stream is not necessarily the start time.
325a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar * For instance, in the case of a seek to a particular video frame,
326a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar * the target frame may be an interframe. Thus the first buffer of
327334de520b0369215b7931fefa424fb92d295f0ebJames Dong * the stream will be the intra-frame preceding the target frame and
328334de520b0369215b7931fefa424fb92d295f0ebJames Dong * the starttime will occur with the target frame (with any other
329334de520b0369215b7931fefa424fb92d295f0ebJames Dong * required frames required to reconstruct the target intervening).
330334de520b0369215b7931fefa424fb92d295f0ebJames Dong *
331a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar * The STARTTIME flag is directly associated with the buffer's
332a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar * timestamp ' thus its association to buffer data and its
333334de520b0369215b7931fefa424fb92d295f0ebJames Dong * propagation is identical to the timestamp's.
334334de520b0369215b7931fefa424fb92d295f0ebJames Dong *
335a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar * When a Sync Component client receives a buffer with the
336a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar * STARTTIME flag it shall perform a SetConfig on its sync port
337334de520b0369215b7931fefa424fb92d295f0ebJames Dong * using OMX_ConfigTimeClientStartTime and passing the buffer's
338334de520b0369215b7931fefa424fb92d295f0ebJames Dong * timestamp.
339a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar *
340334de520b0369215b7931fefa424fb92d295f0ebJames Dong * @ingroup buf
341334de520b0369215b7931fefa424fb92d295f0ebJames Dong */
342334de520b0369215b7931fefa424fb92d295f0ebJames Dong
343334de520b0369215b7931fefa424fb92d295f0ebJames Dong#define OMX_BUFFERFLAG_STARTTIME 0x00000002
344334de520b0369215b7931fefa424fb92d295f0ebJames Dong
345334de520b0369215b7931fefa424fb92d295f0ebJames Dong
346a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar
347a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar/** Decode Only Buffer Flag:
348334de520b0369215b7931fefa424fb92d295f0ebJames Dong *
349334de520b0369215b7931fefa424fb92d295f0ebJames Dong * The source of a stream (e.g. a demux component) sets the DECODEONLY
350334de520b0369215b7931fefa424fb92d295f0ebJames Dong * flag on any buffer that should shall be decoded but should not be
351a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar * displayed. This flag is used, for instance, when a source seeks to
352a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar * a target interframe that requires the decode of frames preceding the
353a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar * target to facilitate the target's reconstruction. In this case the
354a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar * source would emit the frames preceding the target downstream
355334de520b0369215b7931fefa424fb92d295f0ebJames Dong * but mark them as decode only.
356334de520b0369215b7931fefa424fb92d295f0ebJames Dong *
357a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar * The DECODEONLY is associated with buffer data and propagated in a
358334de520b0369215b7931fefa424fb92d295f0ebJames Dong * manner identical to the buffer timestamp.
359334de520b0369215b7931fefa424fb92d295f0ebJames Dong *
360a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar * A component that renders data should ignore all buffers with
361334de520b0369215b7931fefa424fb92d295f0ebJames Dong * the DECODEONLY flag set.
362a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar *
363334de520b0369215b7931fefa424fb92d295f0ebJames Dong * @ingroup buf
364334de520b0369215b7931fefa424fb92d295f0ebJames Dong */
365334de520b0369215b7931fefa424fb92d295f0ebJames Dong
366334de520b0369215b7931fefa424fb92d295f0ebJames Dong#define OMX_BUFFERFLAG_DECODEONLY 0x00000004
367334de520b0369215b7931fefa424fb92d295f0ebJames Dong
368334de520b0369215b7931fefa424fb92d295f0ebJames Dong
369a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar/* Data Corrupt Flag: This flag is set when the IL client believes the data in the associated buffer is corrupt
370334de520b0369215b7931fefa424fb92d295f0ebJames Dong * @ingroup buf
371334de520b0369215b7931fefa424fb92d295f0ebJames Dong */
372334de520b0369215b7931fefa424fb92d295f0ebJames Dong
373334de520b0369215b7931fefa424fb92d295f0ebJames Dong#define OMX_BUFFERFLAG_DATACORRUPT 0x00000008
374334de520b0369215b7931fefa424fb92d295f0ebJames Dong
375334de520b0369215b7931fefa424fb92d295f0ebJames Dong/* End of Frame: The buffer contains exactly one end of frame and no data
376334de520b0369215b7931fefa424fb92d295f0ebJames Dong *  occurs after the end of frame. This flag is an optional hint. The absence
377a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar *  of this flag does not imply the absence of an end of frame within the buffer.
378334de520b0369215b7931fefa424fb92d295f0ebJames Dong * @ingroup buf
379334de520b0369215b7931fefa424fb92d295f0ebJames Dong*/
380334de520b0369215b7931fefa424fb92d295f0ebJames Dong#define OMX_BUFFERFLAG_ENDOFFRAME 0x00000010
381334de520b0369215b7931fefa424fb92d295f0ebJames Dong
382a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar/* Sync Frame Flag: This flag is set when the buffer content contains a coded sync frame '
383a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar *  a frame that has no dependency on any other frame information
384334de520b0369215b7931fefa424fb92d295f0ebJames Dong *  @ingroup buf
385334de520b0369215b7931fefa424fb92d295f0ebJames Dong */
386334de520b0369215b7931fefa424fb92d295f0ebJames Dong#define OMX_BUFFERFLAG_SYNCFRAME 0x00000020
387334de520b0369215b7931fefa424fb92d295f0ebJames Dong
388334de520b0369215b7931fefa424fb92d295f0ebJames Dong/* Extra data present flag: there is extra data appended to the data stream
389a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar * residing in the buffer
390a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar * @ingroup buf
391334de520b0369215b7931fefa424fb92d295f0ebJames Dong */
392334de520b0369215b7931fefa424fb92d295f0ebJames Dong#define OMX_BUFFERFLAG_EXTRADATA 0x00000040
393334de520b0369215b7931fefa424fb92d295f0ebJames Dong
394a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar/** Codec Config Buffer Flag:
395334de520b0369215b7931fefa424fb92d295f0ebJames Dong* OMX_BUFFERFLAG_CODECCONFIG is an optional flag that is set by an
396334de520b0369215b7931fefa424fb92d295f0ebJames Dong* output port when all bytes in the buffer form part or all of a set of
397334de520b0369215b7931fefa424fb92d295f0ebJames Dong* codec specific configuration data.  Examples include SPS/PPS nal units
398334de520b0369215b7931fefa424fb92d295f0ebJames Dong* for OMX_VIDEO_CodingAVC or AudioSpecificConfig data for
399a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar* OMX_AUDIO_CodingAAC.  Any component that for a given stream sets
400334de520b0369215b7931fefa424fb92d295f0ebJames Dong* OMX_BUFFERFLAG_CODECCONFIG shall not mix codec configuration bytes
401334de520b0369215b7931fefa424fb92d295f0ebJames Dong* with frame data in the same buffer, and shall send all buffers
402334de520b0369215b7931fefa424fb92d295f0ebJames Dong* containing codec configuration bytes before any buffers containing
403334de520b0369215b7931fefa424fb92d295f0ebJames Dong* frame data that those configurations bytes describe.
404334de520b0369215b7931fefa424fb92d295f0ebJames Dong* If the stream format for a particular codec has a frame specific
405334de520b0369215b7931fefa424fb92d295f0ebJames Dong* header at the start of each frame, for example OMX_AUDIO_CodingMP3 or
406334de520b0369215b7931fefa424fb92d295f0ebJames Dong* OMX_AUDIO_CodingAAC in ADTS mode, then these shall be presented as
407334de520b0369215b7931fefa424fb92d295f0ebJames Dong* normal without setting OMX_BUFFERFLAG_CODECCONFIG.
408334de520b0369215b7931fefa424fb92d295f0ebJames Dong * @ingroup buf
409334de520b0369215b7931fefa424fb92d295f0ebJames Dong */
410334de520b0369215b7931fefa424fb92d295f0ebJames Dong#define OMX_BUFFERFLAG_CODECCONFIG 0x00000080
411334de520b0369215b7931fefa424fb92d295f0ebJames Dong
412334de520b0369215b7931fefa424fb92d295f0ebJames Dong
413334de520b0369215b7931fefa424fb92d295f0ebJames Dong
414334de520b0369215b7931fefa424fb92d295f0ebJames Dong/** @ingroup buf */
415334de520b0369215b7931fefa424fb92d295f0ebJames Dongtypedef struct OMX_BUFFERHEADERTYPE
416334de520b0369215b7931fefa424fb92d295f0ebJames Dong{
417334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_U32 nSize;              /**< size of the structure in bytes */
418334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_VERSIONTYPE nVersion;   /**< OMX specification version information */
419a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar    OMX_U8* pBuffer;            /**< Pointer to actual block of memory
420334de520b0369215b7931fefa424fb92d295f0ebJames Dong                                     that is acting as the buffer */
421334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_U32 nAllocLen;          /**< size of the buffer allocated, in bytes */
422a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar    OMX_U32 nFilledLen;         /**< number of bytes currently in the
423334de520b0369215b7931fefa424fb92d295f0ebJames Dong                                     buffer */
424334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_U32 nOffset;            /**< start offset of valid data in bytes from
425334de520b0369215b7931fefa424fb92d295f0ebJames Dong                                     the start of the buffer */
426334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_PTR pAppPrivate;        /**< pointer to any data the application
427334de520b0369215b7931fefa424fb92d295f0ebJames Dong                                     wants to associate with this buffer */
428334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_PTR pPlatformPrivate;   /**< pointer to any data the platform
429a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar                                     wants to associate with this buffer */
430334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_PTR pInputPortPrivate;  /**< pointer to any data the input port
431334de520b0369215b7931fefa424fb92d295f0ebJames Dong                                     wants to associate with this buffer */
432334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_PTR pOutputPortPrivate; /**< pointer to any data the output port
433334de520b0369215b7931fefa424fb92d295f0ebJames Dong                                     wants to associate with this buffer */
434a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar    OMX_HANDLETYPE hMarkTargetComponent; /**< The component that will generate a
435334de520b0369215b7931fefa424fb92d295f0ebJames Dong                                              mark event upon processing this buffer. */
436a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar    OMX_PTR pMarkData;          /**< Application specific data associated with
437a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar                                     the mark sent on a mark event to disambiguate
438334de520b0369215b7931fefa424fb92d295f0ebJames Dong                                     this mark from others. */
439334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_U32 nTickCount;         /**< Optional entry that the component and
440334de520b0369215b7931fefa424fb92d295f0ebJames Dong                                     application can update with a tick count
441334de520b0369215b7931fefa424fb92d295f0ebJames Dong                                     when they access the component.  This
442334de520b0369215b7931fefa424fb92d295f0ebJames Dong                                     value should be in microseconds.  Since
443334de520b0369215b7931fefa424fb92d295f0ebJames Dong                                     this is a value relative to an arbitrary
444a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar                                     starting point, this value cannot be used
445334de520b0369215b7931fefa424fb92d295f0ebJames Dong                                     to determine absolute time.  This is an
446334de520b0369215b7931fefa424fb92d295f0ebJames Dong                                     optional entry and not all components
447334de520b0369215b7931fefa424fb92d295f0ebJames Dong                                     will update it.*/
448a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar OMX_TICKS nTimeStamp;          /**< Timestamp corresponding to the sample
449a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar                                     starting at the first logical sample
450a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar                                     boundary in the buffer. Timestamps of
451334de520b0369215b7931fefa424fb92d295f0ebJames Dong                                     successive samples within the buffer may
452a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar                                     be inferred by adding the duration of the
453334de520b0369215b7931fefa424fb92d295f0ebJames Dong                                     of the preceding buffer to the timestamp
454334de520b0369215b7931fefa424fb92d295f0ebJames Dong                                     of the preceding buffer.*/
455334de520b0369215b7931fefa424fb92d295f0ebJames Dong  OMX_U32     nFlags;           /**< buffer specific flags */
456a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar  OMX_U32 nOutputPortIndex;     /**< The index of the output port (if any) using
457334de520b0369215b7931fefa424fb92d295f0ebJames Dong                                     this buffer */
458334de520b0369215b7931fefa424fb92d295f0ebJames Dong  OMX_U32 nInputPortIndex;      /**< The index of the input port (if any) using
459334de520b0369215b7931fefa424fb92d295f0ebJames Dong                                     this buffer */
460334de520b0369215b7931fefa424fb92d295f0ebJames Dong} OMX_BUFFERHEADERTYPE;
461334de520b0369215b7931fefa424fb92d295f0ebJames Dong
462a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar/** The OMX_EXTRADATATYPE enumeration is used to define the
463334de520b0369215b7931fefa424fb92d295f0ebJames Dong * possible extra data payload types.
464334de520b0369215b7931fefa424fb92d295f0ebJames Dong * NB: this enum is binary backwards compatible with the previous
465334de520b0369215b7931fefa424fb92d295f0ebJames Dong * OMX_EXTRADATA_QUANT define.  This should be replaced with
466334de520b0369215b7931fefa424fb92d295f0ebJames Dong * OMX_ExtraDataQuantization.
467334de520b0369215b7931fefa424fb92d295f0ebJames Dong */
468334de520b0369215b7931fefa424fb92d295f0ebJames Dongtypedef enum OMX_EXTRADATATYPE
469334de520b0369215b7931fefa424fb92d295f0ebJames Dong{
470a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar   OMX_ExtraDataNone = 0,                       /**< Indicates that no more extra data sections follow */
471334de520b0369215b7931fefa424fb92d295f0ebJames Dong   OMX_ExtraDataQuantization,                   /**< The data payload contains quantization data */
472a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar   OMX_ExtraDataKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
473334de520b0369215b7931fefa424fb92d295f0ebJames Dong   OMX_ExtraDataVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
474334de520b0369215b7931fefa424fb92d295f0ebJames Dong   OMX_ExtraDataMax = 0x7FFFFFFF
475334de520b0369215b7931fefa424fb92d295f0ebJames Dong} OMX_EXTRADATATYPE;
476334de520b0369215b7931fefa424fb92d295f0ebJames Dong
477334de520b0369215b7931fefa424fb92d295f0ebJames Dong
478334de520b0369215b7931fefa424fb92d295f0ebJames Dongtypedef struct OMX_OTHER_EXTRADATATYPE  {
479334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_U32 nSize;
480a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar    OMX_VERSIONTYPE nVersion;
481334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_U32 nPortIndex;
482334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_EXTRADATATYPE eType;       /* Extra Data type */
483334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_U32 nDataSize;   /* Size of the supporting data to follow */
484334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_U8  data[1];     /* Supporting data hint  */
485334de520b0369215b7931fefa424fb92d295f0ebJames Dong} OMX_OTHER_EXTRADATATYPE;
486334de520b0369215b7931fefa424fb92d295f0ebJames Dong
487334de520b0369215b7931fefa424fb92d295f0ebJames Dong/** @ingroup comp */
488334de520b0369215b7931fefa424fb92d295f0ebJames Dongtypedef struct OMX_PORT_PARAM_TYPE {
489334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_U32 nSize;              /**< size of the structure in bytes */
490334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_VERSIONTYPE nVersion;   /**< OMX specification version information */
491334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_U32 nPorts;             /**< The number of ports for this component */
492334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_U32 nStartPortNumber;   /** first port number for this type of port */
493a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar} OMX_PORT_PARAM_TYPE;
494334de520b0369215b7931fefa424fb92d295f0ebJames Dong
495334de520b0369215b7931fefa424fb92d295f0ebJames Dong/** @ingroup comp */
496334de520b0369215b7931fefa424fb92d295f0ebJames Dongtypedef enum OMX_EVENTTYPE
497334de520b0369215b7931fefa424fb92d295f0ebJames Dong{
498334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_EventCmdComplete,         /**< component has sucessfully completed a command */
499334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_EventError,               /**< component has detected an error condition */
500334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_EventMark,                /**< component has detected a buffer mark */
501334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_EventPortSettingsChanged, /**< component is reported a port settings change */
502a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar    OMX_EventBufferFlag,          /**< component has detected an EOS */
503334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_EventResourcesAcquired,   /**< component has been granted resources and is
504334de520b0369215b7931fefa424fb92d295f0ebJames Dong                                       automatically starting the state change from
505334de520b0369215b7931fefa424fb92d295f0ebJames Dong                                       OMX_StateWaitForResources to OMX_StateIdle. */
506334de520b0369215b7931fefa424fb92d295f0ebJames Dong   OMX_EventComponentResumed,     /**< Component resumed due to reacquisition of resources */
507334de520b0369215b7931fefa424fb92d295f0ebJames Dong   OMX_EventDynamicResourcesAvailable, /**< Component has acquired previously unavailable dynamic resources */
508334de520b0369215b7931fefa424fb92d295f0ebJames Dong   OMX_EventPortFormatDetected,      /**< Component has detected a supported format. */
509a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar   OMX_EventKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
510334de520b0369215b7931fefa424fb92d295f0ebJames Dong   OMX_EventVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
511334de520b0369215b7931fefa424fb92d295f0ebJames Dong   OMX_EventMax = 0x7FFFFFFF
512334de520b0369215b7931fefa424fb92d295f0ebJames Dong} OMX_EVENTTYPE;
513334de520b0369215b7931fefa424fb92d295f0ebJames Dong
514334de520b0369215b7931fefa424fb92d295f0ebJames Dongtypedef struct OMX_CALLBACKTYPE
515334de520b0369215b7931fefa424fb92d295f0ebJames Dong{
516334de520b0369215b7931fefa424fb92d295f0ebJames Dong    /** The EventHandler method is used to notify the application when an
517334de520b0369215b7931fefa424fb92d295f0ebJames Dong        event of interest occurs.  Events are defined in the OMX_EVENTTYPE
518334de520b0369215b7931fefa424fb92d295f0ebJames Dong        enumeration.  Please see that enumeration for details of what will
519334de520b0369215b7931fefa424fb92d295f0ebJames Dong        be returned for each type of event. Callbacks should not return
520a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar        an error to the component, so if an error occurs, the application
521334de520b0369215b7931fefa424fb92d295f0ebJames Dong        shall handle it internally.  This is a blocking call.
522334de520b0369215b7931fefa424fb92d295f0ebJames Dong
523334de520b0369215b7931fefa424fb92d295f0ebJames Dong        The application should return from this call within 5 msec to avoid
524334de520b0369215b7931fefa424fb92d295f0ebJames Dong        blocking the component for an excessively long period of time.
525334de520b0369215b7931fefa424fb92d295f0ebJames Dong
526334de520b0369215b7931fefa424fb92d295f0ebJames Dong        @param hComponent
527334de520b0369215b7931fefa424fb92d295f0ebJames Dong            handle of the component to access.  This is the component
528334de520b0369215b7931fefa424fb92d295f0ebJames Dong            handle returned by the call to the GetHandle function.
529334de520b0369215b7931fefa424fb92d295f0ebJames Dong        @param pAppData
530a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar            pointer to an application defined value that was provided in the
531334de520b0369215b7931fefa424fb92d295f0ebJames Dong            pAppData parameter to the OMX_GetHandle method for the component.
532a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar            This application defined value is provided so that the application
533334de520b0369215b7931fefa424fb92d295f0ebJames Dong            can have a component specific context when receiving the callback.
534334de520b0369215b7931fefa424fb92d295f0ebJames Dong        @param eEvent
535334de520b0369215b7931fefa424fb92d295f0ebJames Dong            Event that the component wants to notify the application about.
536334de520b0369215b7931fefa424fb92d295f0ebJames Dong        @param nData1
537a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar            nData will be the OMX_ERRORTYPE for an error event and will be
538334de520b0369215b7931fefa424fb92d295f0ebJames Dong            an OMX_COMMANDTYPE for a command complete event and OMX_INDEXTYPE for a OMX_PortSettingsChanged event.
539334de520b0369215b7931fefa424fb92d295f0ebJames Dong         @param nData2
540334de520b0369215b7931fefa424fb92d295f0ebJames Dong            nData2 will hold further information related to the event. Can be OMX_STATETYPE for
541334de520b0369215b7931fefa424fb92d295f0ebJames Dong            a OMX_CommandStateSet command or port index for a OMX_PortSettingsChanged event.
542334de520b0369215b7931fefa424fb92d295f0ebJames Dong            Default value is 0 if not used. )
543334de520b0369215b7931fefa424fb92d295f0ebJames Dong        @param pEventData
544334de520b0369215b7931fefa424fb92d295f0ebJames Dong            Pointer to additional event-specific data (see spec for meaning).
545334de520b0369215b7931fefa424fb92d295f0ebJames Dong      */
546334de520b0369215b7931fefa424fb92d295f0ebJames Dong
547334de520b0369215b7931fefa424fb92d295f0ebJames Dong   OMX_ERRORTYPE (*EventHandler)(
548334de520b0369215b7931fefa424fb92d295f0ebJames Dong        OMX_IN OMX_HANDLETYPE hComponent,
549334de520b0369215b7931fefa424fb92d295f0ebJames Dong        OMX_IN OMX_PTR pAppData,
550334de520b0369215b7931fefa424fb92d295f0ebJames Dong        OMX_IN OMX_EVENTTYPE eEvent,
551334de520b0369215b7931fefa424fb92d295f0ebJames Dong        OMX_IN OMX_U32 nData1,
552334de520b0369215b7931fefa424fb92d295f0ebJames Dong        OMX_IN OMX_U32 nData2,
553334de520b0369215b7931fefa424fb92d295f0ebJames Dong        OMX_IN OMX_PTR pEventData);
554334de520b0369215b7931fefa424fb92d295f0ebJames Dong
555334de520b0369215b7931fefa424fb92d295f0ebJames Dong    /** The EmptyBufferDone method is used to return emptied buffers from an
556a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar        input port back to the application for reuse.  This is a blocking call
557334de520b0369215b7931fefa424fb92d295f0ebJames Dong        so the application should not attempt to refill the buffers during this
558334de520b0369215b7931fefa424fb92d295f0ebJames Dong        call, but should queue them and refill them in another thread.  There
559334de520b0369215b7931fefa424fb92d295f0ebJames Dong        is no error return, so the application shall handle any errors generated
560a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar        internally.
561a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar
562334de520b0369215b7931fefa424fb92d295f0ebJames Dong        The application should return from this call within 5 msec.
563a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar
564334de520b0369215b7931fefa424fb92d295f0ebJames Dong        @param hComponent
565334de520b0369215b7931fefa424fb92d295f0ebJames Dong            handle of the component to access.  This is the component
566334de520b0369215b7931fefa424fb92d295f0ebJames Dong            handle returned by the call to the GetHandle function.
567334de520b0369215b7931fefa424fb92d295f0ebJames Dong        @param pAppData
568a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar            pointer to an application defined value that was provided in the
569334de520b0369215b7931fefa424fb92d295f0ebJames Dong            pAppData parameter to the OMX_GetHandle method for the component.
570a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar            This application defined value is provided so that the application
571334de520b0369215b7931fefa424fb92d295f0ebJames Dong            can have a component specific context when receiving the callback.
572334de520b0369215b7931fefa424fb92d295f0ebJames Dong        @param pBuffer
573334de520b0369215b7931fefa424fb92d295f0ebJames Dong            pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer
574334de520b0369215b7931fefa424fb92d295f0ebJames Dong            or AllocateBuffer indicating the buffer that was emptied.
575334de520b0369215b7931fefa424fb92d295f0ebJames Dong        @ingroup buf
576334de520b0369215b7931fefa424fb92d295f0ebJames Dong     */
577334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_ERRORTYPE (*EmptyBufferDone)(
578334de520b0369215b7931fefa424fb92d295f0ebJames Dong        OMX_IN OMX_HANDLETYPE hComponent,
579334de520b0369215b7931fefa424fb92d295f0ebJames Dong        OMX_IN OMX_PTR pAppData,
580334de520b0369215b7931fefa424fb92d295f0ebJames Dong        OMX_IN OMX_BUFFERHEADERTYPE* pBuffer);
581334de520b0369215b7931fefa424fb92d295f0ebJames Dong
582334de520b0369215b7931fefa424fb92d295f0ebJames Dong    /** The FillBufferDone method is used to return filled buffers from an
583a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar        output port back to the application for emptying and then reuse.
584a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar        This is a blocking call so the application should not attempt to
585a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar        empty the buffers during this call, but should queue the buffers
586a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar        and empty them in another thread.  There is no error return, so
587a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar        the application shall handle any errors generated internally.  The
588334de520b0369215b7931fefa424fb92d295f0ebJames Dong        application shall also update the buffer header to indicate the
589a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar        number of bytes placed into the buffer.
590334de520b0369215b7931fefa424fb92d295f0ebJames Dong
591334de520b0369215b7931fefa424fb92d295f0ebJames Dong        The application should return from this call within 5 msec.
592a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar
593334de520b0369215b7931fefa424fb92d295f0ebJames Dong        @param hComponent
594334de520b0369215b7931fefa424fb92d295f0ebJames Dong            handle of the component to access.  This is the component
595334de520b0369215b7931fefa424fb92d295f0ebJames Dong            handle returned by the call to the GetHandle function.
596334de520b0369215b7931fefa424fb92d295f0ebJames Dong        @param pAppData
597a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar            pointer to an application defined value that was provided in the
598334de520b0369215b7931fefa424fb92d295f0ebJames Dong            pAppData parameter to the OMX_GetHandle method for the component.
599a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar            This application defined value is provided so that the application
600334de520b0369215b7931fefa424fb92d295f0ebJames Dong            can have a component specific context when receiving the callback.
601334de520b0369215b7931fefa424fb92d295f0ebJames Dong        @param pBuffer
602334de520b0369215b7931fefa424fb92d295f0ebJames Dong            pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer
603334de520b0369215b7931fefa424fb92d295f0ebJames Dong            or AllocateBuffer indicating the buffer that was filled.
604334de520b0369215b7931fefa424fb92d295f0ebJames Dong        @ingroup buf
605334de520b0369215b7931fefa424fb92d295f0ebJames Dong     */
606334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_ERRORTYPE (*FillBufferDone)(
607334de520b0369215b7931fefa424fb92d295f0ebJames Dong        OMX_OUT OMX_HANDLETYPE hComponent,
608334de520b0369215b7931fefa424fb92d295f0ebJames Dong        OMX_OUT OMX_PTR pAppData,
609334de520b0369215b7931fefa424fb92d295f0ebJames Dong        OMX_OUT OMX_BUFFERHEADERTYPE* pBuffer);
610334de520b0369215b7931fefa424fb92d295f0ebJames Dong
611334de520b0369215b7931fefa424fb92d295f0ebJames Dong} OMX_CALLBACKTYPE;
612334de520b0369215b7931fefa424fb92d295f0ebJames Dong
613334de520b0369215b7931fefa424fb92d295f0ebJames Dong/** The OMX_BUFFERSUPPLIERTYPE enumeration is used to dictate port supplier
614334de520b0369215b7931fefa424fb92d295f0ebJames Dong    preference when tunneling between two ports.
615334de520b0369215b7931fefa424fb92d295f0ebJames Dong    @ingroup tun buf
616334de520b0369215b7931fefa424fb92d295f0ebJames Dong*/
617334de520b0369215b7931fefa424fb92d295f0ebJames Dongtypedef enum OMX_BUFFERSUPPLIERTYPE
618334de520b0369215b7931fefa424fb92d295f0ebJames Dong{
619334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_BufferSupplyUnspecified = 0x0, /**< port supplying the buffers is unspecified,
620334de520b0369215b7931fefa424fb92d295f0ebJames Dong                                              or don't care */
621334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_BufferSupplyInput,             /**< input port supplies the buffers */
622334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_BufferSupplyOutput,            /**< output port supplies the buffers */
623a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar    OMX_BufferSupplyKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
624334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_BufferSupplyVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
625334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_BufferSupplyMax = 0x7FFFFFFF
626334de520b0369215b7931fefa424fb92d295f0ebJames Dong} OMX_BUFFERSUPPLIERTYPE;
627334de520b0369215b7931fefa424fb92d295f0ebJames Dong
628334de520b0369215b7931fefa424fb92d295f0ebJames Dong
629a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar/** buffer supplier parameter
630334de520b0369215b7931fefa424fb92d295f0ebJames Dong * @ingroup tun
631334de520b0369215b7931fefa424fb92d295f0ebJames Dong */
632334de520b0369215b7931fefa424fb92d295f0ebJames Dongtypedef struct OMX_PARAM_BUFFERSUPPLIERTYPE {
633334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_U32 nSize; /**< size of the structure in bytes */
634334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
635334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_U32 nPortIndex; /**< port that this structure applies to */
636334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_BUFFERSUPPLIERTYPE eBufferSupplier; /**< buffer supplier */
637334de520b0369215b7931fefa424fb92d295f0ebJames Dong} OMX_PARAM_BUFFERSUPPLIERTYPE;
638334de520b0369215b7931fefa424fb92d295f0ebJames Dong
639334de520b0369215b7931fefa424fb92d295f0ebJames Dong
640a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar/**< indicates that buffers received by an input port of a tunnel
641a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar     may not modify the data in the buffers
642334de520b0369215b7931fefa424fb92d295f0ebJames Dong     @ingroup tun
643334de520b0369215b7931fefa424fb92d295f0ebJames Dong */
644a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar#define OMX_PORTTUNNELFLAG_READONLY 0x00000001
645334de520b0369215b7931fefa424fb92d295f0ebJames Dong
646334de520b0369215b7931fefa424fb92d295f0ebJames Dong
647334de520b0369215b7931fefa424fb92d295f0ebJames Dong/** The OMX_TUNNELSETUPTYPE structure is used to pass data from an output
648334de520b0369215b7931fefa424fb92d295f0ebJames Dong    port to an input port as part the two ComponentTunnelRequest calls
649a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar    resulting from a OMX_SetupTunnel call from the IL Client.
650334de520b0369215b7931fefa424fb92d295f0ebJames Dong    @ingroup tun
651a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar */
652334de520b0369215b7931fefa424fb92d295f0ebJames Dongtypedef struct OMX_TUNNELSETUPTYPE
653334de520b0369215b7931fefa424fb92d295f0ebJames Dong{
654334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_U32 nTunnelFlags;             /**< bit flags for tunneling */
655334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_BUFFERSUPPLIERTYPE eSupplier; /**< supplier preference */
656a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar} OMX_TUNNELSETUPTYPE;
657334de520b0369215b7931fefa424fb92d295f0ebJames Dong
658334de520b0369215b7931fefa424fb92d295f0ebJames Dong/* OMX Component headers is included to enable the core to use
659a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar   macros for functions into the component for OMX release 1.0.
660334de520b0369215b7931fefa424fb92d295f0ebJames Dong   Developers should not access any structures or data from within
661334de520b0369215b7931fefa424fb92d295f0ebJames Dong   the component header directly */
662334de520b0369215b7931fefa424fb92d295f0ebJames Dong/* TO BE REMOVED - #include <OMX_Component.h> */
663334de520b0369215b7931fefa424fb92d295f0ebJames Dong
664a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar/** GetComponentVersion will return information about the component.
665334de520b0369215b7931fefa424fb92d295f0ebJames Dong    This is a blocking call.  This macro will go directly from the
666334de520b0369215b7931fefa424fb92d295f0ebJames Dong    application to the component (via a core macro).  The
667334de520b0369215b7931fefa424fb92d295f0ebJames Dong    component will return from this call within 5 msec.
668334de520b0369215b7931fefa424fb92d295f0ebJames Dong    @param [in] hComponent
669334de520b0369215b7931fefa424fb92d295f0ebJames Dong        handle of component to execute the command
670334de520b0369215b7931fefa424fb92d295f0ebJames Dong    @param [out] pComponentName
671a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar        pointer to an empty string of length 128 bytes.  The component
672a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar        will write its name into this string.  The name will be
673a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar        terminated by a single zero byte.  The name of a component will
674a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar        be 127 bytes or less to leave room for the trailing zero byte.
675334de520b0369215b7931fefa424fb92d295f0ebJames Dong        An example of a valid component name is "OMX.ABC.ChannelMixer\0".
676334de520b0369215b7931fefa424fb92d295f0ebJames Dong    @param [out] pComponentVersion
677a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar        pointer to an OMX Version structure that the component will fill
678a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar        in.  The component will fill in a value that indicates the
679a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar        component version.  NOTE: the component version is NOT the same
680a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar        as the OMX Specification version (found in all structures).  The
681a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar        component version is defined by the vendor of the component and
682334de520b0369215b7931fefa424fb92d295f0ebJames Dong        its value is entirely up to the component vendor.
683334de520b0369215b7931fefa424fb92d295f0ebJames Dong    @param [out] pSpecVersion
684a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar        pointer to an OMX Version structure that the component will fill
685a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar        in.  The SpecVersion is the version of the specification that the
686a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar        component was built against.  Please note that this value may or
687a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar        may not match the structure's version.  For example, if the
688a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar        component was built against the 2.0 specification, but the
689a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar        application (which creates the structure is built against the
690334de520b0369215b7931fefa424fb92d295f0ebJames Dong        1.0 specification the versions would be different.
691334de520b0369215b7931fefa424fb92d295f0ebJames Dong    @param [out] pComponentUUID
692a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar        pointer to the UUID of the component which will be filled in by
693a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar        the component.  The UUID is a unique identifier that is set at
694a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar        RUN time for the component and is unique to each instantion of
695334de520b0369215b7931fefa424fb92d295f0ebJames Dong        the component.
696334de520b0369215b7931fefa424fb92d295f0ebJames Dong    @return OMX_ERRORTYPE
697334de520b0369215b7931fefa424fb92d295f0ebJames Dong        If the command successfully executes, the return code will be
698334de520b0369215b7931fefa424fb92d295f0ebJames Dong        OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.
699334de520b0369215b7931fefa424fb92d295f0ebJames Dong    @ingroup comp
700334de520b0369215b7931fefa424fb92d295f0ebJames Dong */
701334de520b0369215b7931fefa424fb92d295f0ebJames Dong#define OMX_GetComponentVersion(                            \
702334de520b0369215b7931fefa424fb92d295f0ebJames Dong        hComponent,                                         \
703334de520b0369215b7931fefa424fb92d295f0ebJames Dong        pComponentName,                                     \
704334de520b0369215b7931fefa424fb92d295f0ebJames Dong        pComponentVersion,                                  \
705334de520b0369215b7931fefa424fb92d295f0ebJames Dong        pSpecVersion,                                       \
706334de520b0369215b7931fefa424fb92d295f0ebJames Dong        pComponentUUID)                                     \
707334de520b0369215b7931fefa424fb92d295f0ebJames Dong    ((OMX_COMPONENTTYPE*)hComponent)->GetComponentVersion(  \
708334de520b0369215b7931fefa424fb92d295f0ebJames Dong        hComponent,                                         \
709334de520b0369215b7931fefa424fb92d295f0ebJames Dong        pComponentName,                                     \
710334de520b0369215b7931fefa424fb92d295f0ebJames Dong        pComponentVersion,                                  \
711334de520b0369215b7931fefa424fb92d295f0ebJames Dong        pSpecVersion,                                       \
712334de520b0369215b7931fefa424fb92d295f0ebJames Dong        pComponentUUID)                 /* Macro End */
713334de520b0369215b7931fefa424fb92d295f0ebJames Dong
714334de520b0369215b7931fefa424fb92d295f0ebJames Dong
715334de520b0369215b7931fefa424fb92d295f0ebJames Dong/** Send a command to the component.  This call is a non-blocking call.
716334de520b0369215b7931fefa424fb92d295f0ebJames Dong    The component should check the parameters and then queue the command
717a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar    to the component thread to be executed.  The component thread shall
718a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar    send the EventHandler() callback at the conclusion of the command.
719334de520b0369215b7931fefa424fb92d295f0ebJames Dong    This macro will go directly from the application to the component (via
720334de520b0369215b7931fefa424fb92d295f0ebJames Dong    a core macro).  The component will return from this call within 5 msec.
721a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar
722334de520b0369215b7931fefa424fb92d295f0ebJames Dong    When the command is "OMX_CommandStateSet" the component will queue a
723334de520b0369215b7931fefa424fb92d295f0ebJames Dong    state transition to the new state idenfied in nParam.
724a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar
725334de520b0369215b7931fefa424fb92d295f0ebJames Dong    When the command is "OMX_CommandFlush", to flush a port's buffer queues,
726a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar    the command will force the component to return all buffers NOT CURRENTLY
727a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar    BEING PROCESSED to the application, in the order in which the buffers
728334de520b0369215b7931fefa424fb92d295f0ebJames Dong    were received.
729a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar
730a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar    When the command is "OMX_CommandPortDisable" or
731334de520b0369215b7931fefa424fb92d295f0ebJames Dong    "OMX_CommandPortEnable", the component's port (given by the value of
732a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar    nParam) will be stopped or restarted.
733a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar
734334de520b0369215b7931fefa424fb92d295f0ebJames Dong    When the command "OMX_CommandMarkBuffer" is used to mark a buffer, the
735334de520b0369215b7931fefa424fb92d295f0ebJames Dong    pCmdData will point to a OMX_MARKTYPE structure containing the component
736334de520b0369215b7931fefa424fb92d295f0ebJames Dong    handle of the component to examine the buffer chain for the mark.  nParam1
737334de520b0369215b7931fefa424fb92d295f0ebJames Dong    contains the index of the port on which the buffer mark is applied.
738334de520b0369215b7931fefa424fb92d295f0ebJames Dong
739a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar    Specification text for more details.
740a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar
741334de520b0369215b7931fefa424fb92d295f0ebJames Dong    @param [in] hComponent
742334de520b0369215b7931fefa424fb92d295f0ebJames Dong        handle of component to execute the command
743334de520b0369215b7931fefa424fb92d295f0ebJames Dong    @param [in] Cmd
744334de520b0369215b7931fefa424fb92d295f0ebJames Dong        Command for the component to execute
745334de520b0369215b7931fefa424fb92d295f0ebJames Dong    @param [in] nParam
746a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar        Parameter for the command to be executed.  When Cmd has the value
747a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar        OMX_CommandStateSet, value is a member of OMX_STATETYPE.  When Cmd has
748a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar        the value OMX_CommandFlush, value of nParam indicates which port(s)
749a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar        to flush. -1 is used to flush all ports a single port index will
750334de520b0369215b7931fefa424fb92d295f0ebJames Dong        only flush that port.  When Cmd has the value "OMX_CommandPortDisable"
751a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar        or "OMX_CommandPortEnable", the component's port is given by
752334de520b0369215b7931fefa424fb92d295f0ebJames Dong        the value of nParam.  When Cmd has the value "OMX_CommandMarkBuffer"
753334de520b0369215b7931fefa424fb92d295f0ebJames Dong        the components pot is given by the value of nParam.
754334de520b0369215b7931fefa424fb92d295f0ebJames Dong    @param [in] pCmdData
755334de520b0369215b7931fefa424fb92d295f0ebJames Dong        Parameter pointing to the OMX_MARKTYPE structure when Cmd has the value
756a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar        "OMX_CommandMarkBuffer".
757334de520b0369215b7931fefa424fb92d295f0ebJames Dong    @return OMX_ERRORTYPE
758334de520b0369215b7931fefa424fb92d295f0ebJames Dong        If the command successfully executes, the return code will be
759334de520b0369215b7931fefa424fb92d295f0ebJames Dong        OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.
760334de520b0369215b7931fefa424fb92d295f0ebJames Dong    @ingroup comp
761334de520b0369215b7931fefa424fb92d295f0ebJames Dong */
762334de520b0369215b7931fefa424fb92d295f0ebJames Dong#define OMX_SendCommand(                                    \
763334de520b0369215b7931fefa424fb92d295f0ebJames Dong         hComponent,                                        \
764334de520b0369215b7931fefa424fb92d295f0ebJames Dong         Cmd,                                               \
765334de520b0369215b7931fefa424fb92d295f0ebJames Dong         nParam,                                            \
766334de520b0369215b7931fefa424fb92d295f0ebJames Dong         pCmdData)                                          \
767334de520b0369215b7931fefa424fb92d295f0ebJames Dong     ((OMX_COMPONENTTYPE*)hComponent)->SendCommand(         \
768334de520b0369215b7931fefa424fb92d295f0ebJames Dong         hComponent,                                        \
769334de520b0369215b7931fefa424fb92d295f0ebJames Dong         Cmd,                                               \
770334de520b0369215b7931fefa424fb92d295f0ebJames Dong         nParam,                                            \
771334de520b0369215b7931fefa424fb92d295f0ebJames Dong         pCmdData)                          /* Macro End */
772334de520b0369215b7931fefa424fb92d295f0ebJames Dong
773334de520b0369215b7931fefa424fb92d295f0ebJames Dong
774a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar/** The OMX_GetParameter macro will get one of the current parameter
775a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar    settings from the component.  This macro cannot only be invoked when
776334de520b0369215b7931fefa424fb92d295f0ebJames Dong    the component is in the OMX_StateInvalid state.  The nParamIndex
777334de520b0369215b7931fefa424fb92d295f0ebJames Dong    parameter is used to indicate which structure is being requested from
778a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar    the component.  The application shall allocate the correct structure
779a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar    and shall fill in the structure size and version information before
780334de520b0369215b7931fefa424fb92d295f0ebJames Dong    invoking this macro.  When the parameter applies to a port, the
781334de520b0369215b7931fefa424fb92d295f0ebJames Dong    caller shall fill in the appropriate nPortIndex value indicating the
782a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar    port on which the parameter applies. If the component has not had
783a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar    any settings changed, then the component should return a set of
784a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar    valid DEFAULT  parameters for the component.  This is a blocking
785a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar    call.
786a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar
787334de520b0369215b7931fefa424fb92d295f0ebJames Dong    The component should return from this call within 20 msec.
788a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar
789334de520b0369215b7931fefa424fb92d295f0ebJames Dong    @param [in] hComponent
790334de520b0369215b7931fefa424fb92d295f0ebJames Dong        Handle of the component to be accessed.  This is the component
791334de520b0369215b7931fefa424fb92d295f0ebJames Dong        handle returned by the call to the OMX_GetHandle function.
792334de520b0369215b7931fefa424fb92d295f0ebJames Dong    @param [in] nParamIndex
793334de520b0369215b7931fefa424fb92d295f0ebJames Dong        Index of the structure to be filled.  This value is from the
794334de520b0369215b7931fefa424fb92d295f0ebJames Dong        OMX_INDEXTYPE enumeration.
795334de520b0369215b7931fefa424fb92d295f0ebJames Dong    @param [in,out] pComponentParameterStructure
796a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar        Pointer to application allocated structure to be filled by the
797334de520b0369215b7931fefa424fb92d295f0ebJames Dong        component.
798334de520b0369215b7931fefa424fb92d295f0ebJames Dong    @return OMX_ERRORTYPE
799334de520b0369215b7931fefa424fb92d295f0ebJames Dong        If the command successfully executes, the return code will be
800334de520b0369215b7931fefa424fb92d295f0ebJames Dong        OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.
801334de520b0369215b7931fefa424fb92d295f0ebJames Dong    @ingroup comp
802334de520b0369215b7931fefa424fb92d295f0ebJames Dong */
803334de520b0369215b7931fefa424fb92d295f0ebJames Dong#define OMX_GetParameter(                                   \
804334de520b0369215b7931fefa424fb92d295f0ebJames Dong        hComponent,                                         \
805334de520b0369215b7931fefa424fb92d295f0ebJames Dong        nParamIndex,                                        \
806334de520b0369215b7931fefa424fb92d295f0ebJames Dong        pComponentParameterStructure)                        \
807334de520b0369215b7931fefa424fb92d295f0ebJames Dong    ((OMX_COMPONENTTYPE*)hComponent)->GetParameter(         \
808334de520b0369215b7931fefa424fb92d295f0ebJames Dong        hComponent,                                         \
809334de520b0369215b7931fefa424fb92d295f0ebJames Dong        nParamIndex,                                        \
810334de520b0369215b7931fefa424fb92d295f0ebJames Dong        pComponentParameterStructure)    /* Macro End */
811334de520b0369215b7931fefa424fb92d295f0ebJames Dong
812334de520b0369215b7931fefa424fb92d295f0ebJames Dong
813334de520b0369215b7931fefa424fb92d295f0ebJames Dong/** The OMX_SetParameter macro will send an initialization parameter
814334de520b0369215b7931fefa424fb92d295f0ebJames Dong    structure to a component.  Each structure shall be sent one at a time,
815334de520b0369215b7931fefa424fb92d295f0ebJames Dong    in a separate invocation of the macro.  This macro can only be
816334de520b0369215b7931fefa424fb92d295f0ebJames Dong    invoked when the component is in the OMX_StateLoaded state, or the
817a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar    port is disabled (when the parameter applies to a port). The
818334de520b0369215b7931fefa424fb92d295f0ebJames Dong    nParamIndex parameter is used to indicate which structure is being
819a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar    passed to the component.  The application shall allocate the
820a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar    correct structure and shall fill in the structure size and version
821334de520b0369215b7931fefa424fb92d295f0ebJames Dong    information (as well as the actual data) before invoking this macro.
822334de520b0369215b7931fefa424fb92d295f0ebJames Dong    The application is free to dispose of this structure after the call
823a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar    as the component is required to copy any data it shall retain.  This
824a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar    is a blocking call.
825a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar
826334de520b0369215b7931fefa424fb92d295f0ebJames Dong    The component should return from this call within 20 msec.
827a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar
828334de520b0369215b7931fefa424fb92d295f0ebJames Dong    @param [in] hComponent
829334de520b0369215b7931fefa424fb92d295f0ebJames Dong        Handle of the component to be accessed.  This is the component
830334de520b0369215b7931fefa424fb92d295f0ebJames Dong        handle returned by the call to the OMX_GetHandle function.
831334de520b0369215b7931fefa424fb92d295f0ebJames Dong    @param [in] nIndex
832334de520b0369215b7931fefa424fb92d295f0ebJames Dong        Index of the structure to be sent.  This value is from the
833334de520b0369215b7931fefa424fb92d295f0ebJames Dong        OMX_INDEXTYPE enumeration.
834334de520b0369215b7931fefa424fb92d295f0ebJames Dong    @param [in] pComponentParameterStructure
835334de520b0369215b7931fefa424fb92d295f0ebJames Dong        pointer to application allocated structure to be used for
836334de520b0369215b7931fefa424fb92d295f0ebJames Dong        initialization by the component.
837334de520b0369215b7931fefa424fb92d295f0ebJames Dong    @return OMX_ERRORTYPE
838334de520b0369215b7931fefa424fb92d295f0ebJames Dong        If the command successfully executes, the return code will be
839334de520b0369215b7931fefa424fb92d295f0ebJames Dong        OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.
840334de520b0369215b7931fefa424fb92d295f0ebJames Dong    @ingroup comp
841334de520b0369215b7931fefa424fb92d295f0ebJames Dong */
842334de520b0369215b7931fefa424fb92d295f0ebJames Dong#define OMX_SetParameter(                                   \
843334de520b0369215b7931fefa424fb92d295f0ebJames Dong        hComponent,                                         \
844334de520b0369215b7931fefa424fb92d295f0ebJames Dong        nParamIndex,                                        \
845334de520b0369215b7931fefa424fb92d295f0ebJames Dong        pComponentParameterStructure)                        \
846334de520b0369215b7931fefa424fb92d295f0ebJames Dong    ((OMX_COMPONENTTYPE*)hComponent)->SetParameter(         \
847334de520b0369215b7931fefa424fb92d295f0ebJames Dong        hComponent,                                         \
848334de520b0369215b7931fefa424fb92d295f0ebJames Dong        nParamIndex,                                        \
849334de520b0369215b7931fefa424fb92d295f0ebJames Dong        pComponentParameterStructure)    /* Macro End */
850334de520b0369215b7931fefa424fb92d295f0ebJames Dong
851334de520b0369215b7931fefa424fb92d295f0ebJames Dong
852a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar/** The OMX_GetConfig macro will get one of the configuration structures
853a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar    from a component.  This macro can be invoked anytime after the
854a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar    component has been loaded.  The nParamIndex call parameter is used to
855a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar    indicate which structure is being requested from the component.  The
856a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar    application shall allocate the correct structure and shall fill in the
857a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar    structure size and version information before invoking this macro.
858a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar    If the component has not had this configuration parameter sent before,
859a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar    then the component should return a set of valid DEFAULT values for the
860a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar    component.  This is a blocking call.
861a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar
862334de520b0369215b7931fefa424fb92d295f0ebJames Dong    The component should return from this call within 5 msec.
863a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar
864334de520b0369215b7931fefa424fb92d295f0ebJames Dong    @param [in] hComponent
865334de520b0369215b7931fefa424fb92d295f0ebJames Dong        Handle of the component to be accessed.  This is the component
866334de520b0369215b7931fefa424fb92d295f0ebJames Dong        handle returned by the call to the OMX_GetHandle function.
867334de520b0369215b7931fefa424fb92d295f0ebJames Dong    @param [in] nIndex
868334de520b0369215b7931fefa424fb92d295f0ebJames Dong        Index of the structure to be filled.  This value is from the
869334de520b0369215b7931fefa424fb92d295f0ebJames Dong        OMX_INDEXTYPE enumeration.
870334de520b0369215b7931fefa424fb92d295f0ebJames Dong    @param [in,out] pComponentConfigStructure
871a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar        pointer to application allocated structure to be filled by the
872334de520b0369215b7931fefa424fb92d295f0ebJames Dong        component.
873334de520b0369215b7931fefa424fb92d295f0ebJames Dong    @return OMX_ERRORTYPE
874334de520b0369215b7931fefa424fb92d295f0ebJames Dong        If the command successfully executes, the return code will be
875334de520b0369215b7931fefa424fb92d295f0ebJames Dong        OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.
876334de520b0369215b7931fefa424fb92d295f0ebJames Dong    @ingroup comp
877a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar*/
878334de520b0369215b7931fefa424fb92d295f0ebJames Dong#define OMX_GetConfig(                                      \
879334de520b0369215b7931fefa424fb92d295f0ebJames Dong        hComponent,                                         \
880334de520b0369215b7931fefa424fb92d295f0ebJames Dong        nConfigIndex,                                       \
881334de520b0369215b7931fefa424fb92d295f0ebJames Dong        pComponentConfigStructure)                           \
882334de520b0369215b7931fefa424fb92d295f0ebJames Dong    ((OMX_COMPONENTTYPE*)hComponent)->GetConfig(            \
883334de520b0369215b7931fefa424fb92d295f0ebJames Dong        hComponent,                                         \
884334de520b0369215b7931fefa424fb92d295f0ebJames Dong        nConfigIndex,                                       \
885334de520b0369215b7931fefa424fb92d295f0ebJames Dong        pComponentConfigStructure)       /* Macro End */
886334de520b0369215b7931fefa424fb92d295f0ebJames Dong
887334de520b0369215b7931fefa424fb92d295f0ebJames Dong
888a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar/** The OMX_SetConfig macro will send one of the configuration
889334de520b0369215b7931fefa424fb92d295f0ebJames Dong    structures to a component.  Each structure shall be sent one at a time,
890a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar    each in a separate invocation of the macro.  This macro can be invoked
891a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar    anytime after the component has been loaded.  The application shall
892a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar    allocate the correct structure and shall fill in the structure size
893a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar    and version information (as well as the actual data) before invoking
894a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar    this macro.  The application is free to dispose of this structure after
895a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar    the call as the component is required to copy any data it shall retain.
896a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar    This is a blocking call.
897a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar
898334de520b0369215b7931fefa424fb92d295f0ebJames Dong    The component should return from this call within 5 msec.
899a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar
900334de520b0369215b7931fefa424fb92d295f0ebJames Dong    @param [in] hComponent
901334de520b0369215b7931fefa424fb92d295f0ebJames Dong        Handle of the component to be accessed.  This is the component
902334de520b0369215b7931fefa424fb92d295f0ebJames Dong        handle returned by the call to the OMX_GetHandle function.
903334de520b0369215b7931fefa424fb92d295f0ebJames Dong    @param [in] nConfigIndex
904334de520b0369215b7931fefa424fb92d295f0ebJames Dong        Index of the structure to be sent.  This value is from the
905334de520b0369215b7931fefa424fb92d295f0ebJames Dong        OMX_INDEXTYPE enumeration above.
906334de520b0369215b7931fefa424fb92d295f0ebJames Dong    @param [in] pComponentConfigStructure
907334de520b0369215b7931fefa424fb92d295f0ebJames Dong        pointer to application allocated structure to be used for
908334de520b0369215b7931fefa424fb92d295f0ebJames Dong        initialization by the component.
909334de520b0369215b7931fefa424fb92d295f0ebJames Dong    @return OMX_ERRORTYPE
910334de520b0369215b7931fefa424fb92d295f0ebJames Dong        If the command successfully executes, the return code will be
911334de520b0369215b7931fefa424fb92d295f0ebJames Dong        OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.
912334de520b0369215b7931fefa424fb92d295f0ebJames Dong    @ingroup comp
913334de520b0369215b7931fefa424fb92d295f0ebJames Dong */
914334de520b0369215b7931fefa424fb92d295f0ebJames Dong#define OMX_SetConfig(                                      \
915334de520b0369215b7931fefa424fb92d295f0ebJames Dong        hComponent,                                         \
916334de520b0369215b7931fefa424fb92d295f0ebJames Dong        nConfigIndex,                                       \
917334de520b0369215b7931fefa424fb92d295f0ebJames Dong        pComponentConfigStructure)                           \
918334de520b0369215b7931fefa424fb92d295f0ebJames Dong    ((OMX_COMPONENTTYPE*)hComponent)->SetConfig(            \
919334de520b0369215b7931fefa424fb92d295f0ebJames Dong        hComponent,                                         \
920334de520b0369215b7931fefa424fb92d295f0ebJames Dong        nConfigIndex,                                       \
921334de520b0369215b7931fefa424fb92d295f0ebJames Dong        pComponentConfigStructure)       /* Macro End */
922334de520b0369215b7931fefa424fb92d295f0ebJames Dong
923334de520b0369215b7931fefa424fb92d295f0ebJames Dong
924a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar/** The OMX_GetExtensionIndex macro will invoke a component to translate
925a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar    a vendor specific configuration or parameter string into an OMX
926a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar    structure index.  There is no requirement for the vendor to support
927a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar    this command for the indexes already found in the OMX_INDEXTYPE
928a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar    enumeration (this is done to save space in small components).  The
929334de520b0369215b7931fefa424fb92d295f0ebJames Dong    component shall support all vendor supplied extension indexes not found
930a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar    in the master OMX_INDEXTYPE enumeration.  This is a blocking call.
931a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar
932334de520b0369215b7931fefa424fb92d295f0ebJames Dong    The component should return from this call within 5 msec.
933a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar
934334de520b0369215b7931fefa424fb92d295f0ebJames Dong    @param [in] hComponent
935334de520b0369215b7931fefa424fb92d295f0ebJames Dong        Handle of the component to be accessed.  This is the component
936334de520b0369215b7931fefa424fb92d295f0ebJames Dong        handle returned by the call to the GetHandle function.
937334de520b0369215b7931fefa424fb92d295f0ebJames Dong    @param [in] cParameterName
938334de520b0369215b7931fefa424fb92d295f0ebJames Dong        OMX_STRING that shall be less than 128 characters long including
939a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar        the trailing null byte.  This is the string that will get
940334de520b0369215b7931fefa424fb92d295f0ebJames Dong        translated by the component into a configuration index.
941334de520b0369215b7931fefa424fb92d295f0ebJames Dong    @param [out] pIndexType
942334de520b0369215b7931fefa424fb92d295f0ebJames Dong        a pointer to a OMX_INDEXTYPE to receive the index value.
943334de520b0369215b7931fefa424fb92d295f0ebJames Dong    @return OMX_ERRORTYPE
944334de520b0369215b7931fefa424fb92d295f0ebJames Dong        If the command successfully executes, the return code will be
945334de520b0369215b7931fefa424fb92d295f0ebJames Dong        OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.
946334de520b0369215b7931fefa424fb92d295f0ebJames Dong    @ingroup comp
947334de520b0369215b7931fefa424fb92d295f0ebJames Dong */
948334de520b0369215b7931fefa424fb92d295f0ebJames Dong#define OMX_GetExtensionIndex(                              \
949334de520b0369215b7931fefa424fb92d295f0ebJames Dong        hComponent,                                         \
950334de520b0369215b7931fefa424fb92d295f0ebJames Dong        cParameterName,                                     \
951334de520b0369215b7931fefa424fb92d295f0ebJames Dong        pIndexType)                                         \
952334de520b0369215b7931fefa424fb92d295f0ebJames Dong    ((OMX_COMPONENTTYPE*)hComponent)->GetExtensionIndex(    \
953334de520b0369215b7931fefa424fb92d295f0ebJames Dong        hComponent,                                         \
954334de520b0369215b7931fefa424fb92d295f0ebJames Dong        cParameterName,                                     \
955334de520b0369215b7931fefa424fb92d295f0ebJames Dong        pIndexType)                     /* Macro End */
956334de520b0369215b7931fefa424fb92d295f0ebJames Dong
957334de520b0369215b7931fefa424fb92d295f0ebJames Dong
958a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar/** The OMX_GetState macro will invoke the component to get the current
959334de520b0369215b7931fefa424fb92d295f0ebJames Dong    state of the component and place the state value into the location
960a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar    pointed to by pState.
961a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar
962334de520b0369215b7931fefa424fb92d295f0ebJames Dong    The component should return from this call within 5 msec.
963a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar
964334de520b0369215b7931fefa424fb92d295f0ebJames Dong    @param [in] hComponent
965334de520b0369215b7931fefa424fb92d295f0ebJames Dong        Handle of the component to be accessed.  This is the component
966334de520b0369215b7931fefa424fb92d295f0ebJames Dong        handle returned by the call to the OMX_GetHandle function.
967334de520b0369215b7931fefa424fb92d295f0ebJames Dong    @param [out] pState
968334de520b0369215b7931fefa424fb92d295f0ebJames Dong        pointer to the location to receive the state.  The value returned
969a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar        is one of the OMX_STATETYPE members
970334de520b0369215b7931fefa424fb92d295f0ebJames Dong    @return OMX_ERRORTYPE
971334de520b0369215b7931fefa424fb92d295f0ebJames Dong        If the command successfully executes, the return code will be
972334de520b0369215b7931fefa424fb92d295f0ebJames Dong        OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.
973334de520b0369215b7931fefa424fb92d295f0ebJames Dong    @ingroup comp
974334de520b0369215b7931fefa424fb92d295f0ebJames Dong */
975334de520b0369215b7931fefa424fb92d295f0ebJames Dong#define OMX_GetState(                                       \
976334de520b0369215b7931fefa424fb92d295f0ebJames Dong        hComponent,                                         \
977334de520b0369215b7931fefa424fb92d295f0ebJames Dong        pState)                                             \
978334de520b0369215b7931fefa424fb92d295f0ebJames Dong    ((OMX_COMPONENTTYPE*)hComponent)->GetState(             \
979334de520b0369215b7931fefa424fb92d295f0ebJames Dong        hComponent,                                         \
980334de520b0369215b7931fefa424fb92d295f0ebJames Dong        pState)                         /* Macro End */
981334de520b0369215b7931fefa424fb92d295f0ebJames Dong
982334de520b0369215b7931fefa424fb92d295f0ebJames Dong
983334de520b0369215b7931fefa424fb92d295f0ebJames Dong/** The OMX_UseBuffer macro will request that the component use
984a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar    a buffer (and allocate its own buffer header) already allocated
985a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar    by another component, or by the IL Client. This is a blocking
986334de520b0369215b7931fefa424fb92d295f0ebJames Dong    call.
987a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar
988334de520b0369215b7931fefa424fb92d295f0ebJames Dong    The component should return from this call within 20 msec.
989a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar
990334de520b0369215b7931fefa4