OMX_Types.h 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352
  1. /*
  2. * Copyright (c) 2008 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. /** OMX_Types.h - OpenMax IL version 1.1.2
  24. * The OMX_Types header file contains the primitive type definitions used by
  25. * the core, the application and the component. This file may need to be
  26. * modified to be used on systems that do not have "char" set to 8 bits,
  27. * "short" set to 16 bits and "long" set to 32 bits.
  28. */
  29. #ifndef OMX_Types_h
  30. #define OMX_Types_h
  31. #ifdef __cplusplus
  32. extern "C" {
  33. #endif /* __cplusplus */
  34. /** The OMX_API and OMX_APIENTRY are platform specific definitions used
  35. * to declare OMX function prototypes. They are modified to meet the
  36. * requirements for a particular platform */
  37. #ifdef __SYMBIAN32__
  38. # ifdef __OMX_EXPORTS
  39. # define OMX_API __declspec(dllexport)
  40. # else
  41. # ifdef _WIN32
  42. # define OMX_API __declspec(dllexport)
  43. # else
  44. # define OMX_API __declspec(dllimport)
  45. # endif
  46. # endif
  47. #else
  48. # ifdef _WIN32
  49. # ifdef __OMX_EXPORTS
  50. # define OMX_API __declspec(dllexport)
  51. # else
  52. # define OMX_API __declspec(dllimport)
  53. # endif
  54. # else
  55. # ifdef __OMX_EXPORTS
  56. # define OMX_API
  57. # else
  58. # define OMX_API extern
  59. # endif
  60. # endif
  61. #endif
  62. #ifndef OMX_APIENTRY
  63. #define OMX_APIENTRY
  64. #endif
  65. /** OMX_IN is used to identify inputs to an OMX function. This designation
  66. will also be used in the case of a pointer that points to a parameter
  67. that is used as an output. */
  68. #ifndef OMX_IN
  69. #define OMX_IN
  70. #endif
  71. /** OMX_OUT is used to identify outputs from an OMX function. This
  72. designation will also be used in the case of a pointer that points
  73. to a parameter that is used as an input. */
  74. #ifndef OMX_OUT
  75. #define OMX_OUT
  76. #endif
  77. /** OMX_INOUT is used to identify parameters that may be either inputs or
  78. outputs from an OMX function at the same time. This designation will
  79. also be used in the case of a pointer that points to a parameter that
  80. is used both as an input and an output. */
  81. #ifndef OMX_INOUT
  82. #define OMX_INOUT
  83. #endif
  84. /** OMX_ALL is used to as a wildcard to select all entities of the same type
  85. * when specifying the index, or referring to a object by an index. (i.e.
  86. * use OMX_ALL to indicate all N channels). When used as a port index
  87. * for a config or parameter this OMX_ALL denotes that the config or
  88. * parameter applies to the entire component not just one port. */
  89. #define OMX_ALL 0xFFFFFFFF
  90. /** In the following we define groups that help building doxygen documentation */
  91. /** @defgroup core OpenMAX IL core
  92. * Functions and structure related to the OMX IL core
  93. */
  94. /** @defgroup comp OpenMAX IL component
  95. * Functions and structure related to the OMX IL component
  96. */
  97. /** @defgroup rpm Resource and Policy Management
  98. * Structures for resource and policy management of components
  99. */
  100. /** @defgroup buf Buffer Management
  101. * Buffer handling functions and structures
  102. */
  103. /** @defgroup tun Tunneling
  104. * @ingroup core comp
  105. * Structures and functions to manage tunnels among component ports
  106. */
  107. /** @defgroup cp Content Pipes
  108. * @ingroup core
  109. */
  110. /** @defgroup metadata Metadata handling
  111. *
  112. */
  113. /** OMX_U8 is an 8 bit unsigned quantity that is byte aligned */
  114. typedef unsigned char OMX_U8;
  115. /** OMX_S8 is an 8 bit signed quantity that is byte aligned */
  116. typedef signed char OMX_S8;
  117. /** OMX_U16 is a 16 bit unsigned quantity that is 16 bit word aligned */
  118. typedef unsigned short OMX_U16;
  119. /** OMX_S16 is a 16 bit signed quantity that is 16 bit word aligned */
  120. typedef signed short OMX_S16;
  121. /** OMX_U32 is a 32 bit unsigned quantity that is 32 bit word aligned */
  122. typedef unsigned long OMX_U32;
  123. /** OMX_S32 is a 32 bit signed quantity that is 32 bit word aligned */
  124. typedef signed long OMX_S32;
  125. /* Users with compilers that cannot accept the "long long" designation should
  126. define the OMX_SKIP64BIT macro. It should be noted that this may cause
  127. some components to fail to compile if the component was written to require
  128. 64 bit integral types. However, these components would NOT compile anyway
  129. since the compiler does not support the way the component was written.
  130. */
  131. #ifndef OMX_SKIP64BIT
  132. #ifdef __SYMBIAN32__
  133. /** OMX_U64 is a 64 bit unsigned quantity that is 64 bit word aligned */
  134. typedef unsigned long long OMX_U64;
  135. /** OMX_S64 is a 64 bit signed quantity that is 64 bit word aligned */
  136. typedef signed long long OMX_S64;
  137. #elif defined(WIN32)
  138. /** OMX_U64 is a 64 bit unsigned quantity that is 64 bit word aligned */
  139. typedef unsigned __int64 OMX_U64;
  140. /** OMX_S64 is a 64 bit signed quantity that is 64 bit word aligned */
  141. typedef signed __int64 OMX_S64;
  142. #else /* WIN32 */
  143. /** OMX_U64 is a 64 bit unsigned quantity that is 64 bit word aligned */
  144. typedef unsigned long long OMX_U64;
  145. /** OMX_S64 is a 64 bit signed quantity that is 64 bit word aligned */
  146. typedef signed long long OMX_S64;
  147. #endif /* WIN32 */
  148. #endif
  149. /** The OMX_BOOL type is intended to be used to represent a true or a false
  150. value when passing parameters to and from the OMX core and components. The
  151. OMX_BOOL is a 32 bit quantity and is aligned on a 32 bit word boundary.
  152. */
  153. typedef enum OMX_BOOL {
  154. OMX_FALSE = 0,
  155. OMX_TRUE = !OMX_FALSE,
  156. OMX_BOOL_MAX = 0x7FFFFFFF
  157. } OMX_BOOL;
  158. /** The OMX_PTR type is intended to be used to pass pointers between the OMX
  159. applications and the OMX Core and components. This is a 32 bit pointer and
  160. is aligned on a 32 bit boundary.
  161. */
  162. typedef void* OMX_PTR;
  163. /** The OMX_STRING type is intended to be used to pass "C" type strings between
  164. the application and the core and component. The OMX_STRING type is a 32
  165. bit pointer to a zero terminated string. The pointer is word aligned and
  166. the string is byte aligned.
  167. */
  168. typedef char* OMX_STRING;
  169. /** The OMX_BYTE type is intended to be used to pass arrays of bytes such as
  170. buffers between the application and the component and core. The OMX_BYTE
  171. type is a 32 bit pointer to a zero terminated string. The pointer is word
  172. aligned and the string is byte aligned.
  173. */
  174. typedef unsigned char* OMX_BYTE;
  175. /** OMX_UUIDTYPE is a very long unique identifier to uniquely identify
  176. at runtime. This identifier should be generated by a component in a way
  177. that guarantees that every instance of the identifier running on the system
  178. is unique. */
  179. typedef unsigned char OMX_UUIDTYPE[128];
  180. /** The OMX_DIRTYPE enumeration is used to indicate if a port is an input or
  181. an output port. This enumeration is common across all component types.
  182. */
  183. typedef enum OMX_DIRTYPE {
  184. OMX_DirInput, /**< Port is an input port */
  185. OMX_DirOutput, /**< Port is an output port */
  186. OMX_DirMax = 0x7FFFFFFF
  187. } OMX_DIRTYPE;
  188. /** The OMX_ENDIANTYPE enumeration is used to indicate the bit ordering
  189. for numerical data (i.e. big endian, or little endian).
  190. */
  191. typedef enum OMX_ENDIANTYPE {
  192. OMX_EndianBig, /**< big endian */
  193. OMX_EndianLittle, /**< little endian */
  194. OMX_EndianMax = 0x7FFFFFFF
  195. } OMX_ENDIANTYPE;
  196. /** The OMX_NUMERICALDATATYPE enumeration is used to indicate if data
  197. is signed or unsigned
  198. */
  199. typedef enum OMX_NUMERICALDATATYPE {
  200. OMX_NumericalDataSigned, /**< signed data */
  201. OMX_NumericalDataUnsigned, /**< unsigned data */
  202. OMX_NumercialDataMax = 0x7FFFFFFF
  203. } OMX_NUMERICALDATATYPE;
  204. /** Unsigned bounded value type */
  205. typedef struct OMX_BU32 {
  206. OMX_U32 nValue; /**< actual value */
  207. OMX_U32 nMin; /**< minimum for value (i.e. nValue >= nMin) */
  208. OMX_U32 nMax; /**< maximum for value (i.e. nValue <= nMax) */
  209. } OMX_BU32;
  210. /** Signed bounded value type */
  211. typedef struct OMX_BS32 {
  212. OMX_S32 nValue; /**< actual value */
  213. OMX_S32 nMin; /**< minimum for value (i.e. nValue >= nMin) */
  214. OMX_S32 nMax; /**< maximum for value (i.e. nValue <= nMax) */
  215. } OMX_BS32;
  216. /** Structure representing some time or duration in microseconds. This structure
  217. * must be interpreted as a signed 64 bit value. The quantity is signed to accommodate
  218. * negative deltas and preroll scenarios. The quantity is represented in microseconds
  219. * to accomodate high resolution timestamps (e.g. DVD presentation timestamps based
  220. * on a 90kHz clock) and to allow more accurate and synchronized delivery (e.g.
  221. * individual audio samples delivered at 192 kHz). The quantity is 64 bit to
  222. * accommodate a large dynamic range (signed 32 bit values would allow only for plus
  223. * or minus 35 minutes).
  224. *
  225. * Implementations with limited precision may convert the signed 64 bit value to
  226. * a signed 32 bit value internally but risk loss of precision.
  227. */
  228. #ifndef OMX_SKIP64BIT
  229. typedef OMX_S64 OMX_TICKS;
  230. #else
  231. typedef struct OMX_TICKS {
  232. OMX_U32 nLowPart; /** low bits of the signed 64 bit tick value */
  233. OMX_U32 nHighPart; /** high bits of the signed 64 bit tick value */
  234. } OMX_TICKS;
  235. #endif
  236. #define OMX_TICKS_PER_SECOND 1000000
  237. /** Define the public interface for the OMX Handle. The core will not use
  238. this value internally, but the application should only use this value.
  239. */
  240. typedef void* OMX_HANDLETYPE;
  241. typedef struct OMX_MARKTYPE {
  242. OMX_HANDLETYPE hMarkTargetComponent; /**< The component that will
  243. generate a mark event upon
  244. processing the mark. */
  245. OMX_PTR pMarkData; /**< Application specific data associated with
  246. the mark sent on a mark event to disambiguate
  247. this mark from others. */
  248. } OMX_MARKTYPE;
  249. /** OMX_NATIVE_DEVICETYPE is used to map a OMX video port to the
  250. * platform & operating specific object used to reference the display
  251. * or can be used by a audio port for native audio rendering */
  252. typedef void* OMX_NATIVE_DEVICETYPE;
  253. /** OMX_NATIVE_WINDOWTYPE is used to map a OMX video port to the
  254. * platform & operating specific object used to reference the window */
  255. typedef void* OMX_NATIVE_WINDOWTYPE;
  256. /** Define the OMX IL version that corresponds to this set of header files.
  257. * We also define a combined version that can be used to write or compare
  258. * values of the 32bit nVersion field, assuming a little endian architecture */
  259. #define OMX_VERSION_MAJOR 1
  260. #define OMX_VERSION_MINOR 1
  261. #define OMX_VERSION_REVISION 2
  262. #define OMX_VERSION_STEP 0
  263. #define OMX_VERSION ((OMX_VERSION_STEP<<24) | (OMX_VERSION_REVISION<<16) | (OMX_VERSION_MINOR<<8) | OMX_VERSION_MAJOR)
  264. /** The OMX_VERSIONTYPE union is used to specify the version for
  265. a structure or component. For a component, the version is entirely
  266. specified by the component vendor. Components doing the same function
  267. from different vendors may or may not have the same version. For
  268. structures, the version shall be set by the entity that allocates the
  269. structure. For structures specified in the OMX 1.1 specification, the
  270. value of the version shall be set to 1.1.0.0 in all cases. Access to the
  271. OMX_VERSIONTYPE can be by a single 32 bit access (e.g. by nVersion) or
  272. by accessing one of the structure elements to, for example, check only
  273. the Major revision.
  274. */
  275. typedef union OMX_VERSIONTYPE {
  276. struct {
  277. OMX_U8 nVersionMajor; /**< Major version accessor element */
  278. OMX_U8 nVersionMinor; /**< Minor version accessor element */
  279. OMX_U8 nRevision; /**< Revision version accessor element */
  280. OMX_U8 nStep; /**< Step version accessor element */
  281. } s;
  282. OMX_U32 nVersion; /**< 32 bit value to make accessing the
  283. version easily done in a single word
  284. size copy/compare operation */
  285. } OMX_VERSIONTYPE;
  286. #ifdef __cplusplus
  287. }
  288. #endif /* __cplusplus */
  289. #endif
  290. /* File EOF */