OSDN Git Service

original
[gb-231r1-is01/Gingerbread_2.3.3_r1_IS01.git] / hardware / ti / omap3 / omx / system / src / openmax_il / omx_core / inc / OMX_Types.h
1 /*\r
2  * Copyright (c) 2008 The Khronos Group Inc. \r
3  * \r
4  * Permission is hereby granted, free of charge, to any person obtaining\r
5  * a copy of this software and associated documentation files (the\r
6  * "Software"), to deal in the Software without restriction, including\r
7  * without limitation the rights to use, copy, modify, merge, publish,\r
8  * distribute, sublicense, and/or sell copies of the Software, and to\r
9  * permit persons to whom the Software is furnished to do so, subject\r
10  * to the following conditions: \r
11  * The above copyright notice and this permission notice shall be included\r
12  * in all copies or substantial portions of the Software. \r
13  * \r
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS\r
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
16  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\r
17  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\r
18  * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\r
19  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\r
20  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \r
21  *\r
22  */\r
23 \r
24 /** OMX_Types.h - OpenMax IL version 1.1.2\r
25  *  The OMX_Types header file contains the primitive type definitions used by \r
26  *  the core, the application and the component.  This file may need to be\r
27  *  modified to be used on systems that do not have "char" set to 8 bits, \r
28  *  "short" set to 16 bits and "long" set to 32 bits.\r
29  */\r
30 \r
31 #ifndef OMX_Types_h\r
32 #define OMX_Types_h\r
33 \r
34 #ifdef __cplusplus\r
35 extern "C" {\r
36 #endif /* __cplusplus */\r
37 \r
38 /** The OMX_API and OMX_APIENTRY are platform specific definitions used\r
39  *  to declare OMX function prototypes.  They are modified to meet the\r
40  *  requirements for a particular platform */\r
41 #ifdef __SYMBIAN32__   \r
42 #   ifdef __OMX_EXPORTS\r
43 #       define OMX_API __declspec(dllexport)\r
44 #   else\r
45 #       ifdef _WIN32\r
46 #           define OMX_API __declspec(dllexport) \r
47 #       else\r
48 #           define OMX_API __declspec(dllimport)\r
49 #       endif\r
50 #   endif\r
51 #else\r
52 #   ifdef _WIN32\r
53 #      ifdef __OMX_EXPORTS\r
54 #          define OMX_API __declspec(dllexport)\r
55 #      else\r
56 #          define OMX_API __declspec(dllimport)\r
57 #      endif\r
58 #   else\r
59 #      ifdef __OMX_EXPORTS\r
60 #          define OMX_API\r
61 #      else\r
62 #          define OMX_API extern\r
63 #      endif\r
64 #   endif\r
65 #endif\r
66 \r
67 #ifndef OMX_APIENTRY\r
68 #define OMX_APIENTRY \r
69 #endif \r
70 \r
71 /** OMX_IN is used to identify inputs to an OMX function.  This designation \r
72     will also be used in the case of a pointer that points to a parameter \r
73     that is used as an output. */\r
74 #ifndef OMX_IN\r
75 #define OMX_IN\r
76 #endif\r
77 \r
78 /** OMX_OUT is used to identify outputs from an OMX function.  This \r
79     designation will also be used in the case of a pointer that points \r
80     to a parameter that is used as an input. */\r
81 #ifndef OMX_OUT\r
82 #define OMX_OUT\r
83 #endif\r
84 \r
85 \r
86 /** OMX_INOUT is used to identify parameters that may be either inputs or\r
87     outputs from an OMX function at the same time.  This designation will \r
88     also be used in the case of a pointer that  points to a parameter that \r
89     is used both as an input and an output. */\r
90 #ifndef OMX_INOUT\r
91 #define OMX_INOUT\r
92 #endif\r
93 \r
94 /** OMX_ALL is used to as a wildcard to select all entities of the same type\r
95  *  when specifying the index, or referring to a object by an index.  (i.e.\r
96  *  use OMX_ALL to indicate all N channels). When used as a port index\r
97  *  for a config or parameter this OMX_ALL denotes that the config or\r
98  *  parameter applies to the entire component not just one port. */\r
99 #define OMX_ALL 0xFFFFFFFF\r
100 \r
101 /** In the following we define groups that help building doxygen documentation */\r
102 \r
103 /** @defgroup core OpenMAX IL core\r
104  * Functions and structure related to the OMX IL core\r
105  */\r
106  \r
107  /** @defgroup comp OpenMAX IL component\r
108  * Functions and structure related to the OMX IL component\r
109  */\r
110  \r
111 /** @defgroup rpm Resource and Policy Management \r
112  * Structures for resource and policy management of components\r
113  */\r
114 \r
115 /** @defgroup buf Buffer Management\r
116  * Buffer handling functions and structures\r
117  */\r
118   \r
119 /** @defgroup tun Tunneling\r
120  * @ingroup core comp\r
121  * Structures and functions to manage tunnels among component ports\r
122  */\r
123  \r
124 /** @defgroup cp Content Pipes\r
125  *  @ingroup core\r
126  */\r
127  \r
128  /** @defgroup metadata Metadata handling\r
129   * \r
130   */ \r
131 \r
132 /** OMX_U8 is an 8 bit unsigned quantity that is byte aligned */\r
133 typedef unsigned char OMX_U8;\r
134 \r
135 /** OMX_S8 is an 8 bit signed quantity that is byte aligned */\r
136 typedef signed char OMX_S8;\r
137 \r
138 /** OMX_U16 is a 16 bit unsigned quantity that is 16 bit word aligned */\r
139 typedef unsigned short OMX_U16;\r
140 \r
141 /** OMX_S16 is a 16 bit signed quantity that is 16 bit word aligned */\r
142 typedef signed short OMX_S16;\r
143 \r
144 /** OMX_U32 is a 32 bit unsigned quantity that is 32 bit word aligned */\r
145 typedef unsigned long OMX_U32;\r
146 \r
147 /** OMX_S32 is a 32 bit signed quantity that is 32 bit word aligned */\r
148 typedef signed long OMX_S32;\r
149 \r
150 \r
151 /* Users with compilers that cannot accept the "long long" designation should\r
152    define the OMX_SKIP64BIT macro.  It should be noted that this may cause \r
153    some components to fail to compile if the component was written to require\r
154    64 bit integral types.  However, these components would NOT compile anyway\r
155    since the compiler does not support the way the component was written.\r
156 */\r
157 #ifndef OMX_SKIP64BIT\r
158 #ifdef __SYMBIAN32__\r
159 /** OMX_U64 is a 64 bit unsigned quantity that is 64 bit word aligned */\r
160 typedef unsigned long long OMX_U64;\r
161 \r
162 /** OMX_S64 is a 64 bit signed quantity that is 64 bit word aligned */\r
163 typedef signed long long OMX_S64;\r
164 \r
165 #elif defined(WIN32)\r
166 \r
167 /** OMX_U64 is a 64 bit unsigned quantity that is 64 bit word aligned */   \r
168 typedef unsigned __int64  OMX_U64;\r
169 \r
170 /** OMX_S64 is a 64 bit signed quantity that is 64 bit word aligned */\r
171 typedef signed   __int64  OMX_S64;\r
172 \r
173 #else /* WIN32 */\r
174 \r
175 /** OMX_U64 is a 64 bit unsigned quantity that is 64 bit word aligned */\r
176 typedef unsigned long long OMX_U64;\r
177 \r
178 /** OMX_S64 is a 64 bit signed quantity that is 64 bit word aligned */\r
179 typedef signed long long OMX_S64;\r
180 \r
181 #endif /* WIN32 */\r
182 #endif\r
183 \r
184 \r
185 /** The OMX_BOOL type is intended to be used to represent a true or a false \r
186     value when passing parameters to and from the OMX core and components.  The\r
187     OMX_BOOL is a 32 bit quantity and is aligned on a 32 bit word boundary.\r
188  */\r
189 typedef enum OMX_BOOL {\r
190     OMX_FALSE = 0,\r
191     OMX_TRUE = !OMX_FALSE,\r
192     OMX_BOOL_MAX = 0x7FFFFFFF\r
193 } OMX_BOOL; \r
194  \r
195 /** The OMX_PTR type is intended to be used to pass pointers between the OMX\r
196     applications and the OMX Core and components.  This is a 32 bit pointer and\r
197     is aligned on a 32 bit boundary.\r
198  */\r
199 typedef void* OMX_PTR;\r
200 \r
201 /** The OMX_STRING type is intended to be used to pass "C" type strings between\r
202     the application and the core and component.  The OMX_STRING type is a 32 \r
203     bit pointer to a zero terminated string.  The  pointer is word aligned and \r
204     the string is byte aligned.  \r
205  */\r
206 typedef char* OMX_STRING;\r
207 \r
208 /** The OMX_BYTE type is intended to be used to pass arrays of bytes such as\r
209     buffers between the application and the component and core.  The OMX_BYTE \r
210     type is a 32 bit pointer to a zero terminated string.  The  pointer is word\r
211     aligned and the string is byte aligned.\r
212  */\r
213 typedef unsigned char* OMX_BYTE;\r
214 \r
215 /** OMX_UUIDTYPE is a very long unique identifier to uniquely identify\r
216     at runtime.  This identifier should be generated by a component in a way\r
217     that guarantees that every instance of the identifier running on the system\r
218     is unique. */\r
219 typedef unsigned char OMX_UUIDTYPE[128];\r
220 \r
221 /** The OMX_DIRTYPE enumeration is used to indicate if a port is an input or\r
222     an output port.  This enumeration is common across all component types.    \r
223  */\r
224 typedef enum OMX_DIRTYPE\r
225 {\r
226     OMX_DirInput,              /**< Port is an input port */\r
227     OMX_DirOutput,             /**< Port is an output port */\r
228     OMX_DirMax = 0x7FFFFFFF\r
229 } OMX_DIRTYPE;\r
230 \r
231 /** The OMX_ENDIANTYPE enumeration is used to indicate the bit ordering \r
232     for numerical data (i.e. big endian, or little endian).    \r
233  */\r
234 typedef enum OMX_ENDIANTYPE\r
235 {\r
236     OMX_EndianBig, /**< big endian */\r
237     OMX_EndianLittle, /**< little endian */\r
238     OMX_EndianMax = 0x7FFFFFFF\r
239 } OMX_ENDIANTYPE;\r
240 \r
241 \r
242 /** The OMX_NUMERICALDATATYPE enumeration is used to indicate if data \r
243     is signed or unsigned\r
244  */\r
245 typedef enum OMX_NUMERICALDATATYPE\r
246 {\r
247     OMX_NumericalDataSigned, /**< signed data */\r
248     OMX_NumericalDataUnsigned, /**< unsigned data */\r
249     OMX_NumercialDataMax = 0x7FFFFFFF\r
250 } OMX_NUMERICALDATATYPE;\r
251 \r
252 \r
253 /** Unsigned bounded value type */\r
254 typedef struct OMX_BU32 {\r
255     OMX_U32 nValue; /**< actual value */\r
256     OMX_U32 nMin;   /**< minimum for value (i.e. nValue >= nMin) */\r
257     OMX_U32 nMax;   /**< maximum for value (i.e. nValue <= nMax) */\r
258 } OMX_BU32;\r
259 \r
260 \r
261 /** Signed bounded value type */\r
262 typedef struct OMX_BS32 {\r
263     OMX_S32 nValue; /**< actual value */\r
264     OMX_S32 nMin;   /**< minimum for value (i.e. nValue >= nMin) */\r
265     OMX_S32 nMax;   /**< maximum for value (i.e. nValue <= nMax) */\r
266 } OMX_BS32;\r
267 \r
268 \r
269 /** Structure representing some time or duration in microseconds. This structure\r
270   *  must be interpreted as a signed 64 bit value. The quantity is signed to accommodate \r
271   *  negative deltas and preroll scenarios. The quantity is represented in microseconds \r
272   *  to accomodate high resolution timestamps (e.g. DVD presentation timestamps based\r
273   *  on a 90kHz clock) and to allow more accurate and synchronized delivery (e.g. \r
274   *  individual audio samples delivered at 192 kHz). The quantity is 64 bit to \r
275   *  accommodate a large dynamic range (signed 32 bit values would allow only for plus\r
276   *  or minus 35 minutes).\r
277   *\r
278   *  Implementations with limited precision may convert the signed 64 bit value to \r
279   *  a signed 32 bit value internally but risk loss of precision.  \r
280   */\r
281 #ifndef OMX_SKIP64BIT\r
282 typedef OMX_S64 OMX_TICKS;\r
283 #else\r
284 typedef struct OMX_TICKS\r
285 {\r
286     OMX_U32 nLowPart;    /** low bits of the signed 64 bit tick value */\r
287     OMX_U32 nHighPart;   /** high bits of the signed 64 bit tick value */\r
288 } OMX_TICKS;\r
289 #endif\r
290 #define OMX_TICKS_PER_SECOND 1000000\r
291 \r
292 /** Define the public interface for the OMX Handle.  The core will not use\r
293     this value internally, but the application should only use this value.\r
294  */\r
295 typedef void* OMX_HANDLETYPE;\r
296 \r
297 typedef struct OMX_MARKTYPE\r
298 {\r
299     OMX_HANDLETYPE hMarkTargetComponent;   /**< The component that will \r
300                                                 generate a mark event upon \r
301                                                 processing the mark. */\r
302     OMX_PTR pMarkData;   /**< Application specific data associated with \r
303                               the mark sent on a mark event to disambiguate \r
304                               this mark from others. */\r
305 } OMX_MARKTYPE;\r
306 \r
307 \r
308 /** OMX_NATIVE_DEVICETYPE is used to map a OMX video port to the\r
309  *  platform & operating specific object used to reference the display \r
310  *  or can be used by a audio port for native audio rendering */\r
311 typedef void* OMX_NATIVE_DEVICETYPE;\r
312 \r
313 /** OMX_NATIVE_WINDOWTYPE is used to map a OMX video port to the\r
314  *  platform & operating specific object used to reference the window */\r
315 typedef void* OMX_NATIVE_WINDOWTYPE;\r
316 \r
317 /** The OMX_VERSIONTYPE union is used to specify the version for\r
318     a structure or component.  For a component, the version is entirely\r
319     specified by the component vendor.  Components doing the same function\r
320     from different vendors may or may not have the same version.  For \r
321     structures, the version shall be set by the entity that allocates the\r
322     structure.  For structures specified in the OMX 1.1 specification, the\r
323     value of the version shall be set to 1.1.0.0 in all cases.  Access to the\r
324     OMX_VERSIONTYPE can be by a single 32 bit access (e.g. by nVersion) or\r
325     by accessing one of the structure elements to, for example, check only\r
326     the Major revision.\r
327  */\r
328 typedef union OMX_VERSIONTYPE\r
329 {\r
330     struct\r
331     {\r
332         OMX_U8 nVersionMajor;   /**< Major version accessor element */\r
333         OMX_U8 nVersionMinor;   /**< Minor version accessor element */\r
334         OMX_U8 nRevision;       /**< Revision version accessor element */\r
335         OMX_U8 nStep;           /**< Step version accessor element */\r
336     } s;\r
337     OMX_U32 nVersion;           /**< 32 bit value to make accessing the\r
338                                     version easily done in a single word\r
339                                     size copy/compare operation */\r
340 } OMX_VERSIONTYPE;\r
341 \r
342 #ifdef __cplusplus\r
343 }\r
344 #endif /* __cplusplus */\r
345 \r
346 #endif\r
347 /* File EOF */\r