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