OMX_Core.h 68 KB

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