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