2 * Copyright (c) 2008 The Khronos Group Inc.
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.
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.
24 /** OMX_Core.h - OpenMax IL version 1.1.2
25 * The OMX_Core header file contains the definitions used by both the
26 * application and the component to access common items.
34 #endif /* __cplusplus */
37 /* Each OMX header shall include all required header files to allow the
38 * header to compile without errors. The includes below are required
39 * for this header file to compile successfully
42 #include <OMX_Index.h>
45 /** The OMX_COMMANDTYPE enumeration is used to specify the action in the
46 * OMX_SendCommand macro.
49 typedef enum OMX_COMMANDTYPE
51 OMX_CommandStateSet, /**< Change the component state */
52 OMX_CommandFlush, /**< Flush the data queue(s) of a component */
53 OMX_CommandPortDisable, /**< Disable a port on a component. */
54 OMX_CommandPortEnable, /**< Enable a port on a component. */
55 OMX_CommandMarkBuffer, /**< Mark a component/buffer for observation */
56 OMX_CommandKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
57 OMX_CommandVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
58 OMX_CommandMax = 0X7FFFFFFF
63 /** The OMX_STATETYPE enumeration is used to indicate or change the component
64 * state. This enumeration reflects the current state of the component when
65 * used with the OMX_GetState macro or becomes the parameter in a state change
66 * command when used with the OMX_SendCommand macro.
68 * The component will be in the Loaded state after the component is initially
69 * loaded into memory. In the Loaded state, the component is not allowed to
70 * allocate or hold resources other than to build it's internal parameter
71 * and configuration tables. The application will send one or more
72 * SetParameters/GetParameters and SetConfig/GetConfig commands to the
73 * component and the component will record each of these parameter and
74 * configuration changes for use later. When the application sends the
75 * Idle command, the component will acquire the resources needed for the
76 * specified configuration and will transition to the idle state if the
77 * allocation is successful. If the component cannot successfully
78 * transition to the idle state for any reason, the state of the component
79 * shall be fully rolled back to the Loaded state (e.g. all allocated
80 * resources shall be released). When the component receives the command
81 * to go to the Executing state, it shall begin processing buffers by
82 * sending all input buffers it holds to the application. While
83 * the component is in the Idle state, the application may also send the
84 * Pause command. If the component receives the pause command while in the
85 * Idle state, the component shall send all input buffers it holds to the
86 * application, but shall not begin processing buffers. This will allow the
87 * application to prefill buffers.
92 typedef enum OMX_STATETYPE
94 OMX_StateInvalid, /**< component has detected that it's internal data
95 structures are corrupted to the point that
96 it cannot determine it's state properly */
97 OMX_StateLoaded, /**< component has been loaded but has not completed
98 initialization. The OMX_SetParameter macro
99 and the OMX_GetParameter macro are the only
100 valid macros allowed to be sent to the
101 component in this state. */
102 OMX_StateIdle, /**< component initialization has been completed
103 successfully and the component is ready to
105 OMX_StateExecuting, /**< component has accepted the start command and
106 is processing data (if data is available) */
107 OMX_StatePause, /**< component has received pause command */
108 OMX_StateWaitForResources, /**< component is waiting for resources, either after
109 preemption or before it gets the resources requested.
110 See specification for complete details. */
111 OMX_StateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
112 OMX_StateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
113 OMX_StateMax = 0X7FFFFFFF
116 /** The OMX_ERRORTYPE enumeration defines the standard OMX Errors. These
117 * errors should cover most of the common failure cases. However,
118 * vendors are free to add additional error messages of their own as
119 * long as they follow these rules:
120 * 1. Vendor error messages shall be in the range of 0x90000000 to
122 * 2. Vendor error messages shall be defined in a header file provided
123 * with the component. No error messages are allowed that are
126 typedef enum OMX_ERRORTYPE
130 /** There were insufficient resources to perform the requested operation */
131 OMX_ErrorInsufficientResources = (OMX_S32) 0x80001000,
133 /** There was an error, but the cause of the error could not be determined */
134 OMX_ErrorUndefined = (OMX_S32) 0x80001001,
136 /** The component name string was not valid */
137 OMX_ErrorInvalidComponentName = (OMX_S32) 0x80001002,
139 /** No component with the specified name string was found */
140 OMX_ErrorComponentNotFound = (OMX_S32) 0x80001003,
142 /** The component specified did not have a "OMX_ComponentInit" or
143 "OMX_ComponentDeInit entry point */
144 OMX_ErrorInvalidComponent = (OMX_S32) 0x80001004,
146 /** One or more parameters were not valid */
147 OMX_ErrorBadParameter = (OMX_S32) 0x80001005,
149 /** The requested function is not implemented */
150 OMX_ErrorNotImplemented = (OMX_S32) 0x80001006,
152 /** The buffer was emptied before the next buffer was ready */
153 OMX_ErrorUnderflow = (OMX_S32) 0x80001007,
155 /** The buffer was not available when it was needed */
156 OMX_ErrorOverflow = (OMX_S32) 0x80001008,
158 /** The hardware failed to respond as expected */
159 OMX_ErrorHardware = (OMX_S32) 0x80001009,
161 /** The component is in the state OMX_StateInvalid */
162 OMX_ErrorInvalidState = (OMX_S32) 0x8000100A,
164 /** Stream is found to be corrupt */
165 OMX_ErrorStreamCorrupt = (OMX_S32) 0x8000100B,
167 /** Ports being connected are not compatible */
168 OMX_ErrorPortsNotCompatible = (OMX_S32) 0x8000100C,
170 /** Resources allocated to an idle component have been
171 lost resulting in the component returning to the loaded state */
172 OMX_ErrorResourcesLost = (OMX_S32) 0x8000100D,
174 /** No more indicies can be enumerated */
175 OMX_ErrorNoMore = (OMX_S32) 0x8000100E,
177 /** The component detected a version mismatch */
178 OMX_ErrorVersionMismatch = (OMX_S32) 0x8000100F,
180 /** The component is not ready to return data at this time */
181 OMX_ErrorNotReady = (OMX_S32) 0x80001010,
183 /** There was a timeout that occurred */
184 OMX_ErrorTimeout = (OMX_S32) 0x80001011,
186 /** This error occurs when trying to transition into the state you are already in */
187 OMX_ErrorSameState = (OMX_S32) 0x80001012,
189 /** Resources allocated to an executing or paused component have been
190 preempted, causing the component to return to the idle state */
191 OMX_ErrorResourcesPreempted = (OMX_S32) 0x80001013,
193 /** A non-supplier port sends this error to the IL client (via the EventHandler callback)
194 during the allocation of buffers (on a transition from the LOADED to the IDLE state or
195 on a port restart) when it deems that it has waited an unusually long time for the supplier
196 to send it an allocated buffer via a UseBuffer call. */
197 OMX_ErrorPortUnresponsiveDuringAllocation = (OMX_S32) 0x80001014,
199 /** A non-supplier port sends this error to the IL client (via the EventHandler callback)
200 during the deallocation of buffers (on a transition from the IDLE to LOADED state or
201 on a port stop) when it deems that it has waited an unusually long time for the supplier
202 to request the deallocation of a buffer header via a FreeBuffer call. */
203 OMX_ErrorPortUnresponsiveDuringDeallocation = (OMX_S32) 0x80001015,
205 /** A supplier port sends this error to the IL client (via the EventHandler callback)
206 during the stopping of a port (either on a transition from the IDLE to LOADED
207 state or a port stop) when it deems that it has waited an unusually long time for
208 the non-supplier to return a buffer via an EmptyThisBuffer or FillThisBuffer call. */
209 OMX_ErrorPortUnresponsiveDuringStop = (OMX_S32) 0x80001016,
211 /** Attempting a state transtion that is not allowed */
212 OMX_ErrorIncorrectStateTransition = (OMX_S32) 0x80001017,
214 /* Attempting a command that is not allowed during the present state. */
215 OMX_ErrorIncorrectStateOperation = (OMX_S32) 0x80001018,
217 /** The values encapsulated in the parameter or config structure are not supported. */
218 OMX_ErrorUnsupportedSetting = (OMX_S32) 0x80001019,
220 /** The parameter or config indicated by the given index is not supported. */
221 OMX_ErrorUnsupportedIndex = (OMX_S32) 0x8000101A,
223 /** The port index supplied is incorrect. */
224 OMX_ErrorBadPortIndex = (OMX_S32) 0x8000101B,
226 /** The port has lost one or more of its buffers and it thus unpopulated. */
227 OMX_ErrorPortUnpopulated = (OMX_S32) 0x8000101C,
229 /** Component suspended due to temporary loss of resources */
230 OMX_ErrorComponentSuspended = (OMX_S32) 0x8000101D,
232 /** Component suspended due to an inability to acquire dynamic resources */
233 OMX_ErrorDynamicResourcesUnavailable = (OMX_S32) 0x8000101E,
235 /** When the macroblock error reporting is enabled the component returns new error
236 for every frame that has errors */
237 OMX_ErrorMbErrorsInFrame = (OMX_S32) 0x8000101F,
239 /** A component reports this error when it cannot parse or determine the format of an input stream. */
240 OMX_ErrorFormatNotDetected = (OMX_S32) 0x80001020,
242 /** The content open operation failed. */
243 OMX_ErrorContentPipeOpenFailed = (OMX_S32) 0x80001021,
245 /** The content creation operation failed. */
246 OMX_ErrorContentPipeCreationFailed = (OMX_S32) 0x80001022,
248 /** Separate table information is being used */
249 OMX_ErrorSeperateTablesUsed = (OMX_S32) 0x80001023,
251 /** Tunneling is unsupported by the component*/
252 OMX_ErrorTunnelingUnsupported = (OMX_S32) 0x80001024,
254 OMX_ErrorKhronosExtensions = (OMX_S32)0x8F000000, /**< Reserved region for introducing Khronos Standard Extensions */
255 OMX_ErrorVendorStartUnused = (OMX_S32)0x90000000, /**< Reserved region for introducing Vendor Extensions */
256 OMX_ErrorMax = 0x7FFFFFFF
260 typedef OMX_ERRORTYPE (* OMX_COMPONENTINITTYPE)(OMX_IN OMX_HANDLETYPE hComponent);
263 typedef struct OMX_COMPONENTREGISTERTYPE
265 const char * pName; /* Component name, 128 byte limit (including '\0') applies */
266 OMX_COMPONENTINITTYPE pInitialize; /* Component instance initialization function */
267 } OMX_COMPONENTREGISTERTYPE;
270 extern OMX_COMPONENTREGISTERTYPE OMX_ComponentRegistered[];
273 typedef struct OMX_PRIORITYMGMTTYPE {
274 OMX_U32 nSize; /**< size of the structure in bytes */
275 OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
276 OMX_U32 nGroupPriority; /**< Priority of the component group */
277 OMX_U32 nGroupID; /**< ID of the component group */
278 } OMX_PRIORITYMGMTTYPE;
280 /* Component name and Role names are limited to 128 characters including the terminating '\0'. */
281 #define OMX_MAX_STRINGNAME_SIZE 128
284 typedef struct OMX_PARAM_COMPONENTROLETYPE {
285 OMX_U32 nSize; /**< size of the structure in bytes */
286 OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
287 OMX_U8 cRole[OMX_MAX_STRINGNAME_SIZE]; /**< name of standard component which defines component role */
288 } OMX_PARAM_COMPONENTROLETYPE;
290 /** End of Stream Buffer Flag:
292 * A component sets EOS when it has no more data to emit on a particular
293 * output port. Thus an output port shall set EOS on the last buffer it
294 * emits. A component's determination of when an output port should
295 * cease sending data is implemenation specific.
299 #define OMX_BUFFERFLAG_EOS 0x00000001
301 /** Start Time Buffer Flag:
303 * The source of a stream (e.g. a demux component) sets the STARTTIME
304 * flag on the buffer that contains the starting timestamp for the
305 * stream. The starting timestamp corresponds to the first data that
306 * should be displayed at startup or after a seek.
307 * The first timestamp of the stream is not necessarily the start time.
308 * For instance, in the case of a seek to a particular video frame,
309 * the target frame may be an interframe. Thus the first buffer of
310 * the stream will be the intra-frame preceding the target frame and
311 * the starttime will occur with the target frame (with any other
312 * required frames required to reconstruct the target intervening).
314 * The STARTTIME flag is directly associated with the buffer's
315 * timestamp ' thus its association to buffer data and its
316 * propagation is identical to the timestamp's.
318 * When a Sync Component client receives a buffer with the
319 * STARTTIME flag it shall perform a SetConfig on its sync port
320 * using OMX_ConfigTimeClientStartTime and passing the buffer's
326 #define OMX_BUFFERFLAG_STARTTIME 0x00000002
330 /** Decode Only Buffer Flag:
332 * The source of a stream (e.g. a demux component) sets the DECODEONLY
333 * flag on any buffer that should shall be decoded but should not be
334 * displayed. This flag is used, for instance, when a source seeks to
335 * a target interframe that requires the decode of frames preceding the
336 * target to facilitate the target's reconstruction. In this case the
337 * source would emit the frames preceding the target downstream
338 * but mark them as decode only.
340 * The DECODEONLY is associated with buffer data and propagated in a
341 * manner identical to the buffer timestamp.
343 * A component that renders data should ignore all buffers with
344 * the DECODEONLY flag set.
349 #define OMX_BUFFERFLAG_DECODEONLY 0x00000004
352 /* Data Corrupt Flag: This flag is set when the IL client believes the data in the associated buffer is corrupt
356 #define OMX_BUFFERFLAG_DATACORRUPT 0x00000008
358 /* End of Frame: The buffer contains exactly one end of frame and no data
359 * occurs after the end of frame. This flag is an optional hint. The absence
360 * of this flag does not imply the absence of an end of frame within the buffer.
363 #define OMX_BUFFERFLAG_ENDOFFRAME 0x00000010
365 /* Sync Frame Flag: This flag is set when the buffer content contains a coded sync frame '
366 * a frame that has no dependency on any other frame information
369 #define OMX_BUFFERFLAG_SYNCFRAME 0x00000020
371 /* Extra data present flag: there is extra data appended to the data stream
372 * residing in the buffer
375 #define OMX_BUFFERFLAG_EXTRADATA 0x00000040
377 /** Codec Config Buffer Flag:
378 * OMX_BUFFERFLAG_CODECCONFIG is an optional flag that is set by an
379 * output port when all bytes in the buffer form part or all of a set of
380 * codec specific configuration data. Examples include SPS/PPS nal units
381 * for OMX_VIDEO_CodingAVC or AudioSpecificConfig data for
382 * OMX_AUDIO_CodingAAC. Any component that for a given stream sets
383 * OMX_BUFFERFLAG_CODECCONFIG shall not mix codec configuration bytes
384 * with frame data in the same buffer, and shall send all buffers
385 * containing codec configuration bytes before any buffers containing
386 * frame data that those configurations bytes describe.
387 * If the stream format for a particular codec has a frame specific
388 * header at the start of each frame, for example OMX_AUDIO_CodingMP3 or
389 * OMX_AUDIO_CodingAAC in ADTS mode, then these shall be presented as
390 * normal without setting OMX_BUFFERFLAG_CODECCONFIG.
393 #define OMX_BUFFERFLAG_CODECCONFIG 0x00000080
398 typedef struct OMX_BUFFERHEADERTYPE
400 OMX_U32 nSize; /**< size of the structure in bytes */
401 OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
402 OMX_U8* pBuffer; /**< Pointer to actual block of memory
403 that is acting as the buffer */
404 OMX_U32 nAllocLen; /**< size of the buffer allocated, in bytes */
405 OMX_U32 nFilledLen; /**< number of bytes currently in the
407 OMX_U32 nOffset; /**< start offset of valid data in bytes from
408 the start of the buffer */
409 OMX_PTR pAppPrivate; /**< pointer to any data the application
410 wants to associate with this buffer */
411 OMX_PTR pPlatformPrivate; /**< pointer to any data the platform
412 wants to associate with this buffer */
413 OMX_PTR pInputPortPrivate; /**< pointer to any data the input port
414 wants to associate with this buffer */
415 OMX_PTR pOutputPortPrivate; /**< pointer to any data the output port
416 wants to associate with this buffer */
417 OMX_HANDLETYPE hMarkTargetComponent; /**< The component that will generate a
418 mark event upon processing this buffer. */
419 OMX_PTR pMarkData; /**< Application specific data associated with
420 the mark sent on a mark event to disambiguate
421 this mark from others. */
422 OMX_U32 nTickCount; /**< Optional entry that the component and
423 application can update with a tick count
424 when they access the component. This
425 value should be in microseconds. Since
426 this is a value relative to an arbitrary
427 starting point, this value cannot be used
428 to determine absolute time. This is an
429 optional entry and not all components
431 OMX_TICKS nTimeStamp; /**< Timestamp corresponding to the sample
432 starting at the first logical sample
433 boundary in the buffer. Timestamps of
434 successive samples within the buffer may
435 be inferred by adding the duration of the
436 of the preceding buffer to the timestamp
437 of the preceding buffer.*/
438 OMX_U32 nFlags; /**< buffer specific flags */
439 OMX_U32 nOutputPortIndex; /**< The index of the output port (if any) using
441 OMX_U32 nInputPortIndex; /**< The index of the input port (if any) using
443 OMX_U32 output_width;
444 OMX_U32 output_height;
445 } OMX_BUFFERHEADERTYPE;
447 /** The OMX_EXTRADATATYPE enumeration is used to define the
448 * possible extra data payload types.
449 * NB: this enum is binary backwards compatible with the previous
450 * OMX_EXTRADATA_QUANT define. This should be replaced with
451 * OMX_ExtraDataQuantization.
453 typedef enum OMX_EXTRADATATYPE
455 OMX_ExtraDataNone = 0, /**< Indicates that no more extra data sections follow */
456 OMX_ExtraDataQuantization, /**< The data payload contains quantization data */
457 OMX_ExtraDataKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
458 OMX_ExtraDataVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
459 OMX_ExtraDataMax = 0x7FFFFFFF
463 typedef struct OMX_OTHER_EXTRADATATYPE {
465 OMX_VERSIONTYPE nVersion;
467 OMX_EXTRADATATYPE eType; /* Extra Data type */
468 OMX_U32 nDataSize; /* Size of the supporting data to follow */
469 OMX_U8 data[1]; /* Supporting data hint */
470 } OMX_OTHER_EXTRADATATYPE;
473 typedef struct OMX_PORT_PARAM_TYPE {
474 OMX_U32 nSize; /**< size of the structure in bytes */
475 OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
476 OMX_U32 nPorts; /**< The number of ports for this component */
477 OMX_U32 nStartPortNumber; /** first port number for this type of port */
478 } OMX_PORT_PARAM_TYPE;
481 typedef enum OMX_EVENTTYPE
483 OMX_EventCmdComplete, /**< component has sucessfully completed a command */
484 OMX_EventError, /**< component has detected an error condition */
485 OMX_EventMark, /**< component has detected a buffer mark */
486 OMX_EventPortSettingsChanged, /**< component is reported a port settings change */
487 OMX_EventBufferFlag, /**< component has detected an EOS */
488 OMX_EventResourcesAcquired, /**< component has been granted resources and is
489 automatically starting the state change from
490 OMX_StateWaitForResources to OMX_StateIdle. */
491 OMX_EventComponentResumed, /**< Component resumed due to reacquisition of resources */
492 OMX_EventDynamicResourcesAvailable, /**< Component has acquired previously unavailable dynamic resources */
493 OMX_EventPortFormatDetected, /**< Component has detected a supported format. */
494 OMX_EventKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
495 OMX_EventVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
496 OMX_EventMax = 0x7FFFFFFF
499 typedef struct OMX_CALLBACKTYPE
501 /** The EventHandler method is used to notify the application when an
502 event of interest occurs. Events are defined in the OMX_EVENTTYPE
503 enumeration. Please see that enumeration for details of what will
504 be returned for each type of event. Callbacks should not return
505 an error to the component, so if an error occurs, the application
506 shall handle it internally. This is a blocking call.
508 The application should return from this call within 5 msec to avoid
509 blocking the component for an excessively long period of time.
512 handle of the component to access. This is the component
513 handle returned by the call to the GetHandle function.
515 pointer to an application defined value that was provided in the
516 pAppData parameter to the OMX_GetHandle method for the component.
517 This application defined value is provided so that the application
518 can have a component specific context when receiving the callback.
520 Event that the component wants to notify the application about.
522 nData will be the OMX_ERRORTYPE for an error event and will be
523 an OMX_COMMANDTYPE for a command complete event and OMX_INDEXTYPE for a OMX_PortSettingsChanged event.
525 nData2 will hold further information related to the event. Can be OMX_STATETYPE for
526 a OMX_CommandStateSet command or port index for a OMX_PortSettingsChanged event.
527 Default value is 0 if not used. )
529 Pointer to additional event-specific data (see spec for meaning).
532 OMX_ERRORTYPE (*EventHandler)(
533 OMX_IN OMX_HANDLETYPE hComponent,
534 OMX_IN OMX_PTR pAppData,
535 OMX_IN OMX_EVENTTYPE eEvent,
536 OMX_IN OMX_U32 nData1,
537 OMX_IN OMX_U32 nData2,
538 OMX_IN OMX_PTR pEventData);
540 /** The EmptyBufferDone method is used to return emptied buffers from an
541 input port back to the application for reuse. This is a blocking call
542 so the application should not attempt to refill the buffers during this
543 call, but should queue them and refill them in another thread. There
544 is no error return, so the application shall handle any errors generated
547 The application should return from this call within 5 msec.
550 handle of the component to access. This is the component
551 handle returned by the call to the GetHandle function.
553 pointer to an application defined value that was provided in the
554 pAppData parameter to the OMX_GetHandle method for the component.
555 This application defined value is provided so that the application
556 can have a component specific context when receiving the callback.
558 pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer
559 or AllocateBuffer indicating the buffer that was emptied.
562 OMX_ERRORTYPE (*EmptyBufferDone)(
563 OMX_IN OMX_HANDLETYPE hComponent,
564 OMX_IN OMX_PTR pAppData,
565 OMX_IN OMX_BUFFERHEADERTYPE* pBuffer);
567 /** The FillBufferDone method is used to return filled buffers from an
568 output port back to the application for emptying and then reuse.
569 This is a blocking call so the application should not attempt to
570 empty the buffers during this call, but should queue the buffers
571 and empty them in another thread. There is no error return, so
572 the application shall handle any errors generated internally. The
573 application shall also update the buffer header to indicate the
574 number of bytes placed into the buffer.
576 The application should return from this call within 5 msec.
579 handle of the component to access. This is the component
580 handle returned by the call to the GetHandle function.
582 pointer to an application defined value that was provided in the
583 pAppData parameter to the OMX_GetHandle method for the component.
584 This application defined value is provided so that the application
585 can have a component specific context when receiving the callback.
587 pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer
588 or AllocateBuffer indicating the buffer that was filled.
591 OMX_ERRORTYPE (*FillBufferDone)(
592 OMX_OUT OMX_HANDLETYPE hComponent,
593 OMX_OUT OMX_PTR pAppData,
594 OMX_OUT OMX_BUFFERHEADERTYPE* pBuffer);
598 /** The OMX_BUFFERSUPPLIERTYPE enumeration is used to dictate port supplier
599 preference when tunneling between two ports.
602 typedef enum OMX_BUFFERSUPPLIERTYPE
604 OMX_BufferSupplyUnspecified = 0x0, /**< port supplying the buffers is unspecified,
606 OMX_BufferSupplyInput, /**< input port supplies the buffers */
607 OMX_BufferSupplyOutput, /**< output port supplies the buffers */
608 OMX_BufferSupplyKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
609 OMX_BufferSupplyVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
610 OMX_BufferSupplyMax = 0x7FFFFFFF
611 } OMX_BUFFERSUPPLIERTYPE;
614 /** buffer supplier parameter
617 typedef struct OMX_PARAM_BUFFERSUPPLIERTYPE {
618 OMX_U32 nSize; /**< size of the structure in bytes */
619 OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
620 OMX_U32 nPortIndex; /**< port that this structure applies to */
621 OMX_BUFFERSUPPLIERTYPE eBufferSupplier; /**< buffer supplier */
622 } OMX_PARAM_BUFFERSUPPLIERTYPE;
625 /**< indicates that buffers received by an input port of a tunnel
626 may not modify the data in the buffers
629 #define OMX_PORTTUNNELFLAG_READONLY 0x00000001
632 /** The OMX_TUNNELSETUPTYPE structure is used to pass data from an output
633 port to an input port as part the two ComponentTunnelRequest calls
634 resulting from a OMX_SetupTunnel call from the IL Client.
637 typedef struct OMX_TUNNELSETUPTYPE
639 OMX_U32 nTunnelFlags; /**< bit flags for tunneling */
640 OMX_BUFFERSUPPLIERTYPE eSupplier; /**< supplier preference */
641 } OMX_TUNNELSETUPTYPE;
643 /* OMX Component headers is included to enable the core to use
644 macros for functions into the component for OMX release 1.0.
645 Developers should not access any structures or data from within
646 the component header directly */
647 /* TO BE REMOVED - #include <OMX_Component.h> */
649 /** GetComponentVersion will return information about the component.
650 This is a blocking call. This macro will go directly from the
651 application to the component (via a core macro). The
652 component will return from this call within 5 msec.
653 @param [in] hComponent
654 handle of component to execute the command
655 @param [out] pComponentName
656 pointer to an empty string of length 128 bytes. The component
657 will write its name into this string. The name will be
658 terminated by a single zero byte. The name of a component will
659 be 127 bytes or less to leave room for the trailing zero byte.
660 An example of a valid component name is "OMX.ABC.ChannelMixer\0".
661 @param [out] pComponentVersion
662 pointer to an OMX Version structure that the component will fill
663 in. The component will fill in a value that indicates the
664 component version. NOTE: the component version is NOT the same
665 as the OMX Specification version (found in all structures). The
666 component version is defined by the vendor of the component and
667 its value is entirely up to the component vendor.
668 @param [out] pSpecVersion
669 pointer to an OMX Version structure that the component will fill
670 in. The SpecVersion is the version of the specification that the
671 component was built against. Please note that this value may or
672 may not match the structure's version. For example, if the
673 component was built against the 2.0 specification, but the
674 application (which creates the structure is built against the
675 1.0 specification the versions would be different.
676 @param [out] pComponentUUID
677 pointer to the UUID of the component which will be filled in by
678 the component. The UUID is a unique identifier that is set at
679 RUN time for the component and is unique to each instantion of
681 @return OMX_ERRORTYPE
682 If the command successfully executes, the return code will be
683 OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
686 #define OMX_GetComponentVersion( \
692 ((OMX_COMPONENTTYPE*)hComponent)->GetComponentVersion( \
697 pComponentUUID) /* Macro End */
700 /** Send a command to the component. This call is a non-blocking call.
701 The component should check the parameters and then queue the command
702 to the component thread to be executed. The component thread shall
703 send the EventHandler() callback at the conclusion of the command.
704 This macro will go directly from the application to the component (via
705 a core macro). The component will return from this call within 5 msec.
707 When the command is "OMX_CommandStateSet" the component will queue a
708 state transition to the new state idenfied in nParam.
710 When the command is "OMX_CommandFlush", to flush a port's buffer queues,
711 the command will force the component to return all buffers NOT CURRENTLY
712 BEING PROCESSED to the application, in the order in which the buffers
715 When the command is "OMX_CommandPortDisable" or
716 "OMX_CommandPortEnable", the component's port (given by the value of
717 nParam) will be stopped or restarted.
719 When the command "OMX_CommandMarkBuffer" is used to mark a buffer, the
720 pCmdData will point to a OMX_MARKTYPE structure containing the component
721 handle of the component to examine the buffer chain for the mark. nParam1
722 contains the index of the port on which the buffer mark is applied.
724 Specification text for more details.
726 @param [in] hComponent
727 handle of component to execute the command
729 Command for the component to execute
731 Parameter for the command to be executed. When Cmd has the value
732 OMX_CommandStateSet, value is a member of OMX_STATETYPE. When Cmd has
733 the value OMX_CommandFlush, value of nParam indicates which port(s)
734 to flush. -1 is used to flush all ports a single port index will
735 only flush that port. When Cmd has the value "OMX_CommandPortDisable"
736 or "OMX_CommandPortEnable", the component's port is given by
737 the value of nParam. When Cmd has the value "OMX_CommandMarkBuffer"
738 the components pot is given by the value of nParam.
740 Parameter pointing to the OMX_MARKTYPE structure when Cmd has the value
741 "OMX_CommandMarkBuffer".
742 @return OMX_ERRORTYPE
743 If the command successfully executes, the return code will be
744 OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
747 #define OMX_SendCommand( \
752 ((OMX_COMPONENTTYPE*)hComponent)->SendCommand( \
756 pCmdData) /* Macro End */
759 /** The OMX_GetParameter macro will get one of the current parameter
760 settings from the component. This macro cannot only be invoked when
761 the component is in the OMX_StateInvalid state. The nParamIndex
762 parameter is used to indicate which structure is being requested from
763 the component. The application shall allocate the correct structure
764 and shall fill in the structure size and version information before
765 invoking this macro. When the parameter applies to a port, the
766 caller shall fill in the appropriate nPortIndex value indicating the
767 port on which the parameter applies. If the component has not had
768 any settings changed, then the component should return a set of
769 valid DEFAULT parameters for the component. This is a blocking
772 The component should return from this call within 20 msec.
774 @param [in] hComponent
775 Handle of the component to be accessed. This is the component
776 handle returned by the call to the OMX_GetHandle function.
777 @param [in] nParamIndex
778 Index of the structure to be filled. This value is from the
779 OMX_INDEXTYPE enumeration.
780 @param [in,out] pComponentParameterStructure
781 Pointer to application allocated structure to be filled by the
783 @return OMX_ERRORTYPE
784 If the command successfully executes, the return code will be
785 OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
788 #define OMX_GetParameter( \
791 pComponentParameterStructure) \
792 ((OMX_COMPONENTTYPE*)hComponent)->GetParameter( \
795 pComponentParameterStructure) /* Macro End */
798 /** The OMX_SetParameter macro will send an initialization parameter
799 structure to a component. Each structure shall be sent one at a time,
800 in a separate invocation of the macro. This macro can only be
801 invoked when the component is in the OMX_StateLoaded state, or the
802 port is disabled (when the parameter applies to a port). The
803 nParamIndex parameter is used to indicate which structure is being
804 passed to the component. The application shall allocate the
805 correct structure and shall fill in the structure size and version
806 information (as well as the actual data) before invoking this macro.
807 The application is free to dispose of this structure after the call
808 as the component is required to copy any data it shall retain. This
811 The component should return from this call within 20 msec.
813 @param [in] hComponent
814 Handle of the component to be accessed. This is the component
815 handle returned by the call to the OMX_GetHandle function.
817 Index of the structure to be sent. This value is from the
818 OMX_INDEXTYPE enumeration.
819 @param [in] pComponentParameterStructure
820 pointer to application allocated structure to be used for
821 initialization by the component.
822 @return OMX_ERRORTYPE
823 If the command successfully executes, the return code will be
824 OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
827 #define OMX_SetParameter( \
830 pComponentParameterStructure) \
831 ((OMX_COMPONENTTYPE*)hComponent)->SetParameter( \
834 pComponentParameterStructure) /* Macro End */
837 /** The OMX_GetConfig macro will get one of the configuration structures
838 from a component. This macro can be invoked anytime after the
839 component has been loaded. The nParamIndex call parameter is used to
840 indicate which structure is being requested from the component. The
841 application shall allocate the correct structure and shall fill in the
842 structure size and version information before invoking this macro.
843 If the component has not had this configuration parameter sent before,
844 then the component should return a set of valid DEFAULT values for the
845 component. This is a blocking call.
847 The component should return from this call within 5 msec.
849 @param [in] hComponent
850 Handle of the component to be accessed. This is the component
851 handle returned by the call to the OMX_GetHandle function.
853 Index of the structure to be filled. This value is from the
854 OMX_INDEXTYPE enumeration.
855 @param [in,out] pComponentConfigStructure
856 pointer to application allocated structure to be filled by the
858 @return OMX_ERRORTYPE
859 If the command successfully executes, the return code will be
860 OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
863 #define OMX_GetConfig( \
866 pComponentConfigStructure) \
867 ((OMX_COMPONENTTYPE*)hComponent)->GetConfig( \
870 pComponentConfigStructure) /* Macro End */
873 /** The OMX_SetConfig macro will send one of the configuration
874 structures to a component. Each structure shall be sent one at a time,
875 each in a separate invocation of the macro. This macro can be invoked
876 anytime after the component has been loaded. The application shall
877 allocate the correct structure and shall fill in the structure size
878 and version information (as well as the actual data) before invoking
879 this macro. The application is free to dispose of this structure after
880 the call as the component is required to copy any data it shall retain.
881 This is a blocking call.
883 The component should return from this call within 5 msec.
885 @param [in] hComponent
886 Handle of the component to be accessed. This is the component
887 handle returned by the call to the OMX_GetHandle function.
888 @param [in] nConfigIndex
889 Index of the structure to be sent. This value is from the
890 OMX_INDEXTYPE enumeration above.
891 @param [in] pComponentConfigStructure
892 pointer to application allocated structure to be used for
893 initialization by the component.
894 @return OMX_ERRORTYPE
895 If the command successfully executes, the return code will be
896 OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
899 #define OMX_SetConfig( \
902 pComponentConfigStructure) \
903 ((OMX_COMPONENTTYPE*)hComponent)->SetConfig( \
906 pComponentConfigStructure) /* Macro End */
909 /** The OMX_GetExtensionIndex macro will invoke a component to translate
910 a vendor specific configuration or parameter string into an OMX
911 structure index. There is no requirement for the vendor to support
912 this command for the indexes already found in the OMX_INDEXTYPE
913 enumeration (this is done to save space in small components). The
914 component shall support all vendor supplied extension indexes not found
915 in the master OMX_INDEXTYPE enumeration. This is a blocking call.
917 The component should return from this call within 5 msec.
919 @param [in] hComponent
920 Handle of the component to be accessed. This is the component
921 handle returned by the call to the GetHandle function.
922 @param [in] cParameterName
923 OMX_STRING that shall be less than 128 characters long including
924 the trailing null byte. This is the string that will get
925 translated by the component into a configuration index.
926 @param [out] pIndexType
927 a pointer to a OMX_INDEXTYPE to receive the index value.
928 @return OMX_ERRORTYPE
929 If the command successfully executes, the return code will be
930 OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
933 #define OMX_GetExtensionIndex( \
937 ((OMX_COMPONENTTYPE*)hComponent)->GetExtensionIndex( \
940 pIndexType) /* Macro End */
943 /** The OMX_GetState macro will invoke the component to get the current
944 state of the component and place the state value into the location
945 pointed to by pState.
947 The component should return from this call within 5 msec.
949 @param [in] hComponent
950 Handle of the component to be accessed. This is the component
951 handle returned by the call to the OMX_GetHandle function.
953 pointer to the location to receive the state. The value returned
954 is one of the OMX_STATETYPE members
955 @return OMX_ERRORTYPE
956 If the command successfully executes, the return code will be
957 OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
960 #define OMX_GetState( \
963 ((OMX_COMPONENTTYPE*)hComponent)->GetState( \
965 pState) /* Macro End */
968 /** The OMX_UseBuffer macro will request that the component use
969 a buffer (and allocate its own buffer header) already allocated
970 by another component, or by the IL Client. This is a blocking
973 The component should return from this call within 20 msec.
975 @param [in] hComponent
976 Handle of the component to be accessed. This is the component
977 handle returned by the call to the OMX_GetHandle function.
978 @param [out] ppBuffer
979 pointer to an OMX_BUFFERHEADERTYPE structure used to receive the
980 pointer to the buffer header
981 @return OMX_ERRORTYPE
982 If the command successfully executes, the return code will be
983 OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
987 #define OMX_UseBuffer( \
994 ((OMX_COMPONENTTYPE*)hComponent)->UseBuffer( \
1003 /** The OMX_AllocateBuffer macro will request that the component allocate
1004 a new buffer and buffer header. The component will allocate the
1005 buffer and the buffer header and return a pointer to the buffer
1006 header. This is a blocking call.
1008 The component should return from this call within 5 msec.
1010 @param [in] hComponent
1011 Handle of the component to be accessed. This is the component
1012 handle returned by the call to the OMX_GetHandle function.
1013 @param [out] ppBuffer
1014 pointer to an OMX_BUFFERHEADERTYPE structure used to receive
1015 the pointer to the buffer header
1016 @param [in] nPortIndex
1017 nPortIndex is used to select the port on the component the buffer will
1018 be used with. The port can be found by using the nPortIndex
1019 value as an index into the Port Definition array of the component.
1020 @param [in] pAppPrivate
1021 pAppPrivate is used to initialize the pAppPrivate member of the
1022 buffer header structure.
1023 @param [in] nSizeBytes
1024 size of the buffer to allocate. Used when bAllocateNew is true.
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.
1030 #define OMX_AllocateBuffer( \
1036 ((OMX_COMPONENTTYPE*)hComponent)->AllocateBuffer( \
1041 nSizeBytes) /* Macro End */
1044 /** The OMX_FreeBuffer macro will release a buffer header from the component
1045 which was allocated using either OMX_AllocateBuffer or OMX_UseBuffer. If
1046 the component allocated the buffer (see the OMX_UseBuffer macro) then
1047 the component shall free the buffer and buffer header. This is a
1050 The component should return from this call within 20 msec.
1052 @param [in] hComponent
1053 Handle of the component to be accessed. This is the component
1054 handle returned by the call to the OMX_GetHandle function.
1055 @param [in] nPortIndex
1056 nPortIndex is used to select the port on the component the buffer will
1059 pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer
1061 @return OMX_ERRORTYPE
1062 If the command successfully executes, the return code will be
1063 OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
1066 #define OMX_FreeBuffer( \
1070 ((OMX_COMPONENTTYPE*)hComponent)->FreeBuffer( \
1073 pBuffer) /* Macro End */
1076 /** The OMX_EmptyThisBuffer macro will send a buffer full of data to an
1077 input port of a component. The buffer will be emptied by the component
1078 and returned to the application via the EmptyBufferDone call back.
1079 This is a non-blocking call in that the component will record the buffer
1080 and return immediately and then empty the buffer, later, at the proper
1081 time. As expected, this macro may be invoked only while the component
1082 is in the OMX_StateExecuting. If nPortIndex does not specify an input
1083 port, the component shall return an error.
1085 The component should return from this call within 5 msec.
1087 @param [in] hComponent
1088 Handle of the component to be accessed. This is the component
1089 handle returned by the call to the OMX_GetHandle function.
1091 pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer
1093 @return OMX_ERRORTYPE
1094 If the command successfully executes, the return code will be
1095 OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
1098 #define OMX_EmptyThisBuffer( \
1101 ((OMX_COMPONENTTYPE*)hComponent)->EmptyThisBuffer( \
1103 pBuffer) /* Macro End */
1106 /** The OMX_FillThisBuffer macro will send an empty buffer to an
1107 output port of a component. The buffer will be filled by the component
1108 and returned to the application via the FillBufferDone call back.
1109 This is a non-blocking call in that the component will record the buffer
1110 and return immediately and then fill the buffer, later, at the proper
1111 time. As expected, this macro may be invoked only while the component
1112 is in the OMX_ExecutingState. If nPortIndex does not specify an output
1113 port, the component shall return an error.
1115 The component should return from this call within 5 msec.
1117 @param [in] hComponent
1118 Handle of the component to be accessed. This is the component
1119 handle returned by the call to the OMX_GetHandle function.
1121 pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer
1123 @return OMX_ERRORTYPE
1124 If the command successfully executes, the return code will be
1125 OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
1128 #define OMX_FillThisBuffer( \
1131 ((OMX_COMPONENTTYPE*)hComponent)->FillThisBuffer( \
1133 pBuffer) /* Macro End */
1137 /** The OMX_UseEGLImage macro will request that the component use
1138 a EGLImage provided by EGL (and allocate its own buffer header)
1139 This is a blocking call.
1141 The component should return from this call within 20 msec.
1143 @param [in] hComponent
1144 Handle of the component to be accessed. This is the component
1145 handle returned by the call to the OMX_GetHandle function.
1146 @param [out] ppBuffer
1147 pointer to an OMX_BUFFERHEADERTYPE structure used to receive the
1148 pointer to the buffer header. Note that the memory location used
1149 for this buffer is NOT visible to the IL Client.
1150 @param [in] nPortIndex
1151 nPortIndex is used to select the port on the component the buffer will
1152 be used with. The port can be found by using the nPortIndex
1153 value as an index into the Port Definition array of the component.
1154 @param [in] pAppPrivate
1155 pAppPrivate is used to initialize the pAppPrivate member of the
1156 buffer header structure.
1157 @param [in] eglImage
1158 eglImage contains the handle of the EGLImage to use as a buffer on the
1159 specified port. The component is expected to validate properties of
1160 the EGLImage against the configuration of the port to ensure the component
1161 can use the EGLImage as a buffer.
1162 @return OMX_ERRORTYPE
1163 If the command successfully executes, the return code will be
1164 OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
1167 #define OMX_UseEGLImage( \
1173 ((OMX_COMPONENTTYPE*)hComponent)->UseEGLImage( \
1180 /** The OMX_Init method is used to initialize the OMX core. It shall be the
1181 first call made into OMX and it should only be executed one time without
1182 an interviening OMX_Deinit call.
1184 The core should return from this call within 20 msec.
1186 @return OMX_ERRORTYPE
1187 If the command successfully executes, the return code will be
1188 OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
1191 OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_Init(void);
1194 /** The OMX_Deinit method is used to deinitialize the OMX core. It shall be
1195 the last call made into OMX. In the event that the core determines that
1196 thare are components loaded when this call is made, the core may return
1197 with an error rather than try to unload the components.
1199 The core should return from this call within 20 msec.
1201 @return OMX_ERRORTYPE
1202 If the command successfully executes, the return code will be
1203 OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
1206 OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_Deinit(void);
1209 /** The OMX_ComponentNameEnum method will enumerate through all the names of
1210 recognised valid components in the system. This function is provided
1211 as a means to detect all the components in the system run-time. There is
1212 no strict ordering to the enumeration order of component names, although
1213 each name will only be enumerated once. If the OMX core supports run-time
1214 installation of new components, it is only requried to detect newly
1215 installed components when the first call to enumerate component names
1216 is made (i.e. when nIndex is 0x0).
1218 The core should return from this call in 20 msec.
1220 @param [out] cComponentName
1221 pointer to a null terminated string with the component name. The
1222 names of the components are strings less than 127 bytes in length
1223 plus the trailing null for a maximum size of 128 bytes. An example
1224 of a valid component name is "OMX.TI.AUDIO.DSP.MIXER\0". Names are
1225 assigned by the vendor, but shall start with "OMX." and then have
1226 the Vendor designation next.
1227 @param [in] nNameLength
1228 number of characters in the cComponentName string. With all
1229 component name strings restricted to less than 128 characters
1230 (including the trailing null) it is recomended that the caller
1231 provide a input string for the cComponentName of 128 characters.
1233 number containing the enumeration index for the component.
1234 Multiple calls to OMX_ComponentNameEnum with increasing values
1235 of nIndex will enumerate through the component names in the
1236 system until OMX_ErrorNoMore is returned. The value of nIndex
1237 is 0 to (N-1), where N is the number of valid installed components
1239 @return OMX_ERRORTYPE
1240 If the command successfully executes, the return code will be
1241 OMX_ErrorNone. When the value of nIndex exceeds the number of
1242 components in the system minus 1, OMX_ErrorNoMore will be
1243 returned. Otherwise the appropriate OMX error will be returned.
1246 OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_ComponentNameEnum(
1247 OMX_OUT OMX_STRING cComponentName,
1248 OMX_IN OMX_U32 nNameLength,
1249 OMX_IN OMX_U32 nIndex);
1252 /** The OMX_GetHandle method will locate the component specified by the
1253 component name given, load that component into memory and then invoke
1254 the component's methods to create an instance of the component.
1256 The core should return from this call within 20 msec.
1258 @param [out] pHandle
1259 pointer to an OMX_HANDLETYPE pointer to be filled in by this method.
1260 @param [in] cComponentName
1261 pointer to a null terminated string with the component name. The
1262 names of the components are strings less than 127 bytes in length
1263 plus the trailing null for a maximum size of 128 bytes. An example
1264 of a valid component name is "OMX.TI.AUDIO.DSP.MIXER\0". Names are
1265 assigned by the vendor, but shall start with "OMX." and then have
1266 the Vendor designation next.
1267 @param [in] pAppData
1268 pointer to an application defined value that will be returned
1269 during callbacks so that the application can identify the source
1271 @param [in] pCallBacks
1272 pointer to a OMX_CALLBACKTYPE structure that will be passed to the
1273 component to initialize it with.
1274 @return OMX_ERRORTYPE
1275 If the command successfully executes, the return code will be
1276 OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
1279 OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_GetHandle(
1280 OMX_OUT OMX_HANDLETYPE* pHandle,
1281 OMX_IN OMX_STRING cComponentName,
1282 OMX_IN OMX_PTR pAppData,
1283 OMX_IN OMX_CALLBACKTYPE* pCallBacks);
1286 /** The OMX_FreeHandle method will free a handle allocated by the OMX_GetHandle
1287 method. If the component reference count goes to zero, the component will
1288 be unloaded from memory.
1290 The core should return from this call within 20 msec when the component is
1291 in the OMX_StateLoaded state.
1293 @param [in] hComponent
1294 Handle of the component to be accessed. This is the component
1295 handle returned by the call to the GetHandle function.
1296 @return OMX_ERRORTYPE
1297 If the command successfully executes, the return code will be
1298 OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
1301 OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_FreeHandle(
1302 OMX_IN OMX_HANDLETYPE hComponent);
1306 /** The OMX_SetupTunnel method will handle the necessary calls to the components
1307 to setup the specified tunnel the two components. NOTE: This is
1308 an actual method (not a #define macro). This method will make calls into
1309 the component ComponentTunnelRequest method to do the actual tunnel
1312 The ComponentTunnelRequest method on both components will be called.
1313 This method shall not be called unless the component is in the
1314 OMX_StateLoaded state except when the ports used for the tunnel are
1315 disabled. In this case, the component may be in the OMX_StateExecuting,
1316 OMX_StatePause, or OMX_StateIdle states.
1318 The core should return from this call within 20 msec.
1321 Handle of the component to be accessed. Also this is the handle
1322 of the component whose port, specified in the nPortOutput parameter
1323 will be used the source for the tunnel. This is the component handle
1324 returned by the call to the OMX_GetHandle function. There is a
1325 requirement that hOutput be the source for the data when
1326 tunelling (i.e. nPortOutput is an output port). If 0x0, the component
1327 specified in hInput will have it's port specified in nPortInput
1328 setup for communication with the application / IL client.
1329 @param [in] nPortOutput
1330 nPortOutput is used to select the source port on component to be
1333 This is the component to setup the tunnel with. This is the handle
1334 of the component whose port, specified in the nPortInput parameter
1335 will be used the destination for the tunnel. This is the component handle
1336 returned by the call to the OMX_GetHandle function. There is a
1337 requirement that hInput be the destination for the data when
1338 tunelling (i.e. nPortInut is an input port). If 0x0, the component
1339 specified in hOutput will have it's port specified in nPortPOutput
1340 setup for communication with the application / IL client.
1341 @param [in] nPortInput
1342 nPortInput is used to select the destination port on component to be
1344 @return OMX_ERRORTYPE
1345 If the command successfully executes, the return code will be
1346 OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
1347 When OMX_ErrorNotImplemented is returned, one or both components is
1348 a non-interop component and does not support tunneling.
1350 On failure, the ports of both components are setup for communication
1351 with the application / IL Client.
1354 OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_SetupTunnel(
1355 OMX_IN OMX_HANDLETYPE hOutput,
1356 OMX_IN OMX_U32 nPortOutput,
1357 OMX_IN OMX_HANDLETYPE hInput,
1358 OMX_IN OMX_U32 nPortInput);
1361 OMX_API OMX_ERRORTYPE OMX_GetContentPipe(
1362 OMX_OUT OMX_HANDLETYPE *hPipe,
1363 OMX_IN OMX_STRING szURI);
1365 /** The OMX_GetComponentsOfRole method will return the number of components that support the given
1366 role and (if the compNames field is non-NULL) the names of those components. The call will fail if
1367 an insufficiently sized array of names is supplied. To ensure the array is sufficiently sized the
1369 * first call this function with the compNames field NULL to determine the number of component names
1370 * second call this function with the compNames field pointing to an array of names allocated
1371 according to the number returned by the first call.
1373 The core should return from this call within 5 msec.
1376 This is generic standard component name consisting only of component class
1377 name and the type within that class (e.g. 'audio_decoder.aac').
1378 @param [inout] pNumComps
1379 This is used both as input and output.
1381 If compNames is NULL, the input is ignored and the output specifies how many components support
1384 If compNames is not NULL, on input it bounds the size of the input structure and
1385 on output, it specifies the number of components string names listed within the compNames parameter.
1386 @param [inout] compNames
1387 If NULL this field is ignored. If non-NULL this points to an array of 128-byte strings which accepts
1388 a list of the names of all physical components that implement the specified standard component name.
1389 Each name is NULL terminated. numComps indicates the number of names.
1392 OMX_API OMX_ERRORTYPE OMX_GetComponentsOfRole (
1393 OMX_IN OMX_STRING role,
1394 OMX_INOUT OMX_U32 *pNumComps,
1395 OMX_INOUT OMX_U8 **compNames);
1397 /** The OMX_GetRolesOfComponent method will return the number of roles supported by the given
1398 component and (if the roles field is non-NULL) the names of those roles. The call will fail if
1399 an insufficiently sized array of names is supplied. To ensure the array is sufficiently sized the
1401 * first call this function with the roles field NULL to determine the number of role names
1402 * second call this function with the roles field pointing to an array of names allocated
1403 according to the number returned by the first call.
1405 The core should return from this call within 5 msec.
1407 @param [in] compName
1408 This is the name of the component being queried about.
1409 @param [inout] pNumRoles
1410 This is used both as input and output.
1412 If roles is NULL, the input is ignored and the output specifies how many roles the component supports.
1414 If compNames is not NULL, on input it bounds the size of the input structure and
1415 on output, it specifies the number of roles string names listed within the roles parameter.
1417 If NULL this field is ignored. If non-NULL this points to an array of 128-byte strings
1418 which accepts a list of the names of all standard components roles implemented on the
1419 specified component name. numComps indicates the number of names.
1422 OMX_API OMX_ERRORTYPE OMX_GetRolesOfComponent (
1423 OMX_IN OMX_STRING compName,
1424 OMX_INOUT OMX_U32 *pNumRoles,
1425 OMX_OUT OMX_U8 **roles);
1429 #endif /* __cplusplus */