1e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen/* ------------------------------------------------------------------
2e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen * Copyright (C) 1998-2009 PacketVideo
3e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen *
4e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen * Licensed under the Apache License, Version 2.0 (the "License");
5e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen * you may not use this file except in compliance with the License.
6e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen * You may obtain a copy of the License at
7e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen *
8e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen *      http://www.apache.org/licenses/LICENSE-2.0
9e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen *
10e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen * Unless required by applicable law or agreed to in writing, software
11e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen * distributed under the License is distributed on an "AS IS" BASIS,
12e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
13e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen * express or implied.
14e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen * See the License for the specific language governing permissions
15e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen * and limitations under the License.
16e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen * -------------------------------------------------------------------
17e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen */
18c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev/*
19e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen * Copyright (c) 2008 The Khronos Group Inc.
20e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen *
21c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev * Permission is hereby granted, free of charge, to any person obtaining
22c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev * a copy of this software and associated documentation files (the
23c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev * "Software"), to deal in the Software without restriction, including
24c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev * without limitation the rights to use, copy, modify, merge, publish,
25c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev * distribute, sublicense, and/or sell copies of the Software, and to
26c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev * permit persons to whom the Software is furnished to do so, subject
27e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen * to the following conditions:
28c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev * The above copyright notice and this permission notice shall be included
29e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen * in all copies or substantial portions of the Software.
30e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen *
31c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
32c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
33c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
34c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
35c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
36c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
37e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
38c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev *
39c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev */
40c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
41c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev/** OMX_Core.h - OpenMax IL version 1.1.2
42c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev *  The OMX_Core header file contains the definitions used by both the
43c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev *  application and the component to access common items.
44c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev */
45c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
46c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#ifndef OMX_Core_h
47c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#define OMX_Core_h
48c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
49c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#ifdef __cplusplus
50c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchevextern "C" {
51c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#endif /* __cplusplus */
52c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
53c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
54c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev/* Each OMX header shall include all required header files to allow the
55c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev *  header to compile without errors.  The includes below are required
56e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen *  for this header file to compile successfully
57c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev */
58c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
59c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#include <OMX_Index.h>
60c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
61c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
62c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev/** The OMX_COMMANDTYPE enumeration is used to specify the action in the
63e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen *  OMX_SendCommand macro.
64c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev *  @ingroup core
65c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev */
66c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchevtypedef enum OMX_COMMANDTYPE
67c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev{
68c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_CommandStateSet,    /**< Change the component state */
69c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_CommandFlush,       /**< Flush the data queue(s) of a component */
70c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_CommandPortDisable, /**< Disable a port on a component. */
71c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_CommandPortEnable,  /**< Enable a port on a component. */
72c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_CommandMarkBuffer,  /**< Mark a component/buffer for observation */
73e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    OMX_CommandKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
74c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_CommandVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
75c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_CommandMax = 0X7FFFFFFF
76c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev} OMX_COMMANDTYPE;
77c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
78c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
79c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
80c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev/** The OMX_STATETYPE enumeration is used to indicate or change the component
81c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev *  state.  This enumeration reflects the current state of the component when
82c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev *  used with the OMX_GetState macro or becomes the parameter in a state change
83c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev *  command when used with the OMX_SendCommand macro.
84c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev *
85c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev *  The component will be in the Loaded state after the component is initially
86c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev *  loaded into memory.  In the Loaded state, the component is not allowed to
87c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev *  allocate or hold resources other than to build it's internal parameter
88c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev *  and configuration tables.  The application will send one or more
89c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev *  SetParameters/GetParameters and SetConfig/GetConfig commands to the
90c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev *  component and the component will record each of these parameter and
91c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev *  configuration changes for use later.  When the application sends the
92c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev *  Idle command, the component will acquire the resources needed for the
93c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev *  specified configuration and will transition to the idle state if the
94c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev *  allocation is successful.  If the component cannot successfully
95c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev *  transition to the idle state for any reason, the state of the component
96e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen *  shall be fully rolled back to the Loaded state (e.g. all allocated
97c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev *  resources shall be released).  When the component receives the command
98c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev *  to go to the Executing state, it shall begin processing buffers by
99c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev *  sending all input buffers it holds to the application.  While
100c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev *  the component is in the Idle state, the application may also send the
101c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev *  Pause command.  If the component receives the pause command while in the
102e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen *  Idle state, the component shall send all input buffers it holds to the
103c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev *  application, but shall not begin processing buffers.  This will allow the
104c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev *  application to prefill buffers.
105e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen *
106c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev *  @ingroup comp
107c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev */
108c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
109c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchevtypedef enum OMX_STATETYPE
110c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev{
111e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    OMX_StateInvalid,      /**< component has detected that it's internal data
112c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                                structures are corrupted to the point that
113c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                                it cannot determine it's state properly */
114c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_StateLoaded,      /**< component has been loaded but has not completed
115c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                                initialization.  The OMX_SetParameter macro
116e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen                                and the OMX_GetParameter macro are the only
117e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen                                valid macros allowed to be sent to the
118c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                                component in this state. */
119c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_StateIdle,        /**< component initialization has been completed
120c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                                successfully and the component is ready to
121c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                                to start. */
122c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_StateExecuting,   /**< component has accepted the start command and
123c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                                is processing data (if data is available) */
124c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_StatePause,       /**< component has received pause command */
125e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    OMX_StateWaitForResources, /**< component is waiting for resources, either after
126c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                                preemption or before it gets the resources requested.
127c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                                See specification for complete details. */
128e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    OMX_StateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
129c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_StateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
130c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_StateMax = 0X7FFFFFFF
131c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev} OMX_STATETYPE;
132c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
133e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen/** The OMX_ERRORTYPE enumeration defines the standard OMX Errors.  These
134e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen *  errors should cover most of the common failure cases.  However,
135e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen *  vendors are free to add additional error messages of their own as
136c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev *  long as they follow these rules:
137c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev *  1.  Vendor error messages shall be in the range of 0x90000000 to
138c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev *      0x9000FFFF.
139c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev *  2.  Vendor error messages shall be defined in a header file provided
140c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev *      with the component.  No error messages are allowed that are
141c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev *      not defined.
142c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev */
143c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchevtypedef enum OMX_ERRORTYPE
144c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev{
145c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  OMX_ErrorNone = 0,
146c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
147c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  /** There were insufficient resources to perform the requested operation */
148c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  OMX_ErrorInsufficientResources = (OMX_S32) 0x80001000,
149c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
150c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  /** There was an error, but the cause of the error could not be determined */
151c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  OMX_ErrorUndefined = (OMX_S32) 0x80001001,
152c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
153c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  /** The component name string was not valid */
154c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  OMX_ErrorInvalidComponentName = (OMX_S32) 0x80001002,
155c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
156c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  /** No component with the specified name string was found */
157c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  OMX_ErrorComponentNotFound = (OMX_S32) 0x80001003,
158c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
159c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  /** The component specified did not have a "OMX_ComponentInit" or
160c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev      "OMX_ComponentDeInit entry point */
161c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  OMX_ErrorInvalidComponent = (OMX_S32) 0x80001004,
162c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
163c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  /** One or more parameters were not valid */
164c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  OMX_ErrorBadParameter = (OMX_S32) 0x80001005,
165c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
166c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  /** The requested function is not implemented */
167c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  OMX_ErrorNotImplemented = (OMX_S32) 0x80001006,
168c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
169c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  /** The buffer was emptied before the next buffer was ready */
170c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  OMX_ErrorUnderflow = (OMX_S32) 0x80001007,
171c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
172c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  /** The buffer was not available when it was needed */
173c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  OMX_ErrorOverflow = (OMX_S32) 0x80001008,
174c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
175c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  /** The hardware failed to respond as expected */
176c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  OMX_ErrorHardware = (OMX_S32) 0x80001009,
177c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
178c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  /** The component is in the state OMX_StateInvalid */
179c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  OMX_ErrorInvalidState = (OMX_S32) 0x8000100A,
180c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
181c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  /** Stream is found to be corrupt */
182c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  OMX_ErrorStreamCorrupt = (OMX_S32) 0x8000100B,
183c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
184c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  /** Ports being connected are not compatible */
185c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  OMX_ErrorPortsNotCompatible = (OMX_S32) 0x8000100C,
186c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
187c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  /** Resources allocated to an idle component have been
188c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev      lost resulting in the component returning to the loaded state */
189c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  OMX_ErrorResourcesLost = (OMX_S32) 0x8000100D,
190c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
191c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  /** No more indicies can be enumerated */
192c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  OMX_ErrorNoMore = (OMX_S32) 0x8000100E,
193c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
194c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  /** The component detected a version mismatch */
195c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  OMX_ErrorVersionMismatch = (OMX_S32) 0x8000100F,
196c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
197c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  /** The component is not ready to return data at this time */
198c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  OMX_ErrorNotReady = (OMX_S32) 0x80001010,
199c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
200c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  /** There was a timeout that occurred */
201c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  OMX_ErrorTimeout = (OMX_S32) 0x80001011,
202c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
203c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  /** This error occurs when trying to transition into the state you are already in */
204c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  OMX_ErrorSameState = (OMX_S32) 0x80001012,
205c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
206e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen  /** Resources allocated to an executing or paused component have been
207c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev      preempted, causing the component to return to the idle state */
208e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen  OMX_ErrorResourcesPreempted = (OMX_S32) 0x80001013,
209c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
210e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen  /** A non-supplier port sends this error to the IL client (via the EventHandler callback)
211c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev      during the allocation of buffers (on a transition from the LOADED to the IDLE state or
212e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen      on a port restart) when it deems that it has waited an unusually long time for the supplier
213c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev      to send it an allocated buffer via a UseBuffer call. */
214c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  OMX_ErrorPortUnresponsiveDuringAllocation = (OMX_S32) 0x80001014,
215c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
216e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen  /** A non-supplier port sends this error to the IL client (via the EventHandler callback)
217e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen      during the deallocation of buffers (on a transition from the IDLE to LOADED state or
218e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen      on a port stop) when it deems that it has waited an unusually long time for the supplier
219c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev      to request the deallocation of a buffer header via a FreeBuffer call. */
220c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  OMX_ErrorPortUnresponsiveDuringDeallocation = (OMX_S32) 0x80001015,
221c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
222e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen  /** A supplier port sends this error to the IL client (via the EventHandler callback)
223e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen      during the stopping of a port (either on a transition from the IDLE to LOADED
224e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen      state or a port stop) when it deems that it has waited an unusually long time for
225c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev      the non-supplier to return a buffer via an EmptyThisBuffer or FillThisBuffer call. */
226c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  OMX_ErrorPortUnresponsiveDuringStop = (OMX_S32) 0x80001016,
227c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
228c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  /** Attempting a state transtion that is not allowed */
229c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  OMX_ErrorIncorrectStateTransition = (OMX_S32) 0x80001017,
230c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
231c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  /* Attempting a command that is not allowed during the present state. */
232e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen  OMX_ErrorIncorrectStateOperation = (OMX_S32) 0x80001018,
233c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
234c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  /** The values encapsulated in the parameter or config structure are not supported. */
235c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  OMX_ErrorUnsupportedSetting = (OMX_S32) 0x80001019,
236c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
237c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  /** The parameter or config indicated by the given index is not supported. */
238c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  OMX_ErrorUnsupportedIndex = (OMX_S32) 0x8000101A,
239c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
240c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  /** The port index supplied is incorrect. */
241c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  OMX_ErrorBadPortIndex = (OMX_S32) 0x8000101B,
242c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
243c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  /** The port has lost one or more of its buffers and it thus unpopulated. */
244c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  OMX_ErrorPortUnpopulated = (OMX_S32) 0x8000101C,
245c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
246c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  /** Component suspended due to temporary loss of resources */
247c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  OMX_ErrorComponentSuspended = (OMX_S32) 0x8000101D,
248c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
249c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  /** Component suspended due to an inability to acquire dynamic resources */
250c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  OMX_ErrorDynamicResourcesUnavailable = (OMX_S32) 0x8000101E,
251c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
252e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen  /** When the macroblock error reporting is enabled the component returns new error
253c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  for every frame that has errors */
254c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  OMX_ErrorMbErrorsInFrame = (OMX_S32) 0x8000101F,
255c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
256c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  /** A component reports this error when it cannot parse or determine the format of an input stream. */
257e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen  OMX_ErrorFormatNotDetected = (OMX_S32) 0x80001020,
258c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
259c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  /** The content open operation failed. */
260c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  OMX_ErrorContentPipeOpenFailed = (OMX_S32) 0x80001021,
261c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
262c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  /** The content creation operation failed. */
263c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  OMX_ErrorContentPipeCreationFailed = (OMX_S32) 0x80001022,
264c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
265c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  /** Separate table information is being used */
266c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  OMX_ErrorSeperateTablesUsed = (OMX_S32) 0x80001023,
267c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
268c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  /** Tunneling is unsupported by the component*/
269c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  OMX_ErrorTunnelingUnsupported = (OMX_S32) 0x80001024,
270c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
271e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen  OMX_ErrorKhronosExtensions = (OMX_S32)0x8F000000, /**< Reserved region for introducing Khronos Standard Extensions */
272c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  OMX_ErrorVendorStartUnused = (OMX_S32)0x90000000, /**< Reserved region for introducing Vendor Extensions */
273c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  OMX_ErrorMax = 0x7FFFFFFF
274c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev} OMX_ERRORTYPE;
275c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
276c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev/** @ingroup core */
277c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchevtypedef OMX_ERRORTYPE (* OMX_COMPONENTINITTYPE)(OMX_IN  OMX_HANDLETYPE hComponent);
278c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
279c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev/** @ingroup core */
280c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchevtypedef struct OMX_COMPONENTREGISTERTYPE
281c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev{
282c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  const char          * pName;       /* Component name, 128 byte limit (including '\0') applies */
283c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  OMX_COMPONENTINITTYPE pInitialize; /* Component instance initialization function */
284c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev} OMX_COMPONENTREGISTERTYPE;
285c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
286c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev/** @ingroup core */
287c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchevextern OMX_COMPONENTREGISTERTYPE OMX_ComponentRegistered[];
288c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
289c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev/** @ingroup rpm */
290c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchevtypedef struct OMX_PRIORITYMGMTTYPE {
291c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev OMX_U32 nSize;             /**< size of the structure in bytes */
292c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev OMX_VERSIONTYPE nVersion;  /**< OMX specification version information */
293c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev OMX_U32 nGroupPriority;            /**< Priority of the component group */
294c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev OMX_U32 nGroupID;                  /**< ID of the component group */
295c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev} OMX_PRIORITYMGMTTYPE;
296c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
297c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev/* Component name and Role names are limited to 128 characters including the terminating '\0'. */
298c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#define OMX_MAX_STRINGNAME_SIZE 128
299c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
300c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev/** @ingroup comp */
301c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchevtypedef struct OMX_PARAM_COMPONENTROLETYPE {
302c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_U32 nSize;              /**< size of the structure in bytes */
303c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_VERSIONTYPE nVersion;   /**< OMX specification version information */
304c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_U8 cRole[OMX_MAX_STRINGNAME_SIZE];  /**< name of standard component which defines component role */
305c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev} OMX_PARAM_COMPONENTROLETYPE;
306c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
307e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen/** End of Stream Buffer Flag:
308c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  *
309e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen  * A component sets EOS when it has no more data to emit on a particular
310e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen  * output port. Thus an output port shall set EOS on the last buffer it
311e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen  * emits. A component's determination of when an output port should
312c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  * cease sending data is implemenation specific.
313c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  * @ingroup buf
314c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  */
315c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
316e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen#define OMX_BUFFERFLAG_EOS 0x00000001
317c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
318e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen/** Start Time Buffer Flag:
319c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev *
320c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev * The source of a stream (e.g. a demux component) sets the STARTTIME
321c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev * flag on the buffer that contains the starting timestamp for the
322c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev * stream. The starting timestamp corresponds to the first data that
323c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev * should be displayed at startup or after a seek.
324c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev * The first timestamp of the stream is not necessarily the start time.
325e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen * For instance, in the case of a seek to a particular video frame,
326e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen * the target frame may be an interframe. Thus the first buffer of
327c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev * the stream will be the intra-frame preceding the target frame and
328c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev * the starttime will occur with the target frame (with any other
329c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev * required frames required to reconstruct the target intervening).
330c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev *
331e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen * The STARTTIME flag is directly associated with the buffer's
332e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen * timestamp ' thus its association to buffer data and its
333c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev * propagation is identical to the timestamp's.
334c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev *
335e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen * When a Sync Component client receives a buffer with the
336e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen * STARTTIME flag it shall perform a SetConfig on its sync port
337c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev * using OMX_ConfigTimeClientStartTime and passing the buffer's
338c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev * timestamp.
339e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen *
340c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev * @ingroup buf
341c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev */
342c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
343c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#define OMX_BUFFERFLAG_STARTTIME 0x00000002
344c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
345c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
346e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen
347e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen/** Decode Only Buffer Flag:
348c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev *
349c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev * The source of a stream (e.g. a demux component) sets the DECODEONLY
350c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev * flag on any buffer that should shall be decoded but should not be
351e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen * displayed. This flag is used, for instance, when a source seeks to
352e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen * a target interframe that requires the decode of frames preceding the
353e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen * target to facilitate the target's reconstruction. In this case the
354e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen * source would emit the frames preceding the target downstream
355c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev * but mark them as decode only.
356c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev *
357e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen * The DECODEONLY is associated with buffer data and propagated in a
358c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev * manner identical to the buffer timestamp.
359c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev *
360e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen * A component that renders data should ignore all buffers with
361c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev * the DECODEONLY flag set.
362e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen *
363c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev * @ingroup buf
364c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev */
365c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
366c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#define OMX_BUFFERFLAG_DECODEONLY 0x00000004
367c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
368c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
369e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen/* Data Corrupt Flag: This flag is set when the IL client believes the data in the associated buffer is corrupt
370c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev * @ingroup buf
371c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev */
372c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
373c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#define OMX_BUFFERFLAG_DATACORRUPT 0x00000008
374c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
375c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev/* End of Frame: The buffer contains exactly one end of frame and no data
376c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev *  occurs after the end of frame. This flag is an optional hint. The absence
377e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen *  of this flag does not imply the absence of an end of frame within the buffer.
378c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev * @ingroup buf
379c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev*/
380c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#define OMX_BUFFERFLAG_ENDOFFRAME 0x00000010
381c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
382e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen/* Sync Frame Flag: This flag is set when the buffer content contains a coded sync frame '
383e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen *  a frame that has no dependency on any other frame information
384c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev *  @ingroup buf
385c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev */
386c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#define OMX_BUFFERFLAG_SYNCFRAME 0x00000020
387c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
388c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev/* Extra data present flag: there is extra data appended to the data stream
389e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen * residing in the buffer
390e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen * @ingroup buf
391c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev */
392c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#define OMX_BUFFERFLAG_EXTRADATA 0x00000040
393c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
394e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen/** Codec Config Buffer Flag:
395c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev* OMX_BUFFERFLAG_CODECCONFIG is an optional flag that is set by an
396c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev* output port when all bytes in the buffer form part or all of a set of
397c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev* codec specific configuration data.  Examples include SPS/PPS nal units
398c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev* for OMX_VIDEO_CodingAVC or AudioSpecificConfig data for
399e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen* OMX_AUDIO_CodingAAC.  Any component that for a given stream sets
400c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev* OMX_BUFFERFLAG_CODECCONFIG shall not mix codec configuration bytes
401c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev* with frame data in the same buffer, and shall send all buffers
402c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev* containing codec configuration bytes before any buffers containing
403c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev* frame data that those configurations bytes describe.
404c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev* If the stream format for a particular codec has a frame specific
405c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev* header at the start of each frame, for example OMX_AUDIO_CodingMP3 or
406c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev* OMX_AUDIO_CodingAAC in ADTS mode, then these shall be presented as
407c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev* normal without setting OMX_BUFFERFLAG_CODECCONFIG.
408c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev * @ingroup buf
409c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev */
410c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#define OMX_BUFFERFLAG_CODECCONFIG 0x00000080
411c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
412c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
413c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
414c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev/** @ingroup buf */
415c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchevtypedef struct OMX_BUFFERHEADERTYPE
416c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev{
417c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_U32 nSize;              /**< size of the structure in bytes */
418c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_VERSIONTYPE nVersion;   /**< OMX specification version information */
419e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    OMX_U8* pBuffer;            /**< Pointer to actual block of memory
420c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                                     that is acting as the buffer */
421c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_U32 nAllocLen;          /**< size of the buffer allocated, in bytes */
422e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    OMX_U32 nFilledLen;         /**< number of bytes currently in the
423c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                                     buffer */
424c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_U32 nOffset;            /**< start offset of valid data in bytes from
425c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                                     the start of the buffer */
426c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_PTR pAppPrivate;        /**< pointer to any data the application
427c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                                     wants to associate with this buffer */
428c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_PTR pPlatformPrivate;   /**< pointer to any data the platform
429e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen                                     wants to associate with this buffer */
430c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_PTR pInputPortPrivate;  /**< pointer to any data the input port
431c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                                     wants to associate with this buffer */
432c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_PTR pOutputPortPrivate; /**< pointer to any data the output port
433c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                                     wants to associate with this buffer */
434e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    OMX_HANDLETYPE hMarkTargetComponent; /**< The component that will generate a
435c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                                              mark event upon processing this buffer. */
436e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    OMX_PTR pMarkData;          /**< Application specific data associated with
437e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen                                     the mark sent on a mark event to disambiguate
438c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                                     this mark from others. */
439c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_U32 nTickCount;         /**< Optional entry that the component and
440c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                                     application can update with a tick count
441c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                                     when they access the component.  This
442c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                                     value should be in microseconds.  Since
443c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                                     this is a value relative to an arbitrary
444e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen                                     starting point, this value cannot be used
445c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                                     to determine absolute time.  This is an
446c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                                     optional entry and not all components
447c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                                     will update it.*/
448e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen OMX_TICKS nTimeStamp;          /**< Timestamp corresponding to the sample
449e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen                                     starting at the first logical sample
450e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen                                     boundary in the buffer. Timestamps of
451c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                                     successive samples within the buffer may
452e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen                                     be inferred by adding the duration of the
453c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                                     of the preceding buffer to the timestamp
454c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                                     of the preceding buffer.*/
455c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  OMX_U32     nFlags;           /**< buffer specific flags */
456e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen  OMX_U32 nOutputPortIndex;     /**< The index of the output port (if any) using
457c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                                     this buffer */
458c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev  OMX_U32 nInputPortIndex;      /**< The index of the input port (if any) using
459c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                                     this buffer */
460c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev} OMX_BUFFERHEADERTYPE;
461c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
462e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen/** The OMX_EXTRADATATYPE enumeration is used to define the
463c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev * possible extra data payload types.
464c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev * NB: this enum is binary backwards compatible with the previous
465c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev * OMX_EXTRADATA_QUANT define.  This should be replaced with
466c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev * OMX_ExtraDataQuantization.
467c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev */
468c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchevtypedef enum OMX_EXTRADATATYPE
469c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev{
470e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen   OMX_ExtraDataNone = 0,                       /**< Indicates that no more extra data sections follow */
471c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev   OMX_ExtraDataQuantization,                   /**< The data payload contains quantization data */
472e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen   OMX_ExtraDataKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
473c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev   OMX_ExtraDataVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
474c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev   OMX_ExtraDataMax = 0x7FFFFFFF
475c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev} OMX_EXTRADATATYPE;
476c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
477c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
478c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchevtypedef struct OMX_OTHER_EXTRADATATYPE  {
479c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_U32 nSize;
480e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    OMX_VERSIONTYPE nVersion;
481c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_U32 nPortIndex;
482c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_EXTRADATATYPE eType;       /* Extra Data type */
483c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_U32 nDataSize;   /* Size of the supporting data to follow */
484c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_U8  data[1];     /* Supporting data hint  */
485c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev} OMX_OTHER_EXTRADATATYPE;
486c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
487c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev/** @ingroup comp */
488c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchevtypedef struct OMX_PORT_PARAM_TYPE {
489c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_U32 nSize;              /**< size of the structure in bytes */
490c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_VERSIONTYPE nVersion;   /**< OMX specification version information */
491c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_U32 nPorts;             /**< The number of ports for this component */
492c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_U32 nStartPortNumber;   /** first port number for this type of port */
493e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen} OMX_PORT_PARAM_TYPE;
494c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
495c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev/** @ingroup comp */
496c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchevtypedef enum OMX_EVENTTYPE
497c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev{
498c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_EventCmdComplete,         /**< component has sucessfully completed a command */
499c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_EventError,               /**< component has detected an error condition */
500c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_EventMark,                /**< component has detected a buffer mark */
501c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_EventPortSettingsChanged, /**< component is reported a port settings change */
502e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    OMX_EventBufferFlag,          /**< component has detected an EOS */
503c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_EventResourcesAcquired,   /**< component has been granted resources and is
504c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                                       automatically starting the state change from
505c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                                       OMX_StateWaitForResources to OMX_StateIdle. */
506c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev   OMX_EventComponentResumed,     /**< Component resumed due to reacquisition of resources */
507c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev   OMX_EventDynamicResourcesAvailable, /**< Component has acquired previously unavailable dynamic resources */
508c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev   OMX_EventPortFormatDetected,      /**< Component has detected a supported format. */
509e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen   OMX_EventKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
510c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev   OMX_EventVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
511c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev   OMX_EventMax = 0x7FFFFFFF
512c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev} OMX_EVENTTYPE;
513c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
514c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchevtypedef struct OMX_CALLBACKTYPE
515c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev{
516c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    /** The EventHandler method is used to notify the application when an
517c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        event of interest occurs.  Events are defined in the OMX_EVENTTYPE
518c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        enumeration.  Please see that enumeration for details of what will
519c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        be returned for each type of event. Callbacks should not return
520e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen        an error to the component, so if an error occurs, the application
521c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        shall handle it internally.  This is a blocking call.
522c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
523c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        The application should return from this call within 5 msec to avoid
524c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        blocking the component for an excessively long period of time.
525c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
526c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        @param hComponent
527c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev            handle of the component to access.  This is the component
528c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev            handle returned by the call to the GetHandle function.
529c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        @param pAppData
530e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen            pointer to an application defined value that was provided in the
531c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev            pAppData parameter to the OMX_GetHandle method for the component.
532e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen            This application defined value is provided so that the application
533c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev            can have a component specific context when receiving the callback.
534c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        @param eEvent
535c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev            Event that the component wants to notify the application about.
536c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        @param nData1
537e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen            nData will be the OMX_ERRORTYPE for an error event and will be
538c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev            an OMX_COMMANDTYPE for a command complete event and OMX_INDEXTYPE for a OMX_PortSettingsChanged event.
539c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev         @param nData2
540c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev            nData2 will hold further information related to the event. Can be OMX_STATETYPE for
541c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev            a OMX_CommandStateSet command or port index for a OMX_PortSettingsChanged event.
542c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev            Default value is 0 if not used. )
543c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        @param pEventData
544c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev            Pointer to additional event-specific data (see spec for meaning).
545c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev      */
546c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
547c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev   OMX_ERRORTYPE (*EventHandler)(
548c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        OMX_IN OMX_HANDLETYPE hComponent,
549c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        OMX_IN OMX_PTR pAppData,
550c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        OMX_IN OMX_EVENTTYPE eEvent,
551c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        OMX_IN OMX_U32 nData1,
552c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        OMX_IN OMX_U32 nData2,
553c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        OMX_IN OMX_PTR pEventData);
554c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
555c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    /** The EmptyBufferDone method is used to return emptied buffers from an
556e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen        input port back to the application for reuse.  This is a blocking call
557c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        so the application should not attempt to refill the buffers during this
558c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        call, but should queue them and refill them in another thread.  There
559c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        is no error return, so the application shall handle any errors generated
560e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen        internally.
561e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen
562c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        The application should return from this call within 5 msec.
563e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen
564c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        @param hComponent
565c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev            handle of the component to access.  This is the component
566c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev            handle returned by the call to the GetHandle function.
567c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        @param pAppData
568e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen            pointer to an application defined value that was provided in the
569c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev            pAppData parameter to the OMX_GetHandle method for the component.
570e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen            This application defined value is provided so that the application
571c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev            can have a component specific context when receiving the callback.
572c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        @param pBuffer
573c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev            pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer
574c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev            or AllocateBuffer indicating the buffer that was emptied.
575c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        @ingroup buf
576c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev     */
577c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_ERRORTYPE (*EmptyBufferDone)(
578c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        OMX_IN OMX_HANDLETYPE hComponent,
579c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        OMX_IN OMX_PTR pAppData,
580c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        OMX_IN OMX_BUFFERHEADERTYPE* pBuffer);
581c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
582c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    /** The FillBufferDone method is used to return filled buffers from an
583e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen        output port back to the application for emptying and then reuse.
584e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen        This is a blocking call so the application should not attempt to
585e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen        empty the buffers during this call, but should queue the buffers
586e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen        and empty them in another thread.  There is no error return, so
587e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen        the application shall handle any errors generated internally.  The
588c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        application shall also update the buffer header to indicate the
589e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen        number of bytes placed into the buffer.
590c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
591c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        The application should return from this call within 5 msec.
592e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen
593c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        @param hComponent
594c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev            handle of the component to access.  This is the component
595c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev            handle returned by the call to the GetHandle function.
596c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        @param pAppData
597e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen            pointer to an application defined value that was provided in the
598c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev            pAppData parameter to the OMX_GetHandle method for the component.
599e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen            This application defined value is provided so that the application
600c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev            can have a component specific context when receiving the callback.
601c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        @param pBuffer
602c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev            pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer
603c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev            or AllocateBuffer indicating the buffer that was filled.
604c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        @ingroup buf
605c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev     */
606c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_ERRORTYPE (*FillBufferDone)(
607c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        OMX_OUT OMX_HANDLETYPE hComponent,
608c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        OMX_OUT OMX_PTR pAppData,
609c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        OMX_OUT OMX_BUFFERHEADERTYPE* pBuffer);
610c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
611c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev} OMX_CALLBACKTYPE;
612c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
613c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev/** The OMX_BUFFERSUPPLIERTYPE enumeration is used to dictate port supplier
614c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    preference when tunneling between two ports.
615c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @ingroup tun buf
616c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev*/
617c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchevtypedef enum OMX_BUFFERSUPPLIERTYPE
618c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev{
619c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_BufferSupplyUnspecified = 0x0, /**< port supplying the buffers is unspecified,
620c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev                                              or don't care */
621c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_BufferSupplyInput,             /**< input port supplies the buffers */
622c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_BufferSupplyOutput,            /**< output port supplies the buffers */
623e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    OMX_BufferSupplyKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
624c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_BufferSupplyVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
625c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_BufferSupplyMax = 0x7FFFFFFF
626c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev} OMX_BUFFERSUPPLIERTYPE;
627c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
628c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
629e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen/** buffer supplier parameter
630c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev * @ingroup tun
631c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev */
632c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchevtypedef struct OMX_PARAM_BUFFERSUPPLIERTYPE {
633c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_U32 nSize; /**< size of the structure in bytes */
634c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
635c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_U32 nPortIndex; /**< port that this structure applies to */
636c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_BUFFERSUPPLIERTYPE eBufferSupplier; /**< buffer supplier */
637c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev} OMX_PARAM_BUFFERSUPPLIERTYPE;
638c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
639c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
640e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen/**< indicates that buffers received by an input port of a tunnel
641e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen     may not modify the data in the buffers
642c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev     @ingroup tun
643c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev */
644e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen#define OMX_PORTTUNNELFLAG_READONLY 0x00000001
645c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
646c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
647c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev/** The OMX_TUNNELSETUPTYPE structure is used to pass data from an output
648c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    port to an input port as part the two ComponentTunnelRequest calls
649e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    resulting from a OMX_SetupTunnel call from the IL Client.
650c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @ingroup tun
651e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen */
652c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchevtypedef struct OMX_TUNNELSETUPTYPE
653c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev{
654c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_U32 nTunnelFlags;             /**< bit flags for tunneling */
655c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_BUFFERSUPPLIERTYPE eSupplier; /**< supplier preference */
656e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen} OMX_TUNNELSETUPTYPE;
657c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
658c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev/* OMX Component headers is included to enable the core to use
659e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen   macros for functions into the component for OMX release 1.0.
660c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev   Developers should not access any structures or data from within
661c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev   the component header directly */
662c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev/* TO BE REMOVED - #include <OMX_Component.h> */
663c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
664e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen/** GetComponentVersion will return information about the component.
665c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    This is a blocking call.  This macro will go directly from the
666c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    application to the component (via a core macro).  The
667c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    component will return from this call within 5 msec.
668c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @param [in] hComponent
669c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        handle of component to execute the command
670c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @param [out] pComponentName
671e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen        pointer to an empty string of length 128 bytes.  The component
672e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen        will write its name into this string.  The name will be
673e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen        terminated by a single zero byte.  The name of a component will
674e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen        be 127 bytes or less to leave room for the trailing zero byte.
675c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        An example of a valid component name is "OMX.ABC.ChannelMixer\0".
676c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @param [out] pComponentVersion
677e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen        pointer to an OMX Version structure that the component will fill
678e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen        in.  The component will fill in a value that indicates the
679e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen        component version.  NOTE: the component version is NOT the same
680e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen        as the OMX Specification version (found in all structures).  The
681e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen        component version is defined by the vendor of the component and
682c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        its value is entirely up to the component vendor.
683c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @param [out] pSpecVersion
684e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen        pointer to an OMX Version structure that the component will fill
685e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen        in.  The SpecVersion is the version of the specification that the
686e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen        component was built against.  Please note that this value may or
687e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen        may not match the structure's version.  For example, if the
688e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen        component was built against the 2.0 specification, but the
689e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen        application (which creates the structure is built against the
690c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        1.0 specification the versions would be different.
691c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @param [out] pComponentUUID
692e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen        pointer to the UUID of the component which will be filled in by
693e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen        the component.  The UUID is a unique identifier that is set at
694e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen        RUN time for the component and is unique to each instantion of
695c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        the component.
696c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @return OMX_ERRORTYPE
697c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        If the command successfully executes, the return code will be
698c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.
699c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @ingroup comp
700c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev */
701c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#define OMX_GetComponentVersion(                            \
702c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        hComponent,                                         \
703c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        pComponentName,                                     \
704c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        pComponentVersion,                                  \
705c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        pSpecVersion,                                       \
706c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        pComponentUUID)                                     \
707c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    ((OMX_COMPONENTTYPE*)hComponent)->GetComponentVersion(  \
708c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        hComponent,                                         \
709c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        pComponentName,                                     \
710c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        pComponentVersion,                                  \
711c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        pSpecVersion,                                       \
712c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        pComponentUUID)                 /* Macro End */
713c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
714c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
715c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev/** Send a command to the component.  This call is a non-blocking call.
716c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    The component should check the parameters and then queue the command
717e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    to the component thread to be executed.  The component thread shall
718e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    send the EventHandler() callback at the conclusion of the command.
719c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    This macro will go directly from the application to the component (via
720c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    a core macro).  The component will return from this call within 5 msec.
721e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen
722c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    When the command is "OMX_CommandStateSet" the component will queue a
723c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    state transition to the new state idenfied in nParam.
724e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen
725c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    When the command is "OMX_CommandFlush", to flush a port's buffer queues,
726e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    the command will force the component to return all buffers NOT CURRENTLY
727e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    BEING PROCESSED to the application, in the order in which the buffers
728c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    were received.
729e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen
730e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    When the command is "OMX_CommandPortDisable" or
731c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    "OMX_CommandPortEnable", the component's port (given by the value of
732e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    nParam) will be stopped or restarted.
733e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen
734c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    When the command "OMX_CommandMarkBuffer" is used to mark a buffer, the
735c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    pCmdData will point to a OMX_MARKTYPE structure containing the component
736c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    handle of the component to examine the buffer chain for the mark.  nParam1
737c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    contains the index of the port on which the buffer mark is applied.
738c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
739e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    Specification text for more details.
740e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen
741c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @param [in] hComponent
742c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        handle of component to execute the command
743c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @param [in] Cmd
744c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        Command for the component to execute
745c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @param [in] nParam
746e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen        Parameter for the command to be executed.  When Cmd has the value
747e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen        OMX_CommandStateSet, value is a member of OMX_STATETYPE.  When Cmd has
748e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen        the value OMX_CommandFlush, value of nParam indicates which port(s)
749e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen        to flush. -1 is used to flush all ports a single port index will
750c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        only flush that port.  When Cmd has the value "OMX_CommandPortDisable"
751e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen        or "OMX_CommandPortEnable", the component's port is given by
752c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        the value of nParam.  When Cmd has the value "OMX_CommandMarkBuffer"
753c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        the components pot is given by the value of nParam.
754c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @param [in] pCmdData
755c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        Parameter pointing to the OMX_MARKTYPE structure when Cmd has the value
756e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen        "OMX_CommandMarkBuffer".
757c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @return OMX_ERRORTYPE
758c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        If the command successfully executes, the return code will be
759c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.
760c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @ingroup comp
761c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev */
762c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#define OMX_SendCommand(                                    \
763c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev         hComponent,                                        \
764c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev         Cmd,                                               \
765c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev         nParam,                                            \
766c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev         pCmdData)                                          \
767c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev     ((OMX_COMPONENTTYPE*)hComponent)->SendCommand(         \
768c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev         hComponent,                                        \
769c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev         Cmd,                                               \
770c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev         nParam,                                            \
771c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev         pCmdData)                          /* Macro End */
772c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
773c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
774e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen/** The OMX_GetParameter macro will get one of the current parameter
775e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    settings from the component.  This macro cannot only be invoked when
776c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    the component is in the OMX_StateInvalid state.  The nParamIndex
777c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    parameter is used to indicate which structure is being requested from
778e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    the component.  The application shall allocate the correct structure
779e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    and shall fill in the structure size and version information before
780c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    invoking this macro.  When the parameter applies to a port, the
781c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    caller shall fill in the appropriate nPortIndex value indicating the
782e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    port on which the parameter applies. If the component has not had
783e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    any settings changed, then the component should return a set of
784e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    valid DEFAULT  parameters for the component.  This is a blocking
785e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    call.
786e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen
787c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    The component should return from this call within 20 msec.
788e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen
789c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @param [in] hComponent
790c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        Handle of the component to be accessed.  This is the component
791c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        handle returned by the call to the OMX_GetHandle function.
792c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @param [in] nParamIndex
793c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        Index of the structure to be filled.  This value is from the
794c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        OMX_INDEXTYPE enumeration.
795c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @param [in,out] pComponentParameterStructure
796e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen        Pointer to application allocated structure to be filled by the
797c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        component.
798c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @return OMX_ERRORTYPE
799c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        If the command successfully executes, the return code will be
800c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.
801c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @ingroup comp
802c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev */
803c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#define OMX_GetParameter(                                   \
804c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        hComponent,                                         \
805c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        nParamIndex,                                        \
806c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        pComponentParameterStructure)                        \
807c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    ((OMX_COMPONENTTYPE*)hComponent)->GetParameter(         \
808c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        hComponent,                                         \
809c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        nParamIndex,                                        \
810c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        pComponentParameterStructure)    /* Macro End */
811c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
812c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
813c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev/** The OMX_SetParameter macro will send an initialization parameter
814c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    structure to a component.  Each structure shall be sent one at a time,
815c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    in a separate invocation of the macro.  This macro can only be
816c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    invoked when the component is in the OMX_StateLoaded state, or the
817e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    port is disabled (when the parameter applies to a port). The
818c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    nParamIndex parameter is used to indicate which structure is being
819e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    passed to the component.  The application shall allocate the
820e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    correct structure and shall fill in the structure size and version
821c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    information (as well as the actual data) before invoking this macro.
822c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    The application is free to dispose of this structure after the call
823e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    as the component is required to copy any data it shall retain.  This
824e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    is a blocking call.
825e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen
826c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    The component should return from this call within 20 msec.
827e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen
828c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @param [in] hComponent
829c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        Handle of the component to be accessed.  This is the component
830c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        handle returned by the call to the OMX_GetHandle function.
831c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @param [in] nIndex
832c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        Index of the structure to be sent.  This value is from the
833c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        OMX_INDEXTYPE enumeration.
834c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @param [in] pComponentParameterStructure
835c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        pointer to application allocated structure to be used for
836c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        initialization by the component.
837c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @return OMX_ERRORTYPE
838c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        If the command successfully executes, the return code will be
839c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.
840c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @ingroup comp
841c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev */
842c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#define OMX_SetParameter(                                   \
843c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        hComponent,                                         \
844c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        nParamIndex,                                        \
845c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        pComponentParameterStructure)                        \
846c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    ((OMX_COMPONENTTYPE*)hComponent)->SetParameter(         \
847c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        hComponent,                                         \
848c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        nParamIndex,                                        \
849c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        pComponentParameterStructure)    /* Macro End */
850c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
851c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
852e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen/** The OMX_GetConfig macro will get one of the configuration structures
853e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    from a component.  This macro can be invoked anytime after the
854e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    component has been loaded.  The nParamIndex call parameter is used to
855e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    indicate which structure is being requested from the component.  The
856e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    application shall allocate the correct structure and shall fill in the
857e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    structure size and version information before invoking this macro.
858e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    If the component has not had this configuration parameter sent before,
859e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    then the component should return a set of valid DEFAULT values for the
860e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    component.  This is a blocking call.
861e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen
862c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    The component should return from this call within 5 msec.
863e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen
864c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @param [in] hComponent
865c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        Handle of the component to be accessed.  This is the component
866c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        handle returned by the call to the OMX_GetHandle function.
867c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @param [in] nIndex
868c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        Index of the structure to be filled.  This value is from the
869c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        OMX_INDEXTYPE enumeration.
870c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @param [in,out] pComponentConfigStructure
871e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen        pointer to application allocated structure to be filled by the
872c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        component.
873c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @return OMX_ERRORTYPE
874c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        If the command successfully executes, the return code will be
875c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.
876c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @ingroup comp
877e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen*/
878c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#define OMX_GetConfig(                                      \
879c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        hComponent,                                         \
880c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        nConfigIndex,                                       \
881c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        pComponentConfigStructure)                           \
882c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    ((OMX_COMPONENTTYPE*)hComponent)->GetConfig(            \
883c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        hComponent,                                         \
884c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        nConfigIndex,                                       \
885c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        pComponentConfigStructure)       /* Macro End */
886c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
887c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
888e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen/** The OMX_SetConfig macro will send one of the configuration
889c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    structures to a component.  Each structure shall be sent one at a time,
890e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    each in a separate invocation of the macro.  This macro can be invoked
891e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    anytime after the component has been loaded.  The application shall
892e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    allocate the correct structure and shall fill in the structure size
893e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    and version information (as well as the actual data) before invoking
894e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    this macro.  The application is free to dispose of this structure after
895e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    the call as the component is required to copy any data it shall retain.
896e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    This is a blocking call.
897e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen
898c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    The component should return from this call within 5 msec.
899e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen
900c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @param [in] hComponent
901c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        Handle of the component to be accessed.  This is the component
902c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        handle returned by the call to the OMX_GetHandle function.
903c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @param [in] nConfigIndex
904c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        Index of the structure to be sent.  This value is from the
905c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        OMX_INDEXTYPE enumeration above.
906c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @param [in] pComponentConfigStructure
907c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        pointer to application allocated structure to be used for
908c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        initialization by the component.
909c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @return OMX_ERRORTYPE
910c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        If the command successfully executes, the return code will be
911c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.
912c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @ingroup comp
913c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev */
914c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#define OMX_SetConfig(                                      \
915c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        hComponent,                                         \
916c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        nConfigIndex,                                       \
917c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        pComponentConfigStructure)                           \
918c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    ((OMX_COMPONENTTYPE*)hComponent)->SetConfig(            \
919c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        hComponent,                                         \
920c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        nConfigIndex,                                       \
921c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        pComponentConfigStructure)       /* Macro End */
922c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
923c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
924e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen/** The OMX_GetExtensionIndex macro will invoke a component to translate
925e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    a vendor specific configuration or parameter string into an OMX
926e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    structure index.  There is no requirement for the vendor to support
927e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    this command for the indexes already found in the OMX_INDEXTYPE
928e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    enumeration (this is done to save space in small components).  The
929c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    component shall support all vendor supplied extension indexes not found
930e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    in the master OMX_INDEXTYPE enumeration.  This is a blocking call.
931e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen
932c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    The component should return from this call within 5 msec.
933e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen
934c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @param [in] hComponent
935c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        Handle of the component to be accessed.  This is the component
936c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        handle returned by the call to the GetHandle function.
937c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @param [in] cParameterName
938c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        OMX_STRING that shall be less than 128 characters long including
939e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen        the trailing null byte.  This is the string that will get
940c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        translated by the component into a configuration index.
941c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @param [out] pIndexType
942c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        a pointer to a OMX_INDEXTYPE to receive the index value.
943c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @return OMX_ERRORTYPE
944c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        If the command successfully executes, the return code will be
945c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.
946c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @ingroup comp
947c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev */
948c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#define OMX_GetExtensionIndex(                              \
949c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        hComponent,                                         \
950c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        cParameterName,                                     \
951c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        pIndexType)                                         \
952c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    ((OMX_COMPONENTTYPE*)hComponent)->GetExtensionIndex(    \
953c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        hComponent,                                         \
954c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        cParameterName,                                     \
955c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        pIndexType)                     /* Macro End */
956c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
957c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
958e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen/** The OMX_GetState macro will invoke the component to get the current
959c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    state of the component and place the state value into the location
960e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    pointed to by pState.
961e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen
962c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    The component should return from this call within 5 msec.
963e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen
964c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @param [in] hComponent
965c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        Handle of the component to be accessed.  This is the component
966c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        handle returned by the call to the OMX_GetHandle function.
967c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @param [out] pState
968c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        pointer to the location to receive the state.  The value returned
969e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen        is one of the OMX_STATETYPE members
970c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @return OMX_ERRORTYPE
971c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        If the command successfully executes, the return code will be
972c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.
973c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @ingroup comp
974c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev */
975c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#define OMX_GetState(                                       \
976c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        hComponent,                                         \
977c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        pState)                                             \
978c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    ((OMX_COMPONENTTYPE*)hComponent)->GetState(             \
979c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        hComponent,                                         \
980c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        pState)                         /* Macro End */
981c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
982c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
983c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev/** The OMX_UseBuffer macro will request that the component use
984e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    a buffer (and allocate its own buffer header) already allocated
985e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    by another component, or by the IL Client. This is a blocking
986c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    call.
987e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen
988c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    The component should return from this call within 20 msec.
989e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen
990c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @param [in] hComponent
991c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        Handle of the component to be accessed.  This is the component
992c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        handle returned by the call to the OMX_GetHandle function.
993c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @param [out] ppBuffer
994e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen        pointer to an OMX_BUFFERHEADERTYPE structure used to receive the
995c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        pointer to the buffer header
996c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @return OMX_ERRORTYPE
997c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        If the command successfully executes, the return code will be
998c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.
999c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @ingroup comp buf
1000c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev */
1001c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
1002c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#define OMX_UseBuffer(                                      \
1003c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev           hComponent,                                      \
1004c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev           ppBufferHdr,                                     \
1005c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev           nPortIndex,                                      \
1006c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev           pAppPrivate,                                     \
1007c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev           nSizeBytes,                                      \
1008c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev           pBuffer)                                         \
1009c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    ((OMX_COMPONENTTYPE*)hComponent)->UseBuffer(            \
1010c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev           hComponent,                                      \
1011c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev           ppBufferHdr,                                     \
1012c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev           nPortIndex,                                      \
1013c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev           pAppPrivate,                                     \
1014c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev           nSizeBytes,                                      \
1015c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev           pBuffer)
1016c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
1017c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
1018e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen/** The OMX_AllocateBuffer macro will request that the component allocate
1019e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    a new buffer and buffer header.  The component will allocate the
1020e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    buffer and the buffer header and return a pointer to the buffer
1021c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    header.  This is a blocking call.
1022e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen
1023c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    The component should return from this call within 5 msec.
1024e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen
1025c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @param [in] hComponent
1026c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        Handle of the component to be accessed.  This is the component
1027c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        handle returned by the call to the OMX_GetHandle function.
1028c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @param [out] ppBuffer
1029e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen        pointer to an OMX_BUFFERHEADERTYPE structure used to receive
1030c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        the pointer to the buffer header
1031c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @param [in] nPortIndex
1032c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        nPortIndex is used to select the port on the component the buffer will
1033c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        be used with.  The port can be found by using the nPortIndex
1034c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        value as an index into the Port Definition array of the component.
1035c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @param [in] pAppPrivate
1036e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen        pAppPrivate is used to initialize the pAppPrivate member of the
1037c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        buffer header structure.
1038c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @param [in] nSizeBytes
1039c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        size of the buffer to allocate.  Used when bAllocateNew is true.
1040c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @return OMX_ERRORTYPE
1041c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        If the command successfully executes, the return code will be
1042c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.
1043c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @ingroup comp buf
1044e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen */
1045c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#define OMX_AllocateBuffer(                                 \
1046c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        hComponent,                                         \
1047c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        ppBuffer,                                           \
1048c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        nPortIndex,                                         \
1049c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        pAppPrivate,                                        \
1050c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        nSizeBytes)                                         \
1051c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    ((OMX_COMPONENTTYPE*)hComponent)->AllocateBuffer(       \
1052c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        hComponent,                                         \
1053c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        ppBuffer,                                           \
1054c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        nPortIndex,                                         \
1055c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        pAppPrivate,                                        \
1056c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        nSizeBytes)                     /* Macro End */
1057c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
1058c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
1059c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev/** The OMX_FreeBuffer macro will release a buffer header from the component
1060e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    which was allocated using either OMX_AllocateBuffer or OMX_UseBuffer. If
1061e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    the component allocated the buffer (see the OMX_UseBuffer macro) then
1062e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    the component shall free the buffer and buffer header. This is a
1063e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    blocking call.
1064e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen
1065c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    The component should return from this call within 20 msec.
1066e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen
1067c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @param [in] hComponent
1068c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        Handle of the component to be accessed.  This is the component
1069c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        handle returned by the call to the OMX_GetHandle function.
1070c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @param [in] nPortIndex
1071c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        nPortIndex is used to select the port on the component the buffer will
1072c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        be used with.
1073c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @param [in] pBuffer
1074c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer
1075c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        or AllocateBuffer.
1076c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @return OMX_ERRORTYPE
1077c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        If the command successfully executes, the return code will be
1078c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.
1079c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @ingroup comp buf
1080c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev */
1081c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#define OMX_FreeBuffer(                                     \
1082c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        hComponent,                                         \
1083c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        nPortIndex,                                         \
1084c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        pBuffer)                                            \
1085c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    ((OMX_COMPONENTTYPE*)hComponent)->FreeBuffer(           \
1086c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        hComponent,                                         \
1087c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        nPortIndex,                                         \
1088c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        pBuffer)                        /* Macro End */
1089c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
1090c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
1091e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen/** The OMX_EmptyThisBuffer macro will send a buffer full of data to an
1092c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    input port of a component.  The buffer will be emptied by the component
1093c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    and returned to the application via the EmptyBufferDone call back.
1094c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    This is a non-blocking call in that the component will record the buffer
1095e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    and return immediately and then empty the buffer, later, at the proper
1096e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    time.  As expected, this macro may be invoked only while the component
1097c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    is in the OMX_StateExecuting.  If nPortIndex does not specify an input
1098e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    port, the component shall return an error.
1099e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen
1100c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    The component should return from this call within 5 msec.
1101e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen
1102c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @param [in] hComponent
1103c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        Handle of the component to be accessed.  This is the component
1104c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        handle returned by the call to the OMX_GetHandle function.
1105c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @param [in] pBuffer
1106c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer
1107c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        or AllocateBuffer.
1108c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @return OMX_ERRORTYPE
1109c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        If the command successfully executes, the return code will be
1110c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.
1111c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @ingroup comp buf
1112c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev */
1113c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#define OMX_EmptyThisBuffer(                                \
1114c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        hComponent,                                         \
1115c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        pBuffer)                                            \
1116c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    ((OMX_COMPONENTTYPE*)hComponent)->EmptyThisBuffer(      \
1117c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        hComponent,                                         \
1118c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        pBuffer)                        /* Macro End */
1119c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
1120c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
1121e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen/** The OMX_FillThisBuffer macro will send an empty buffer to an
1122c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    output port of a component.  The buffer will be filled by the component
1123c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    and returned to the application via the FillBufferDone call back.
1124c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    This is a non-blocking call in that the component will record the buffer
1125e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    and return immediately and then fill the buffer, later, at the proper
1126e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    time.  As expected, this macro may be invoked only while the component
1127c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    is in the OMX_ExecutingState.  If nPortIndex does not specify an output
1128e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    port, the component shall return an error.
1129e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen
1130c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    The component should return from this call within 5 msec.
1131e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen
1132c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @param [in] hComponent
1133c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        Handle of the component to be accessed.  This is the component
1134c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        handle returned by the call to the OMX_GetHandle function.
1135c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @param [in] pBuffer
1136c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer
1137c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        or AllocateBuffer.
1138c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @return OMX_ERRORTYPE
1139c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        If the command successfully executes, the return code will be
1140c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.
1141c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @ingroup comp buf
1142c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev */
1143c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#define OMX_FillThisBuffer(                                 \
1144c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        hComponent,                                         \
1145c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        pBuffer)                                            \
1146c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    ((OMX_COMPONENTTYPE*)hComponent)->FillThisBuffer(       \
1147c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        hComponent,                                         \
1148c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        pBuffer)                        /* Macro End */
1149c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
1150c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
1151c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
1152c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev/** The OMX_UseEGLImage macro will request that the component use
1153c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    a EGLImage provided by EGL (and allocate its own buffer header)
1154c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    This is a blocking call.
1155e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen
1156c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    The component should return from this call within 20 msec.
1157e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen
1158c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @param [in] hComponent
1159c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        Handle of the component to be accessed.  This is the component
1160c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        handle returned by the call to the OMX_GetHandle function.
1161c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @param [out] ppBuffer
1162e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen        pointer to an OMX_BUFFERHEADERTYPE structure used to receive the
1163c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        pointer to the buffer header.  Note that the memory location used
1164c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        for this buffer is NOT visible to the IL Client.
1165c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @param [in] nPortIndex
1166c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        nPortIndex is used to select the port on the component the buffer will
1167c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        be used with.  The port can be found by using the nPortIndex
1168c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        value as an index into the Port Definition array of the component.
1169c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @param [in] pAppPrivate
1170e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen        pAppPrivate is used to initialize the pAppPrivate member of the
1171c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        buffer header structure.
1172c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @param [in] eglImage
1173c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        eglImage contains the handle of the EGLImage to use as a buffer on the
1174e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen        specified port.  The component is expected to validate properties of
1175c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        the EGLImage against the configuration of the port to ensure the component
1176e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen        can use the EGLImage as a buffer.
1177c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @return OMX_ERRORTYPE
1178c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        If the command successfully executes, the return code will be
1179c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.
1180c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @ingroup comp buf
1181c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev */
1182c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#define OMX_UseEGLImage(                                    \
1183c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev           hComponent,                                      \
1184c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev           ppBufferHdr,                                     \
1185c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev           nPortIndex,                                      \
1186c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev           pAppPrivate,                                     \
1187c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev           eglImage)                                        \
1188c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    ((OMX_COMPONENTTYPE*)hComponent)->UseEGLImage(          \
1189c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev           hComponent,                                      \
1190c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev           ppBufferHdr,                                     \
1191c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev           nPortIndex,                                      \
1192c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev           pAppPrivate,                                     \
1193c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev           eglImage)
1194c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
1195c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev/** The OMX_Init method is used to initialize the OMX core.  It shall be the
1196c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    first call made into OMX and it should only be executed one time without
1197e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    an interviening OMX_Deinit call.
1198e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen
1199c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    The core should return from this call within 20 msec.
1200c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
1201c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @return OMX_ERRORTYPE
1202c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        If the command successfully executes, the return code will be
1203c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.
1204c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @ingroup core
1205c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev */
1206c322989ae6ff6769490828de1b5eda12b749cce9Iliyan MalchevOMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_Init(void);
1207c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
1208c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
1209e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen/** The OMX_Deinit method is used to deinitialize the OMX core.  It shall be
1210e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    the last call made into OMX. In the event that the core determines that
1211e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    thare are components loaded when this call is made, the core may return
1212c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    with an error rather than try to unload the components.
1213e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen
1214c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    The core should return from this call within 20 msec.
1215e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen
1216c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @return OMX_ERRORTYPE
1217c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        If the command successfully executes, the return code will be
1218c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.
1219c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @ingroup core
1220c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev */
1221c322989ae6ff6769490828de1b5eda12b749cce9Iliyan MalchevOMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_Deinit(void);
1222c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
1223c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
1224c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev/** The OMX_ComponentNameEnum method will enumerate through all the names of
1225c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    recognised valid components in the system. This function is provided
1226c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    as a means to detect all the components in the system run-time. There is
1227c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    no strict ordering to the enumeration order of component names, although
1228c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    each name will only be enumerated once.  If the OMX core supports run-time
1229c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    installation of new components, it is only requried to detect newly
1230c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    installed components when the first call to enumerate component names
1231c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    is made (i.e. when nIndex is 0x0).
1232e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen
1233c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    The core should return from this call in 20 msec.
1234e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen
1235c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @param [out] cComponentName
1236c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        pointer to a null terminated string with the component name.  The
1237c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        names of the components are strings less than 127 bytes in length
1238e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen        plus the trailing null for a maximum size of 128 bytes.  An example
1239e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen        of a valid component name is "OMX.TI.AUDIO.DSP.MIXER\0".  Names are
1240e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen        assigned by the vendor, but shall start with "OMX." and then have
1241c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        the Vendor designation next.
1242c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @param [in] nNameLength
1243e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen        number of characters in the cComponentName string.  With all
1244e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen        component name strings restricted to less than 128 characters
1245c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        (including the trailing null) it is recomended that the caller
1246c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        provide a input string for the cComponentName of 128 characters.
1247c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @param [in] nIndex
1248e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen        number containing the enumeration index for the component.
1249c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        Multiple calls to OMX_ComponentNameEnum with increasing values
1250c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        of nIndex will enumerate through the component names in the
1251c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        system until OMX_ErrorNoMore is returned.  The value of nIndex
1252c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        is 0 to (N-1), where N is the number of valid installed components
1253c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        in the system.
1254c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @return OMX_ERRORTYPE
1255c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        If the command successfully executes, the return code will be
1256e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen        OMX_ErrorNone.  When the value of nIndex exceeds the number of
1257c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        components in the system minus 1, OMX_ErrorNoMore will be
1258c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        returned. Otherwise the appropriate OMX error will be returned.
1259c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @ingroup core
1260c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev */
1261c322989ae6ff6769490828de1b5eda12b749cce9Iliyan MalchevOMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_ComponentNameEnum(
1262c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_OUT OMX_STRING cComponentName,
1263c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_IN  OMX_U32 nNameLength,
1264c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_IN  OMX_U32 nIndex);
1265c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
1266c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
1267c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev/** The OMX_GetHandle method will locate the component specified by the
1268c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    component name given, load that component into memory and then invoke
1269e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    the component's methods to create an instance of the component.
1270e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen
1271c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    The core should return from this call within 20 msec.
1272e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen
1273c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @param [out] pHandle
1274c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        pointer to an OMX_HANDLETYPE pointer to be filled in by this method.
1275c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @param [in] cComponentName
1276c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        pointer to a null terminated string with the component name.  The
1277c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        names of the components are strings less than 127 bytes in length
1278e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen        plus the trailing null for a maximum size of 128 bytes.  An example
1279e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen        of a valid component name is "OMX.TI.AUDIO.DSP.MIXER\0".  Names are
1280e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen        assigned by the vendor, but shall start with "OMX." and then have
1281c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        the Vendor designation next.
1282c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @param [in] pAppData
1283c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        pointer to an application defined value that will be returned
1284c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        during callbacks so that the application can identify the source
1285c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        of the callback.
1286c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @param [in] pCallBacks
1287c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        pointer to a OMX_CALLBACKTYPE structure that will be passed to the
1288e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen        component to initialize it with.
1289c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @return OMX_ERRORTYPE
1290c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        If the command successfully executes, the return code will be
1291c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.
1292c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @ingroup core
1293c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev */
1294c322989ae6ff6769490828de1b5eda12b749cce9Iliyan MalchevOMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_GetHandle(
1295e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    OMX_OUT OMX_HANDLETYPE* pHandle,
1296c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_IN  OMX_STRING cComponentName,
1297c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_IN  OMX_PTR pAppData,
1298c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_IN  OMX_CALLBACKTYPE* pCallBacks);
1299c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
1300c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
1301e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen/** The OMX_FreeHandle method will free a handle allocated by the OMX_GetHandle
1302c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    method.  If the component reference count goes to zero, the component will
1303e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    be unloaded from memory.
1304e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen
1305e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    The core should return from this call within 20 msec when the component is
1306c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    in the OMX_StateLoaded state.
1307c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
1308c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @param [in] hComponent
1309c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        Handle of the component to be accessed.  This is the component
1310c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        handle returned by the call to the GetHandle function.
1311c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @return OMX_ERRORTYPE
1312c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        If the command successfully executes, the return code will be
1313c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.
1314c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @ingroup core
1315c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev */
1316c322989ae6ff6769490828de1b5eda12b749cce9Iliyan MalchevOMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_FreeHandle(
1317c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_IN  OMX_HANDLETYPE hComponent);
1318c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
1319c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
1320c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
1321c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev/** The OMX_SetupTunnel method will handle the necessary calls to the components
1322c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    to setup the specified tunnel the two components.  NOTE: This is
1323c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    an actual method (not a #define macro).  This method will make calls into
1324e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    the component ComponentTunnelRequest method to do the actual tunnel
1325e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    connection.
1326c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
1327e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    The ComponentTunnelRequest method on both components will be called.
1328e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    This method shall not be called unless the component is in the
1329c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_StateLoaded state except when the ports used for the tunnel are
1330c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    disabled. In this case, the component may be in the OMX_StateExecuting,
1331e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    OMX_StatePause, or OMX_StateIdle states.
1332c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
1333c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    The core should return from this call within 20 msec.
1334e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen
1335c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @param [in] hOutput
1336c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        Handle of the component to be accessed.  Also this is the handle
1337c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        of the component whose port, specified in the nPortOutput parameter
1338c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        will be used the source for the tunnel. This is the component handle
1339e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen        returned by the call to the OMX_GetHandle function.  There is a
1340c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        requirement that hOutput be the source for the data when
1341c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        tunelling (i.e. nPortOutput is an output port).  If 0x0, the component
1342c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        specified in hInput will have it's port specified in nPortInput
1343c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        setup for communication with the application / IL client.
1344c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @param [in] nPortOutput
1345c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        nPortOutput is used to select the source port on component to be
1346e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen        used in the tunnel.
1347c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @param [in] hInput
1348c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        This is the component to setup the tunnel with. This is the handle
1349c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        of the component whose port, specified in the nPortInput parameter
1350c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        will be used the destination for the tunnel. This is the component handle
1351e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen        returned by the call to the OMX_GetHandle function.  There is a
1352c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        requirement that hInput be the destination for the data when
1353c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        tunelling (i.e. nPortInut is an input port).   If 0x0, the component
1354c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        specified in hOutput will have it's port specified in nPortPOutput
1355c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        setup for communication with the application / IL client.
1356c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @param [in] nPortInput
1357c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        nPortInput is used to select the destination port on component to be
1358c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        used in the tunnel.
1359c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @return OMX_ERRORTYPE
1360c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        If the command successfully executes, the return code will be
1361c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.
1362e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen        When OMX_ErrorNotImplemented is returned, one or both components is
1363c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        a non-interop component and does not support tunneling.
1364e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen
1365c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        On failure, the ports of both components are setup for communication
1366c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        with the application / IL Client.
1367c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @ingroup core tun
1368c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev */
1369c322989ae6ff6769490828de1b5eda12b749cce9Iliyan MalchevOMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_SetupTunnel(
1370c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_IN  OMX_HANDLETYPE hOutput,
1371c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_IN  OMX_U32 nPortOutput,
1372c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_IN  OMX_HANDLETYPE hInput,
1373c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_IN  OMX_U32 nPortInput);
1374e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen
1375c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev/** @ingroup cp */
1376c322989ae6ff6769490828de1b5eda12b749cce9Iliyan MalchevOMX_API OMX_ERRORTYPE   OMX_GetContentPipe(
1377c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_OUT OMX_HANDLETYPE *hPipe,
1378c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_IN OMX_STRING szURI);
1379c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
1380c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev/** The OMX_GetComponentsOfRole method will return the number of components that support the given
1381e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    role and (if the compNames field is non-NULL) the names of those components. The call will fail if
1382c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    an insufficiently sized array of names is supplied. To ensure the array is sufficiently sized the
1383c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    client should:
1384c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        * first call this function with the compNames field NULL to determine the number of component names
1385e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen        * second call this function with the compNames field pointing to an array of names allocated
1386c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev          according to the number returned by the first call.
1387c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
1388c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    The core should return from this call within 5 msec.
1389e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen
1390c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @param [in] role
1391e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen        This is generic standard component name consisting only of component class
1392c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        name and the type within that class (e.g. 'audio_decoder.aac').
1393c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @param [inout] pNumComps
1394e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen        This is used both as input and output.
1395e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen
1396c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        If compNames is NULL, the input is ignored and the output specifies how many components support
1397c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        the given role.
1398e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen
1399e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen        If compNames is not NULL, on input it bounds the size of the input structure and
1400c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        on output, it specifies the number of components string names listed within the compNames parameter.
1401c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @param [inout] compNames
1402e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen        If NULL this field is ignored. If non-NULL this points to an array of 128-byte strings which accepts
1403e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen        a list of the names of all physical components that implement the specified standard component name.
1404c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        Each name is NULL terminated. numComps indicates the number of names.
1405c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @ingroup core
1406c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev */
1407e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. ChenOMX_API OMX_ERRORTYPE OMX_GetComponentsOfRole (
1408c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev	OMX_IN      OMX_STRING role,
1409c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_INOUT   OMX_U32 *pNumComps,
1410c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_INOUT   OMX_U8  **compNames);
1411c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
1412c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev/** The OMX_GetRolesOfComponent method will return the number of roles supported by the given
1413e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen    component and (if the roles field is non-NULL) the names of those roles. The call will fail if
1414c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    an insufficiently sized array of names is supplied. To ensure the array is sufficiently sized the
1415c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    client should:
1416c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        * first call this function with the roles field NULL to determine the number of role names
1417e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen        * second call this function with the roles field pointing to an array of names allocated
1418c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev          according to the number returned by the first call.
1419c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
1420c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    The core should return from this call within 5 msec.
1421c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
1422c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @param [in] compName
1423c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        This is the name of the component being queried about.
1424c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @param [inout] pNumRoles
1425e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen        This is used both as input and output.
1426e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen
1427c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        If roles is NULL, the input is ignored and the output specifies how many roles the component supports.
1428e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen
1429e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen        If compNames is not NULL, on input it bounds the size of the input structure and
1430c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        on output, it specifies the number of roles string names listed within the roles parameter.
1431c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @param [out] roles
1432e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen        If NULL this field is ignored. If non-NULL this points to an array of 128-byte strings
1433e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen        which accepts a list of the names of all standard components roles implemented on the
1434c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev        specified component name. numComps indicates the number of names.
1435c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    @ingroup core
1436c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev */
1437e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. ChenOMX_API OMX_ERRORTYPE OMX_GetRolesOfComponent (
1438e4b5eb97c1ebb41905d9acb8cf1c0992688152e9Mike J. Chen	OMX_IN      OMX_STRING compName,
1439c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_INOUT   OMX_U32 *pNumRoles,
1440c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev    OMX_OUT     OMX_U8 **roles);
1441c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
1442c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#ifdef __cplusplus
1443c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev}
1444c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#endif /* __cplusplus */
1445c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
1446c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev#endif
1447c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev/* File EOF */
1448c322989ae6ff6769490828de1b5eda12b749cce9Iliyan Malchev
1449