OMX_Core.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2008 The Khronos Group Inc. 
00003  * 
00004  * Permission is hereby granted, free of charge, to any person obtaining
00005  * a copy of this software and associated documentation files (the
00006  * "Software"), to deal in the Software without restriction, including
00007  * without limitation the rights to use, copy, modify, merge, publish,
00008  * distribute, sublicense, and/or sell copies of the Software, and to
00009  * permit persons to whom the Software is furnished to do so, subject
00010  * to the following conditions: 
00011  * The above copyright notice and this permission notice shall be included
00012  * in all copies or substantial portions of the Software. 
00013  * 
00014  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
00015  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00016  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
00017  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
00018  * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
00019  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
00020  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 
00021  *
00022  */
00023 
00024 /** OMX_Core.h - OpenMax IL version 1.1.2
00025  *  The OMX_Core header file contains the definitions used by both the
00026  *  application and the component to access common items.
00027  */
00028 
00029 #ifndef OMX_Core_h
00030 #define OMX_Core_h
00031 
00032 #ifdef __cplusplus
00033 extern "C" {
00034 #endif /* __cplusplus */
00035 
00036 
00037 /* Each OMX header shall include all required header files to allow the
00038  *  header to compile without errors.  The includes below are required
00039  *  for this header file to compile successfully 
00040  */
00041 
00042 #include <OMX_Index.h>
00043 
00044 
00045 /** The OMX_COMMANDTYPE enumeration is used to specify the action in the
00046  *  OMX_SendCommand macro.  
00047  *  @ingroup core
00048  */
00049 typedef enum OMX_COMMANDTYPE
00050 {
00051     OMX_CommandStateSet,    /**< Change the component state */
00052     OMX_CommandFlush,       /**< Flush the data queue(s) of a component */
00053     OMX_CommandPortDisable, /**< Disable a port on a component. */
00054     OMX_CommandPortEnable,  /**< Enable a port on a component. */
00055     OMX_CommandMarkBuffer,  /**< Mark a component/buffer for observation */
00056     OMX_CommandKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ 
00057     OMX_CommandVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
00058     OMX_CommandMax = 0X7FFFFFFF
00059 } OMX_COMMANDTYPE;
00060 
00061 
00062 
00063 /** The OMX_STATETYPE enumeration is used to indicate or change the component
00064  *  state.  This enumeration reflects the current state of the component when
00065  *  used with the OMX_GetState macro or becomes the parameter in a state change
00066  *  command when used with the OMX_SendCommand macro.
00067  *
00068  *  The component will be in the Loaded state after the component is initially
00069  *  loaded into memory.  In the Loaded state, the component is not allowed to
00070  *  allocate or hold resources other than to build it's internal parameter
00071  *  and configuration tables.  The application will send one or more
00072  *  SetParameters/GetParameters and SetConfig/GetConfig commands to the
00073  *  component and the component will record each of these parameter and
00074  *  configuration changes for use later.  When the application sends the
00075  *  Idle command, the component will acquire the resources needed for the
00076  *  specified configuration and will transition to the idle state if the
00077  *  allocation is successful.  If the component cannot successfully
00078  *  transition to the idle state for any reason, the state of the component
00079  *  shall be fully rolled back to the Loaded state (e.g. all allocated 
00080  *  resources shall be released).  When the component receives the command
00081  *  to go to the Executing state, it shall begin processing buffers by
00082  *  sending all input buffers it holds to the application.  While
00083  *  the component is in the Idle state, the application may also send the
00084  *  Pause command.  If the component receives the pause command while in the
00085  *  Idle state, the component shall send all input buffers it holds to the 
00086  *  application, but shall not begin processing buffers.  This will allow the
00087  *  application to prefill buffers.
00088  * 
00089  *  @ingroup comp
00090  */
00091 
00092 typedef enum OMX_STATETYPE
00093 {
00094     OMX_StateInvalid,      /**< component has detected that it's internal data 
00095                                 structures are corrupted to the point that
00096                                 it cannot determine it's state properly */
00097     OMX_StateLoaded,      /**< component has been loaded but has not completed
00098                                 initialization.  The OMX_SetParameter macro
00099                                 and the OMX_GetParameter macro are the only 
00100                                 valid macros allowed to be sent to the 
00101                                 component in this state. */
00102     OMX_StateIdle,        /**< component initialization has been completed
00103                                 successfully and the component is ready to
00104                                 to start. */
00105     OMX_StateExecuting,   /**< component has accepted the start command and
00106                                 is processing data (if data is available) */
00107     OMX_StatePause,       /**< component has received pause command */
00108     OMX_StateWaitForResources, /**< component is waiting for resources, either after 
00109                                 preemption or before it gets the resources requested.
00110                                 See specification for complete details. */
00111     OMX_StateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ 
00112     OMX_StateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
00113     OMX_StateMax = 0X7FFFFFFF
00114 } OMX_STATETYPE;
00115 
00116 /** The OMX_ERRORTYPE enumeration defines the standard OMX Errors.  These 
00117  *  errors should cover most of the common failure cases.  However, 
00118  *  vendors are free to add additional error messages of their own as 
00119  *  long as they follow these rules:
00120  *  1.  Vendor error messages shall be in the range of 0x90000000 to
00121  *      0x9000FFFF.
00122  *  2.  Vendor error messages shall be defined in a header file provided
00123  *      with the component.  No error messages are allowed that are
00124  *      not defined.
00125  */
00126 typedef enum OMX_ERRORTYPE
00127 {
00128   OMX_ErrorNone = 0,
00129 
00130   /** There were insufficient resources to perform the requested operation */
00131   OMX_ErrorInsufficientResources = (OMX_S32) 0x80001000,
00132 
00133   /** There was an error, but the cause of the error could not be determined */
00134   OMX_ErrorUndefined = (OMX_S32) 0x80001001,
00135 
00136   /** The component name string was not valid */
00137   OMX_ErrorInvalidComponentName = (OMX_S32) 0x80001002,
00138 
00139   /** No component with the specified name string was found */
00140   OMX_ErrorComponentNotFound = (OMX_S32) 0x80001003,
00141 
00142   /** The component specified did not have a "OMX_ComponentInit" or
00143       "OMX_ComponentDeInit entry point */
00144   OMX_ErrorInvalidComponent = (OMX_S32) 0x80001004,
00145 
00146   /** One or more parameters were not valid */
00147   OMX_ErrorBadParameter = (OMX_S32) 0x80001005,
00148 
00149   /** The requested function is not implemented */
00150   OMX_ErrorNotImplemented = (OMX_S32) 0x80001006,
00151 
00152   /** The buffer was emptied before the next buffer was ready */
00153   OMX_ErrorUnderflow = (OMX_S32) 0x80001007,
00154 
00155   /** The buffer was not available when it was needed */
00156   OMX_ErrorOverflow = (OMX_S32) 0x80001008,
00157 
00158   /** The hardware failed to respond as expected */
00159   OMX_ErrorHardware = (OMX_S32) 0x80001009,
00160 
00161   /** The component is in the state OMX_StateInvalid */
00162   OMX_ErrorInvalidState = (OMX_S32) 0x8000100A,
00163 
00164   /** Stream is found to be corrupt */
00165   OMX_ErrorStreamCorrupt = (OMX_S32) 0x8000100B,
00166 
00167   /** Ports being connected are not compatible */
00168   OMX_ErrorPortsNotCompatible = (OMX_S32) 0x8000100C,
00169 
00170   /** Resources allocated to an idle component have been
00171       lost resulting in the component returning to the loaded state */
00172   OMX_ErrorResourcesLost = (OMX_S32) 0x8000100D,
00173 
00174   /** No more indicies can be enumerated */
00175   OMX_ErrorNoMore = (OMX_S32) 0x8000100E,
00176 
00177   /** The component detected a version mismatch */
00178   OMX_ErrorVersionMismatch = (OMX_S32) 0x8000100F,
00179 
00180   /** The component is not ready to return data at this time */
00181   OMX_ErrorNotReady = (OMX_S32) 0x80001010,
00182 
00183   /** There was a timeout that occurred */
00184   OMX_ErrorTimeout = (OMX_S32) 0x80001011,
00185 
00186   /** This error occurs when trying to transition into the state you are already in */
00187   OMX_ErrorSameState = (OMX_S32) 0x80001012,
00188 
00189   /** Resources allocated to an executing or paused component have been 
00190       preempted, causing the component to return to the idle state */
00191   OMX_ErrorResourcesPreempted = (OMX_S32) 0x80001013, 
00192 
00193   /** A non-supplier port sends this error to the IL client (via the EventHandler callback) 
00194       during the allocation of buffers (on a transition from the LOADED to the IDLE state or
00195       on a port restart) when it deems that it has waited an unusually long time for the supplier 
00196       to send it an allocated buffer via a UseBuffer call. */
00197   OMX_ErrorPortUnresponsiveDuringAllocation = (OMX_S32) 0x80001014,
00198 
00199   /** A non-supplier port sends this error to the IL client (via the EventHandler callback) 
00200       during the deallocation of buffers (on a transition from the IDLE to LOADED state or 
00201       on a port stop) when it deems that it has waited an unusually long time for the supplier 
00202       to request the deallocation of a buffer header via a FreeBuffer call. */
00203   OMX_ErrorPortUnresponsiveDuringDeallocation = (OMX_S32) 0x80001015,
00204 
00205   /** A supplier port sends this error to the IL client (via the EventHandler callback) 
00206       during the stopping of a port (either on a transition from the IDLE to LOADED 
00207       state or a port stop) when it deems that it has waited an unusually long time for 
00208       the non-supplier to return a buffer via an EmptyThisBuffer or FillThisBuffer call. */
00209   OMX_ErrorPortUnresponsiveDuringStop = (OMX_S32) 0x80001016,
00210 
00211   /** Attempting a state transtion that is not allowed */
00212   OMX_ErrorIncorrectStateTransition = (OMX_S32) 0x80001017,
00213 
00214   /* Attempting a command that is not allowed during the present state. */
00215   OMX_ErrorIncorrectStateOperation = (OMX_S32) 0x80001018, 
00216 
00217   /** The values encapsulated in the parameter or config structure are not supported. */
00218   OMX_ErrorUnsupportedSetting = (OMX_S32) 0x80001019,
00219 
00220   /** The parameter or config indicated by the given index is not supported. */
00221   OMX_ErrorUnsupportedIndex = (OMX_S32) 0x8000101A,
00222 
00223   /** The port index supplied is incorrect. */
00224   OMX_ErrorBadPortIndex = (OMX_S32) 0x8000101B,
00225 
00226   /** The port has lost one or more of its buffers and it thus unpopulated. */
00227   OMX_ErrorPortUnpopulated = (OMX_S32) 0x8000101C,
00228 
00229   /** Component suspended due to temporary loss of resources */
00230   OMX_ErrorComponentSuspended = (OMX_S32) 0x8000101D,
00231 
00232   /** Component suspended due to an inability to acquire dynamic resources */
00233   OMX_ErrorDynamicResourcesUnavailable = (OMX_S32) 0x8000101E,
00234 
00235   /** When the macroblock error reporting is enabled the component returns new error 
00236   for every frame that has errors */
00237   OMX_ErrorMbErrorsInFrame = (OMX_S32) 0x8000101F,
00238 
00239   /** A component reports this error when it cannot parse or determine the format of an input stream. */
00240   OMX_ErrorFormatNotDetected = (OMX_S32) 0x80001020, 
00241 
00242   /** The content open operation failed. */
00243   OMX_ErrorContentPipeOpenFailed = (OMX_S32) 0x80001021,
00244 
00245   /** The content creation operation failed. */
00246   OMX_ErrorContentPipeCreationFailed = (OMX_S32) 0x80001022,
00247 
00248   /** Separate table information is being used */
00249   OMX_ErrorSeperateTablesUsed = (OMX_S32) 0x80001023,
00250 
00251   /** Tunneling is unsupported by the component*/
00252   OMX_ErrorTunnelingUnsupported = (OMX_S32) 0x80001024,
00253 
00254   OMX_ErrorKhronosExtensions = (OMX_S32)0x8F000000, /**< Reserved region for introducing Khronos Standard Extensions */ 
00255   OMX_ErrorVendorStartUnused = (OMX_S32)0x90000000, /**< Reserved region for introducing Vendor Extensions */
00256   OMX_ErrorMax = 0x7FFFFFFF
00257 } OMX_ERRORTYPE;
00258 
00259 /** @ingroup core */
00260 typedef OMX_ERRORTYPE (* OMX_COMPONENTINITTYPE)(OMX_IN  OMX_HANDLETYPE hComponent);
00261 
00262 /** @ingroup core */
00263 typedef struct OMX_COMPONENTREGISTERTYPE
00264 {
00265   const char          * pName;       /* Component name, 128 byte limit (including '\0') applies */
00266   OMX_COMPONENTINITTYPE pInitialize; /* Component instance initialization function */
00267 } OMX_COMPONENTREGISTERTYPE;
00268 
00269 /** @ingroup core */
00270 extern OMX_COMPONENTREGISTERTYPE OMX_ComponentRegistered[];
00271 
00272 /** @ingroup rpm */
00273 typedef struct OMX_PRIORITYMGMTTYPE {
00274  OMX_U32 nSize;             /**< size of the structure in bytes */
00275  OMX_VERSIONTYPE nVersion;  /**< OMX specification version information */
00276  OMX_U32 nGroupPriority;            /**< Priority of the component group */
00277  OMX_U32 nGroupID;                  /**< ID of the component group */
00278 } OMX_PRIORITYMGMTTYPE;
00279 
00280 /* Component name and Role names are limited to 128 characters including the terminating '\0'. */
00281 #define OMX_MAX_STRINGNAME_SIZE 128
00282 
00283 /** @ingroup comp */
00284 typedef struct OMX_PARAM_COMPONENTROLETYPE {
00285     OMX_U32 nSize;              /**< size of the structure in bytes */
00286     OMX_VERSIONTYPE nVersion;   /**< OMX specification version information */
00287     OMX_U8 cRole[OMX_MAX_STRINGNAME_SIZE];  /**< name of standard component which defines component role */
00288 } OMX_PARAM_COMPONENTROLETYPE;
00289 
00290 /** End of Stream Buffer Flag: 
00291   *
00292   * A component sets EOS when it has no more data to emit on a particular 
00293   * output port. Thus an output port shall set EOS on the last buffer it 
00294   * emits. A component's determination of when an output port should 
00295   * cease sending data is implemenation specific.
00296   * @ingroup buf
00297   */
00298 
00299 #define OMX_BUFFERFLAG_EOS 0x00000001 
00300 
00301 /** Start Time Buffer Flag: 
00302  *
00303  * The source of a stream (e.g. a demux component) sets the STARTTIME
00304  * flag on the buffer that contains the starting timestamp for the
00305  * stream. The starting timestamp corresponds to the first data that
00306  * should be displayed at startup or after a seek.
00307  * The first timestamp of the stream is not necessarily the start time.
00308  * For instance, in the case of a seek to a particular video frame, 
00309  * the target frame may be an interframe. Thus the first buffer of 
00310  * the stream will be the intra-frame preceding the target frame and
00311  * the starttime will occur with the target frame (with any other
00312  * required frames required to reconstruct the target intervening).
00313  *
00314  * The STARTTIME flag is directly associated with the buffer's 
00315  * timestamp ' thus its association to buffer data and its 
00316  * propagation is identical to the timestamp's.
00317  *
00318  * When a Sync Component client receives a buffer with the 
00319  * STARTTIME flag it shall perform a SetConfig on its sync port 
00320  * using OMX_ConfigTimeClientStartTime and passing the buffer's
00321  * timestamp.
00322  * 
00323  * @ingroup buf
00324  */
00325 
00326 #define OMX_BUFFERFLAG_STARTTIME 0x00000002
00327 
00328  
00329 
00330 /** Decode Only Buffer Flag: 
00331  *
00332  * The source of a stream (e.g. a demux component) sets the DECODEONLY
00333  * flag on any buffer that should shall be decoded but should not be
00334  * displayed. This flag is used, for instance, when a source seeks to 
00335  * a target interframe that requires the decode of frames preceding the 
00336  * target to facilitate the target's reconstruction. In this case the 
00337  * source would emit the frames preceding the target downstream 
00338  * but mark them as decode only.
00339  *
00340  * The DECODEONLY is associated with buffer data and propagated in a 
00341  * manner identical to the buffer timestamp.
00342  *
00343  * A component that renders data should ignore all buffers with 
00344  * the DECODEONLY flag set.
00345  * 
00346  * @ingroup buf
00347  */
00348 
00349 #define OMX_BUFFERFLAG_DECODEONLY 0x00000004
00350 
00351 
00352 /* Data Corrupt Flag: This flag is set when the IL client believes the data in the associated buffer is corrupt 
00353  * @ingroup buf
00354  */
00355 
00356 #define OMX_BUFFERFLAG_DATACORRUPT 0x00000008
00357 
00358 /* End of Frame: The buffer contains exactly one end of frame and no data
00359  *  occurs after the end of frame. This flag is an optional hint. The absence
00360  *  of this flag does not imply the absence of an end of frame within the buffer. 
00361  * @ingroup buf
00362 */
00363 #define OMX_BUFFERFLAG_ENDOFFRAME 0x00000010
00364 
00365 /* Sync Frame Flag: This flag is set when the buffer content contains a coded sync frame ' 
00366  *  a frame that has no dependency on any other frame information 
00367  *  @ingroup buf
00368  */
00369 #define OMX_BUFFERFLAG_SYNCFRAME 0x00000020
00370 
00371 /* Extra data present flag: there is extra data appended to the data stream
00372  * residing in the buffer 
00373  * @ingroup buf  
00374  */
00375 #define OMX_BUFFERFLAG_EXTRADATA 0x00000040
00376 
00377 /** Codec Config Buffer Flag: 
00378 * OMX_BUFFERFLAG_CODECCONFIG is an optional flag that is set by an
00379 * output port when all bytes in the buffer form part or all of a set of
00380 * codec specific configuration data.  Examples include SPS/PPS nal units
00381 * for OMX_VIDEO_CodingAVC or AudioSpecificConfig data for
00382 * OMX_AUDIO_CodingAAC.  Any component that for a given stream sets 
00383 * OMX_BUFFERFLAG_CODECCONFIG shall not mix codec configuration bytes
00384 * with frame data in the same buffer, and shall send all buffers
00385 * containing codec configuration bytes before any buffers containing
00386 * frame data that those configurations bytes describe.
00387 * If the stream format for a particular codec has a frame specific
00388 * header at the start of each frame, for example OMX_AUDIO_CodingMP3 or
00389 * OMX_AUDIO_CodingAAC in ADTS mode, then these shall be presented as
00390 * normal without setting OMX_BUFFERFLAG_CODECCONFIG.
00391  * @ingroup buf
00392  */
00393 #define OMX_BUFFERFLAG_CODECCONFIG 0x00000080
00394 
00395 
00396 
00397 /** @ingroup buf */
00398 typedef struct OMX_BUFFERHEADERTYPE
00399 {
00400     OMX_U32 nSize;              /**< size of the structure in bytes */
00401     OMX_VERSIONTYPE nVersion;   /**< OMX specification version information */
00402     OMX_U8* pBuffer;            /**< Pointer to actual block of memory 
00403                                      that is acting as the buffer */
00404     OMX_U32 nAllocLen;          /**< size of the buffer allocated, in bytes */
00405     OMX_U32 nFilledLen;         /**< number of bytes currently in the 
00406                                      buffer */
00407     OMX_U32 nOffset;            /**< start offset of valid data in bytes from
00408                                      the start of the buffer */
00409     OMX_PTR pAppPrivate;        /**< pointer to any data the application
00410                                      wants to associate with this buffer */
00411     OMX_PTR pPlatformPrivate;   /**< pointer to any data the platform
00412                                      wants to associate with this buffer */ 
00413     OMX_PTR pInputPortPrivate;  /**< pointer to any data the input port
00414                                      wants to associate with this buffer */
00415     OMX_PTR pOutputPortPrivate; /**< pointer to any data the output port
00416                                      wants to associate with this buffer */
00417     OMX_HANDLETYPE hMarkTargetComponent; /**< The component that will generate a 
00418                                               mark event upon processing this buffer. */
00419     OMX_PTR pMarkData;          /**< Application specific data associated with 
00420                                      the mark sent on a mark event to disambiguate 
00421                                      this mark from others. */
00422     OMX_U32 nTickCount;         /**< Optional entry that the component and
00423                                      application can update with a tick count
00424                                      when they access the component.  This
00425                                      value should be in microseconds.  Since
00426                                      this is a value relative to an arbitrary
00427                                      starting point, this value cannot be used 
00428                                      to determine absolute time.  This is an
00429                                      optional entry and not all components
00430                                      will update it.*/
00431  OMX_TICKS nTimeStamp;          /**< Timestamp corresponding to the sample 
00432                                      starting at the first logical sample 
00433                                      boundary in the buffer. Timestamps of 
00434                                      successive samples within the buffer may
00435                                      be inferred by adding the duration of the 
00436                                      of the preceding buffer to the timestamp
00437                                      of the preceding buffer.*/
00438   OMX_U32     nFlags;           /**< buffer specific flags */
00439   OMX_U32 nOutputPortIndex;     /**< The index of the output port (if any) using 
00440                                      this buffer */
00441   OMX_U32 nInputPortIndex;      /**< The index of the input port (if any) using
00442                                      this buffer */
00443 } OMX_BUFFERHEADERTYPE;
00444 
00445 /** The OMX_EXTRADATATYPE enumeration is used to define the 
00446  * possible extra data payload types.
00447  * NB: this enum is binary backwards compatible with the previous
00448  * OMX_EXTRADATA_QUANT define.  This should be replaced with
00449  * OMX_ExtraDataQuantization.
00450  */
00451 typedef enum OMX_EXTRADATATYPE
00452 {
00453    OMX_ExtraDataNone = 0,                       /**< Indicates that no more extra data sections follow */        
00454    OMX_ExtraDataQuantization,                   /**< The data payload contains quantization data */
00455    OMX_ExtraDataKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ 
00456    OMX_ExtraDataVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
00457    OMX_ExtraDataMax = 0x7FFFFFFF
00458 } OMX_EXTRADATATYPE;
00459 
00460 
00461 typedef struct OMX_OTHER_EXTRADATATYPE  {
00462     OMX_U32 nSize;
00463     OMX_VERSIONTYPE nVersion;               
00464     OMX_U32 nPortIndex;
00465     OMX_EXTRADATATYPE eType;       /* Extra Data type */
00466     OMX_U32 nDataSize;   /* Size of the supporting data to follow */
00467     OMX_U8  data[1];     /* Supporting data hint  */
00468 } OMX_OTHER_EXTRADATATYPE;
00469 
00470 /** @ingroup comp */
00471 typedef struct OMX_PORT_PARAM_TYPE {
00472     OMX_U32 nSize;              /**< size of the structure in bytes */
00473     OMX_VERSIONTYPE nVersion;   /**< OMX specification version information */
00474     OMX_U32 nPorts;             /**< The number of ports for this component */
00475     OMX_U32 nStartPortNumber;   /** first port number for this type of port */
00476 } OMX_PORT_PARAM_TYPE; 
00477 
00478 /** @ingroup comp */
00479 typedef enum OMX_EVENTTYPE
00480 {
00481     OMX_EventCmdComplete,         /**< component has sucessfully completed a command */
00482     OMX_EventError,               /**< component has detected an error condition */
00483     OMX_EventMark,                /**< component has detected a buffer mark */
00484     OMX_EventPortSettingsChanged, /**< component is reported a port settings change */
00485     OMX_EventBufferFlag,          /**< component has detected an EOS */ 
00486     OMX_EventResourcesAcquired,   /**< component has been granted resources and is
00487                                        automatically starting the state change from
00488                                        OMX_StateWaitForResources to OMX_StateIdle. */
00489    OMX_EventComponentResumed,     /**< Component resumed due to reacquisition of resources */
00490    OMX_EventDynamicResourcesAvailable, /**< Component has acquired previously unavailable dynamic resources */
00491    OMX_EventPortFormatDetected,      /**< Component has detected a supported format. */
00492    OMX_EventKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ 
00493    OMX_EventVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
00494    OMX_EventMax = 0x7FFFFFFF
00495 } OMX_EVENTTYPE;
00496 
00497 typedef struct OMX_CALLBACKTYPE
00498 {
00499     /** The EventHandler method is used to notify the application when an
00500         event of interest occurs.  Events are defined in the OMX_EVENTTYPE
00501         enumeration.  Please see that enumeration for details of what will
00502         be returned for each type of event. Callbacks should not return
00503         an error to the component, so if an error occurs, the application 
00504         shall handle it internally.  This is a blocking call.
00505 
00506         The application should return from this call within 5 msec to avoid
00507         blocking the component for an excessively long period of time.
00508 
00509         @param hComponent
00510             handle of the component to access.  This is the component
00511             handle returned by the call to the GetHandle function.
00512         @param pAppData
00513             pointer to an application defined value that was provided in the 
00514             pAppData parameter to the OMX_GetHandle method for the component.
00515             This application defined value is provided so that the application 
00516             can have a component specific context when receiving the callback.
00517         @param eEvent
00518             Event that the component wants to notify the application about.
00519         @param nData1
00520             nData will be the OMX_ERRORTYPE for an error event and will be 
00521             an OMX_COMMANDTYPE for a command complete event and OMX_INDEXTYPE for a OMX_PortSettingsChanged event.
00522          @param nData2
00523             nData2 will hold further information related to the event. Can be OMX_STATETYPE for
00524             a OMX_CommandStateSet command or port index for a OMX_PortSettingsChanged event.
00525             Default value is 0 if not used. )
00526         @param pEventData
00527             Pointer to additional event-specific data (see spec for meaning).
00528       */
00529 
00530    OMX_ERRORTYPE (*EventHandler)(
00531         OMX_IN OMX_HANDLETYPE hComponent,
00532         OMX_IN OMX_PTR pAppData,
00533         OMX_IN OMX_EVENTTYPE eEvent,
00534         OMX_IN OMX_U32 nData1,
00535         OMX_IN OMX_U32 nData2,
00536         OMX_IN OMX_PTR pEventData);
00537 
00538     /** The EmptyBufferDone method is used to return emptied buffers from an
00539         input port back to the application for reuse.  This is a blocking call 
00540         so the application should not attempt to refill the buffers during this
00541         call, but should queue them and refill them in another thread.  There
00542         is no error return, so the application shall handle any errors generated
00543         internally.  
00544         
00545         The application should return from this call within 5 msec.
00546         
00547         @param hComponent
00548             handle of the component to access.  This is the component
00549             handle returned by the call to the GetHandle function.
00550         @param pAppData
00551             pointer to an application defined value that was provided in the 
00552             pAppData parameter to the OMX_GetHandle method for the component.
00553             This application defined value is provided so that the application 
00554             can have a component specific context when receiving the callback.
00555         @param pBuffer
00556             pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer
00557             or AllocateBuffer indicating the buffer that was emptied.
00558         @ingroup buf
00559      */
00560     OMX_ERRORTYPE (*EmptyBufferDone)(
00561         OMX_IN OMX_HANDLETYPE hComponent,
00562         OMX_IN OMX_PTR pAppData,
00563         OMX_IN OMX_BUFFERHEADERTYPE* pBuffer);
00564 
00565     /** The FillBufferDone method is used to return filled buffers from an
00566         output port back to the application for emptying and then reuse.  
00567         This is a blocking call so the application should not attempt to 
00568         empty the buffers during this call, but should queue the buffers 
00569         and empty them in another thread.  There is no error return, so 
00570         the application shall handle any errors generated internally.  The 
00571         application shall also update the buffer header to indicate the
00572         number of bytes placed into the buffer.  
00573 
00574         The application should return from this call within 5 msec.
00575         
00576         @param hComponent
00577             handle of the component to access.  This is the component
00578             handle returned by the call to the GetHandle function.
00579         @param pAppData
00580             pointer to an application defined value that was provided in the 
00581             pAppData parameter to the OMX_GetHandle method for the component.
00582             This application defined value is provided so that the application 
00583             can have a component specific context when receiving the callback.
00584         @param pBuffer
00585             pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer
00586             or AllocateBuffer indicating the buffer that was filled.
00587         @ingroup buf
00588      */
00589     OMX_ERRORTYPE (*FillBufferDone)(
00590         OMX_OUT OMX_HANDLETYPE hComponent,
00591         OMX_OUT OMX_PTR pAppData,
00592         OMX_OUT OMX_BUFFERHEADERTYPE* pBuffer);
00593 
00594 } OMX_CALLBACKTYPE;
00595 
00596 /** The OMX_BUFFERSUPPLIERTYPE enumeration is used to dictate port supplier
00597     preference when tunneling between two ports.
00598     @ingroup tun buf
00599 */
00600 typedef enum OMX_BUFFERSUPPLIERTYPE
00601 {
00602     OMX_BufferSupplyUnspecified = 0x0, /**< port supplying the buffers is unspecified,
00603                                               or don't care */
00604     OMX_BufferSupplyInput,             /**< input port supplies the buffers */
00605     OMX_BufferSupplyOutput,            /**< output port supplies the buffers */
00606     OMX_BufferSupplyKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ 
00607     OMX_BufferSupplyVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
00608     OMX_BufferSupplyMax = 0x7FFFFFFF
00609 } OMX_BUFFERSUPPLIERTYPE;
00610 
00611 
00612 /** buffer supplier parameter 
00613  * @ingroup tun
00614  */
00615 typedef struct OMX_PARAM_BUFFERSUPPLIERTYPE {
00616     OMX_U32 nSize; /**< size of the structure in bytes */
00617     OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
00618     OMX_U32 nPortIndex; /**< port that this structure applies to */
00619     OMX_BUFFERSUPPLIERTYPE eBufferSupplier; /**< buffer supplier */
00620 } OMX_PARAM_BUFFERSUPPLIERTYPE;
00621 
00622 
00623 /**< indicates that buffers received by an input port of a tunnel 
00624      may not modify the data in the buffers 
00625      @ingroup tun
00626  */
00627 #define OMX_PORTTUNNELFLAG_READONLY 0x00000001 
00628 
00629 
00630 /** The OMX_TUNNELSETUPTYPE structure is used to pass data from an output
00631     port to an input port as part the two ComponentTunnelRequest calls
00632     resulting from a OMX_SetupTunnel call from the IL Client. 
00633     @ingroup tun
00634  */   
00635 typedef struct OMX_TUNNELSETUPTYPE
00636 {
00637     OMX_U32 nTunnelFlags;             /**< bit flags for tunneling */
00638     OMX_BUFFERSUPPLIERTYPE eSupplier; /**< supplier preference */
00639 } OMX_TUNNELSETUPTYPE; 
00640 
00641 /* OMX Component headers is included to enable the core to use
00642    macros for functions into the component for OMX release 1.0.  
00643    Developers should not access any structures or data from within
00644    the component header directly */
00645 /* TO BE REMOVED - #include <OMX_Component.h> */
00646 
00647 /** GetComponentVersion will return information about the component.  
00648     This is a blocking call.  This macro will go directly from the
00649     application to the component (via a core macro).  The
00650     component will return from this call within 5 msec.
00651     @param [in] hComponent
00652         handle of component to execute the command
00653     @param [out] pComponentName
00654         pointer to an empty string of length 128 bytes.  The component 
00655         will write its name into this string.  The name will be 
00656         terminated by a single zero byte.  The name of a component will 
00657         be 127 bytes or less to leave room for the trailing zero byte.  
00658         An example of a valid component name is "OMX.ABC.ChannelMixer\0".
00659     @param [out] pComponentVersion
00660         pointer to an OMX Version structure that the component will fill 
00661         in.  The component will fill in a value that indicates the 
00662         component version.  NOTE: the component version is NOT the same 
00663         as the OMX Specification version (found in all structures).  The 
00664         component version is defined by the vendor of the component and 
00665         its value is entirely up to the component vendor.
00666     @param [out] pSpecVersion
00667         pointer to an OMX Version structure that the component will fill 
00668         in.  The SpecVersion is the version of the specification that the 
00669         component was built against.  Please note that this value may or 
00670         may not match the structure's version.  For example, if the 
00671         component was built against the 2.0 specification, but the 
00672         application (which creates the structure is built against the 
00673         1.0 specification the versions would be different.
00674     @param [out] pComponentUUID
00675         pointer to the UUID of the component which will be filled in by 
00676         the component.  The UUID is a unique identifier that is set at 
00677         RUN time for the component and is unique to each instantion of 
00678         the component.
00679     @return OMX_ERRORTYPE
00680         If the command successfully executes, the return code will be
00681         OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.
00682     @ingroup comp
00683  */
00684 #define OMX_GetComponentVersion(                            \
00685         hComponent,                                         \
00686         pComponentName,                                     \
00687         pComponentVersion,                                  \
00688         pSpecVersion,                                       \
00689         pComponentUUID)                                     \
00690     ((OMX_COMPONENTTYPE*)hComponent)->GetComponentVersion(  \
00691         hComponent,                                         \
00692         pComponentName,                                     \
00693         pComponentVersion,                                  \
00694         pSpecVersion,                                       \
00695         pComponentUUID)                 /* Macro End */
00696 
00697 
00698 /** Send a command to the component.  This call is a non-blocking call.
00699     The component should check the parameters and then queue the command
00700     to the component thread to be executed.  The component thread shall 
00701     send the EventHandler() callback at the conclusion of the command. 
00702     This macro will go directly from the application to the component (via
00703     a core macro).  The component will return from this call within 5 msec.
00704     
00705     When the command is "OMX_CommandStateSet" the component will queue a
00706     state transition to the new state idenfied in nParam.
00707     
00708     When the command is "OMX_CommandFlush", to flush a port's buffer queues,
00709     the command will force the component to return all buffers NOT CURRENTLY 
00710     BEING PROCESSED to the application, in the order in which the buffers 
00711     were received.
00712     
00713     When the command is "OMX_CommandPortDisable" or 
00714     "OMX_CommandPortEnable", the component's port (given by the value of
00715     nParam) will be stopped or restarted. 
00716     
00717     When the command "OMX_CommandMarkBuffer" is used to mark a buffer, the
00718     pCmdData will point to a OMX_MARKTYPE structure containing the component
00719     handle of the component to examine the buffer chain for the mark.  nParam1
00720     contains the index of the port on which the buffer mark is applied.
00721 
00722     Specification text for more details. 
00723     
00724     @param [in] hComponent
00725         handle of component to execute the command
00726     @param [in] Cmd
00727         Command for the component to execute
00728     @param [in] nParam
00729         Parameter for the command to be executed.  When Cmd has the value 
00730         OMX_CommandStateSet, value is a member of OMX_STATETYPE.  When Cmd has 
00731         the value OMX_CommandFlush, value of nParam indicates which port(s) 
00732         to flush. -1 is used to flush all ports a single port index will 
00733         only flush that port.  When Cmd has the value "OMX_CommandPortDisable"
00734         or "OMX_CommandPortEnable", the component's port is given by 
00735         the value of nParam.  When Cmd has the value "OMX_CommandMarkBuffer"
00736         the components pot is given by the value of nParam.
00737     @param [in] pCmdData
00738         Parameter pointing to the OMX_MARKTYPE structure when Cmd has the value
00739         "OMX_CommandMarkBuffer".     
00740     @return OMX_ERRORTYPE
00741         If the command successfully executes, the return code will be
00742         OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.
00743     @ingroup comp
00744  */
00745 #define OMX_SendCommand(                                    \
00746          hComponent,                                        \
00747          Cmd,                                               \
00748          nParam,                                            \
00749          pCmdData)                                          \
00750      ((OMX_COMPONENTTYPE*)hComponent)->SendCommand(         \
00751          hComponent,                                        \
00752          Cmd,                                               \
00753          nParam,                                            \
00754          pCmdData)                          /* Macro End */
00755 
00756 
00757 /** The OMX_GetParameter macro will get one of the current parameter 
00758     settings from the component.  This macro cannot only be invoked when 
00759     the component is in the OMX_StateInvalid state.  The nParamIndex
00760     parameter is used to indicate which structure is being requested from
00761     the component.  The application shall allocate the correct structure 
00762     and shall fill in the structure size and version information before 
00763     invoking this macro.  When the parameter applies to a port, the
00764     caller shall fill in the appropriate nPortIndex value indicating the
00765     port on which the parameter applies. If the component has not had 
00766     any settings changed, then the component should return a set of 
00767     valid DEFAULT  parameters for the component.  This is a blocking 
00768     call.  
00769     
00770     The component should return from this call within 20 msec.
00771     
00772     @param [in] hComponent
00773         Handle of the component to be accessed.  This is the component
00774         handle returned by the call to the OMX_GetHandle function.
00775     @param [in] nParamIndex
00776         Index of the structure to be filled.  This value is from the
00777         OMX_INDEXTYPE enumeration.
00778     @param [in,out] pComponentParameterStructure
00779         Pointer to application allocated structure to be filled by the 
00780         component.
00781     @return OMX_ERRORTYPE
00782         If the command successfully executes, the return code will be
00783         OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.
00784     @ingroup comp
00785  */
00786 #define OMX_GetParameter(                                   \
00787         hComponent,                                         \
00788         nParamIndex,                                        \
00789         pComponentParameterStructure)                        \
00790     ((OMX_COMPONENTTYPE*)hComponent)->GetParameter(         \
00791         hComponent,                                         \
00792         nParamIndex,                                        \
00793         pComponentParameterStructure)    /* Macro End */
00794 
00795 
00796 /** The OMX_SetParameter macro will send an initialization parameter
00797     structure to a component.  Each structure shall be sent one at a time,
00798     in a separate invocation of the macro.  This macro can only be
00799     invoked when the component is in the OMX_StateLoaded state, or the
00800     port is disabled (when the parameter applies to a port). The 
00801     nParamIndex parameter is used to indicate which structure is being
00802     passed to the component.  The application shall allocate the 
00803     correct structure and shall fill in the structure size and version 
00804     information (as well as the actual data) before invoking this macro.
00805     The application is free to dispose of this structure after the call
00806     as the component is required to copy any data it shall retain.  This 
00807     is a blocking call.  
00808     
00809     The component should return from this call within 20 msec.
00810     
00811     @param [in] hComponent
00812         Handle of the component to be accessed.  This is the component
00813         handle returned by the call to the OMX_GetHandle function.
00814     @param [in] nIndex
00815         Index of the structure to be sent.  This value is from the
00816         OMX_INDEXTYPE enumeration.
00817     @param [in] pComponentParameterStructure
00818         pointer to application allocated structure to be used for
00819         initialization by the component.
00820     @return OMX_ERRORTYPE
00821         If the command successfully executes, the return code will be
00822         OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.
00823     @ingroup comp
00824  */
00825 #define OMX_SetParameter(                                   \
00826         hComponent,                                         \
00827         nParamIndex,                                        \
00828         pComponentParameterStructure)                        \
00829     ((OMX_COMPONENTTYPE*)hComponent)->SetParameter(         \
00830         hComponent,                                         \
00831         nParamIndex,                                        \
00832         pComponentParameterStructure)    /* Macro End */
00833 
00834 
00835 /** The OMX_GetConfig macro will get one of the configuration structures 
00836     from a component.  This macro can be invoked anytime after the 
00837     component has been loaded.  The nParamIndex call parameter is used to 
00838     indicate which structure is being requested from the component.  The 
00839     application shall allocate the correct structure and shall fill in the 
00840     structure size and version information before invoking this macro.  
00841     If the component has not had this configuration parameter sent before, 
00842     then the component should return a set of valid DEFAULT values for the 
00843     component.  This is a blocking call.  
00844     
00845     The component should return from this call within 5 msec.
00846     
00847     @param [in] hComponent
00848         Handle of the component to be accessed.  This is the component
00849         handle returned by the call to the OMX_GetHandle function.
00850     @param [in] nIndex
00851         Index of the structure to be filled.  This value is from the
00852         OMX_INDEXTYPE enumeration.
00853     @param [in,out] pComponentConfigStructure
00854         pointer to application allocated structure to be filled by the 
00855         component.
00856     @return OMX_ERRORTYPE
00857         If the command successfully executes, the return code will be
00858         OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.
00859     @ingroup comp
00860 */        
00861 #define OMX_GetConfig(                                      \
00862         hComponent,                                         \
00863         nConfigIndex,                                       \
00864         pComponentConfigStructure)                           \
00865     ((OMX_COMPONENTTYPE*)hComponent)->GetConfig(            \
00866         hComponent,                                         \
00867         nConfigIndex,                                       \
00868         pComponentConfigStructure)       /* Macro End */
00869 
00870 
00871 /** The OMX_SetConfig macro will send one of the configuration 
00872     structures to a component.  Each structure shall be sent one at a time,
00873     each in a separate invocation of the macro.  This macro can be invoked 
00874     anytime after the component has been loaded.  The application shall 
00875     allocate the correct structure and shall fill in the structure size 
00876     and version information (as well as the actual data) before invoking 
00877     this macro.  The application is free to dispose of this structure after 
00878     the call as the component is required to copy any data it shall retain.  
00879     This is a blocking call.  
00880     
00881     The component should return from this call within 5 msec.
00882     
00883     @param [in] hComponent
00884         Handle of the component to be accessed.  This is the component
00885         handle returned by the call to the OMX_GetHandle function.
00886     @param [in] nConfigIndex
00887         Index of the structure to be sent.  This value is from the
00888         OMX_INDEXTYPE enumeration above.
00889     @param [in] pComponentConfigStructure
00890         pointer to application allocated structure to be used for
00891         initialization by the component.
00892     @return OMX_ERRORTYPE
00893         If the command successfully executes, the return code will be
00894         OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.
00895     @ingroup comp
00896  */
00897 #define OMX_SetConfig(                                      \
00898         hComponent,                                         \
00899         nConfigIndex,                                       \
00900         pComponentConfigStructure)                           \
00901     ((OMX_COMPONENTTYPE*)hComponent)->SetConfig(            \
00902         hComponent,                                         \
00903         nConfigIndex,                                       \
00904         pComponentConfigStructure)       /* Macro End */
00905 
00906 
00907 /** The OMX_GetExtensionIndex macro will invoke a component to translate 
00908     a vendor specific configuration or parameter string into an OMX 
00909     structure index.  There is no requirement for the vendor to support 
00910     this command for the indexes already found in the OMX_INDEXTYPE 
00911     enumeration (this is done to save space in small components).  The 
00912     component shall support all vendor supplied extension indexes not found
00913     in the master OMX_INDEXTYPE enumeration.  This is a blocking call.  
00914     
00915     The component should return from this call within 5 msec.
00916     
00917     @param [in] hComponent
00918         Handle of the component to be accessed.  This is the component
00919         handle returned by the call to the GetHandle function.
00920     @param [in] cParameterName
00921         OMX_STRING that shall be less than 128 characters long including
00922         the trailing null byte.  This is the string that will get 
00923         translated by the component into a configuration index.
00924     @param [out] pIndexType
00925         a pointer to a OMX_INDEXTYPE to receive the index value.
00926     @return OMX_ERRORTYPE
00927         If the command successfully executes, the return code will be
00928         OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.
00929     @ingroup comp
00930  */
00931 #define OMX_GetExtensionIndex(                              \
00932         hComponent,                                         \
00933         cParameterName,                                     \
00934         pIndexType)                                         \
00935     ((OMX_COMPONENTTYPE*)hComponent)->GetExtensionIndex(    \
00936         hComponent,                                         \
00937         cParameterName,                                     \
00938         pIndexType)                     /* Macro End */
00939 
00940 
00941 /** The OMX_GetState macro will invoke the component to get the current 
00942     state of the component and place the state value into the location
00943     pointed to by pState.  
00944     
00945     The component should return from this call within 5 msec.
00946     
00947     @param [in] hComponent
00948         Handle of the component to be accessed.  This is the component
00949         handle returned by the call to the OMX_GetHandle function.
00950     @param [out] pState
00951         pointer to the location to receive the state.  The value returned
00952         is one of the OMX_STATETYPE members 
00953     @return OMX_ERRORTYPE
00954         If the command successfully executes, the return code will be
00955         OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.
00956     @ingroup comp
00957  */
00958 #define OMX_GetState(                                       \
00959         hComponent,                                         \
00960         pState)                                             \
00961     ((OMX_COMPONENTTYPE*)hComponent)->GetState(             \
00962         hComponent,                                         \
00963         pState)                         /* Macro End */
00964 
00965 
00966 /** The OMX_UseBuffer macro will request that the component use
00967     a buffer (and allocate its own buffer header) already allocated 
00968     by another component, or by the IL Client. This is a blocking 
00969     call.
00970     
00971     The component should return from this call within 20 msec.
00972     
00973     @param [in] hComponent
00974         Handle of the component to be accessed.  This is the component
00975         handle returned by the call to the OMX_GetHandle function.
00976     @param [out] ppBuffer
00977         pointer to an OMX_BUFFERHEADERTYPE structure used to receive the 
00978         pointer to the buffer header
00979     @return OMX_ERRORTYPE
00980         If the command successfully executes, the return code will be
00981         OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.
00982     @ingroup comp buf
00983  */
00984 
00985 #define OMX_UseBuffer(                                      \
00986            hComponent,                                      \
00987            ppBufferHdr,                                     \
00988            nPortIndex,                                      \
00989            pAppPrivate,                                     \
00990            nSizeBytes,                                      \
00991            pBuffer)                                         \
00992     ((OMX_COMPONENTTYPE*)hComponent)->UseBuffer(            \
00993            hComponent,                                      \
00994            ppBufferHdr,                                     \
00995            nPortIndex,                                      \
00996            pAppPrivate,                                     \
00997            nSizeBytes,                                      \
00998            pBuffer)
00999 
01000 
01001 /** The OMX_AllocateBuffer macro will request that the component allocate 
01002     a new buffer and buffer header.  The component will allocate the 
01003     buffer and the buffer header and return a pointer to the buffer 
01004     header.  This is a blocking call.
01005     
01006     The component should return from this call within 5 msec.
01007     
01008     @param [in] hComponent
01009         Handle of the component to be accessed.  This is the component
01010         handle returned by the call to the OMX_GetHandle function.
01011     @param [out] ppBuffer
01012         pointer to an OMX_BUFFERHEADERTYPE structure used to receive 
01013         the pointer to the buffer header
01014     @param [in] nPortIndex
01015         nPortIndex is used to select the port on the component the buffer will
01016         be used with.  The port can be found by using the nPortIndex
01017         value as an index into the Port Definition array of the component.
01018     @param [in] pAppPrivate
01019         pAppPrivate is used to initialize the pAppPrivate member of the 
01020         buffer header structure.
01021     @param [in] nSizeBytes
01022         size of the buffer to allocate.  Used when bAllocateNew is true.
01023     @return OMX_ERRORTYPE
01024         If the command successfully executes, the return code will be
01025         OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.
01026     @ingroup comp buf
01027  */    
01028 #define OMX_AllocateBuffer(                                 \
01029         hComponent,                                         \
01030         ppBuffer,                                           \
01031         nPortIndex,                                         \
01032         pAppPrivate,                                        \
01033         nSizeBytes)                                         \
01034     ((OMX_COMPONENTTYPE*)hComponent)->AllocateBuffer(       \
01035         hComponent,                                         \
01036         ppBuffer,                                           \
01037         nPortIndex,                                         \
01038         pAppPrivate,                                        \
01039         nSizeBytes)                     /* Macro End */
01040 
01041 
01042 /** The OMX_FreeBuffer macro will release a buffer header from the component
01043     which was allocated using either OMX_AllocateBuffer or OMX_UseBuffer. If  
01044     the component allocated the buffer (see the OMX_UseBuffer macro) then 
01045     the component shall free the buffer and buffer header. This is a 
01046     blocking call. 
01047     
01048     The component should return from this call within 20 msec.
01049     
01050     @param [in] hComponent
01051         Handle of the component to be accessed.  This is the component
01052         handle returned by the call to the OMX_GetHandle function.
01053     @param [in] nPortIndex
01054         nPortIndex is used to select the port on the component the buffer will
01055         be used with.
01056     @param [in] pBuffer
01057         pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer
01058         or AllocateBuffer.
01059     @return OMX_ERRORTYPE
01060         If the command successfully executes, the return code will be
01061         OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.
01062     @ingroup comp buf
01063  */
01064 #define OMX_FreeBuffer(                                     \
01065         hComponent,                                         \
01066         nPortIndex,                                         \
01067         pBuffer)                                            \
01068     ((OMX_COMPONENTTYPE*)hComponent)->FreeBuffer(           \
01069         hComponent,                                         \
01070         nPortIndex,                                         \
01071         pBuffer)                        /* Macro End */
01072 
01073 
01074 /** The OMX_EmptyThisBuffer macro will send a buffer full of data to an 
01075     input port of a component.  The buffer will be emptied by the component
01076     and returned to the application via the EmptyBufferDone call back.
01077     This is a non-blocking call in that the component will record the buffer
01078     and return immediately and then empty the buffer, later, at the proper 
01079     time.  As expected, this macro may be invoked only while the component 
01080     is in the OMX_StateExecuting.  If nPortIndex does not specify an input
01081     port, the component shall return an error.  
01082     
01083     The component should return from this call within 5 msec.
01084     
01085     @param [in] hComponent
01086         Handle of the component to be accessed.  This is the component
01087         handle returned by the call to the OMX_GetHandle function.
01088     @param [in] pBuffer
01089         pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer
01090         or AllocateBuffer.
01091     @return OMX_ERRORTYPE
01092         If the command successfully executes, the return code will be
01093         OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.
01094     @ingroup comp buf
01095  */
01096 #define OMX_EmptyThisBuffer(                                \
01097         hComponent,                                         \
01098         pBuffer)                                            \
01099     ((OMX_COMPONENTTYPE*)hComponent)->EmptyThisBuffer(      \
01100         hComponent,                                         \
01101         pBuffer)                        /* Macro End */
01102 
01103 
01104 /** The OMX_FillThisBuffer macro will send an empty buffer to an 
01105     output port of a component.  The buffer will be filled by the component
01106     and returned to the application via the FillBufferDone call back.
01107     This is a non-blocking call in that the component will record the buffer
01108     and return immediately and then fill the buffer, later, at the proper 
01109     time.  As expected, this macro may be invoked only while the component 
01110     is in the OMX_ExecutingState.  If nPortIndex does not specify an output
01111     port, the component shall return an error.  
01112     
01113     The component should return from this call within 5 msec.
01114     
01115     @param [in] hComponent
01116         Handle of the component to be accessed.  This is the component
01117         handle returned by the call to the OMX_GetHandle function.
01118     @param [in] pBuffer
01119         pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer
01120         or AllocateBuffer.
01121     @return OMX_ERRORTYPE
01122         If the command successfully executes, the return code will be
01123         OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.
01124     @ingroup comp buf
01125  */
01126 #define OMX_FillThisBuffer(                                 \
01127         hComponent,                                         \
01128         pBuffer)                                            \
01129     ((OMX_COMPONENTTYPE*)hComponent)->FillThisBuffer(       \
01130         hComponent,                                         \
01131         pBuffer)                        /* Macro End */
01132 
01133 
01134 
01135 /** The OMX_UseEGLImage macro will request that the component use
01136     a EGLImage provided by EGL (and allocate its own buffer header)
01137     This is a blocking call.
01138     
01139     The component should return from this call within 20 msec.
01140     
01141     @param [in] hComponent
01142         Handle of the component to be accessed.  This is the component
01143         handle returned by the call to the OMX_GetHandle function.
01144     @param [out] ppBuffer
01145         pointer to an OMX_BUFFERHEADERTYPE structure used to receive the 
01146         pointer to the buffer header.  Note that the memory location used
01147         for this buffer is NOT visible to the IL Client.
01148     @param [in] nPortIndex
01149         nPortIndex is used to select the port on the component the buffer will
01150         be used with.  The port can be found by using the nPortIndex
01151         value as an index into the Port Definition array of the component.
01152     @param [in] pAppPrivate
01153         pAppPrivate is used to initialize the pAppPrivate member of the 
01154         buffer header structure.
01155     @param [in] eglImage
01156         eglImage contains the handle of the EGLImage to use as a buffer on the
01157         specified port.  The component is expected to validate properties of 
01158         the EGLImage against the configuration of the port to ensure the component
01159         can use the EGLImage as a buffer.          
01160     @return OMX_ERRORTYPE
01161         If the command successfully executes, the return code will be
01162         OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.
01163     @ingroup comp buf
01164  */
01165 #define OMX_UseEGLImage(                                    \
01166            hComponent,                                      \
01167            ppBufferHdr,                                     \
01168            nPortIndex,                                      \
01169            pAppPrivate,                                     \
01170            eglImage)                                        \
01171     ((OMX_COMPONENTTYPE*)hComponent)->UseEGLImage(          \
01172            hComponent,                                      \
01173            ppBufferHdr,                                     \
01174            nPortIndex,                                      \
01175            pAppPrivate,                                     \
01176            eglImage)
01177 
01178 /** The OMX_Init method is used to initialize the OMX core.  It shall be the
01179     first call made into OMX and it should only be executed one time without
01180     an interviening OMX_Deinit call.  
01181     
01182     The core should return from this call within 20 msec.
01183 
01184     @return OMX_ERRORTYPE
01185         If the command successfully executes, the return code will be
01186         OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.
01187     @ingroup core
01188  */
01189 OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_Init(void);
01190 
01191 
01192 /** The OMX_Deinit method is used to deinitialize the OMX core.  It shall be 
01193     the last call made into OMX. In the event that the core determines that 
01194     thare are components loaded when this call is made, the core may return 
01195     with an error rather than try to unload the components.
01196         
01197     The core should return from this call within 20 msec.
01198     
01199     @return OMX_ERRORTYPE
01200         If the command successfully executes, the return code will be
01201         OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.
01202     @ingroup core
01203  */
01204 OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_Deinit(void);
01205 
01206 
01207 /** The OMX_ComponentNameEnum method will enumerate through all the names of
01208     recognised valid components in the system. This function is provided
01209     as a means to detect all the components in the system run-time. There is
01210     no strict ordering to the enumeration order of component names, although
01211     each name will only be enumerated once.  If the OMX core supports run-time
01212     installation of new components, it is only requried to detect newly
01213     installed components when the first call to enumerate component names
01214     is made (i.e. when nIndex is 0x0).
01215     
01216     The core should return from this call in 20 msec.
01217     
01218     @param [out] cComponentName
01219         pointer to a null terminated string with the component name.  The
01220         names of the components are strings less than 127 bytes in length
01221         plus the trailing null for a maximum size of 128 bytes.  An example 
01222         of a valid component name is "OMX.TI.AUDIO.DSP.MIXER\0".  Names are 
01223         assigned by the vendor, but shall start with "OMX." and then have 
01224         the Vendor designation next.
01225     @param [in] nNameLength
01226         number of characters in the cComponentName string.  With all 
01227         component name strings restricted to less than 128 characters 
01228         (including the trailing null) it is recomended that the caller
01229         provide a input string for the cComponentName of 128 characters.
01230     @param [in] nIndex
01231         number containing the enumeration index for the component. 
01232         Multiple calls to OMX_ComponentNameEnum with increasing values
01233         of nIndex will enumerate through the component names in the
01234         system until OMX_ErrorNoMore is returned.  The value of nIndex
01235         is 0 to (N-1), where N is the number of valid installed components
01236         in the system.
01237     @return OMX_ERRORTYPE
01238         If the command successfully executes, the return code will be
01239         OMX_ErrorNone.  When the value of nIndex exceeds the number of 
01240         components in the system minus 1, OMX_ErrorNoMore will be
01241         returned. Otherwise the appropriate OMX error will be returned.
01242     @ingroup core
01243  */
01244 OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_ComponentNameEnum(
01245     OMX_OUT OMX_STRING cComponentName,
01246     OMX_IN  OMX_U32 nNameLength,
01247     OMX_IN  OMX_U32 nIndex);
01248 
01249 
01250 /** The OMX_GetHandle method will locate the component specified by the
01251     component name given, load that component into memory and then invoke
01252     the component's methods to create an instance of the component.  
01253     
01254     The core should return from this call within 20 msec.
01255     
01256     @param [out] pHandle
01257         pointer to an OMX_HANDLETYPE pointer to be filled in by this method.
01258     @param [in] cComponentName
01259         pointer to a null terminated string with the component name.  The
01260         names of the components are strings less than 127 bytes in length
01261         plus the trailing null for a maximum size of 128 bytes.  An example 
01262         of a valid component name is "OMX.TI.AUDIO.DSP.MIXER\0".  Names are 
01263         assigned by the vendor, but shall start with "OMX." and then have 
01264         the Vendor designation next.
01265     @param [in] pAppData
01266         pointer to an application defined value that will be returned
01267         during callbacks so that the application can identify the source
01268         of the callback.
01269     @param [in] pCallBacks
01270         pointer to a OMX_CALLBACKTYPE structure that will be passed to the
01271         component to initialize it with.  
01272     @return OMX_ERRORTYPE
01273         If the command successfully executes, the return code will be
01274         OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.
01275     @ingroup core
01276  */
01277 OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_GetHandle(
01278     OMX_OUT OMX_HANDLETYPE* pHandle, 
01279     OMX_IN  OMX_STRING cComponentName,
01280     OMX_IN  OMX_PTR pAppData,
01281     OMX_IN  OMX_CALLBACKTYPE* pCallBacks);
01282 
01283 
01284 /** The OMX_FreeHandle method will free a handle allocated by the OMX_GetHandle 
01285     method.  If the component reference count goes to zero, the component will
01286     be unloaded from memory.  
01287     
01288     The core should return from this call within 20 msec when the component is 
01289     in the OMX_StateLoaded state.
01290 
01291     @param [in] hComponent
01292         Handle of the component to be accessed.  This is the component
01293         handle returned by the call to the GetHandle function.
01294     @return OMX_ERRORTYPE
01295         If the command successfully executes, the return code will be
01296         OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.
01297     @ingroup core
01298  */
01299 OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_FreeHandle(
01300     OMX_IN  OMX_HANDLETYPE hComponent);
01301 
01302 
01303 
01304 /** The OMX_SetupTunnel method will handle the necessary calls to the components
01305     to setup the specified tunnel the two components.  NOTE: This is
01306     an actual method (not a #define macro).  This method will make calls into
01307     the component ComponentTunnelRequest method to do the actual tunnel 
01308     connection.  
01309 
01310     The ComponentTunnelRequest method on both components will be called. 
01311     This method shall not be called unless the component is in the 
01312     OMX_StateLoaded state except when the ports used for the tunnel are
01313     disabled. In this case, the component may be in the OMX_StateExecuting,
01314     OMX_StatePause, or OMX_StateIdle states. 
01315 
01316     The core should return from this call within 20 msec.
01317     
01318     @param [in] hOutput
01319         Handle of the component to be accessed.  Also this is the handle
01320         of the component whose port, specified in the nPortOutput parameter
01321         will be used the source for the tunnel. This is the component handle
01322         returned by the call to the OMX_GetHandle function.  There is a 
01323         requirement that hOutput be the source for the data when
01324         tunelling (i.e. nPortOutput is an output port).  If 0x0, the component
01325         specified in hInput will have it's port specified in nPortInput
01326         setup for communication with the application / IL client.
01327     @param [in] nPortOutput
01328         nPortOutput is used to select the source port on component to be
01329         used in the tunnel. 
01330     @param [in] hInput
01331         This is the component to setup the tunnel with. This is the handle
01332         of the component whose port, specified in the nPortInput parameter
01333         will be used the destination for the tunnel. This is the component handle
01334         returned by the call to the OMX_GetHandle function.  There is a 
01335         requirement that hInput be the destination for the data when
01336         tunelling (i.e. nPortInut is an input port).   If 0x0, the component
01337         specified in hOutput will have it's port specified in nPortPOutput
01338         setup for communication with the application / IL client.
01339     @param [in] nPortInput
01340         nPortInput is used to select the destination port on component to be
01341         used in the tunnel.
01342     @return OMX_ERRORTYPE
01343         If the command successfully executes, the return code will be
01344         OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.
01345         When OMX_ErrorNotImplemented is returned, one or both components is 
01346         a non-interop component and does not support tunneling.
01347         
01348         On failure, the ports of both components are setup for communication
01349         with the application / IL Client.
01350     @ingroup core tun
01351  */
01352 OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_SetupTunnel(
01353     OMX_IN  OMX_HANDLETYPE hOutput,
01354     OMX_IN  OMX_U32 nPortOutput,
01355     OMX_IN  OMX_HANDLETYPE hInput,
01356     OMX_IN  OMX_U32 nPortInput);
01357     
01358 /** @ingroup cp */
01359 OMX_API OMX_ERRORTYPE   OMX_GetContentPipe(
01360     OMX_OUT OMX_HANDLETYPE *hPipe,
01361     OMX_IN OMX_STRING szURI);
01362 
01363 /** The OMX_GetComponentsOfRole method will return the number of components that support the given
01364     role and (if the compNames field is non-NULL) the names of those components. The call will fail if 
01365     an insufficiently sized array of names is supplied. To ensure the array is sufficiently sized the
01366     client should:
01367         * first call this function with the compNames field NULL to determine the number of component names
01368         * second call this function with the compNames field pointing to an array of names allocated 
01369           according to the number returned by the first call.
01370 
01371     The core should return from this call within 5 msec.
01372     
01373     @param [in] role
01374         This is generic standard component name consisting only of component class 
01375         name and the type within that class (e.g. 'audio_decoder.aac').
01376     @param [inout] pNumComps
01377         This is used both as input and output. 
01378  
01379         If compNames is NULL, the input is ignored and the output specifies how many components support
01380         the given role.
01381      
01382         If compNames is not NULL, on input it bounds the size of the input structure and 
01383         on output, it specifies the number of components string names listed within the compNames parameter.
01384     @param [inout] compNames
01385         If NULL this field is ignored. If non-NULL this points to an array of 128-byte strings which accepts 
01386         a list of the names of all physical components that implement the specified standard component name. 
01387         Each name is NULL terminated. numComps indicates the number of names.
01388     @ingroup core
01389  */
01390 OMX_API OMX_ERRORTYPE OMX_GetComponentsOfRole ( 
01391     OMX_IN      OMX_STRING role,
01392     OMX_INOUT   OMX_U32 *pNumComps,
01393     OMX_INOUT   OMX_U8  **compNames);
01394 
01395 /** The OMX_GetRolesOfComponent method will return the number of roles supported by the given
01396     component and (if the roles field is non-NULL) the names of those roles. The call will fail if 
01397     an insufficiently sized array of names is supplied. To ensure the array is sufficiently sized the
01398     client should:
01399         * first call this function with the roles field NULL to determine the number of role names
01400         * second call this function with the roles field pointing to an array of names allocated 
01401           according to the number returned by the first call.
01402 
01403     The core should return from this call within 5 msec.
01404 
01405     @param [in] compName
01406         This is the name of the component being queried about.
01407     @param [inout] pNumRoles
01408         This is used both as input and output. 
01409  
01410         If roles is NULL, the input is ignored and the output specifies how many roles the component supports.
01411      
01412         If compNames is not NULL, on input it bounds the size of the input structure and 
01413         on output, it specifies the number of roles string names listed within the roles parameter.
01414     @param [out] roles
01415         If NULL this field is ignored. If non-NULL this points to an array of 128-byte strings 
01416         which accepts a list of the names of all standard components roles implemented on the 
01417         specified component name. numComps indicates the number of names.
01418     @ingroup core
01419  */
01420 OMX_API OMX_ERRORTYPE OMX_GetRolesOfComponent ( 
01421     OMX_IN      OMX_STRING compName, 
01422     OMX_INOUT   OMX_U32 *pNumRoles,
01423     OMX_OUT     OMX_U8 **roles);
01424 
01425 #ifdef __cplusplus
01426 }
01427 #endif /* __cplusplus */
01428 
01429 #endif
01430 /* File EOF */
01431 

Generated on Tue May 25 08:04:54 2010 for VLC by  doxygen 1.5.6