1826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev/*
2826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev * Copyright (c) 2008 The Khronos Group Inc.
3826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev *
4826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev * Permission is hereby granted, free of charge, to any person obtaining
5826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev * a copy of this software and associated documentation files (the
6826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev * "Software"), to deal in the Software without restriction, including
7826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev * without limitation the rights to use, copy, modify, merge, publish,
8826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev * distribute, sublicense, and/or sell copies of the Software, and to
9826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev * permit persons to whom the Software is furnished to do so, subject
10826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev * to the following conditions:
11826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev * The above copyright notice and this permission notice shall be included
12826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev * in all copies or substantial portions of the Software.
13826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev *
14826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
18826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev *
22826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev */
23826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
24826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev/** OMX_Core.h - OpenMax IL version 1.1.2
25826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev *  The OMX_Core header file contains the definitions used by both the
26826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev *  application and the component to access common items.
27826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev */
28826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
29826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev#ifndef OMX_Core_h
30826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev#define OMX_Core_h
31826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
32826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev#ifdef __cplusplus
33826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchevextern "C" {
34826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev#endif /* __cplusplus */
35826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
36826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
37826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev/* Each OMX header shall include all required header files to allow the
38826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev *  header to compile without errors.  The includes below are required
39826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev *  for this header file to compile successfully
40826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev */
41826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
42826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev#include <OMX_Index.h>
43826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
44826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
45826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev/** The OMX_COMMANDTYPE enumeration is used to specify the action in the
46826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev *  OMX_SendCommand macro.
47826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev *  @ingroup core
48826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev */
49826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchevtypedef enum OMX_COMMANDTYPE
50826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev{
51826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_CommandStateSet,    /**< Change the component state */
52826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_CommandFlush,       /**< Flush the data queue(s) of a component */
53826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_CommandPortDisable, /**< Disable a port on a component. */
54826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_CommandPortEnable,  /**< Enable a port on a component. */
55826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_CommandMarkBuffer,  /**< Mark a component/buffer for observation */
56826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_CommandKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
57826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_CommandVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
58826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_CommandMax = 0X7FFFFFFF
59826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev} OMX_COMMANDTYPE;
60826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
61826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
62826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
63826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev/** The OMX_STATETYPE enumeration is used to indicate or change the component
64826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev *  state.  This enumeration reflects the current state of the component when
65826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev *  used with the OMX_GetState macro or becomes the parameter in a state change
66826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev *  command when used with the OMX_SendCommand macro.
67826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev *
68826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev *  The component will be in the Loaded state after the component is initially
69826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev *  loaded into memory.  In the Loaded state, the component is not allowed to
70826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev *  allocate or hold resources other than to build it's internal parameter
71826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev *  and configuration tables.  The application will send one or more
72826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev *  SetParameters/GetParameters and SetConfig/GetConfig commands to the
73826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev *  component and the component will record each of these parameter and
74826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev *  configuration changes for use later.  When the application sends the
75826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev *  Idle command, the component will acquire the resources needed for the
76826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev *  specified configuration and will transition to the idle state if the
77826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev *  allocation is successful.  If the component cannot successfully
78826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev *  transition to the idle state for any reason, the state of the component
79826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev *  shall be fully rolled back to the Loaded state (e.g. all allocated
80826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev *  resources shall be released).  When the component receives the command
81826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev *  to go to the Executing state, it shall begin processing buffers by
82826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev *  sending all input buffers it holds to the application.  While
83826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev *  the component is in the Idle state, the application may also send the
84826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev *  Pause command.  If the component receives the pause command while in the
85826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev *  Idle state, the component shall send all input buffers it holds to the
86826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev *  application, but shall not begin processing buffers.  This will allow the
87826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev *  application to prefill buffers.
88826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev *
89826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev *  @ingroup comp
90826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev */
91826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
92826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchevtypedef enum OMX_STATETYPE
93826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev{
94826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_StateInvalid,      /**< component has detected that it's internal data
95826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev                                structures are corrupted to the point that
96826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev                                it cannot determine it's state properly */
97826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_StateLoaded,      /**< component has been loaded but has not completed
98826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev                                initialization.  The OMX_SetParameter macro
99826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev                                and the OMX_GetParameter macro are the only
100826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev                                valid macros allowed to be sent to the
101826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev                                component in this state. */
102826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_StateIdle,        /**< component initialization has been completed
103826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev                                successfully and the component is ready to
104826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev                                to start. */
105826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_StateExecuting,   /**< component has accepted the start command and
106826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev                                is processing data (if data is available) */
107826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_StatePause,       /**< component has received pause command */
108826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_StateWaitForResources, /**< component is waiting for resources, either after
109826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev                                preemption or before it gets the resources requested.
110826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev                                See specification for complete details. */
111826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_StateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
112826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_StateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
113826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_StateMax = 0X7FFFFFFF
114826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev} OMX_STATETYPE;
115826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
116826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev/** The OMX_ERRORTYPE enumeration defines the standard OMX Errors.  These
117826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev *  errors should cover most of the common failure cases.  However,
118826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev *  vendors are free to add additional error messages of their own as
119826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev *  long as they follow these rules:
120826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev *  1.  Vendor error messages shall be in the range of 0x90000000 to
121826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev *      0x9000FFFF.
122826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev *  2.  Vendor error messages shall be defined in a header file provided
123826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev *      with the component.  No error messages are allowed that are
124826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev *      not defined.
125826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev */
126826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchevtypedef enum OMX_ERRORTYPE
127826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev{
128826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  OMX_ErrorNone = 0,
129826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
130826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  /** There were insufficient resources to perform the requested operation */
131826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  OMX_ErrorInsufficientResources = (OMX_S32) 0x80001000,
132826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
133826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  /** There was an error, but the cause of the error could not be determined */
134826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  OMX_ErrorUndefined = (OMX_S32) 0x80001001,
135826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
136826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  /** The component name string was not valid */
137826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  OMX_ErrorInvalidComponentName = (OMX_S32) 0x80001002,
138826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
139826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  /** No component with the specified name string was found */
140826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  OMX_ErrorComponentNotFound = (OMX_S32) 0x80001003,
141826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
142826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  /** The component specified did not have a "OMX_ComponentInit" or
143826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev      "OMX_ComponentDeInit entry point */
144826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  OMX_ErrorInvalidComponent = (OMX_S32) 0x80001004,
145826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
146826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  /** One or more parameters were not valid */
147826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  OMX_ErrorBadParameter = (OMX_S32) 0x80001005,
148826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
149826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  /** The requested function is not implemented */
150826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  OMX_ErrorNotImplemented = (OMX_S32) 0x80001006,
151826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
152826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  /** The buffer was emptied before the next buffer was ready */
153826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  OMX_ErrorUnderflow = (OMX_S32) 0x80001007,
154826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
155826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  /** The buffer was not available when it was needed */
156826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  OMX_ErrorOverflow = (OMX_S32) 0x80001008,
157826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
158826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  /** The hardware failed to respond as expected */
159826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  OMX_ErrorHardware = (OMX_S32) 0x80001009,
160826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
161826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  /** The component is in the state OMX_StateInvalid */
162826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  OMX_ErrorInvalidState = (OMX_S32) 0x8000100A,
163826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
164826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  /** Stream is found to be corrupt */
165826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  OMX_ErrorStreamCorrupt = (OMX_S32) 0x8000100B,
166826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
167826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  /** Ports being connected are not compatible */
168826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  OMX_ErrorPortsNotCompatible = (OMX_S32) 0x8000100C,
169826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
170826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  /** Resources allocated to an idle component have been
171826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev      lost resulting in the component returning to the loaded state */
172826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  OMX_ErrorResourcesLost = (OMX_S32) 0x8000100D,
173826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
174826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  /** No more indicies can be enumerated */
175826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  OMX_ErrorNoMore = (OMX_S32) 0x8000100E,
176826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
177826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  /** The component detected a version mismatch */
178826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  OMX_ErrorVersionMismatch = (OMX_S32) 0x8000100F,
179826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
180826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  /** The component is not ready to return data at this time */
181826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  OMX_ErrorNotReady = (OMX_S32) 0x80001010,
182826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
183826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  /** There was a timeout that occurred */
184826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  OMX_ErrorTimeout = (OMX_S32) 0x80001011,
185826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
186826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  /** This error occurs when trying to transition into the state you are already in */
187826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  OMX_ErrorSameState = (OMX_S32) 0x80001012,
188826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
189826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  /** Resources allocated to an executing or paused component have been
190826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev      preempted, causing the component to return to the idle state */
191826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  OMX_ErrorResourcesPreempted = (OMX_S32) 0x80001013,
192826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
193826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  /** A non-supplier port sends this error to the IL client (via the EventHandler callback)
194826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev      during the allocation of buffers (on a transition from the LOADED to the IDLE state or
195826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev      on a port restart) when it deems that it has waited an unusually long time for the supplier
196826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev      to send it an allocated buffer via a UseBuffer call. */
197826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  OMX_ErrorPortUnresponsiveDuringAllocation = (OMX_S32) 0x80001014,
198826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
199826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  /** A non-supplier port sends this error to the IL client (via the EventHandler callback)
200826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev      during the deallocation of buffers (on a transition from the IDLE to LOADED state or
201826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev      on a port stop) when it deems that it has waited an unusually long time for the supplier
202826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev      to request the deallocation of a buffer header via a FreeBuffer call. */
203826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  OMX_ErrorPortUnresponsiveDuringDeallocation = (OMX_S32) 0x80001015,
204826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
205826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  /** A supplier port sends this error to the IL client (via the EventHandler callback)
206826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev      during the stopping of a port (either on a transition from the IDLE to LOADED
207826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev      state or a port stop) when it deems that it has waited an unusually long time for
208826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev      the non-supplier to return a buffer via an EmptyThisBuffer or FillThisBuffer call. */
209826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  OMX_ErrorPortUnresponsiveDuringStop = (OMX_S32) 0x80001016,
210826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
211826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  /** Attempting a state transtion that is not allowed */
212826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  OMX_ErrorIncorrectStateTransition = (OMX_S32) 0x80001017,
213826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
214826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  /* Attempting a command that is not allowed during the present state. */
215826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  OMX_ErrorIncorrectStateOperation = (OMX_S32) 0x80001018,
216826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
217826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  /** The values encapsulated in the parameter or config structure are not supported. */
218826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  OMX_ErrorUnsupportedSetting = (OMX_S32) 0x80001019,
219826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
220826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  /** The parameter or config indicated by the given index is not supported. */
221826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  OMX_ErrorUnsupportedIndex = (OMX_S32) 0x8000101A,
222826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
223826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  /** The port index supplied is incorrect. */
224826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  OMX_ErrorBadPortIndex = (OMX_S32) 0x8000101B,
225826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
226826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  /** The port has lost one or more of its buffers and it thus unpopulated. */
227826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  OMX_ErrorPortUnpopulated = (OMX_S32) 0x8000101C,
228826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
229826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  /** Component suspended due to temporary loss of resources */
230826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  OMX_ErrorComponentSuspended = (OMX_S32) 0x8000101D,
231826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
232826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  /** Component suspended due to an inability to acquire dynamic resources */
233826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  OMX_ErrorDynamicResourcesUnavailable = (OMX_S32) 0x8000101E,
234826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
235826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  /** When the macroblock error reporting is enabled the component returns new error
236826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  for every frame that has errors */
237826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  OMX_ErrorMbErrorsInFrame = (OMX_S32) 0x8000101F,
238826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
239826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  /** A component reports this error when it cannot parse or determine the format of an input stream. */
240826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  OMX_ErrorFormatNotDetected = (OMX_S32) 0x80001020,
241826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
242826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  /** The content open operation failed. */
243826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  OMX_ErrorContentPipeOpenFailed = (OMX_S32) 0x80001021,
244826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
245826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  /** The content creation operation failed. */
246826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  OMX_ErrorContentPipeCreationFailed = (OMX_S32) 0x80001022,
247826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
248826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  /** Separate table information is being used */
249826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  OMX_ErrorSeperateTablesUsed = (OMX_S32) 0x80001023,
250826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
251826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  /** Tunneling is unsupported by the component*/
252826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  OMX_ErrorTunnelingUnsupported = (OMX_S32) 0x80001024,
253826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
254826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  OMX_ErrorKhronosExtensions = (OMX_S32)0x8F000000, /**< Reserved region for introducing Khronos Standard Extensions */
255826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  OMX_ErrorVendorStartUnused = (OMX_S32)0x90000000, /**< Reserved region for introducing Vendor Extensions */
256826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  OMX_ErrorMax = 0x7FFFFFFF
257826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev} OMX_ERRORTYPE;
258826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
259826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev/** @ingroup core */
260826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchevtypedef OMX_ERRORTYPE (* OMX_COMPONENTINITTYPE)(OMX_IN  OMX_HANDLETYPE hComponent);
261826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
262826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev/** @ingroup core */
263826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchevtypedef struct OMX_COMPONENTREGISTERTYPE
264826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev{
265826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  const char          * pName;       /* Component name, 128 byte limit (including '\0') applies */
266826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  OMX_COMPONENTINITTYPE pInitialize; /* Component instance initialization function */
267826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev} OMX_COMPONENTREGISTERTYPE;
268826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
269826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev/** @ingroup core */
270826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchevextern OMX_COMPONENTREGISTERTYPE OMX_ComponentRegistered[];
271826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
272826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev/** @ingroup rpm */
273826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchevtypedef struct OMX_PRIORITYMGMTTYPE {
274826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev OMX_U32 nSize;             /**< size of the structure in bytes */
275826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev OMX_VERSIONTYPE nVersion;  /**< OMX specification version information */
276826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev OMX_U32 nGroupPriority;            /**< Priority of the component group */
277826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev OMX_U32 nGroupID;                  /**< ID of the component group */
278826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev} OMX_PRIORITYMGMTTYPE;
279826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
280826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev/* Component name and Role names are limited to 128 characters including the terminating '\0'. */
281826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev#define OMX_MAX_STRINGNAME_SIZE 128
282826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
283826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev/** @ingroup comp */
284826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchevtypedef struct OMX_PARAM_COMPONENTROLETYPE {
285826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_U32 nSize;              /**< size of the structure in bytes */
286826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_VERSIONTYPE nVersion;   /**< OMX specification version information */
287826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_U8 cRole[OMX_MAX_STRINGNAME_SIZE];  /**< name of standard component which defines component role */
288826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev} OMX_PARAM_COMPONENTROLETYPE;
289826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
290826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev/** End of Stream Buffer Flag:
291826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  *
292826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  * A component sets EOS when it has no more data to emit on a particular
293826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  * output port. Thus an output port shall set EOS on the last buffer it
294826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  * emits. A component's determination of when an output port should
295826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  * cease sending data is implemenation specific.
296826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  * @ingroup buf
297826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  */
298826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
299826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev#define OMX_BUFFERFLAG_EOS 0x00000001
300826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
301826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev/** Start Time Buffer Flag:
302826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev *
303826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev * The source of a stream (e.g. a demux component) sets the STARTTIME
304826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev * flag on the buffer that contains the starting timestamp for the
305826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev * stream. The starting timestamp corresponds to the first data that
306826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev * should be displayed at startup or after a seek.
307826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev * The first timestamp of the stream is not necessarily the start time.
308826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev * For instance, in the case of a seek to a particular video frame,
309826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev * the target frame may be an interframe. Thus the first buffer of
310826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev * the stream will be the intra-frame preceding the target frame and
311826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev * the starttime will occur with the target frame (with any other
312826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev * required frames required to reconstruct the target intervening).
313826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev *
314826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev * The STARTTIME flag is directly associated with the buffer's
315826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev * timestamp ' thus its association to buffer data and its
316826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev * propagation is identical to the timestamp's.
317826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev *
318826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev * When a Sync Component client receives a buffer with the
319826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev * STARTTIME flag it shall perform a SetConfig on its sync port
320826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev * using OMX_ConfigTimeClientStartTime and passing the buffer's
321826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev * timestamp.
322826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev *
323826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev * @ingroup buf
324826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev */
325826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
326826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev#define OMX_BUFFERFLAG_STARTTIME 0x00000002
327826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
328826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
329826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
330826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev/** Decode Only Buffer Flag:
331826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev *
332826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev * The source of a stream (e.g. a demux component) sets the DECODEONLY
333826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev * flag on any buffer that should shall be decoded but should not be
334826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev * displayed. This flag is used, for instance, when a source seeks to
335826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev * a target interframe that requires the decode of frames preceding the
336826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev * target to facilitate the target's reconstruction. In this case the
337826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev * source would emit the frames preceding the target downstream
338826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev * but mark them as decode only.
339826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev *
340826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev * The DECODEONLY is associated with buffer data and propagated in a
341826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev * manner identical to the buffer timestamp.
342826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev *
343826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev * A component that renders data should ignore all buffers with
344826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev * the DECODEONLY flag set.
345826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev *
346826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev * @ingroup buf
347826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev */
348826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
349826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev#define OMX_BUFFERFLAG_DECODEONLY 0x00000004
350826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
351826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
352826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev/* Data Corrupt Flag: This flag is set when the IL client believes the data in the associated buffer is corrupt
353826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev * @ingroup buf
354826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev */
355826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
356826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev#define OMX_BUFFERFLAG_DATACORRUPT 0x00000008
357826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
358826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev/* End of Frame: The buffer contains exactly one end of frame and no data
359826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev *  occurs after the end of frame. This flag is an optional hint. The absence
360826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev *  of this flag does not imply the absence of an end of frame within the buffer.
361826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev * @ingroup buf
362826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev*/
363826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev#define OMX_BUFFERFLAG_ENDOFFRAME 0x00000010
364826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
365826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev/* Sync Frame Flag: This flag is set when the buffer content contains a coded sync frame '
366826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev *  a frame that has no dependency on any other frame information
367826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev *  @ingroup buf
368826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev */
369826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev#define OMX_BUFFERFLAG_SYNCFRAME 0x00000020
370826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
371826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev/* Extra data present flag: there is extra data appended to the data stream
372826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev * residing in the buffer
373826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev * @ingroup buf
374826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev */
375826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev#define OMX_BUFFERFLAG_EXTRADATA 0x00000040
376826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
377826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev/** Codec Config Buffer Flag:
378826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev* OMX_BUFFERFLAG_CODECCONFIG is an optional flag that is set by an
379826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev* output port when all bytes in the buffer form part or all of a set of
380826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev* codec specific configuration data.  Examples include SPS/PPS nal units
381826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev* for OMX_VIDEO_CodingAVC or AudioSpecificConfig data for
382826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev* OMX_AUDIO_CodingAAC.  Any component that for a given stream sets
383826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev* OMX_BUFFERFLAG_CODECCONFIG shall not mix codec configuration bytes
384826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev* with frame data in the same buffer, and shall send all buffers
385826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev* containing codec configuration bytes before any buffers containing
386826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev* frame data that those configurations bytes describe.
387826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev* If the stream format for a particular codec has a frame specific
388826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev* header at the start of each frame, for example OMX_AUDIO_CodingMP3 or
389826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev* OMX_AUDIO_CodingAAC in ADTS mode, then these shall be presented as
390826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev* normal without setting OMX_BUFFERFLAG_CODECCONFIG.
391826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev * @ingroup buf
392826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev */
393826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev#define OMX_BUFFERFLAG_CODECCONFIG 0x00000080
394826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
395826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
396826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
397826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev/** @ingroup buf */
398826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchevtypedef struct OMX_BUFFERHEADERTYPE
399826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev{
400826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_U32 nSize;              /**< size of the structure in bytes */
401826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_VERSIONTYPE nVersion;   /**< OMX specification version information */
402826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_U8* pBuffer;            /**< Pointer to actual block of memory
403826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev                                     that is acting as the buffer */
404826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_U32 nAllocLen;          /**< size of the buffer allocated, in bytes */
405826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_U32 nFilledLen;         /**< number of bytes currently in the
406826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev                                     buffer */
407826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_U32 nOffset;            /**< start offset of valid data in bytes from
408826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev                                     the start of the buffer */
409826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_PTR pAppPrivate;        /**< pointer to any data the application
410826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev                                     wants to associate with this buffer */
411826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_PTR pPlatformPrivate;   /**< pointer to any data the platform
412826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev                                     wants to associate with this buffer */
413826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_PTR pInputPortPrivate;  /**< pointer to any data the input port
414826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev                                     wants to associate with this buffer */
415826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_PTR pOutputPortPrivate; /**< pointer to any data the output port
416826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev                                     wants to associate with this buffer */
417826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_HANDLETYPE hMarkTargetComponent; /**< The component that will generate a
418826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev                                              mark event upon processing this buffer. */
419826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_PTR pMarkData;          /**< Application specific data associated with
420826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev                                     the mark sent on a mark event to disambiguate
421826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev                                     this mark from others. */
422826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_U32 nTickCount;         /**< Optional entry that the component and
423826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev                                     application can update with a tick count
424826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev                                     when they access the component.  This
425826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev                                     value should be in microseconds.  Since
426826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev                                     this is a value relative to an arbitrary
427826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev                                     starting point, this value cannot be used
428826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev                                     to determine absolute time.  This is an
429826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev                                     optional entry and not all components
430826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev                                     will update it.*/
431826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev OMX_TICKS nTimeStamp;          /**< Timestamp corresponding to the sample
432826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev                                     starting at the first logical sample
433826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev                                     boundary in the buffer. Timestamps of
434826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev                                     successive samples within the buffer may
435826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev                                     be inferred by adding the duration of the
436826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev                                     of the preceding buffer to the timestamp
437826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev                                     of the preceding buffer.*/
438826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  OMX_U32     nFlags;           /**< buffer specific flags */
439826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  OMX_U32 nOutputPortIndex;     /**< The index of the output port (if any) using
440826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev                                     this buffer */
441826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev  OMX_U32 nInputPortIndex;      /**< The index of the input port (if any) using
442826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev                                     this buffer */
443826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev} OMX_BUFFERHEADERTYPE;
444826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
445826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev/** The OMX_EXTRADATATYPE enumeration is used to define the
446826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev * possible extra data payload types.
447826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev * NB: this enum is binary backwards compatible with the previous
448826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev * OMX_EXTRADATA_QUANT define.  This should be replaced with
449826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev * OMX_ExtraDataQuantization.
450826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev */
451826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchevtypedef enum OMX_EXTRADATATYPE
452826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev{
453826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev   OMX_ExtraDataNone = 0,                       /**< Indicates that no more extra data sections follow */
454826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev   OMX_ExtraDataQuantization,                   /**< The data payload contains quantization data */
455826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev   OMX_ExtraDataKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
456826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev   OMX_ExtraDataVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
457826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev   OMX_ExtraDataMax = 0x7FFFFFFF
458826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev} OMX_EXTRADATATYPE;
459826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
460826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
461826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchevtypedef struct OMX_OTHER_EXTRADATATYPE  {
462826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_U32 nSize;
463826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_VERSIONTYPE nVersion;
464826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_U32 nPortIndex;
465826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_EXTRADATATYPE eType;       /* Extra Data type */
466826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_U32 nDataSize;   /* Size of the supporting data to follow */
467826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_U8  data[1];     /* Supporting data hint  */
468826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev} OMX_OTHER_EXTRADATATYPE;
469826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
470826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev/** @ingroup comp */
471826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchevtypedef struct OMX_PORT_PARAM_TYPE {
472826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_U32 nSize;              /**< size of the structure in bytes */
473826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_VERSIONTYPE nVersion;   /**< OMX specification version information */
474826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_U32 nPorts;             /**< The number of ports for this component */
475826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_U32 nStartPortNumber;   /** first port number for this type of port */
476826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev} OMX_PORT_PARAM_TYPE;
477826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
478826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev/** @ingroup comp */
479826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchevtypedef enum OMX_EVENTTYPE
480826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev{
481826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_EventCmdComplete,         /**< component has sucessfully completed a command */
482826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_EventError,               /**< component has detected an error condition */
483826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_EventMark,                /**< component has detected a buffer mark */
484826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_EventPortSettingsChanged, /**< component is reported a port settings change */
485826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_EventBufferFlag,          /**< component has detected an EOS */
486826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_EventResourcesAcquired,   /**< component has been granted resources and is
487826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev                                       automatically starting the state change from
488826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev                                       OMX_StateWaitForResources to OMX_StateIdle. */
489826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev   OMX_EventComponentResumed,     /**< Component resumed due to reacquisition of resources */
490826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev   OMX_EventDynamicResourcesAvailable, /**< Component has acquired previously unavailable dynamic resources */
491826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev   OMX_EventPortFormatDetected,      /**< Component has detected a supported format. */
492826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev   OMX_EventKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
493826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev   OMX_EventVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
494826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev   OMX_EventMax = 0x7FFFFFFF
495826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev} OMX_EVENTTYPE;
496826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
497826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchevtypedef struct OMX_CALLBACKTYPE
498826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev{
499826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    /** The EventHandler method is used to notify the application when an
500826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        event of interest occurs.  Events are defined in the OMX_EVENTTYPE
501826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        enumeration.  Please see that enumeration for details of what will
502826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        be returned for each type of event. Callbacks should not return
503826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        an error to the component, so if an error occurs, the application
504826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        shall handle it internally.  This is a blocking call.
505826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
506826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        The application should return from this call within 5 msec to avoid
507826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        blocking the component for an excessively long period of time.
508826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
509826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        @param hComponent
510826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev            handle of the component to access.  This is the component
511826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev            handle returned by the call to the GetHandle function.
512826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        @param pAppData
513826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev            pointer to an application defined value that was provided in the
514826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev            pAppData parameter to the OMX_GetHandle method for the component.
515826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev            This application defined value is provided so that the application
516826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev            can have a component specific context when receiving the callback.
517826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        @param eEvent
518826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev            Event that the component wants to notify the application about.
519826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        @param nData1
520826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev            nData will be the OMX_ERRORTYPE for an error event and will be
521826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev            an OMX_COMMANDTYPE for a command complete event and OMX_INDEXTYPE for a OMX_PortSettingsChanged event.
522826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev         @param nData2
523826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev            nData2 will hold further information related to the event. Can be OMX_STATETYPE for
524826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev            a OMX_CommandStateSet command or port index for a OMX_PortSettingsChanged event.
525826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev            Default value is 0 if not used. )
526826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        @param pEventData
527826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev            Pointer to additional event-specific data (see spec for meaning).
528826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev      */
529826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
530826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev   OMX_ERRORTYPE (*EventHandler)(
531826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        OMX_IN OMX_HANDLETYPE hComponent,
532826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        OMX_IN OMX_PTR pAppData,
533826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        OMX_IN OMX_EVENTTYPE eEvent,
534826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        OMX_IN OMX_U32 nData1,
535826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        OMX_IN OMX_U32 nData2,
536826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        OMX_IN OMX_PTR pEventData);
537826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
538826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    /** The EmptyBufferDone method is used to return emptied buffers from an
539826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        input port back to the application for reuse.  This is a blocking call
540826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        so the application should not attempt to refill the buffers during this
541826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        call, but should queue them and refill them in another thread.  There
542826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        is no error return, so the application shall handle any errors generated
543826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        internally.
544826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
545826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        The application should return from this call within 5 msec.
546826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
547826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        @param hComponent
548826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev            handle of the component to access.  This is the component
549826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev            handle returned by the call to the GetHandle function.
550826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        @param pAppData
551826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev            pointer to an application defined value that was provided in the
552826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev            pAppData parameter to the OMX_GetHandle method for the component.
553826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev            This application defined value is provided so that the application
554826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev            can have a component specific context when receiving the callback.
555826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        @param pBuffer
556826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev            pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer
557826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev            or AllocateBuffer indicating the buffer that was emptied.
558826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        @ingroup buf
559826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev     */
560826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_ERRORTYPE (*EmptyBufferDone)(
561826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        OMX_IN OMX_HANDLETYPE hComponent,
562826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        OMX_IN OMX_PTR pAppData,
563826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        OMX_IN OMX_BUFFERHEADERTYPE* pBuffer);
564826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
565826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    /** The FillBufferDone method is used to return filled buffers from an
566826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        output port back to the application for emptying and then reuse.
567826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        This is a blocking call so the application should not attempt to
568826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        empty the buffers during this call, but should queue the buffers
569826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        and empty them in another thread.  There is no error return, so
570826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        the application shall handle any errors generated internally.  The
571826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        application shall also update the buffer header to indicate the
572826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        number of bytes placed into the buffer.
573826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
574826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        The application should return from this call within 5 msec.
575826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
576826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        @param hComponent
577826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev            handle of the component to access.  This is the component
578826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev            handle returned by the call to the GetHandle function.
579826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        @param pAppData
580826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev            pointer to an application defined value that was provided in the
581826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev            pAppData parameter to the OMX_GetHandle method for the component.
582826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev            This application defined value is provided so that the application
583826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev            can have a component specific context when receiving the callback.
584826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        @param pBuffer
585826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev            pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer
586826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev            or AllocateBuffer indicating the buffer that was filled.
587826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        @ingroup buf
588826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev     */
589826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_ERRORTYPE (*FillBufferDone)(
590826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        OMX_OUT OMX_HANDLETYPE hComponent,
591826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        OMX_OUT OMX_PTR pAppData,
592826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        OMX_OUT OMX_BUFFERHEADERTYPE* pBuffer);
593826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
594826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev} OMX_CALLBACKTYPE;
595826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
596826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev/** The OMX_BUFFERSUPPLIERTYPE enumeration is used to dictate port supplier
597826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    preference when tunneling between two ports.
598826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @ingroup tun buf
599826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev*/
600826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchevtypedef enum OMX_BUFFERSUPPLIERTYPE
601826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev{
602826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_BufferSupplyUnspecified = 0x0, /**< port supplying the buffers is unspecified,
603826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev                                              or don't care */
604826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_BufferSupplyInput,             /**< input port supplies the buffers */
605826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_BufferSupplyOutput,            /**< output port supplies the buffers */
606826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_BufferSupplyKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
607826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_BufferSupplyVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
608826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_BufferSupplyMax = 0x7FFFFFFF
609826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev} OMX_BUFFERSUPPLIERTYPE;
610826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
611826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
612826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev/** buffer supplier parameter
613826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev * @ingroup tun
614826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev */
615826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchevtypedef struct OMX_PARAM_BUFFERSUPPLIERTYPE {
616826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_U32 nSize; /**< size of the structure in bytes */
617826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
618826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_U32 nPortIndex; /**< port that this structure applies to */
619826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_BUFFERSUPPLIERTYPE eBufferSupplier; /**< buffer supplier */
620826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev} OMX_PARAM_BUFFERSUPPLIERTYPE;
621826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
622826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
623826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev/**< indicates that buffers received by an input port of a tunnel
624826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev     may not modify the data in the buffers
625826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev     @ingroup tun
626826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev */
627826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev#define OMX_PORTTUNNELFLAG_READONLY 0x00000001
628826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
629826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
630826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev/** The OMX_TUNNELSETUPTYPE structure is used to pass data from an output
631826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    port to an input port as part the two ComponentTunnelRequest calls
632826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    resulting from a OMX_SetupTunnel call from the IL Client.
633826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @ingroup tun
634826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev */
635826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchevtypedef struct OMX_TUNNELSETUPTYPE
636826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev{
637826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_U32 nTunnelFlags;             /**< bit flags for tunneling */
638826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_BUFFERSUPPLIERTYPE eSupplier; /**< supplier preference */
639826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev} OMX_TUNNELSETUPTYPE;
640826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
641826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev/* OMX Component headers is included to enable the core to use
642826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev   macros for functions into the component for OMX release 1.0.
643826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev   Developers should not access any structures or data from within
644826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev   the component header directly */
645826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev/* TO BE REMOVED - #include <OMX_Component.h> */
646826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
647826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev/** GetComponentVersion will return information about the component.
648826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    This is a blocking call.  This macro will go directly from the
649826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    application to the component (via a core macro).  The
650826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    component will return from this call within 5 msec.
651826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @param [in] hComponent
652826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        handle of component to execute the command
653826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @param [out] pComponentName
654826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        pointer to an empty string of length 128 bytes.  The component
655826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        will write its name into this string.  The name will be
656826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        terminated by a single zero byte.  The name of a component will
657826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        be 127 bytes or less to leave room for the trailing zero byte.
658826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        An example of a valid component name is "OMX.ABC.ChannelMixer\0".
659826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @param [out] pComponentVersion
660826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        pointer to an OMX Version structure that the component will fill
661826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        in.  The component will fill in a value that indicates the
662826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        component version.  NOTE: the component version is NOT the same
663826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        as the OMX Specification version (found in all structures).  The
664826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        component version is defined by the vendor of the component and
665826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        its value is entirely up to the component vendor.
666826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @param [out] pSpecVersion
667826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        pointer to an OMX Version structure that the component will fill
668826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        in.  The SpecVersion is the version of the specification that the
669826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        component was built against.  Please note that this value may or
670826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        may not match the structure's version.  For example, if the
671826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        component was built against the 2.0 specification, but the
672826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        application (which creates the structure is built against the
673826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        1.0 specification the versions would be different.
674826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @param [out] pComponentUUID
675826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        pointer to the UUID of the component which will be filled in by
676826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        the component.  The UUID is a unique identifier that is set at
677826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        RUN time for the component and is unique to each instantion of
678826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        the component.
679826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @return OMX_ERRORTYPE
680826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        If the command successfully executes, the return code will be
681826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.
682826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @ingroup comp
683826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev */
684826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev#define OMX_GetComponentVersion(                            \
685826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        hComponent,                                         \
686826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        pComponentName,                                     \
687826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        pComponentVersion,                                  \
688826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        pSpecVersion,                                       \
689826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        pComponentUUID)                                     \
690826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    ((OMX_COMPONENTTYPE*)hComponent)->GetComponentVersion(  \
691826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        hComponent,                                         \
692826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        pComponentName,                                     \
693826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        pComponentVersion,                                  \
694826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        pSpecVersion,                                       \
695826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        pComponentUUID)                 /* Macro End */
696826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
697826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
698826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev/** Send a command to the component.  This call is a non-blocking call.
699826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    The component should check the parameters and then queue the command
700826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    to the component thread to be executed.  The component thread shall
701826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    send the EventHandler() callback at the conclusion of the command.
702826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    This macro will go directly from the application to the component (via
703826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    a core macro).  The component will return from this call within 5 msec.
704826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
705826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    When the command is "OMX_CommandStateSet" the component will queue a
706826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    state transition to the new state idenfied in nParam.
707826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
708826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    When the command is "OMX_CommandFlush", to flush a port's buffer queues,
709826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    the command will force the component to return all buffers NOT CURRENTLY
710826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    BEING PROCESSED to the application, in the order in which the buffers
711826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    were received.
712826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
713826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    When the command is "OMX_CommandPortDisable" or
714826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    "OMX_CommandPortEnable", the component's port (given by the value of
715826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    nParam) will be stopped or restarted.
716826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
717826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    When the command "OMX_CommandMarkBuffer" is used to mark a buffer, the
718826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    pCmdData will point to a OMX_MARKTYPE structure containing the component
719826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    handle of the component to examine the buffer chain for the mark.  nParam1
720826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    contains the index of the port on which the buffer mark is applied.
721826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
722826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    Specification text for more details.
723826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
724826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @param [in] hComponent
725826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        handle of component to execute the command
726826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @param [in] Cmd
727826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        Command for the component to execute
728826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @param [in] nParam
729826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        Parameter for the command to be executed.  When Cmd has the value
730826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        OMX_CommandStateSet, value is a member of OMX_STATETYPE.  When Cmd has
731826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        the value OMX_CommandFlush, value of nParam indicates which port(s)
732826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        to flush. -1 is used to flush all ports a single port index will
733826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        only flush that port.  When Cmd has the value "OMX_CommandPortDisable"
734826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        or "OMX_CommandPortEnable", the component's port is given by
735826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        the value of nParam.  When Cmd has the value "OMX_CommandMarkBuffer"
736826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        the components pot is given by the value of nParam.
737826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @param [in] pCmdData
738826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        Parameter pointing to the OMX_MARKTYPE structure when Cmd has the value
739826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        "OMX_CommandMarkBuffer".
740826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @return OMX_ERRORTYPE
741826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        If the command successfully executes, the return code will be
742826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.
743826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @ingroup comp
744826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev */
745826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev#define OMX_SendCommand(                                    \
746826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev         hComponent,                                        \
747826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev         Cmd,                                               \
748826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev         nParam,                                            \
749826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev         pCmdData)                                          \
750826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev     ((OMX_COMPONENTTYPE*)hComponent)->SendCommand(         \
751826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev         hComponent,                                        \
752826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev         Cmd,                                               \
753826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev         nParam,                                            \
754826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev         pCmdData)                          /* Macro End */
755826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
756826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
757826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev/** The OMX_GetParameter macro will get one of the current parameter
758826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    settings from the component.  This macro cannot only be invoked when
759826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    the component is in the OMX_StateInvalid state.  The nParamIndex
760826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    parameter is used to indicate which structure is being requested from
761826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    the component.  The application shall allocate the correct structure
762826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    and shall fill in the structure size and version information before
763826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    invoking this macro.  When the parameter applies to a port, the
764826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    caller shall fill in the appropriate nPortIndex value indicating the
765826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    port on which the parameter applies. If the component has not had
766826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    any settings changed, then the component should return a set of
767826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    valid DEFAULT  parameters for the component.  This is a blocking
768826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    call.
769826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
770826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    The component should return from this call within 20 msec.
771826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
772826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @param [in] hComponent
773826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        Handle of the component to be accessed.  This is the component
774826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        handle returned by the call to the OMX_GetHandle function.
775826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @param [in] nParamIndex
776826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        Index of the structure to be filled.  This value is from the
777826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        OMX_INDEXTYPE enumeration.
778826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @param [in,out] pComponentParameterStructure
779826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        Pointer to application allocated structure to be filled by the
780826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        component.
781826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @return OMX_ERRORTYPE
782826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        If the command successfully executes, the return code will be
783826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.
784826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @ingroup comp
785826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev */
786826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev#define OMX_GetParameter(                                   \
787826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        hComponent,                                         \
788826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        nParamIndex,                                        \
789826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        pComponentParameterStructure)                        \
790826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    ((OMX_COMPONENTTYPE*)hComponent)->GetParameter(         \
791826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        hComponent,                                         \
792826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        nParamIndex,                                        \
793826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        pComponentParameterStructure)    /* Macro End */
794826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
795826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
796826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev/** The OMX_SetParameter macro will send an initialization parameter
797826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    structure to a component.  Each structure shall be sent one at a time,
798826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    in a separate invocation of the macro.  This macro can only be
799826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    invoked when the component is in the OMX_StateLoaded state, or the
800826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    port is disabled (when the parameter applies to a port). The
801826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    nParamIndex parameter is used to indicate which structure is being
802826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    passed to the component.  The application shall allocate the
803826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    correct structure and shall fill in the structure size and version
804826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    information (as well as the actual data) before invoking this macro.
805826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    The application is free to dispose of this structure after the call
806826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    as the component is required to copy any data it shall retain.  This
807826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    is a blocking call.
808826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
809826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    The component should return from this call within 20 msec.
810826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
811826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @param [in] hComponent
812826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        Handle of the component to be accessed.  This is the component
813826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        handle returned by the call to the OMX_GetHandle function.
814826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @param [in] nIndex
815826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        Index of the structure to be sent.  This value is from the
816826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        OMX_INDEXTYPE enumeration.
817826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @param [in] pComponentParameterStructure
818826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        pointer to application allocated structure to be used for
819826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        initialization by the component.
820826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @return OMX_ERRORTYPE
821826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        If the command successfully executes, the return code will be
822826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.
823826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @ingroup comp
824826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev */
825826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev#define OMX_SetParameter(                                   \
826826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        hComponent,                                         \
827826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        nParamIndex,                                        \
828826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        pComponentParameterStructure)                        \
829826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    ((OMX_COMPONENTTYPE*)hComponent)->SetParameter(         \
830826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        hComponent,                                         \
831826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        nParamIndex,                                        \
832826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        pComponentParameterStructure)    /* Macro End */
833826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
834826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
835826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev/** The OMX_GetConfig macro will get one of the configuration structures
836826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    from a component.  This macro can be invoked anytime after the
837826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    component has been loaded.  The nParamIndex call parameter is used to
838826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    indicate which structure is being requested from the component.  The
839826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    application shall allocate the correct structure and shall fill in the
840826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    structure size and version information before invoking this macro.
841826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    If the component has not had this configuration parameter sent before,
842826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    then the component should return a set of valid DEFAULT values for the
843826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    component.  This is a blocking call.
844826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
845826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    The component should return from this call within 5 msec.
846826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
847826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @param [in] hComponent
848826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        Handle of the component to be accessed.  This is the component
849826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        handle returned by the call to the OMX_GetHandle function.
850826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @param [in] nIndex
851826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        Index of the structure to be filled.  This value is from the
852826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        OMX_INDEXTYPE enumeration.
853826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @param [in,out] pComponentConfigStructure
854826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        pointer to application allocated structure to be filled by the
855826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        component.
856826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @return OMX_ERRORTYPE
857826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        If the command successfully executes, the return code will be
858826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.
859826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @ingroup comp
860826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev*/
861826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev#define OMX_GetConfig(                                      \
862826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        hComponent,                                         \
863826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        nConfigIndex,                                       \
864826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        pComponentConfigStructure)                           \
865826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    ((OMX_COMPONENTTYPE*)hComponent)->GetConfig(            \
866826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        hComponent,                                         \
867826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        nConfigIndex,                                       \
868826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        pComponentConfigStructure)       /* Macro End */
869826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
870826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
871826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev/** The OMX_SetConfig macro will send one of the configuration
872826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    structures to a component.  Each structure shall be sent one at a time,
873826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    each in a separate invocation of the macro.  This macro can be invoked
874826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    anytime after the component has been loaded.  The application shall
875826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    allocate the correct structure and shall fill in the structure size
876826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    and version information (as well as the actual data) before invoking
877826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    this macro.  The application is free to dispose of this structure after
878826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    the call as the component is required to copy any data it shall retain.
879826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    This is a blocking call.
880826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
881826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    The component should return from this call within 5 msec.
882826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
883826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @param [in] hComponent
884826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        Handle of the component to be accessed.  This is the component
885826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        handle returned by the call to the OMX_GetHandle function.
886826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @param [in] nConfigIndex
887826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        Index of the structure to be sent.  This value is from the
888826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        OMX_INDEXTYPE enumeration above.
889826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @param [in] pComponentConfigStructure
890826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        pointer to application allocated structure to be used for
891826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        initialization by the component.
892826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @return OMX_ERRORTYPE
893826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        If the command successfully executes, the return code will be
894826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.
895826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @ingroup comp
896826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev */
897826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev#define OMX_SetConfig(                                      \
898826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        hComponent,                                         \
899826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        nConfigIndex,                                       \
900826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        pComponentConfigStructure)                           \
901826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    ((OMX_COMPONENTTYPE*)hComponent)->SetConfig(            \
902826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        hComponent,                                         \
903826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        nConfigIndex,                                       \
904826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        pComponentConfigStructure)       /* Macro End */
905826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
906826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
907826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev/** The OMX_GetExtensionIndex macro will invoke a component to translate
908826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    a vendor specific configuration or parameter string into an OMX
909826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    structure index.  There is no requirement for the vendor to support
910826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    this command for the indexes already found in the OMX_INDEXTYPE
911826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    enumeration (this is done to save space in small components).  The
912826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    component shall support all vendor supplied extension indexes not found
913826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    in the master OMX_INDEXTYPE enumeration.  This is a blocking call.
914826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
915826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    The component should return from this call within 5 msec.
916826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
917826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @param [in] hComponent
918826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        Handle of the component to be accessed.  This is the component
919826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        handle returned by the call to the GetHandle function.
920826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @param [in] cParameterName
921826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        OMX_STRING that shall be less than 128 characters long including
922826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        the trailing null byte.  This is the string that will get
923826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        translated by the component into a configuration index.
924826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @param [out] pIndexType
925826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        a pointer to a OMX_INDEXTYPE to receive the index value.
926826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @return OMX_ERRORTYPE
927826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        If the command successfully executes, the return code will be
928826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.
929826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @ingroup comp
930826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev */
931826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev#define OMX_GetExtensionIndex(                              \
932826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        hComponent,                                         \
933826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        cParameterName,                                     \
934826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        pIndexType)                                         \
935826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    ((OMX_COMPONENTTYPE*)hComponent)->GetExtensionIndex(    \
936826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        hComponent,                                         \
937826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        cParameterName,                                     \
938826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        pIndexType)                     /* Macro End */
939826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
940826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
941826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev/** The OMX_GetState macro will invoke the component to get the current
942826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    state of the component and place the state value into the location
943826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    pointed to by pState.
944826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
945826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    The component should return from this call within 5 msec.
946826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
947826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @param [in] hComponent
948826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        Handle of the component to be accessed.  This is the component
949826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        handle returned by the call to the OMX_GetHandle function.
950826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @param [out] pState
951826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        pointer to the location to receive the state.  The value returned
952826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        is one of the OMX_STATETYPE members
953826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @return OMX_ERRORTYPE
954826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        If the command successfully executes, the return code will be
955826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.
956826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @ingroup comp
957826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev */
958826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev#define OMX_GetState(                                       \
959826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        hComponent,                                         \
960826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        pState)                                             \
961826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    ((OMX_COMPONENTTYPE*)hComponent)->GetState(             \
962826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        hComponent,                                         \
963826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        pState)                         /* Macro End */
964826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
965826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
966826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev/** The OMX_UseBuffer macro will request that the component use
967826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    a buffer (and allocate its own buffer header) already allocated
968826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    by another component, or by the IL Client. This is a blocking
969826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    call.
970826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
971826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    The component should return from this call within 20 msec.
972826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
973826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @param [in] hComponent
974826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        Handle of the component to be accessed.  This is the component
975826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        handle returned by the call to the OMX_GetHandle function.
976826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @param [out] ppBuffer
977826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        pointer to an OMX_BUFFERHEADERTYPE structure used to receive the
978826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        pointer to the buffer header
979826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @return OMX_ERRORTYPE
980826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        If the command successfully executes, the return code will be
981826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.
982826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @ingroup comp buf
983826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev */
984826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
985826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev#define OMX_UseBuffer(                                      \
986826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev           hComponent,                                      \
987826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev           ppBufferHdr,                                     \
988826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev           nPortIndex,                                      \
989826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev           pAppPrivate,                                     \
990826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev           nSizeBytes,                                      \
991826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev           pBuffer)                                         \
992826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    ((OMX_COMPONENTTYPE*)hComponent)->UseBuffer(            \
993826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev           hComponent,                                      \
994826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev           ppBufferHdr,                                     \
995826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev           nPortIndex,                                      \
996826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev           pAppPrivate,                                     \
997826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev           nSizeBytes,                                      \
998826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev           pBuffer)
999826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
1000826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
1001826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev/** The OMX_AllocateBuffer macro will request that the component allocate
1002826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    a new buffer and buffer header.  The component will allocate the
1003826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    buffer and the buffer header and return a pointer to the buffer
1004826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    header.  This is a blocking call.
1005826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
1006826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    The component should return from this call within 5 msec.
1007826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
1008826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @param [in] hComponent
1009826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        Handle of the component to be accessed.  This is the component
1010826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        handle returned by the call to the OMX_GetHandle function.
1011826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @param [out] ppBuffer
1012826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        pointer to an OMX_BUFFERHEADERTYPE structure used to receive
1013826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        the pointer to the buffer header
1014826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @param [in] nPortIndex
1015826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        nPortIndex is used to select the port on the component the buffer will
1016826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        be used with.  The port can be found by using the nPortIndex
1017826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        value as an index into the Port Definition array of the component.
1018826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @param [in] pAppPrivate
1019826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        pAppPrivate is used to initialize the pAppPrivate member of the
1020826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        buffer header structure.
1021826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @param [in] nSizeBytes
1022826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        size of the buffer to allocate.  Used when bAllocateNew is true.
1023826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @return OMX_ERRORTYPE
1024826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        If the command successfully executes, the return code will be
1025826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.
1026826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @ingroup comp buf
1027826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev */
1028826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev#define OMX_AllocateBuffer(                                 \
1029826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        hComponent,                                         \
1030826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        ppBuffer,                                           \
1031826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        nPortIndex,                                         \
1032826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        pAppPrivate,                                        \
1033826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        nSizeBytes)                                         \
1034826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    ((OMX_COMPONENTTYPE*)hComponent)->AllocateBuffer(       \
1035826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        hComponent,                                         \
1036826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        ppBuffer,                                           \
1037826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        nPortIndex,                                         \
1038826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        pAppPrivate,                                        \
1039826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        nSizeBytes)                     /* Macro End */
1040826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
1041826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
1042826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev/** The OMX_FreeBuffer macro will release a buffer header from the component
1043826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    which was allocated using either OMX_AllocateBuffer or OMX_UseBuffer. If
1044826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    the component allocated the buffer (see the OMX_UseBuffer macro) then
1045826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    the component shall free the buffer and buffer header. This is a
1046826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    blocking call.
1047826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
1048826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    The component should return from this call within 20 msec.
1049826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
1050826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @param [in] hComponent
1051826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        Handle of the component to be accessed.  This is the component
1052826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        handle returned by the call to the OMX_GetHandle function.
1053826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @param [in] nPortIndex
1054826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        nPortIndex is used to select the port on the component the buffer will
1055826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        be used with.
1056826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @param [in] pBuffer
1057826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer
1058826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        or AllocateBuffer.
1059826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @return OMX_ERRORTYPE
1060826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        If the command successfully executes, the return code will be
1061826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.
1062826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @ingroup comp buf
1063826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev */
1064826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev#define OMX_FreeBuffer(                                     \
1065826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        hComponent,                                         \
1066826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        nPortIndex,                                         \
1067826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        pBuffer)                                            \
1068826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    ((OMX_COMPONENTTYPE*)hComponent)->FreeBuffer(           \
1069826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        hComponent,                                         \
1070826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        nPortIndex,                                         \
1071826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        pBuffer)                        /* Macro End */
1072826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
1073826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
1074826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev/** The OMX_EmptyThisBuffer macro will send a buffer full of data to an
1075826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    input port of a component.  The buffer will be emptied by the component
1076826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    and returned to the application via the EmptyBufferDone call back.
1077826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    This is a non-blocking call in that the component will record the buffer
1078826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    and return immediately and then empty the buffer, later, at the proper
1079826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    time.  As expected, this macro may be invoked only while the component
1080826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    is in the OMX_StateExecuting.  If nPortIndex does not specify an input
1081826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    port, the component shall return an error.
1082826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
1083826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    The component should return from this call within 5 msec.
1084826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
1085826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @param [in] hComponent
1086826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        Handle of the component to be accessed.  This is the component
1087826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        handle returned by the call to the OMX_GetHandle function.
1088826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @param [in] pBuffer
1089826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer
1090826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        or AllocateBuffer.
1091826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @return OMX_ERRORTYPE
1092826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        If the command successfully executes, the return code will be
1093826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.
1094826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @ingroup comp buf
1095826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev */
1096826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev#define OMX_EmptyThisBuffer(                                \
1097826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        hComponent,                                         \
1098826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        pBuffer)                                            \
1099826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    ((OMX_COMPONENTTYPE*)hComponent)->EmptyThisBuffer(      \
1100826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        hComponent,                                         \
1101826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        pBuffer)                        /* Macro End */
1102826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
1103826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
1104826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev/** The OMX_FillThisBuffer macro will send an empty buffer to an
1105826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    output port of a component.  The buffer will be filled by the component
1106826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    and returned to the application via the FillBufferDone call back.
1107826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    This is a non-blocking call in that the component will record the buffer
1108826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    and return immediately and then fill the buffer, later, at the proper
1109826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    time.  As expected, this macro may be invoked only while the component
1110826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    is in the OMX_ExecutingState.  If nPortIndex does not specify an output
1111826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    port, the component shall return an error.
1112826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
1113826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    The component should return from this call within 5 msec.
1114826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
1115826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @param [in] hComponent
1116826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        Handle of the component to be accessed.  This is the component
1117826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        handle returned by the call to the OMX_GetHandle function.
1118826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @param [in] pBuffer
1119826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer
1120826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        or AllocateBuffer.
1121826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @return OMX_ERRORTYPE
1122826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        If the command successfully executes, the return code will be
1123826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.
1124826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @ingroup comp buf
1125826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev */
1126826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev#define OMX_FillThisBuffer(                                 \
1127826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        hComponent,                                         \
1128826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        pBuffer)                                            \
1129826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    ((OMX_COMPONENTTYPE*)hComponent)->FillThisBuffer(       \
1130826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        hComponent,                                         \
1131826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        pBuffer)                        /* Macro End */
1132826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
1133826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
1134826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
1135826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev/** The OMX_UseEGLImage macro will request that the component use
1136826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    a EGLImage provided by EGL (and allocate its own buffer header)
1137826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    This is a blocking call.
1138826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
1139826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    The component should return from this call within 20 msec.
1140826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
1141826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @param [in] hComponent
1142826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        Handle of the component to be accessed.  This is the component
1143826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        handle returned by the call to the OMX_GetHandle function.
1144826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @param [out] ppBuffer
1145826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        pointer to an OMX_BUFFERHEADERTYPE structure used to receive the
1146826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        pointer to the buffer header.  Note that the memory location used
1147826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        for this buffer is NOT visible to the IL Client.
1148826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @param [in] nPortIndex
1149826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        nPortIndex is used to select the port on the component the buffer will
1150826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        be used with.  The port can be found by using the nPortIndex
1151826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        value as an index into the Port Definition array of the component.
1152826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @param [in] pAppPrivate
1153826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        pAppPrivate is used to initialize the pAppPrivate member of the
1154826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        buffer header structure.
1155826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @param [in] eglImage
1156826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        eglImage contains the handle of the EGLImage to use as a buffer on the
1157826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        specified port.  The component is expected to validate properties of
1158826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        the EGLImage against the configuration of the port to ensure the component
1159826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        can use the EGLImage as a buffer.
1160826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @return OMX_ERRORTYPE
1161826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        If the command successfully executes, the return code will be
1162826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.
1163826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @ingroup comp buf
1164826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev */
1165826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev#define OMX_UseEGLImage(                                    \
1166826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev           hComponent,                                      \
1167826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev           ppBufferHdr,                                     \
1168826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev           nPortIndex,                                      \
1169826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev           pAppPrivate,                                     \
1170826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev           eglImage)                                        \
1171826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    ((OMX_COMPONENTTYPE*)hComponent)->UseEGLImage(          \
1172826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev           hComponent,                                      \
1173826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev           ppBufferHdr,                                     \
1174826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev           nPortIndex,                                      \
1175826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev           pAppPrivate,                                     \
1176826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev           eglImage)
1177826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
1178826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev/** The OMX_Init method is used to initialize the OMX core.  It shall be the
1179826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    first call made into OMX and it should only be executed one time without
1180826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    an interviening OMX_Deinit call.
1181826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
1182826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    The core should return from this call within 20 msec.
1183826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
1184826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @return OMX_ERRORTYPE
1185826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        If the command successfully executes, the return code will be
1186826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.
1187826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @ingroup core
1188826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev */
1189826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan MalchevOMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_Init(void);
1190826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
1191826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
1192826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev/** The OMX_Deinit method is used to deinitialize the OMX core.  It shall be
1193826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    the last call made into OMX. In the event that the core determines that
1194826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    thare are components loaded when this call is made, the core may return
1195826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    with an error rather than try to unload the components.
1196826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
1197826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    The core should return from this call within 20 msec.
1198826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
1199826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @return OMX_ERRORTYPE
1200826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        If the command successfully executes, the return code will be
1201826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.
1202826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @ingroup core
1203826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev */
1204826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan MalchevOMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_Deinit(void);
1205826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
1206826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
1207826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev/** The OMX_ComponentNameEnum method will enumerate through all the names of
1208826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    recognised valid components in the system. This function is provided
1209826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    as a means to detect all the components in the system run-time. There is
1210826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    no strict ordering to the enumeration order of component names, although
1211826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    each name will only be enumerated once.  If the OMX core supports run-time
1212826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    installation of new components, it is only requried to detect newly
1213826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    installed components when the first call to enumerate component names
1214826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    is made (i.e. when nIndex is 0x0).
1215826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
1216826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    The core should return from this call in 20 msec.
1217826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
1218826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @param [out] cComponentName
1219826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        pointer to a null terminated string with the component name.  The
1220826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        names of the components are strings less than 127 bytes in length
1221826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        plus the trailing null for a maximum size of 128 bytes.  An example
1222826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        of a valid component name is "OMX.TI.AUDIO.DSP.MIXER\0".  Names are
1223826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        assigned by the vendor, but shall start with "OMX." and then have
1224826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        the Vendor designation next.
1225826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @param [in] nNameLength
1226826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        number of characters in the cComponentName string.  With all
1227826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        component name strings restricted to less than 128 characters
1228826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        (including the trailing null) it is recomended that the caller
1229826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        provide a input string for the cComponentName of 128 characters.
1230826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @param [in] nIndex
1231826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        number containing the enumeration index for the component.
1232826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        Multiple calls to OMX_ComponentNameEnum with increasing values
1233826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        of nIndex will enumerate through the component names in the
1234826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        system until OMX_ErrorNoMore is returned.  The value of nIndex
1235826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        is 0 to (N-1), where N is the number of valid installed components
1236826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        in the system.
1237826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @return OMX_ERRORTYPE
1238826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        If the command successfully executes, the return code will be
1239826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        OMX_ErrorNone.  When the value of nIndex exceeds the number of
1240826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        components in the system minus 1, OMX_ErrorNoMore will be
1241826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        returned. Otherwise the appropriate OMX error will be returned.
1242826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @ingroup core
1243826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev */
1244826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan MalchevOMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_ComponentNameEnum(
1245826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_OUT OMX_STRING cComponentName,
1246826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_IN  OMX_U32 nNameLength,
1247826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_IN  OMX_U32 nIndex);
1248826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
1249826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
1250826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev/** The OMX_GetHandle method will locate the component specified by the
1251826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    component name given, load that component into memory and then invoke
1252826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    the component's methods to create an instance of the component.
1253826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
1254826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    The core should return from this call within 20 msec.
1255826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
1256826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @param [out] pHandle
1257826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        pointer to an OMX_HANDLETYPE pointer to be filled in by this method.
1258826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @param [in] cComponentName
1259826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        pointer to a null terminated string with the component name.  The
1260826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        names of the components are strings less than 127 bytes in length
1261826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        plus the trailing null for a maximum size of 128 bytes.  An example
1262826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        of a valid component name is "OMX.TI.AUDIO.DSP.MIXER\0".  Names are
1263826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        assigned by the vendor, but shall start with "OMX." and then have
1264826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        the Vendor designation next.
1265826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @param [in] pAppData
1266826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        pointer to an application defined value that will be returned
1267826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        during callbacks so that the application can identify the source
1268826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        of the callback.
1269826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @param [in] pCallBacks
1270826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        pointer to a OMX_CALLBACKTYPE structure that will be passed to the
1271826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        component to initialize it with.
1272826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @return OMX_ERRORTYPE
1273826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        If the command successfully executes, the return code will be
1274826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.
1275826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @ingroup core
1276826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev */
1277826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan MalchevOMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_GetHandle(
1278826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_OUT OMX_HANDLETYPE* pHandle,
1279826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_IN  OMX_STRING cComponentName,
1280826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_IN  OMX_PTR pAppData,
1281826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_IN  OMX_CALLBACKTYPE* pCallBacks);
1282826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
1283826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
1284826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev/** The OMX_FreeHandle method will free a handle allocated by the OMX_GetHandle
1285826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    method.  If the component reference count goes to zero, the component will
1286826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    be unloaded from memory.
1287826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
1288826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    The core should return from this call within 20 msec when the component is
1289826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    in the OMX_StateLoaded state.
1290826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
1291826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @param [in] hComponent
1292826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        Handle of the component to be accessed.  This is the component
1293826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        handle returned by the call to the GetHandle function.
1294826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @return OMX_ERRORTYPE
1295826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        If the command successfully executes, the return code will be
1296826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.
1297826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @ingroup core
1298826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev */
1299826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan MalchevOMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_FreeHandle(
1300826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_IN  OMX_HANDLETYPE hComponent);
1301826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
1302826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
1303826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
1304826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev/** The OMX_SetupTunnel method will handle the necessary calls to the components
1305826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    to setup the specified tunnel the two components.  NOTE: This is
1306826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    an actual method (not a #define macro).  This method will make calls into
1307826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    the component ComponentTunnelRequest method to do the actual tunnel
1308826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    connection.
1309826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
1310826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    The ComponentTunnelRequest method on both components will be called.
1311826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    This method shall not be called unless the component is in the
1312826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_StateLoaded state except when the ports used for the tunnel are
1313826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    disabled. In this case, the component may be in the OMX_StateExecuting,
1314826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_StatePause, or OMX_StateIdle states.
1315826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
1316826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    The core should return from this call within 20 msec.
1317826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
1318826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @param [in] hOutput
1319826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        Handle of the component to be accessed.  Also this is the handle
1320826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        of the component whose port, specified in the nPortOutput parameter
1321826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        will be used the source for the tunnel. This is the component handle
1322826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        returned by the call to the OMX_GetHandle function.  There is a
1323826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        requirement that hOutput be the source for the data when
1324826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        tunelling (i.e. nPortOutput is an output port).  If 0x0, the component
1325826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        specified in hInput will have it's port specified in nPortInput
1326826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        setup for communication with the application / IL client.
1327826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @param [in] nPortOutput
1328826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        nPortOutput is used to select the source port on component to be
1329826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        used in the tunnel.
1330826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @param [in] hInput
1331826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        This is the component to setup the tunnel with. This is the handle
1332826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        of the component whose port, specified in the nPortInput parameter
1333826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        will be used the destination for the tunnel. This is the component handle
1334826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        returned by the call to the OMX_GetHandle function.  There is a
1335826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        requirement that hInput be the destination for the data when
1336826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        tunelling (i.e. nPortInut is an input port).   If 0x0, the component
1337826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        specified in hOutput will have it's port specified in nPortPOutput
1338826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        setup for communication with the application / IL client.
1339826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @param [in] nPortInput
1340826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        nPortInput is used to select the destination port on component to be
1341826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        used in the tunnel.
1342826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @return OMX_ERRORTYPE
1343826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        If the command successfully executes, the return code will be
1344826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.
1345826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        When OMX_ErrorNotImplemented is returned, one or both components is
1346826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        a non-interop component and does not support tunneling.
1347826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
1348826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        On failure, the ports of both components are setup for communication
1349826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        with the application / IL Client.
1350826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @ingroup core tun
1351826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev */
1352826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan MalchevOMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_SetupTunnel(
1353826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_IN  OMX_HANDLETYPE hOutput,
1354826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_IN  OMX_U32 nPortOutput,
1355826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_IN  OMX_HANDLETYPE hInput,
1356826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_IN  OMX_U32 nPortInput);
1357826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
1358826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev/** @ingroup cp */
1359826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan MalchevOMX_API OMX_ERRORTYPE   OMX_GetContentPipe(
1360826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_OUT OMX_HANDLETYPE *hPipe,
1361826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_IN OMX_STRING szURI);
1362826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
1363826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev/** The OMX_GetComponentsOfRole method will return the number of components that support the given
1364826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    role and (if the compNames field is non-NULL) the names of those components. The call will fail if
1365826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    an insufficiently sized array of names is supplied. To ensure the array is sufficiently sized the
1366826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    client should:
1367826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        * first call this function with the compNames field NULL to determine the number of component names
1368826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        * second call this function with the compNames field pointing to an array of names allocated
1369826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev          according to the number returned by the first call.
1370826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
1371826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    The core should return from this call within 5 msec.
1372826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
1373826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @param [in] role
1374826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        This is generic standard component name consisting only of component class
1375826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        name and the type within that class (e.g. 'audio_decoder.aac').
1376826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @param [inout] pNumComps
1377826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        This is used both as input and output.
1378826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
1379826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        If compNames is NULL, the input is ignored and the output specifies how many components support
1380826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        the given role.
1381826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
1382826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        If compNames is not NULL, on input it bounds the size of the input structure and
1383826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        on output, it specifies the number of components string names listed within the compNames parameter.
1384826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @param [inout] compNames
1385826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        If NULL this field is ignored. If non-NULL this points to an array of 128-byte strings which accepts
1386826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        a list of the names of all physical components that implement the specified standard component name.
1387826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        Each name is NULL terminated. numComps indicates the number of names.
1388826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @ingroup core
1389826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev */
1390826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan MalchevOMX_API OMX_ERRORTYPE OMX_GetComponentsOfRole (
1391826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev	OMX_IN      OMX_STRING role,
1392826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_INOUT   OMX_U32 *pNumComps,
1393826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_INOUT   OMX_U8  **compNames);
1394826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
1395826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev/** The OMX_GetRolesOfComponent method will return the number of roles supported by the given
1396826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    component and (if the roles field is non-NULL) the names of those roles. The call will fail if
1397826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    an insufficiently sized array of names is supplied. To ensure the array is sufficiently sized the
1398826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    client should:
1399826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        * first call this function with the roles field NULL to determine the number of role names
1400826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        * second call this function with the roles field pointing to an array of names allocated
1401826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev          according to the number returned by the first call.
1402826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
1403826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    The core should return from this call within 5 msec.
1404826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
1405826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @param [in] compName
1406826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        This is the name of the component being queried about.
1407826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @param [inout] pNumRoles
1408826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        This is used both as input and output.
1409826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
1410826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        If roles is NULL, the input is ignored and the output specifies how many roles the component supports.
1411826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
1412826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        If compNames is not NULL, on input it bounds the size of the input structure and
1413826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        on output, it specifies the number of roles string names listed within the roles parameter.
1414826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @param [out] roles
1415826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        If NULL this field is ignored. If non-NULL this points to an array of 128-byte strings
1416826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        which accepts a list of the names of all standard components roles implemented on the
1417826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev        specified component name. numComps indicates the number of names.
1418826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    @ingroup core
1419826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev */
1420826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan MalchevOMX_API OMX_ERRORTYPE OMX_GetRolesOfComponent (
1421826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev	OMX_IN      OMX_STRING compName,
1422826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_INOUT   OMX_U32 *pNumRoles,
1423826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev    OMX_OUT     OMX_U8 **roles);
1424826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
1425826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev#ifdef __cplusplus
1426826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev}
1427826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev#endif /* __cplusplus */
1428826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
1429826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev#endif
1430826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev/* File EOF */
1431826ececcbea342f7a0b92ec61847f1c95d384e05Iliyan Malchev
1432