]> git.sesse.net Git - vlc/commitdiff
Add OpenMAX IL Video/Audio decoder.
authorGildas Bazin <gibalou@videolan.org>
Sun, 7 Feb 2010 20:44:21 +0000 (20:44 +0000)
committerGildas Bazin <gibalou@videolan.org>
Sun, 7 Feb 2010 20:44:21 +0000 (20:44 +0000)
This decoder will try to use OpenMAX IL components to decode video/audio.
Only 2 OpenMAX cores are currently looked for. The TI OMAP IL core (used for
instance on the N900) and the Bellagio IL core.
This decoder is disabled by default (use --enable-omxil) and for now has
a zero priority (use --codec omxil).

16 files changed:
configure.ac
modules/codec/Modules.am
modules/codec/omxil/Modules.am [new file with mode: 0644]
modules/codec/omxil/OMX_Audio.h [new file with mode: 0644]
modules/codec/omxil/OMX_Component.h [new file with mode: 0644]
modules/codec/omxil/OMX_Core.h [new file with mode: 0644]
modules/codec/omxil/OMX_IVCommon.h [new file with mode: 0644]
modules/codec/omxil/OMX_Image.h [new file with mode: 0644]
modules/codec/omxil/OMX_Index.h [new file with mode: 0644]
modules/codec/omxil/OMX_Other.h [new file with mode: 0644]
modules/codec/omxil/OMX_Types.h [new file with mode: 0644]
modules/codec/omxil/OMX_Video.h [new file with mode: 0644]
modules/codec/omxil/omxil.c [new file with mode: 0644]
modules/codec/omxil/omxil.h [new file with mode: 0644]
modules/codec/omxil/omxil_utils.h [new file with mode: 0644]
modules/codec/omxil/utils.c [new file with mode: 0644]

index 2f44cfe770b22faba53537a6e961c4747e94f77b..ae159d1be39579d5fcfeca742a20f428cb97c51b 100644 (file)
@@ -2586,6 +2586,16 @@ then
   VLC_ADD_PLUGIN([shine])
 fi
 
+dnl
+dnl openmax il codec plugin
+dnl
+AC_ARG_ENABLE(omxil,
+  [  --enable-omxil          openmax il codec module (default disabled)])
+if test "${enable_omxil}" = "yes"
+then
+  VLC_ADD_PLUGIN([omxil])
+fi
+
 dnl
 dnl  mad plugin
 dnl
@@ -4848,6 +4858,7 @@ AC_CONFIG_FILES([
   modules/codec/Makefile
   modules/codec/avcodec/Makefile
   modules/codec/dmo/Makefile
+  modules/codec/omxil/Makefile
   modules/codec/shine/Makefile
   modules/codec/subtitles/Makefile
   modules/codec/spudec/Makefile
index 410dc2e5fc59dd62a04d1da1cce1496c8518db8a..b3441769a3063ac196d467fe115707ade9311406 100644 (file)
@@ -1,4 +1,4 @@
-SUBDIRS = dmo avcodec shine subtitles spudec wmafixed
+SUBDIRS = dmo avcodec shine subtitles spudec wmafixed omxil
 SOURCES_a52 = a52.c a52.h
 SOURCES_dts = dts.c
 SOURCES_flac = flac.c
diff --git a/modules/codec/omxil/Modules.am b/modules/codec/omxil/Modules.am
new file mode 100644 (file)
index 0000000..3fb346d
--- /dev/null
@@ -0,0 +1,3 @@
+SOURCES_omxil = omxil.c utils.c omxil.h omxil_utils.h \
+       OMX_Component.h OMX_Core.h OMX_Image.h OMX_IVCommon.h OMX_Types.h \
+        OMX_Audio.h OMX_ContentPipe.h OMX_Index.h OMX_Other.h OMX_Video.h
diff --git a/modules/codec/omxil/OMX_Audio.h b/modules/codec/omxil/OMX_Audio.h
new file mode 100644 (file)
index 0000000..d4f2c04
--- /dev/null
@@ -0,0 +1,1311 @@
+/*\r
+ * Copyright (c) 2008 The Khronos Group Inc. \r
+ * \r
+ * Permission is hereby granted, free of charge, to any person obtaining\r
+ * a copy of this software and associated documentation files (the\r
+ * "Software"), to deal in the Software without restriction, including\r
+ * without limitation the rights to use, copy, modify, merge, publish,\r
+ * distribute, sublicense, and/or sell copies of the Software, and to\r
+ * permit persons to whom the Software is furnished to do so, subject\r
+ * to the following conditions: \r
+ * The above copyright notice and this permission notice shall be included\r
+ * in all copies or substantial portions of the Software. \r
+ * \r
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS\r
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\r
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\r
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\r
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\r
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \r
+ *\r
+ */\r
+\r
+/** @file OMX_Audio.h - OpenMax IL version 1.1.2\r
+ *  The structures needed by Audio components to exchange\r
+ *  parameters and configuration data with the componenmilts.\r
+ */\r
+\r
+#ifndef OMX_Audio_h\r
+#define OMX_Audio_h\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif /* __cplusplus */\r
+\r
+\r
+/* Each OMX header must include all required header files to allow the\r
+ *  header to compile without errors.  The includes below are required\r
+ *  for this header file to compile successfully \r
+ */\r
+\r
+#include <OMX_Core.h>\r
+\r
+/** @defgroup midi MIDI\r
+ * @ingroup audio\r
+ */\r
\r
+/** @defgroup effects Audio effects\r
+ * @ingroup audio\r
+ */\r
+\r
+/** @defgroup audio OpenMAX IL Audio Domain\r
+ * Structures for OpenMAX IL Audio domain\r
+ * @{\r
+ */\r
+\r
+/** Enumeration used to define the possible audio codings.  \r
+ *  If "OMX_AUDIO_CodingUnused" is selected, the coding selection must \r
+ *  be done in a vendor specific way.  Since this is for an audio \r
+ *  processing element this enum is relevant.  However, for another \r
+ *  type of component other enums would be in this area.\r
+ */\r
+typedef enum OMX_AUDIO_CODINGTYPE {\r
+    OMX_AUDIO_CodingUnused = 0,  /**< Placeholder value when coding is N/A  */\r
+    OMX_AUDIO_CodingAutoDetect,  /**< auto detection of audio format */\r
+    OMX_AUDIO_CodingPCM,         /**< Any variant of PCM coding */\r
+    OMX_AUDIO_CodingADPCM,       /**< Any variant of ADPCM encoded data */\r
+    OMX_AUDIO_CodingAMR,         /**< Any variant of AMR encoded data */\r
+    OMX_AUDIO_CodingGSMFR,       /**< Any variant of GSM fullrate (i.e. GSM610) */\r
+    OMX_AUDIO_CodingGSMEFR,      /**< Any variant of GSM Enhanced Fullrate encoded data*/\r
+    OMX_AUDIO_CodingGSMHR,       /**< Any variant of GSM Halfrate encoded data */\r
+    OMX_AUDIO_CodingPDCFR,       /**< Any variant of PDC Fullrate encoded data */\r
+    OMX_AUDIO_CodingPDCEFR,      /**< Any variant of PDC Enhanced Fullrate encoded data */\r
+    OMX_AUDIO_CodingPDCHR,       /**< Any variant of PDC Halfrate encoded data */\r
+    OMX_AUDIO_CodingTDMAFR,      /**< Any variant of TDMA Fullrate encoded data (TIA/EIA-136-420) */\r
+    OMX_AUDIO_CodingTDMAEFR,     /**< Any variant of TDMA Enhanced Fullrate encoded data (TIA/EIA-136-410) */\r
+    OMX_AUDIO_CodingQCELP8,      /**< Any variant of QCELP 8kbps encoded data */\r
+    OMX_AUDIO_CodingQCELP13,     /**< Any variant of QCELP 13kbps encoded data */\r
+    OMX_AUDIO_CodingEVRC,        /**< Any variant of EVRC encoded data */\r
+    OMX_AUDIO_CodingSMV,         /**< Any variant of SMV encoded data */\r
+    OMX_AUDIO_CodingG711,        /**< Any variant of G.711 encoded data */\r
+    OMX_AUDIO_CodingG723,        /**< Any variant of G.723 dot 1 encoded data */\r
+    OMX_AUDIO_CodingG726,        /**< Any variant of G.726 encoded data */\r
+    OMX_AUDIO_CodingG729,        /**< Any variant of G.729 encoded data */\r
+    OMX_AUDIO_CodingAAC,         /**< Any variant of AAC encoded data */\r
+    OMX_AUDIO_CodingMP3,         /**< Any variant of MP3 encoded data */\r
+    OMX_AUDIO_CodingSBC,         /**< Any variant of SBC encoded data */\r
+    OMX_AUDIO_CodingVORBIS,      /**< Any variant of VORBIS encoded data */\r
+    OMX_AUDIO_CodingWMA,         /**< Any variant of WMA encoded data */\r
+    OMX_AUDIO_CodingRA,          /**< Any variant of RA encoded data */\r
+    OMX_AUDIO_CodingMIDI,        /**< Any variant of MIDI encoded data */\r
+    OMX_AUDIO_CodingKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ \r
+    OMX_AUDIO_CodingVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */\r
+    OMX_AUDIO_CodingMax = 0x7FFFFFFF\r
+} OMX_AUDIO_CODINGTYPE;\r
+\r
+\r
+/** The PortDefinition structure is used to define all of the parameters \r
+ *  necessary for the compliant component to setup an input or an output audio \r
+ *  path.  If additional information is needed to define the parameters of the\r
+ *  port (such as frequency), additional structures must be sent such as the\r
+ *  OMX_AUDIO_PARAM_PCMMODETYPE structure to supply the extra parameters for the port.\r
+ */\r
+typedef struct OMX_AUDIO_PORTDEFINITIONTYPE {\r
+    OMX_STRING cMIMEType;            /**< MIME type of data for the port */\r
+    OMX_NATIVE_DEVICETYPE pNativeRender; /** < platform specific reference\r
+                                               for an output device, \r
+                                               otherwise this field is 0 */\r
+    OMX_BOOL bFlagErrorConcealment;  /**< Turns on error concealment if it is \r
+                                          supported by the OMX component */\r
+    OMX_AUDIO_CODINGTYPE eEncoding;  /**< Type of data expected for this \r
+                                          port (e.g. PCM, AMR, MP3, etc) */\r
+} OMX_AUDIO_PORTDEFINITIONTYPE;\r
+\r
+\r
+/**  Port format parameter.  This structure is used to enumerate\r
+  *  the various data input/output format supported by the port.\r
+  */\r
+typedef struct OMX_AUDIO_PARAM_PORTFORMATTYPE {\r
+    OMX_U32 nSize;                  /**< size of the structure in bytes */\r
+    OMX_VERSIONTYPE nVersion;       /**< OMX specification version information */\r
+    OMX_U32 nPortIndex;             /**< Indicates which port to set */\r
+    OMX_U32 nIndex;                 /**< Indicates the enumeration index for the format from 0x0 to N-1 */\r
+    OMX_AUDIO_CODINGTYPE eEncoding; /**< Type of data expected for this port (e.g. PCM, AMR, MP3, etc) */\r
+} OMX_AUDIO_PARAM_PORTFORMATTYPE;\r
+\r
+\r
+/** PCM mode type  */ \r
+typedef enum OMX_AUDIO_PCMMODETYPE { \r
+    OMX_AUDIO_PCMModeLinear = 0,  /**< Linear PCM encoded data */ \r
+    OMX_AUDIO_PCMModeALaw,        /**< A law PCM encoded data (G.711) */ \r
+    OMX_AUDIO_PCMModeMULaw,       /**< Mu law PCM encoded data (G.711)  */ \r
+    OMX_AUDIO_PCMModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ \r
+    OMX_AUDIO_PCMModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */\r
+    OMX_AUDIO_PCMModeMax = 0x7FFFFFFF \r
+} OMX_AUDIO_PCMMODETYPE; \r
+\r
+\r
+typedef enum OMX_AUDIO_CHANNELTYPE {\r
+    OMX_AUDIO_ChannelNone = 0x0,    /**< Unused or empty */\r
+    OMX_AUDIO_ChannelLF   = 0x1,    /**< Left front */\r
+    OMX_AUDIO_ChannelRF   = 0x2,    /**< Right front */\r
+    OMX_AUDIO_ChannelCF   = 0x3,    /**< Center front */\r
+    OMX_AUDIO_ChannelLS   = 0x4,    /**< Left surround */\r
+    OMX_AUDIO_ChannelRS   = 0x5,    /**< Right surround */\r
+    OMX_AUDIO_ChannelLFE  = 0x6,    /**< Low frequency effects */\r
+    OMX_AUDIO_ChannelCS   = 0x7,    /**< Back surround */\r
+    OMX_AUDIO_ChannelLR   = 0x8,    /**< Left rear. */\r
+    OMX_AUDIO_ChannelRR   = 0x9,    /**< Right rear. */\r
+    OMX_AUDIO_ChannelKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ \r
+    OMX_AUDIO_ChannelVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */\r
+    OMX_AUDIO_ChannelMax  = 0x7FFFFFFF \r
+} OMX_AUDIO_CHANNELTYPE;\r
+\r
+#define OMX_AUDIO_MAXCHANNELS 16  /**< maximum number distinct audio channels that a buffer may contain */\r
+#define OMX_MIN_PCMPAYLOAD_MSEC 5 /**< Minimum audio buffer payload size for uncompressed (PCM) audio */\r
+\r
+/** PCM format description */ \r
+typedef struct OMX_AUDIO_PARAM_PCMMODETYPE { \r
+    OMX_U32 nSize;                    /**< Size of this structure, in Bytes */ \r
+    OMX_VERSIONTYPE nVersion;         /**< OMX specification version information */ \r
+    OMX_U32 nPortIndex;               /**< port that this structure applies to */ \r
+    OMX_U32 nChannels;                /**< Number of channels (e.g. 2 for stereo) */ \r
+    OMX_NUMERICALDATATYPE eNumData;   /**< indicates PCM data as signed or unsigned */ \r
+    OMX_ENDIANTYPE eEndian;           /**< indicates PCM data as little or big endian */ \r
+    OMX_BOOL bInterleaved;            /**< True for normal interleaved data; false for \r
+                                           non-interleaved data (e.g. block data) */ \r
+    OMX_U32 nBitPerSample;            /**< Bit per sample */ \r
+    OMX_U32 nSamplingRate;            /**< Sampling rate of the source data.  Use 0 for \r
+                                           variable or unknown sampling rate. */ \r
+    OMX_AUDIO_PCMMODETYPE ePCMMode;   /**< PCM mode enumeration */ \r
+    OMX_AUDIO_CHANNELTYPE eChannelMapping[OMX_AUDIO_MAXCHANNELS]; /**< Slot i contains channel defined by eChannelMap[i] */\r
+\r
+} OMX_AUDIO_PARAM_PCMMODETYPE; \r
+\r
+\r
+/** Audio channel mode.  This is used by both AAC and MP3, although the names are more appropriate\r
+ * for the MP3.  For example, JointStereo for MP3 is CouplingChannels for AAC. \r
+ */\r
+typedef enum OMX_AUDIO_CHANNELMODETYPE {\r
+    OMX_AUDIO_ChannelModeStereo = 0,  /**< 2 channels, the bitrate allocation between those \r
+                                          two channels changes accordingly to each channel information */\r
+    OMX_AUDIO_ChannelModeJointStereo, /**< mode that takes advantage of what is common between \r
+                                           2 channels for higher compression gain */\r
+    OMX_AUDIO_ChannelModeDual,        /**< 2 mono-channels, each channel is encoded with half \r
+                                           the bitrate of the overall bitrate */\r
+    OMX_AUDIO_ChannelModeMono,        /**< Mono channel mode */\r
+    OMX_AUDIO_ChannelModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ \r
+    OMX_AUDIO_ChannelModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */\r
+    OMX_AUDIO_ChannelModeMax = 0x7FFFFFFF\r
+} OMX_AUDIO_CHANNELMODETYPE;\r
+\r
+\r
+typedef enum OMX_AUDIO_MP3STREAMFORMATTYPE {\r
+    OMX_AUDIO_MP3StreamFormatMP1Layer3 = 0, /**< MP3 Audio MPEG 1 Layer 3 Stream format */\r
+    OMX_AUDIO_MP3StreamFormatMP2Layer3,     /**< MP3 Audio MPEG 2 Layer 3 Stream format */\r
+    OMX_AUDIO_MP3StreamFormatMP2_5Layer3,   /**< MP3 Audio MPEG2.5 Layer 3 Stream format */\r
+    OMX_AUDIO_MP3StreamFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ \r
+    OMX_AUDIO_MP3StreamFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */\r
+    OMX_AUDIO_MP3StreamFormatMax = 0x7FFFFFFF\r
+} OMX_AUDIO_MP3STREAMFORMATTYPE;\r
+\r
+/** MP3 params */\r
+typedef struct OMX_AUDIO_PARAM_MP3TYPE {\r
+    OMX_U32 nSize;                 /**< size of the structure in bytes */\r
+    OMX_VERSIONTYPE nVersion;      /**< OMX specification version information */\r
+    OMX_U32 nPortIndex;            /**< port that this structure applies to */\r
+    OMX_U32 nChannels;             /**< Number of channels */\r
+    OMX_U32 nBitRate;              /**< Bit rate of the input data.  Use 0 for variable\r
+                                        rate or unknown bit rates */\r
+    OMX_U32 nSampleRate;           /**< Sampling rate of the source data.  Use 0 for\r
+                                        variable or unknown sampling rate. */\r
+    OMX_U32 nAudioBandWidth;       /**< Audio band width (in Hz) to which an encoder should\r
+                                        limit the audio signal. Use 0 to let encoder decide */\r
+    OMX_AUDIO_CHANNELMODETYPE eChannelMode;   /**< Channel mode enumeration */\r
+    OMX_AUDIO_MP3STREAMFORMATTYPE eFormat;  /**< MP3 stream format */\r
+} OMX_AUDIO_PARAM_MP3TYPE;\r
+\r
+\r
+typedef enum OMX_AUDIO_AACSTREAMFORMATTYPE {\r
+    OMX_AUDIO_AACStreamFormatMP2ADTS = 0, /**< AAC Audio Data Transport Stream 2 format */\r
+    OMX_AUDIO_AACStreamFormatMP4ADTS,     /**< AAC Audio Data Transport Stream 4 format */\r
+    OMX_AUDIO_AACStreamFormatMP4LOAS,     /**< AAC Low Overhead Audio Stream format */\r
+    OMX_AUDIO_AACStreamFormatMP4LATM,     /**< AAC Low overhead Audio Transport Multiplex */\r
+    OMX_AUDIO_AACStreamFormatADIF,        /**< AAC Audio Data Interchange Format */\r
+    OMX_AUDIO_AACStreamFormatMP4FF,       /**< AAC inside MPEG-4/ISO File Format */\r
+    OMX_AUDIO_AACStreamFormatRAW,         /**< AAC Raw Format */\r
+    OMX_AUDIO_AACStreamFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ \r
+    OMX_AUDIO_AACStreamFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */\r
+    OMX_AUDIO_AACStreamFormatMax = 0x7FFFFFFF\r
+} OMX_AUDIO_AACSTREAMFORMATTYPE;\r
+\r
+\r
+/** AAC mode type.  Note that the term profile is used with the MPEG-2\r
+ * standard and the term object type and profile is used with MPEG-4 */\r
+typedef enum OMX_AUDIO_AACPROFILETYPE{\r
+  OMX_AUDIO_AACObjectNull = 0,      /**< Null, not used */\r
+  OMX_AUDIO_AACObjectMain = 1,      /**< AAC Main object */\r
+  OMX_AUDIO_AACObjectLC,            /**< AAC Low Complexity object (AAC profile) */\r
+  OMX_AUDIO_AACObjectSSR,           /**< AAC Scalable Sample Rate object */\r
+  OMX_AUDIO_AACObjectLTP,           /**< AAC Long Term Prediction object */\r
+  OMX_AUDIO_AACObjectHE,            /**< AAC High Efficiency (object type SBR, HE-AAC profile) */\r
+  OMX_AUDIO_AACObjectScalable,      /**< AAC Scalable object */\r
+  OMX_AUDIO_AACObjectERLC = 17,     /**< ER AAC Low Complexity object (Error Resilient AAC-LC) */\r
+  OMX_AUDIO_AACObjectLD = 23,       /**< AAC Low Delay object (Error Resilient) */\r
+  OMX_AUDIO_AACObjectHE_PS = 29,    /**< AAC High Efficiency with Parametric Stereo coding (HE-AAC v2, object type PS) */\r
+  OMX_AUDIO_AACObjectKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ \r
+  OMX_AUDIO_AACObjectVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */\r
+  OMX_AUDIO_AACObjectMax = 0x7FFFFFFF\r
+} OMX_AUDIO_AACPROFILETYPE;\r
+\r
+\r
+/** AAC tool usage (for nAACtools in OMX_AUDIO_PARAM_AACPROFILETYPE).\r
+ * Required for encoder configuration and optional as decoder info output.\r
+ * For MP3, OMX_AUDIO_CHANNELMODETYPE is sufficient. */\r
+#define OMX_AUDIO_AACToolNone 0x00000000 /**< no AAC tools allowed (encoder config) or active (decoder info output) */\r
+#define OMX_AUDIO_AACToolMS   0x00000001 /**< MS: Mid/side joint coding tool allowed or active */\r
+#define OMX_AUDIO_AACToolIS   0x00000002 /**< IS: Intensity stereo tool allowed or active */\r
+#define OMX_AUDIO_AACToolTNS  0x00000004 /**< TNS: Temporal Noise Shaping tool allowed or active */\r
+#define OMX_AUDIO_AACToolPNS  0x00000008 /**< PNS: MPEG-4 Perceptual Noise substitution tool allowed or active */\r
+#define OMX_AUDIO_AACToolLTP  0x00000010 /**< LTP: MPEG-4 Long Term Prediction tool allowed or active */\r
+#define OMX_AUDIO_AACToolAll  0x7FFFFFFF /**< all AAC tools allowed or active (*/\r
+\r
+/** MPEG-4 AAC error resilience (ER) tool usage (for nAACERtools in OMX_AUDIO_PARAM_AACPROFILETYPE).\r
+ * Required for ER encoder configuration and optional as decoder info output */\r
+#define OMX_AUDIO_AACERNone  0x00000000  /**< no AAC ER tools allowed/used */\r
+#define OMX_AUDIO_AACERVCB11 0x00000001  /**< VCB11: Virtual Code Books for AAC section data */\r
+#define OMX_AUDIO_AACERRVLC  0x00000002  /**< RVLC: Reversible Variable Length Coding */\r
+#define OMX_AUDIO_AACERHCR   0x00000004  /**< HCR: Huffman Codeword Reordering */\r
+#define OMX_AUDIO_AACERAll   0x7FFFFFFF  /**< all AAC ER tools allowed/used */\r
+\r
+\r
+/** AAC params */\r
+typedef struct OMX_AUDIO_PARAM_AACPROFILETYPE {\r
+    OMX_U32 nSize;                 /**< Size of this structure, in Bytes */\r
+    OMX_VERSIONTYPE nVersion;      /**< OMX specification version information */\r
+    OMX_U32 nPortIndex;            /**< Port that this structure applies to */\r
+    OMX_U32 nChannels;             /**< Number of channels */\r
+    OMX_U32 nSampleRate;           /**< Sampling rate of the source data.  Use 0 for\r
+                                        variable or unknown sampling rate. */\r
+    OMX_U32 nBitRate;              /**< Bit rate of the input data.  Use 0 for variable\r
+                                        rate or unknown bit rates */\r
+    OMX_U32 nAudioBandWidth;       /**< Audio band width (in Hz) to which an encoder should\r
+                                        limit the audio signal. Use 0 to let encoder decide */\r
+    OMX_U32 nFrameLength;          /**< Frame length (in audio samples per channel) of the codec.\r
+                                        Can be 1024 or 960 (AAC-LC), 2048 (HE-AAC), 480 or 512 (AAC-LD).\r
+                                        Use 0 to let encoder decide */\r
+    OMX_U32 nAACtools;             /**< AAC tool usage */\r
+    OMX_U32 nAACERtools;           /**< MPEG-4 AAC error resilience tool usage */\r
+    OMX_AUDIO_AACPROFILETYPE eAACProfile;   /**< AAC profile enumeration */\r
+    OMX_AUDIO_AACSTREAMFORMATTYPE eAACStreamFormat; /**< AAC stream format enumeration */\r
+    OMX_AUDIO_CHANNELMODETYPE eChannelMode;   /**< Channel mode enumeration */\r
+} OMX_AUDIO_PARAM_AACPROFILETYPE;\r
+\r
+\r
+/** VORBIS params */\r
+typedef struct OMX_AUDIO_PARAM_VORBISTYPE {\r
+    OMX_U32 nSize;            /**< size of the structure in bytes */\r
+    OMX_VERSIONTYPE nVersion; /**< OMX specification version information */\r
+    OMX_U32 nPortIndex;       /**< port that this structure applies to */\r
+    OMX_U32 nChannels;        /**< Number of channels */\r
+    OMX_U32 nBitRate;         /**< Bit rate of the encoded data data.  Use 0 for variable\r
+                                   rate or unknown bit rates. Encoding is set to the\r
+                                   bitrate closest to specified  value (in bps) */\r
+    OMX_U32 nMinBitRate;      /**< Sets minimum bitrate (in bps). */\r
+    OMX_U32 nMaxBitRate;      /**< Sets maximum bitrate (in bps). */\r
+\r
+    OMX_U32 nSampleRate;      /**< Sampling rate of the source data.  Use 0 for\r
+                                   variable or unknown sampling rate. */\r
+    OMX_U32 nAudioBandWidth;  /**< Audio band width (in Hz) to which an encoder should\r
+                                   limit the audio signal. Use 0 to let encoder decide */\r
+    OMX_S32 nQuality;            /**< Sets encoding quality to n, between -1 (low) and 10 (high).\r
+                                   In the default mode of operation, teh quality level is 3.\r
+                                   Normal quality range is 0 - 10. */\r
+    OMX_BOOL bManaged;           /**< Set  bitrate  management  mode. This turns off the\r
+                                   normal VBR encoding, but allows hard or soft bitrate\r
+                                   constraints to be enforced by the encoder. This mode can\r
+                                   be slower, and may also be lower quality. It is\r
+                                   primarily useful for streaming. */\r
+    OMX_BOOL bDownmix;           /**< Downmix input from stereo to mono (has no effect on \r
+                                   non-stereo streams). Useful for lower-bitrate encoding. */     \r
+} OMX_AUDIO_PARAM_VORBISTYPE;\r
+\r
+\r
+/** WMA Version */\r
+typedef enum OMX_AUDIO_WMAFORMATTYPE {\r
+  OMX_AUDIO_WMAFormatUnused = 0, /**< format unused or unknown */\r
+  OMX_AUDIO_WMAFormat7,          /**< Windows Media Audio format 7 */\r
+  OMX_AUDIO_WMAFormat8,          /**< Windows Media Audio format 8 */\r
+  OMX_AUDIO_WMAFormat9,          /**< Windows Media Audio format 9 */\r
+  OMX_AUDIO_WMAFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ \r
+  OMX_AUDIO_WMAFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */\r
+  OMX_AUDIO_WMAFormatMax = 0x7FFFFFFF\r
+} OMX_AUDIO_WMAFORMATTYPE;\r
+\r
+\r
+/** WMA Profile */\r
+typedef enum OMX_AUDIO_WMAPROFILETYPE {\r
+  OMX_AUDIO_WMAProfileUnused = 0,  /**< profile unused or unknown */\r
+  OMX_AUDIO_WMAProfileL1,          /**< Windows Media audio version 9 profile L1 */\r
+  OMX_AUDIO_WMAProfileL2,          /**< Windows Media audio version 9 profile L2 */\r
+  OMX_AUDIO_WMAProfileL3,          /**< Windows Media audio version 9 profile L3 */\r
+  OMX_AUDIO_WMAProfileKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ \r
+  OMX_AUDIO_WMAProfileVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */\r
+  OMX_AUDIO_WMAProfileMax = 0x7FFFFFFF\r
+} OMX_AUDIO_WMAPROFILETYPE;\r
+\r
+\r
+/** WMA params */\r
+typedef struct OMX_AUDIO_PARAM_WMATYPE {\r
+    OMX_U32 nSize;            /**< size of the structure in bytes */\r
+    OMX_VERSIONTYPE nVersion; /**< OMX specification version information */\r
+    OMX_U32 nPortIndex;       /**< port that this structure applies to */\r
+    OMX_U16 nChannels;        /**< Number of channels */\r
+    OMX_U32 nBitRate;         /**< Bit rate of the input data.  Use 0 for variable\r
+                                   rate or unknown bit rates */\r
+    OMX_AUDIO_WMAFORMATTYPE eFormat; /**< Version of WMA stream / data */\r
+       OMX_AUDIO_WMAPROFILETYPE eProfile;  /**< Profile of WMA stream / data */\r
+    OMX_U32 nSamplingRate;    /**< Sampling rate of the source data */\r
+    OMX_U16 nBlockAlign;      /**< is the block alignment, or block size, in bytes of the audio codec */\r
+    OMX_U16 nEncodeOptions;   /**< WMA Type-specific data */\r
+    OMX_U32 nSuperBlockAlign; /**< WMA Type-specific data */\r
+} OMX_AUDIO_PARAM_WMATYPE;\r
+\r
+/** \r
+ * RealAudio format\r
+ */\r
+typedef enum OMX_AUDIO_RAFORMATTYPE {\r
+    OMX_AUDIO_RAFormatUnused = 0, /**< Format unused or unknown */\r
+    OMX_AUDIO_RA8,                /**< RealAudio 8 codec */\r
+    OMX_AUDIO_RA9,                /**< RealAudio 9 codec */\r
+    OMX_AUDIO_RA10_AAC,           /**< MPEG-4 AAC codec for bitrates of more than 128kbps */\r
+    OMX_AUDIO_RA10_CODEC,         /**< RealAudio codec for bitrates less than 128 kbps */\r
+    OMX_AUDIO_RA10_LOSSLESS,      /**< RealAudio Lossless */\r
+    OMX_AUDIO_RA10_MULTICHANNEL,  /**< RealAudio Multichannel */\r
+    OMX_AUDIO_RA10_VOICE,         /**< RealAudio Voice for bitrates below 15 kbps */\r
+    OMX_AUDIO_RAFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ \r
+    OMX_AUDIO_RAFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */\r
+    OMX_VIDEO_RAFormatMax = 0x7FFFFFFF\r
+} OMX_AUDIO_RAFORMATTYPE;\r
+\r
+/** RA (Real Audio) params */ \r
+typedef struct OMX_AUDIO_PARAM_RATYPE { \r
+    OMX_U32 nSize;              /**< Size of this structure, in Bytes */ \r
+    OMX_VERSIONTYPE nVersion;   /**< OMX specification version information */ \r
+    OMX_U32 nPortIndex;         /**< Port that this structure applies to */ \r
+    OMX_U32 nChannels;          /**< Number of channels */ \r
+    OMX_U32 nSamplingRate;      /**< is the sampling rate of the source data */ \r
+    OMX_U32 nBitsPerFrame;      /**< is the value for bits per frame  */ \r
+    OMX_U32 nSamplePerFrame;    /**< is the value for samples per frame */ \r
+    OMX_U32 nCouplingQuantBits; /**< is the number of coupling quantization bits in the stream */ \r
+    OMX_U32 nCouplingStartRegion;   /**< is the coupling start region in the stream  */ \r
+    OMX_U32 nNumRegions;        /**< is the number of regions value */ \r
+    OMX_AUDIO_RAFORMATTYPE eFormat; /**< is the RealAudio audio format */\r
+} OMX_AUDIO_PARAM_RATYPE; \r
+\r
+\r
+/** SBC Allocation Method Type */\r
+typedef enum OMX_AUDIO_SBCALLOCMETHODTYPE {\r
+  OMX_AUDIO_SBCAllocMethodLoudness, /**< Loudness allocation method */\r
+  OMX_AUDIO_SBCAllocMethodSNR,      /**< SNR allocation method */\r
+  OMX_AUDIO_SBCAllocMethodKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ \r
+  OMX_AUDIO_SBCAllocMethodVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */\r
+  OMX_AUDIO_SBCAllocMethodMax = 0x7FFFFFFF\r
+} OMX_AUDIO_SBCALLOCMETHODTYPE;\r
+\r
+\r
+/** SBC params */\r
+typedef struct OMX_AUDIO_PARAM_SBCTYPE {\r
+    OMX_U32 nSize;             /**< size of the structure in bytes */\r
+    OMX_VERSIONTYPE nVersion;  /**< OMX specification version information */\r
+    OMX_U32 nPortIndex;        /**< port that this structure applies to */\r
+    OMX_U32 nChannels;         /**< Number of channels */\r
+    OMX_U32 nBitRate;          /**< Bit rate of the input data.  Use 0 for variable\r
+                                    rate or unknown bit rates */\r
+    OMX_U32 nSampleRate;       /**< Sampling rate of the source data.  Use 0 for\r
+                                    variable or unknown sampling rate. */\r
+    OMX_U32 nBlocks;           /**< Number of blocks */\r
+    OMX_U32 nSubbands;         /**< Number of subbands */\r
+    OMX_U32 nBitPool;          /**< Bitpool value */\r
+    OMX_BOOL bEnableBitrate;   /**< Use bitrate value instead of bitpool */\r
+    OMX_AUDIO_CHANNELMODETYPE eChannelMode; /**< Channel mode enumeration */\r
+    OMX_AUDIO_SBCALLOCMETHODTYPE eSBCAllocType;   /**< SBC Allocation method type */\r
+} OMX_AUDIO_PARAM_SBCTYPE;\r
+\r
+\r
+/** ADPCM stream format parameters */ \r
+typedef struct OMX_AUDIO_PARAM_ADPCMTYPE { \r
+    OMX_U32 nSize;              /**< size of the structure in bytes */ \r
+    OMX_VERSIONTYPE nVersion;   /**< OMX specification version information */ \r
+    OMX_U32 nPortIndex;         /**< port that this structure applies to */ \r
+    OMX_U32 nChannels;          /**< Number of channels in the data stream (not \r
+                                     necessarily the same as the number of channels \r
+                                     to be rendered. */ \r
+    OMX_U32 nBitsPerSample;     /**< Number of bits in each sample */ \r
+    OMX_U32 nSampleRate;        /**< Sampling rate of the source data.  Use 0 for \r
+                                    variable or unknown sampling rate. */ \r
+} OMX_AUDIO_PARAM_ADPCMTYPE; \r
+\r
+\r
+/** G723 rate */\r
+typedef enum OMX_AUDIO_G723RATE {\r
+    OMX_AUDIO_G723ModeUnused = 0,  /**< AMRNB Mode unused / unknown */\r
+    OMX_AUDIO_G723ModeLow,         /**< 5300 bps */\r
+    OMX_AUDIO_G723ModeHigh,        /**< 6300 bps */\r
+    OMX_AUDIO_G723ModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ \r
+    OMX_AUDIO_G723ModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */\r
+    OMX_AUDIO_G723ModeMax = 0x7FFFFFFF\r
+} OMX_AUDIO_G723RATE;\r
+\r
+\r
+/** G723 - Sample rate must be 8 KHz */\r
+typedef struct OMX_AUDIO_PARAM_G723TYPE { \r
+    OMX_U32 nSize;                /**< size of the structure in bytes */ \r
+    OMX_VERSIONTYPE nVersion;     /**< OMX specification version information */ \r
+    OMX_U32 nPortIndex;           /**< port that this structure applies to */ \r
+    OMX_U32 nChannels;            /**< Number of channels in the data stream (not \r
+                                       necessarily the same as the number of channels \r
+                                       to be rendered. */ \r
+    OMX_BOOL bDTX;                /**< Enable Discontinuous Transmisssion */ \r
+    OMX_AUDIO_G723RATE eBitRate;  /**< todo: Should this be moved to a config? */\r
+    OMX_BOOL bHiPassFilter;       /**< Enable High Pass Filter */ \r
+    OMX_BOOL bPostFilter;         /**< Enable Post Filter */ \r
+} OMX_AUDIO_PARAM_G723TYPE; \r
+\r
+\r
+/** ITU G726 (ADPCM) rate */\r
+typedef enum OMX_AUDIO_G726MODE {\r
+    OMX_AUDIO_G726ModeUnused = 0,  /**< G726 Mode unused / unknown */\r
+    OMX_AUDIO_G726Mode16,          /**< 16 kbps */\r
+    OMX_AUDIO_G726Mode24,          /**< 24 kbps */\r
+    OMX_AUDIO_G726Mode32,          /**< 32 kbps, most common rate, also G721 */\r
+    OMX_AUDIO_G726Mode40,          /**< 40 kbps */\r
+    OMX_AUDIO_G726ModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ \r
+    OMX_AUDIO_G726ModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */\r
+    OMX_AUDIO_G726ModeMax = 0x7FFFFFFF\r
+} OMX_AUDIO_G726MODE;\r
+\r
+\r
+/** G.726 stream format parameters - must be at 8KHz */ \r
+typedef struct OMX_AUDIO_PARAM_G726TYPE { \r
+    OMX_U32 nSize;              /**< size of the structure in bytes */ \r
+    OMX_VERSIONTYPE nVersion;   /**< OMX specification version information */ \r
+    OMX_U32 nPortIndex;         /**< port that this structure applies to */ \r
+    OMX_U32 nChannels;          /**< Number of channels in the data stream (not \r
+                                     necessarily the same as the number of channels \r
+                                     to be rendered. */ \r
+     OMX_AUDIO_G726MODE eG726Mode;\r
+} OMX_AUDIO_PARAM_G726TYPE; \r
+\r
+\r
+/** G729 coder type */\r
+typedef enum OMX_AUDIO_G729TYPE {\r
+    OMX_AUDIO_G729 = 0,           /**< ITU G.729  encoded data */\r
+    OMX_AUDIO_G729A,              /**< ITU G.729 annex A  encoded data */\r
+    OMX_AUDIO_G729B,              /**< ITU G.729 with annex B encoded data */\r
+    OMX_AUDIO_G729AB,             /**< ITU G.729 annexes A and B encoded data */\r
+    OMX_AUDIO_G729KhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ \r
+    OMX_AUDIO_G729VendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */\r
+    OMX_AUDIO_G729Max = 0x7FFFFFFF\r
+} OMX_AUDIO_G729TYPE;\r
+\r
+\r
+/** G729 stream format parameters - fixed 6KHz sample rate */\r
+typedef struct OMX_AUDIO_PARAM_G729TYPE {\r
+    OMX_U32 nSize;            /**< size of the structure in bytes */\r
+    OMX_VERSIONTYPE nVersion; /**< OMX specification version information */\r
+    OMX_U32 nPortIndex;       /**< port that this structure applies to */\r
+    OMX_U32 nChannels;        /**< Number of channels in the data stream (not\r
+                                   necessarily the same as the number of channels\r
+                                   to be rendered. */\r
+    OMX_BOOL bDTX;            /**< Enable Discontinuous Transmisssion */\r
+    OMX_AUDIO_G729TYPE eBitType;\r
+} OMX_AUDIO_PARAM_G729TYPE;\r
+\r
+\r
+/** AMR Frame format */ \r
+typedef enum OMX_AUDIO_AMRFRAMEFORMATTYPE { \r
+    OMX_AUDIO_AMRFrameFormatConformance = 0,  /**< Frame Format is AMR Conformance \r
+                                                   (Standard) Format */ \r
+    OMX_AUDIO_AMRFrameFormatIF1,              /**< Frame Format is AMR Interface \r
+                                                   Format 1 */ \r
+    OMX_AUDIO_AMRFrameFormatIF2,              /**< Frame Format is AMR Interface \r
+                                                   Format 2*/ \r
+    OMX_AUDIO_AMRFrameFormatFSF,              /**< Frame Format is AMR File Storage \r
+                                                   Format */ \r
+    OMX_AUDIO_AMRFrameFormatRTPPayload,       /**< Frame Format is AMR Real-Time \r
+                                                   Transport Protocol Payload Format */ \r
+    OMX_AUDIO_AMRFrameFormatITU,              /**< Frame Format is ITU Format (added at Motorola request) */ \r
+    OMX_AUDIO_AMRFrameFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ \r
+    OMX_AUDIO_AMRFrameFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */\r
+    OMX_AUDIO_AMRFrameFormatMax = 0x7FFFFFFF \r
+} OMX_AUDIO_AMRFRAMEFORMATTYPE; \r
+\r
+\r
+/** AMR band mode */\r
+typedef enum OMX_AUDIO_AMRBANDMODETYPE {\r
+    OMX_AUDIO_AMRBandModeUnused = 0,          /**< AMRNB Mode unused / unknown */\r
+    OMX_AUDIO_AMRBandModeNB0,                 /**< AMRNB Mode 0 =  4750 bps */\r
+    OMX_AUDIO_AMRBandModeNB1,                 /**< AMRNB Mode 1 =  5150 bps */\r
+    OMX_AUDIO_AMRBandModeNB2,                 /**< AMRNB Mode 2 =  5900 bps */ \r
+    OMX_AUDIO_AMRBandModeNB3,                 /**< AMRNB Mode 3 =  6700 bps */\r
+    OMX_AUDIO_AMRBandModeNB4,                 /**< AMRNB Mode 4 =  7400 bps */\r
+    OMX_AUDIO_AMRBandModeNB5,                 /**< AMRNB Mode 5 =  7950 bps */\r
+    OMX_AUDIO_AMRBandModeNB6,                 /**< AMRNB Mode 6 = 10200 bps */\r
+    OMX_AUDIO_AMRBandModeNB7,                 /**< AMRNB Mode 7 = 12200 bps */\r
+    OMX_AUDIO_AMRBandModeWB0,                 /**< AMRWB Mode 0 =  6600 bps */\r
+    OMX_AUDIO_AMRBandModeWB1,                 /**< AMRWB Mode 1 =  8850 bps */\r
+    OMX_AUDIO_AMRBandModeWB2,                 /**< AMRWB Mode 2 = 12650 bps */ \r
+    OMX_AUDIO_AMRBandModeWB3,                 /**< AMRWB Mode 3 = 14250 bps */ \r
+    OMX_AUDIO_AMRBandModeWB4,                 /**< AMRWB Mode 4 = 15850 bps */\r
+    OMX_AUDIO_AMRBandModeWB5,                 /**< AMRWB Mode 5 = 18250 bps */\r
+    OMX_AUDIO_AMRBandModeWB6,                 /**< AMRWB Mode 6 = 19850 bps */\r
+    OMX_AUDIO_AMRBandModeWB7,                 /**< AMRWB Mode 7 = 23050 bps */\r
+    OMX_AUDIO_AMRBandModeWB8,                 /**< AMRWB Mode 8 = 23850 bps */      \r
+    OMX_AUDIO_AMRBandModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ \r
+    OMX_AUDIO_AMRBandModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */\r
+    OMX_AUDIO_AMRBandModeMax = 0x7FFFFFFF\r
+} OMX_AUDIO_AMRBANDMODETYPE;\r
+     \r
+\r
+/** AMR Discontinuous Transmission mode */ \r
+typedef enum OMX_AUDIO_AMRDTXMODETYPE { \r
+    OMX_AUDIO_AMRDTXModeOff = 0,        /**< AMR Discontinuous Transmission Mode is disabled */ \r
+    OMX_AUDIO_AMRDTXModeOnVAD1,         /**< AMR Discontinuous Transmission Mode using \r
+                                             Voice Activity Detector 1 (VAD1) is enabled */ \r
+    OMX_AUDIO_AMRDTXModeOnVAD2,         /**< AMR Discontinuous Transmission Mode using \r
+                                             Voice Activity Detector 2 (VAD2) is enabled */       \r
+    OMX_AUDIO_AMRDTXModeOnAuto,         /**< The codec will automatically select between \r
+                                             Off, VAD1 or VAD2 modes */ \r
+\r
+    OMX_AUDIO_AMRDTXasEFR,             /**< DTX as EFR instead of AMR standard (3GPP 26.101, frame type =8,9,10) */\r
+\r
+    OMX_AUDIO_AMRDTXModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ \r
+    OMX_AUDIO_AMRDTXModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */\r
+    OMX_AUDIO_AMRDTXModeMax = 0x7FFFFFFF \r
+} OMX_AUDIO_AMRDTXMODETYPE; \r
\r
+\r
+/** AMR params */\r
+typedef struct OMX_AUDIO_PARAM_AMRTYPE {\r
+    OMX_U32 nSize;                          /**< size of the structure in bytes */\r
+    OMX_VERSIONTYPE nVersion;               /**< OMX specification version information */\r
+    OMX_U32 nPortIndex;                     /**< port that this structure applies to */\r
+    OMX_U32 nChannels;                      /**< Number of channels */\r
+    OMX_U32 nBitRate;                       /**< Bit rate read only field */\r
+    OMX_AUDIO_AMRBANDMODETYPE eAMRBandMode; /**< AMR Band Mode enumeration */ \r
+    OMX_AUDIO_AMRDTXMODETYPE  eAMRDTXMode;  /**< AMR DTX Mode enumeration */\r
+    OMX_AUDIO_AMRFRAMEFORMATTYPE eAMRFrameFormat; /**< AMR frame format enumeration */\r
+} OMX_AUDIO_PARAM_AMRTYPE;\r
+\r
+\r
+/** GSM_FR (ETSI 06.10, 3GPP 46.010) stream format parameters */\r
+typedef struct OMX_AUDIO_PARAM_GSMFRTYPE {\r
+    OMX_U32 nSize;            /**< size of the structure in bytes */\r
+    OMX_VERSIONTYPE nVersion; /**< OMX specification version information */\r
+    OMX_U32 nPortIndex;       /**< port that this structure applies to */\r
+    OMX_BOOL bDTX;            /**< Enable Discontinuous Transmisssion */\r
+    OMX_BOOL bHiPassFilter;   /**< Enable High Pass Filter */\r
+} OMX_AUDIO_PARAM_GSMFRTYPE;\r
+\r
+\r
+/** GSM-HR (ETSI 06.20, 3GPP 46.020) stream format parameters */\r
+typedef struct OMX_AUDIO_PARAM_GSMHRTYPE {\r
+    OMX_U32 nSize;            /**< size of the structure in bytes */\r
+    OMX_VERSIONTYPE nVersion; /**< OMX specification version information */\r
+    OMX_U32 nPortIndex;       /**< port that this structure applies to */\r
+    OMX_BOOL bDTX;            /**< Enable Discontinuous Transmisssion */\r
+    OMX_BOOL bHiPassFilter;   /**< Enable High Pass Filter */\r
+} OMX_AUDIO_PARAM_GSMHRTYPE;\r
+\r
+\r
+/** GSM-EFR (ETSI 06.60, 3GPP 46.060) stream format parameters */\r
+typedef struct OMX_AUDIO_PARAM_GSMEFRTYPE {\r
+    OMX_U32 nSize;            /**< size of the structure in bytes */\r
+    OMX_VERSIONTYPE nVersion; /**< OMX specification version information */\r
+    OMX_U32 nPortIndex;       /**< port that this structure applies to */\r
+    OMX_BOOL bDTX;            /**< Enable Discontinuous Transmisssion */\r
+    OMX_BOOL bHiPassFilter;   /**< Enable High Pass Filter */\r
+} OMX_AUDIO_PARAM_GSMEFRTYPE;\r
+\r
+\r
+/** TDMA FR (TIA/EIA-136-420, VSELP 7.95kbps coder) stream format parameters */\r
+typedef struct OMX_AUDIO_PARAM_TDMAFRTYPE {\r
+    OMX_U32 nSize;                /**< size of the structure in bytes */\r
+    OMX_VERSIONTYPE nVersion;     /**< OMX specification version information */\r
+    OMX_U32 nPortIndex;           /**< port that this structure applies to */\r
+    OMX_U32 nChannels;            /**< Number of channels in the data stream (not\r
+                                       necessarily the same as the number of channels\r
+                                       to be rendered. */\r
+    OMX_BOOL bDTX;                /**< Enable Discontinuous Transmisssion */\r
+    OMX_BOOL bHiPassFilter;       /**< Enable High Pass Filter */\r
+} OMX_AUDIO_PARAM_TDMAFRTYPE;\r
+\r
+\r
+/** TDMA EFR (TIA/EIA-136-410, ACELP 7.4kbps coder) stream format parameters */\r
+typedef struct OMX_AUDIO_PARAM_TDMAEFRTYPE {\r
+    OMX_U32 nSize;                /**< size of the structure in bytes */\r
+    OMX_VERSIONTYPE nVersion;     /**< OMX specification version information */\r
+    OMX_U32 nPortIndex;           /**< port that this structure applies to */\r
+    OMX_U32 nChannels;            /**< Number of channels in the data stream (not\r
+                                       necessarily the same as the number of channels\r
+                                       to be rendered. */\r
+    OMX_BOOL bDTX;                /**< Enable Discontinuous Transmisssion */\r
+    OMX_BOOL bHiPassFilter;       /**< Enable High Pass Filter */\r
+} OMX_AUDIO_PARAM_TDMAEFRTYPE;\r
+\r
+\r
+/** PDC FR ( RCR-27, VSELP 6.7kbps coder) stream format parameters */\r
+typedef struct OMX_AUDIO_PARAM_PDCFRTYPE {\r
+    OMX_U32 nSize;                /**< size of the structure in bytes */\r
+    OMX_VERSIONTYPE nVersion;     /**< OMX specification version information */\r
+    OMX_U32 nPortIndex;           /**< port that this structure applies to */\r
+    OMX_U32 nChannels;            /**< Number of channels in the data stream (not\r
+                                       necessarily the same as the number of channels\r
+                                       to be rendered. */\r
+    OMX_BOOL bDTX;                /**< Enable Discontinuous Transmisssion */\r
+    OMX_BOOL bHiPassFilter;       /**< Enable High Pass Filter */\r
+} OMX_AUDIO_PARAM_PDCFRTYPE;\r
+\r
+\r
+/** PDC EFR ( RCR-27, ACELP 6.7kbps coder) stream format parameters */\r
+typedef struct OMX_AUDIO_PARAM_PDCEFRTYPE {\r
+    OMX_U32 nSize;                /**< size of the structure in bytes */\r
+    OMX_VERSIONTYPE nVersion;     /**< OMX specification version information */\r
+    OMX_U32 nPortIndex;           /**< port that this structure applies to */\r
+    OMX_U32 nChannels;            /**< Number of channels in the data stream (not\r
+                                       necessarily the same as the number of channels\r
+                                       to be rendered. */\r
+    OMX_BOOL bDTX;                /**< Enable Discontinuous Transmisssion */\r
+    OMX_BOOL bHiPassFilter;       /**< Enable High Pass Filter */\r
+} OMX_AUDIO_PARAM_PDCEFRTYPE;\r
+\r
+/** PDC HR ( RCR-27, PSI-CELP 3.45kbps coder) stream format parameters */\r
+typedef struct OMX_AUDIO_PARAM_PDCHRTYPE {\r
+    OMX_U32 nSize;                /**< size of the structure in bytes */\r
+    OMX_VERSIONTYPE nVersion;     /**< OMX specification version information */\r
+    OMX_U32 nPortIndex;           /**< port that this structure applies to */\r
+    OMX_U32 nChannels;            /**< Number of channels in the data stream (not\r
+                                       necessarily the same as the number of channels\r
+                                       to be rendered. */\r
+    OMX_BOOL bDTX;                /**< Enable Discontinuous Transmisssion */\r
+    OMX_BOOL bHiPassFilter;       /**< Enable High Pass Filter */\r
+} OMX_AUDIO_PARAM_PDCHRTYPE;\r
+\r
+\r
+/** CDMA Rate types */\r
+typedef enum OMX_AUDIO_CDMARATETYPE {\r
+    OMX_AUDIO_CDMARateBlank = 0,          /**< CDMA encoded frame is blank */\r
+    OMX_AUDIO_CDMARateFull,               /**< CDMA encoded frame in full rate */\r
+    OMX_AUDIO_CDMARateHalf,               /**< CDMA encoded frame in half rate */\r
+    OMX_AUDIO_CDMARateQuarter,            /**< CDMA encoded frame in quarter rate */\r
+    OMX_AUDIO_CDMARateEighth,             /**< CDMA encoded frame in eighth rate (DTX)*/\r
+    OMX_AUDIO_CDMARateErasure,            /**< CDMA erasure frame */\r
+    OMX_AUDIO_CDMARateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ \r
+    OMX_AUDIO_CDMARateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */\r
+    OMX_AUDIO_CDMARateMax = 0x7FFFFFFF\r
+} OMX_AUDIO_CDMARATETYPE;\r
+\r
+\r
+/** QCELP8 (TIA/EIA-96, up to 8kbps coder) stream format parameters */\r
+typedef struct OMX_AUDIO_PARAM_QCELP8TYPE {\r
+    OMX_U32 nSize;                /**< size of the structure in bytes */\r
+    OMX_VERSIONTYPE nVersion;     /**< OMX specification version information */\r
+    OMX_U32 nPortIndex;           /**< port that this structure applies to */\r
+    OMX_U32 nChannels;            /**< Number of channels in the data stream (not\r
+                                       necessarily the same as the number of channels\r
+                                       to be rendered. */\r
+    OMX_U32 nBitRate;             /**< Bit rate of the input data.  Use 0 for variable\r
+                                       rate or unknown bit rates */\r
+    OMX_AUDIO_CDMARATETYPE eCDMARate; /**< Frame rate */\r
+    OMX_U32 nMinBitRate;          /**< minmal rate for the encoder = 1,2,3,4, default = 1 */\r
+    OMX_U32 nMaxBitRate;          /**< maximal rate for the encoder = 1,2,3,4, default = 4 */\r
+} OMX_AUDIO_PARAM_QCELP8TYPE;\r
+\r
+\r
+/** QCELP13 ( CDMA, EIA/TIA-733, 13.3kbps coder) stream format parameters */\r
+typedef struct OMX_AUDIO_PARAM_QCELP13TYPE {\r
+    OMX_U32 nSize;                /**< size of the structure in bytes */\r
+    OMX_VERSIONTYPE nVersion;     /**< OMX specification version information */\r
+    OMX_U32 nPortIndex;           /**< port that this structure applies to */\r
+    OMX_U32 nChannels;            /**< Number of channels in the data stream (not\r
+                                       necessarily the same as the number of channels\r
+                                       to be rendered. */\r
+    OMX_AUDIO_CDMARATETYPE eCDMARate; /**< Frame rate */\r
+    OMX_U32 nMinBitRate;          /**< minmal rate for the encoder = 1,2,3,4, default = 1 */\r
+    OMX_U32 nMaxBitRate;          /**< maximal rate for the encoder = 1,2,3,4, default = 4 */\r
+} OMX_AUDIO_PARAM_QCELP13TYPE;\r
+\r
+\r
+/** EVRC ( CDMA, EIA/TIA-127, RCELP up to 8.55kbps coder) stream format parameters */\r
+typedef struct OMX_AUDIO_PARAM_EVRCTYPE {\r
+    OMX_U32 nSize;                /**< size of the structure in bytes */\r
+    OMX_VERSIONTYPE nVersion;     /**< OMX specification version information */\r
+    OMX_U32 nPortIndex;           /**< port that this structure applies to */\r
+    OMX_U32 nChannels;            /**< Number of channels in the data stream (not\r
+                                       necessarily the same as the number of channels\r
+                                       to be rendered. */\r
+    OMX_AUDIO_CDMARATETYPE eCDMARate; /**< actual Frame rate */\r
+    OMX_BOOL bRATE_REDUCon;       /**< RATE_REDUCtion is requested for this frame */\r
+    OMX_U32 nMinBitRate;          /**< minmal rate for the encoder = 1,2,3,4, default = 1 */\r
+    OMX_U32 nMaxBitRate;          /**< maximal rate for the encoder = 1,2,3,4, default = 4 */\r
+    OMX_BOOL bHiPassFilter;       /**< Enable encoder's High Pass Filter */\r
+    OMX_BOOL bNoiseSuppressor;    /**< Enable encoder's noise suppressor pre-processing */\r
+    OMX_BOOL bPostFilter;         /**< Enable decoder's post Filter */\r
+} OMX_AUDIO_PARAM_EVRCTYPE;\r
+\r
+\r
+/** SMV ( up to 8.55kbps coder) stream format parameters */\r
+typedef struct OMX_AUDIO_PARAM_SMVTYPE {\r
+    OMX_U32 nSize;                /**< size of the structure in bytes */\r
+    OMX_VERSIONTYPE nVersion;     /**< OMX specification version information */\r
+    OMX_U32 nPortIndex;           /**< port that this structure applies to */\r
+    OMX_U32 nChannels;            /**< Number of channels in the data stream (not\r
+                                       necessarily the same as the number of channels\r
+                                       to be rendered. */\r
+    OMX_AUDIO_CDMARATETYPE eCDMARate; /**< Frame rate */\r
+    OMX_BOOL bRATE_REDUCon;           /**< RATE_REDUCtion is requested for this frame */\r
+    OMX_U32 nMinBitRate;          /**< minmal rate for the encoder = 1,2,3,4, default = 1 ??*/\r
+    OMX_U32 nMaxBitRate;          /**< maximal rate for the encoder = 1,2,3,4, default = 4 ??*/\r
+    OMX_BOOL bHiPassFilter;       /**< Enable encoder's High Pass Filter ??*/\r
+    OMX_BOOL bNoiseSuppressor;    /**< Enable encoder's noise suppressor pre-processing */\r
+    OMX_BOOL bPostFilter;         /**< Enable decoder's post Filter ??*/\r
+} OMX_AUDIO_PARAM_SMVTYPE;\r
+\r
+\r
+/** MIDI Format \r
+ * @ingroup midi\r
+ */\r
+typedef enum OMX_AUDIO_MIDIFORMATTYPE\r
+{\r
+    OMX_AUDIO_MIDIFormatUnknown = 0, /**< MIDI Format unknown or don't care */\r
+    OMX_AUDIO_MIDIFormatSMF0,        /**< Standard MIDI File Type 0 */\r
+    OMX_AUDIO_MIDIFormatSMF1,        /**< Standard MIDI File Type 1 */\r
+    OMX_AUDIO_MIDIFormatSMF2,        /**< Standard MIDI File Type 2 */\r
+    OMX_AUDIO_MIDIFormatSPMIDI,      /**< SP-MIDI */\r
+    OMX_AUDIO_MIDIFormatXMF0,        /**< eXtensible Music Format type 0 */\r
+    OMX_AUDIO_MIDIFormatXMF1,        /**< eXtensible Music Format type 1 */\r
+    OMX_AUDIO_MIDIFormatMobileXMF,   /**< Mobile XMF (eXtensible Music Format type 2) */\r
+    OMX_AUDIO_MIDIFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ \r
+    OMX_AUDIO_MIDIFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */\r
+    OMX_AUDIO_MIDIFormatMax = 0x7FFFFFFF\r
+} OMX_AUDIO_MIDIFORMATTYPE;\r
+\r
+\r
+/** MIDI params \r
+ * @ingroup midi\r
+ */\r
+typedef struct OMX_AUDIO_PARAM_MIDITYPE {\r
+    OMX_U32 nSize;                 /**< size of the structure in bytes */\r
+    OMX_VERSIONTYPE nVersion;      /**< OMX specification version information */\r
+    OMX_U32 nPortIndex;            /**< port that this structure applies to */\r
+    OMX_U32 nFileSize;             /**< size of the MIDI file in bytes, where the entire \r
+                                        MIDI file passed in, otherwise if 0x0, the MIDI data \r
+                                        is merged and streamed (instead of passed as an \r
+                                        entire MIDI file) */\r
+    OMX_BU32 sMaxPolyphony;        /**< Specifies the maximum simultaneous polyphonic \r
+                                        voices. A value of zero indicates that the default \r
+                                        polyphony of the device is used  */                                    \r
+    OMX_BOOL bLoadDefaultSound;    /**< Whether to load default sound \r
+                                        bank at initialization */\r
+    OMX_AUDIO_MIDIFORMATTYPE eMidiFormat; /**< Version of the MIDI file */                                                                           \r
+} OMX_AUDIO_PARAM_MIDITYPE;\r
+\r
+\r
+/** Type of the MIDI sound bank \r
+ * @ingroup midi\r
+ */\r
+typedef enum OMX_AUDIO_MIDISOUNDBANKTYPE {\r
+    OMX_AUDIO_MIDISoundBankUnused = 0,           /**< unused/unknown soundbank type */\r
+    OMX_AUDIO_MIDISoundBankDLS1,                 /**< DLS version 1 */\r
+    OMX_AUDIO_MIDISoundBankDLS2,                 /**< DLS version 2 */\r
+    OMX_AUDIO_MIDISoundBankMobileDLSBase,        /**< Mobile DLS, using the base functionality */\r
+    OMX_AUDIO_MIDISoundBankMobileDLSPlusOptions, /**< Mobile DLS, using the specification-defined optional feature set */\r
+    OMX_AUDIO_MIDISoundBankKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ \r
+    OMX_AUDIO_MIDISoundBankVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */\r
+    OMX_AUDIO_MIDISoundBankMax = 0x7FFFFFFF\r
+} OMX_AUDIO_MIDISOUNDBANKTYPE;\r
+\r
+\r
+/** Bank Layout describes how bank MSB & LSB are used in the DLS instrument definitions sound bank \r
+ * @ingroup midi\r
+ */\r
+typedef enum OMX_AUDIO_MIDISOUNDBANKLAYOUTTYPE {\r
+   OMX_AUDIO_MIDISoundBankLayoutUnused = 0,   /**< unused/unknown soundbank type */\r
+   OMX_AUDIO_MIDISoundBankLayoutGM,           /**< GS layout (based on bank MSB 0x00) */\r
+   OMX_AUDIO_MIDISoundBankLayoutGM2,          /**< General MIDI 2 layout (using MSB 0x78/0x79, LSB 0x00) */\r
+   OMX_AUDIO_MIDISoundBankLayoutUser,         /**< Does not conform to any bank numbering standards */\r
+   OMX_AUDIO_MIDISoundBankLayoutKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ \r
+   OMX_AUDIO_MIDISoundBankLayoutVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */\r
+   OMX_AUDIO_MIDISoundBankLayoutMax = 0x7FFFFFFF\r
+} OMX_AUDIO_MIDISOUNDBANKLAYOUTTYPE;\r
+\r
+\r
+/** MIDI params to load/unload user soundbank \r
+ * @ingroup midi\r
+ */\r
+typedef struct OMX_AUDIO_PARAM_MIDILOADUSERSOUNDTYPE {\r
+    OMX_U32 nSize;            /**< size of the structure in bytes */\r
+    OMX_VERSIONTYPE nVersion; /**< OMX specification version information */\r
+    OMX_U32 nPortIndex;       /**< port that this structure applies to */\r
+    OMX_U32 nDLSIndex;        /**< DLS file index to be loaded */\r
+    OMX_U32 nDLSSize;         /**< Size in bytes */\r
+    OMX_PTR pDLSData;         /**< Pointer to DLS file data */\r
+    OMX_AUDIO_MIDISOUNDBANKTYPE eMidiSoundBank;   /**< Midi sound bank type enumeration */\r
+    OMX_AUDIO_MIDISOUNDBANKLAYOUTTYPE eMidiSoundBankLayout; /**< Midi sound bank layout enumeration */\r
+} OMX_AUDIO_PARAM_MIDILOADUSERSOUNDTYPE;\r
+\r
+\r
+/** Structure for Live MIDI events and MIP messages. \r
+ * (MIP = Maximum Instantaneous Polyphony; part of the SP-MIDI standard.) \r
+ * @ingroup midi\r
+ */\r
+typedef struct OMX_AUDIO_CONFIG_MIDIIMMEDIATEEVENTTYPE {\r
+    OMX_U32 nSize;            /**< size of the structure in bytes */\r
+    OMX_VERSIONTYPE nVersion; /**< OMX specification version information */\r
+    OMX_U32 nPortIndex;       /**< Port that this structure applies to */\r
+    OMX_U32 nMidiEventSize;   /**< Size of immediate MIDI events or MIP message in bytes  */\r
+    OMX_U8 nMidiEvents[1];    /**< MIDI event array to be rendered immediately, or an\r
+                                   array for the MIP message buffer, where the size is \r
+                                   indicated by nMidiEventSize */\r
+} OMX_AUDIO_CONFIG_MIDIIMMEDIATEEVENTTYPE;\r
+\r
+\r
+/** MIDI sound bank/ program pair in a given channel \r
+ * @ingroup midi\r
+ */\r
+typedef struct OMX_AUDIO_CONFIG_MIDISOUNDBANKPROGRAMTYPE {\r
+    OMX_U32 nSize;              /**< size of the structure in bytes */\r
+    OMX_VERSIONTYPE nVersion;   /**< OMX specification version information */\r
+    OMX_U32 nPortIndex;         /**< Port that this structure applies to */\r
+    OMX_U32 nChannel;           /**< Valid channel values range from 1 to 16 */\r
+    OMX_U16 nIDProgram;         /**< Valid program ID range is 1 to 128 */\r
+    OMX_U16 nIDSoundBank;       /**< Sound bank ID */\r
+    OMX_U32 nUserSoundBankIndex;/**< User soundbank index, easier to access soundbanks \r
+                                     by index if multiple banks are present */\r
+} OMX_AUDIO_CONFIG_MIDISOUNDBANKPROGRAMTYPE;\r
+\r
+\r
+/** MIDI control \r
+ * @ingroup midi\r
+ */\r
+typedef struct OMX_AUDIO_CONFIG_MIDICONTROLTYPE {\r
+    OMX_U32 nSize;                /**< size of the structure in bytes */\r
+    OMX_VERSIONTYPE nVersion;     /**< OMX specification version information */\r
+    OMX_U32 nPortIndex;           /**< port that this structure applies to */\r
+    OMX_BS32 sPitchTransposition; /**< Pitch transposition in semitones, stored as Q22.10 \r
+                                       format based on JAVA MMAPI (JSR-135) requirement */\r
+    OMX_BU32 sPlayBackRate;       /**< Relative playback rate, stored as Q14.17 fixed-point\r
+                                       number based on JSR-135 requirement */\r
+    OMX_BU32 sTempo ;             /**< Tempo in beats per minute (BPM), stored as Q22.10 \r
+                                       fixed-point number based on JSR-135 requirement */\r
+    OMX_U32 nMaxPolyphony;        /**< Specifies the maximum simultaneous polyphonic \r
+                                       voices. A value of zero indicates that the default \r
+                                       polyphony of the device is used  */\r
+    OMX_U32 nNumRepeat;           /**< Number of times to repeat playback */\r
+    OMX_U32 nStopTime;            /**< Time in milliseconds to indicate when playback \r
+                                       will stop automatically.  Set to zero if not used */\r
+    OMX_U16 nChannelMuteMask;     /**< 16 bit mask for channel mute status */\r
+    OMX_U16 nChannelSoloMask;     /**< 16 bit mask for channel solo status */\r
+    OMX_U32 nTrack0031MuteMask;   /**< 32 bit mask for track mute status. Note: This is for tracks 0-31 */\r
+    OMX_U32 nTrack3263MuteMask;   /**< 32 bit mask for track mute status. Note: This is for tracks 32-63 */\r
+    OMX_U32 nTrack0031SoloMask;   /**< 32 bit mask for track solo status. Note: This is for tracks 0-31 */\r
+    OMX_U32 nTrack3263SoloMask;   /**< 32 bit mask for track solo status. Note: This is for tracks 32-63 */\r
+\r
+} OMX_AUDIO_CONFIG_MIDICONTROLTYPE;\r
+\r
+\r
+/** MIDI Playback States \r
+ * @ingroup midi\r
+ */\r
+typedef enum OMX_AUDIO_MIDIPLAYBACKSTATETYPE {\r
+  OMX_AUDIO_MIDIPlayBackStateUnknown = 0,      /**< Unknown state or state does not map to \r
+                                                                                                       other defined states */\r
+  OMX_AUDIO_MIDIPlayBackStateClosedEngaged,    /**< No MIDI resource is currently open. \r
+                                                    The MIDI engine is currently processing \r
+                                                    MIDI events. */\r
+  OMX_AUDIO_MIDIPlayBackStateParsing,          /**< A MIDI resource is open and is being \r
+                                                    primed. The MIDI engine is currently \r
+                                                    processing MIDI events. */\r
+  OMX_AUDIO_MIDIPlayBackStateOpenEngaged,      /**< A MIDI resource is open and primed but \r
+                                                    not playing. The MIDI engine is currently\r
+                                                    processing MIDI events. The transition to\r
+                                                    this state is only possible from the \r
+                                                    OMX_AUDIO_MIDIPlayBackStatePlaying state,\r
+                                                    when the 'playback head' reaches the end\r
+                                                    of media data or the playback stops due\r
+                                                    to stop time set.*/\r
+  OMX_AUDIO_MIDIPlayBackStatePlaying,          /**< A MIDI resource is open and currently\r
+                                                    playing. The MIDI engine is currently\r
+                                                    processing MIDI events.*/\r
+  OMX_AUDIO_MIDIPlayBackStatePlayingPartially, /**< Best-effort playback due to SP-MIDI/DLS\r
+                                                    resource constraints */\r
+  OMX_AUDIO_MIDIPlayBackStatePlayingSilently,  /**< Due to system resource constraints and\r
+                                                    SP-MIDI content constraints, there is\r
+                                                    no audible MIDI content during playback\r
+                                                    currently. The situation may change if\r
+                                                    resources are freed later.*/\r
+  OMX_AUDIO_MIDIPlayBackStateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ \r
+  OMX_AUDIO_MIDIPlayBackStateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */\r
+  OMX_AUDIO_MIDIPlayBackStateMax = 0x7FFFFFFF\r
+} OMX_AUDIO_MIDIPLAYBACKSTATETYPE;\r
+\r
+\r
+/** MIDI status \r
+ * @ingroup midi\r
+ */\r
+typedef struct OMX_AUDIO_CONFIG_MIDISTATUSTYPE {\r
+    OMX_U32 nSize;              /**< size of the structure in bytes */\r
+    OMX_VERSIONTYPE nVersion;   /**< OMX specification version information */\r
+    OMX_U32 nPortIndex;         /**< port that this structure applies to */\r
+    OMX_U16 nNumTracks;         /**< Number of MIDI tracks in the file, read only field. \r
+                                     NOTE: May not return a meaningful value until the entire \r
+                                     file is parsed and buffered.  */\r
+    OMX_U32 nDuration;          /**< The length of the currently open MIDI resource \r
+                                     in milliseconds. NOTE: May not return a meaningful value \r
+                                     until the entire file is parsed and buffered.  */  \r
+    OMX_U32 nPosition;          /**< Current Position of the MIDI resource being played \r
+                                     in milliseconds */\r
+    OMX_BOOL bVibra;            /**< Does Vibra track exist? NOTE: May not return a meaningful \r
+                                     value until the entire file is parsed and buffered. */\r
+    OMX_U32 nNumMetaEvents;     /**< Total number of MIDI Meta Events in the currently \r
+                                     open MIDI resource. NOTE: May not return a meaningful value \r
+                                     until the entire file is parsed and buffered.  */\r
+    OMX_U32 nNumActiveVoices;   /**< Number of active voices in the currently playing \r
+                                     MIDI resource. NOTE: May not return a meaningful value until \r
+                                     the entire file is parsed and buffered. */\r
+    OMX_AUDIO_MIDIPLAYBACKSTATETYPE eMIDIPlayBackState;  /**< MIDI playback state enumeration, read only field */\r
+} OMX_AUDIO_CONFIG_MIDISTATUSTYPE;\r
+\r
+\r
+/** MIDI Meta Event structure one per Meta Event.\r
+ *  MIDI Meta Events are like audio metadata, except that they are interspersed \r
+ *  with the MIDI content throughout the file and are not localized in the header. \r
+ *  As such, it is necessary to retrieve information about these Meta Events from \r
+ *  the engine, as it encounters these Meta Events within the MIDI content. \r
+ *  For example, SMF files can have up to 14 types of MIDI Meta Events (copyright, \r
+ *  author, default tempo, etc.) scattered throughout the file. \r
+ *  @ingroup midi\r
+ */\r
+typedef struct OMX_AUDIO_CONFIG_MIDIMETAEVENTTYPE{ \r
+    OMX_U32 nSize;            /**< size of the structure in bytes */ \r
+    OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ \r
+    OMX_U32 nPortIndex;       /**< port that this structure applies to */ \r
+    OMX_U32 nIndex;           /**< Index of Meta Event */ \r
+    OMX_U8 nMetaEventType;    /**< Meta Event Type, 7bits (i.e. 0 - 127) */ \r
+    OMX_U32 nMetaEventSize;   /**< size of the Meta Event in bytes */ \r
+    OMX_U32 nTrack;           /**< track number for the meta event */\r
+    OMX_U32 nPosition;        /**< Position of the meta-event in milliseconds */\r
+} OMX_AUDIO_CONFIG_MIDIMETAEVENTTYPE; \r
+\r
+\r
+/** MIDI Meta Event Data structure - one per Meta Event. \r
+ * @ingroup midi\r
+ */ \r
+typedef struct OMX_AUDIO_CONFIG_MIDIMETAEVENTDATATYPE{ \r
+    OMX_U32 nSize;            /**< size of the structure in bytes */ \r
+    OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ \r
+    OMX_U32 nPortIndex;       /**< port that this structure applies to */ \r
+    OMX_U32 nIndex;           /**< Index of Meta Event */ \r
+    OMX_U32 nMetaEventSize;   /**< size of the Meta Event in bytes */ \r
+    OMX_U8 nData[1];          /**< array of one or more bytes of meta data \r
+                                   as indicated by the nMetaEventSize field */ \r
+} OMX_AUDIO_CONFIG__MIDIMETAEVENTDATATYPE; \r
+\r
+\r
+/** Audio Volume adjustment for a port */\r
+typedef struct OMX_AUDIO_CONFIG_VOLUMETYPE {\r
+    OMX_U32 nSize;              /**< size of the structure in bytes */\r
+    OMX_VERSIONTYPE nVersion;   /**< OMX specification version information */\r
+    OMX_U32 nPortIndex;         /**< Port index indicating which port to \r
+                                     set.  Select the input port to set \r
+                                     just that port's volume.  Select the \r
+                                     output port to adjust the master \r
+                                     volume. */\r
+    OMX_BOOL bLinear;           /**< Is the volume to be set in linear (0.100) \r
+                                     or logarithmic scale (mB) */\r
+    OMX_BS32 sVolume;           /**< Volume linear setting in the 0..100 range, OR\r
+                                     Volume logarithmic setting for this port.  The values\r
+                                     for volume are in mB (millibels = 1/100 dB) relative\r
+                                     to a gain of 1 (e.g. the output is the same as the \r
+                                     input level).  Values are in mB from nMax \r
+                                     (maximum volume) to nMin mB (typically negative).\r
+                                     Since the volume is "voltage"\r
+                                     and not a "power", it takes a setting of\r
+                                     -600 mB to decrease the volume by 1/2.  If\r
+                                     a component cannot accurately set the \r
+                                     volume to the requested value, it must\r
+                                     set the volume to the closest value BELOW\r
+                                     the requested value.  When getting the\r
+                                     volume setting, the current actual volume\r
+                                     must be returned. */\r
+} OMX_AUDIO_CONFIG_VOLUMETYPE;\r
+\r
+\r
+/** Audio Volume adjustment for a channel */\r
+typedef struct OMX_AUDIO_CONFIG_CHANNELVOLUMETYPE {\r
+    OMX_U32 nSize;              /**< size of the structure in bytes */\r
+    OMX_VERSIONTYPE nVersion;   /**< OMX specification version information */\r
+    OMX_U32 nPortIndex;         /**< Port index indicating which port to \r
+                                     set.  Select the input port to set \r
+                                     just that port's volume.  Select the \r
+                                     output port to adjust the master \r
+                                     volume. */\r
+    OMX_U32 nChannel;           /**< channel to select from 0 to N-1, \r
+                                     using OMX_ALL to apply volume settings\r
+                                     to all channels */\r
+    OMX_BOOL bLinear;           /**< Is the volume to be set in linear (0.100) or \r
+                                     logarithmic scale (mB) */\r
+    OMX_BS32 sVolume;           /**< Volume linear setting in the 0..100 range, OR\r
+                                     Volume logarithmic setting for this port.  \r
+                                     The values for volume are in mB \r
+                                     (millibels = 1/100 dB) relative to a gain\r
+                                     of 1 (e.g. the output is the same as the \r
+                                     input level).  Values are in mB from nMax \r
+                                     (maximum volume) to nMin mB (typically negative).  \r
+                                     Since the volume is "voltage"\r
+                                     and not a "power", it takes a setting of\r
+                                     -600 mB to decrease the volume by 1/2.  If\r
+                                     a component cannot accurately set the \r
+                                     volume to the requested value, it must\r
+                                     set the volume to the closest value BELOW\r
+                                     the requested value.  When getting the\r
+                                     volume setting, the current actual volume\r
+                                     must be returned. */\r
+    OMX_BOOL bIsMIDI;           /**< TRUE if nChannel refers to a MIDI channel,\r
+                                     FALSE otherwise */\r
+} OMX_AUDIO_CONFIG_CHANNELVOLUMETYPE;\r
+\r
+\r
+/** Audio balance setting */\r
+typedef struct OMX_AUDIO_CONFIG_BALANCETYPE {\r
+    OMX_U32 nSize;              /**< size of the structure in bytes */\r
+    OMX_VERSIONTYPE nVersion;   /**< OMX specification version information */\r
+    OMX_U32 nPortIndex;         /**< Port index indicating which port to \r
+                                     set.  Select the input port to set \r
+                                     just that port's balance.  Select the \r
+                                     output port to adjust the master \r
+                                     balance. */\r
+    OMX_S32 nBalance;           /**< balance setting for this port \r
+                                     (-100 to 100, where -100 indicates\r
+                                     all left, and no right */\r
+} OMX_AUDIO_CONFIG_BALANCETYPE;\r
+\r
+\r
+/** Audio Port mute */\r
+typedef struct OMX_AUDIO_CONFIG_MUTETYPE {\r
+    OMX_U32 nSize;              /**< size of the structure in bytes */\r
+    OMX_VERSIONTYPE nVersion;   /**< OMX specification version information */\r
+    OMX_U32 nPortIndex;         /**< Port index indicating which port to \r
+                                     set.  Select the input port to set \r
+                                     just that port's mute.  Select the \r
+                                     output port to adjust the master \r
+                                     mute. */\r
+    OMX_BOOL bMute;             /**< Mute setting for this port */\r
+} OMX_AUDIO_CONFIG_MUTETYPE;\r
+\r
+\r
+/** Audio Channel mute */\r
+typedef struct OMX_AUDIO_CONFIG_CHANNELMUTETYPE {\r
+    OMX_U32 nSize;              /**< size of the structure in bytes */\r
+    OMX_VERSIONTYPE nVersion;   /**< OMX specification version information */\r
+    OMX_U32 nPortIndex;         /**< port that this structure applies to */\r
+    OMX_U32 nChannel;           /**< channel to select from 0 to N-1, \r
+                                     using OMX_ALL to apply mute settings\r
+                                     to all channels */\r
+    OMX_BOOL bMute;             /**< Mute setting for this channel */\r
+    OMX_BOOL bIsMIDI;           /**< TRUE if nChannel refers to a MIDI channel,\r
+                                     FALSE otherwise */ \r
+} OMX_AUDIO_CONFIG_CHANNELMUTETYPE;\r
+\r
+\r
+\r
+/** Enable / Disable for loudness control, which boosts bass and to a \r
+ *  smaller extent high end frequencies to compensate for hearing\r
+ *  ability at the extreme ends of the audio spectrum\r
+ */ \r
+typedef struct OMX_AUDIO_CONFIG_LOUDNESSTYPE {\r
+    OMX_U32 nSize;             /**< size of the structure in bytes */\r
+    OMX_VERSIONTYPE nVersion;  /**< OMX specification version information */\r
+    OMX_U32 nPortIndex;        /**< port that this structure applies to */\r
+    OMX_BOOL bLoudness;        /**< Enable/disable for loudness */\r
+} OMX_AUDIO_CONFIG_LOUDNESSTYPE;\r
+\r
+\r
+/** Enable / Disable for bass, which controls low frequencies\r
+ */ \r
+typedef struct OMX_AUDIO_CONFIG_BASSTYPE {\r
+    OMX_U32 nSize;             /**< size of the structure in bytes */\r
+    OMX_VERSIONTYPE nVersion;  /**< OMX specification version information */\r
+    OMX_U32 nPortIndex;        /**< port that this structure applies to */\r
+    OMX_BOOL bEnable;          /**< Enable/disable for bass control */\r
+    OMX_S32 nBass;             /**< bass setting for the port, as a \r
+                                    continuous value from -100 to 100  \r
+                                    (0 means no change in bass level)*/\r
+} OMX_AUDIO_CONFIG_BASSTYPE;\r
+\r
+\r
+/** Enable / Disable for treble, which controls high frequencies tones\r
+ */ \r
+typedef struct OMX_AUDIO_CONFIG_TREBLETYPE {\r
+    OMX_U32 nSize;             /**< size of the structure in bytes */\r
+    OMX_VERSIONTYPE nVersion;  /**< OMX specification version information */\r
+    OMX_U32 nPortIndex;        /**< port that this structure applies to */\r
+    OMX_BOOL bEnable;          /**< Enable/disable for treble control */\r
+    OMX_S32  nTreble;          /**< treble setting for the port, as a\r
+                                    continuous value from -100 to 100  \r
+                                    (0 means no change in treble level) */\r
+} OMX_AUDIO_CONFIG_TREBLETYPE;\r
+\r
+\r
+/** An equalizer is typically used for two reasons: to compensate for an \r
+ *  sub-optimal frequency response of a system to make it sound more natural \r
+ *  or to create intentionally some unnatural coloring to the sound to create\r
+ *  an effect.\r
+ *  @ingroup effects\r
+ */\r
+typedef struct OMX_AUDIO_CONFIG_EQUALIZERTYPE {\r
+    OMX_U32 nSize;             /**< size of the structure in bytes */\r
+    OMX_VERSIONTYPE nVersion;  /**< OMX specification version information */\r
+    OMX_U32 nPortIndex;        /**< port that this structure applies to */\r
+    OMX_BOOL bEnable;          /**< Enable/disable for equalizer */\r
+    OMX_BU32 sBandIndex;       /**< Band number to be set.  Upper Limit is \r
+                                    N-1, where N is the number of bands, lower limit is 0 */\r
+    OMX_BU32 sCenterFreq;      /**< Center frequecies in Hz.  This is a\r
+                                    read only element and is used to determine \r
+                                    the lower, center and upper frequency of \r
+                                    this band.  */\r
+    OMX_BS32 sBandLevel;       /**< band level in millibels */\r
+} OMX_AUDIO_CONFIG_EQUALIZERTYPE;\r
+\r
+\r
+/** Stereo widening mode type \r
+ * @ingroup effects\r
+ */ \r
+typedef enum OMX_AUDIO_STEREOWIDENINGTYPE {\r
+    OMX_AUDIO_StereoWideningHeadphones,    /**< Stereo widening for loudspeakers */\r
+    OMX_AUDIO_StereoWideningLoudspeakers,  /**< Stereo widening for closely spaced loudspeakers */\r
+    OMX_AUDIO_StereoWideningKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ \r
+    OMX_AUDIO_StereoWideningVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */\r
+    OMX_AUDIO_StereoWideningMax = 0x7FFFFFFF\r
+} OMX_AUDIO_STEREOWIDENINGTYPE;\r
+\r
+\r
+/** Control for stereo widening, which is a special 2-channel\r
+ *  case of the audio virtualizer effect. For example, for 5.1-channel \r
+ *  output, it translates to virtual surround sound. \r
+ * @ingroup effects\r
+ */ \r
+typedef struct OMX_AUDIO_CONFIG_STEREOWIDENINGTYPE {\r
+    OMX_U32 nSize;             /**< size of the structure in bytes */\r
+    OMX_VERSIONTYPE nVersion;  /**< OMX specification version information */\r
+    OMX_U32 nPortIndex;        /**< port that this structure applies to */\r
+    OMX_BOOL bEnable;          /**< Enable/disable for stereo widening control */\r
+    OMX_AUDIO_STEREOWIDENINGTYPE eWideningType; /**< Stereo widening algorithm type */\r
+    OMX_U32  nStereoWidening;  /**< stereo widening setting for the port,\r
+                                    as a continuous value from 0 to 100  */\r
+} OMX_AUDIO_CONFIG_STEREOWIDENINGTYPE;\r
+\r
+\r
+/** The chorus effect (or ``choralizer'') is any signal processor which makes\r
+ *  one sound source (such as a voice) sound like many such sources singing \r
+ *  (or playing) in unison. Since performance in unison is never exact, chorus \r
+ *  effects simulate this by making independently modified copies of the input \r
+ *  signal. Modifications may include (1) delay, (2) frequency shift, and \r
+ *  (3) amplitude modulation.\r
+ * @ingroup effects\r
+ */\r
+typedef struct OMX_AUDIO_CONFIG_CHORUSTYPE {\r
+    OMX_U32 nSize;             /**< size of the structure in bytes */\r
+    OMX_VERSIONTYPE nVersion;  /**< OMX specification version information */\r
+    OMX_U32 nPortIndex;        /**< port that this structure applies to */\r
+    OMX_BOOL bEnable;          /**< Enable/disable for chorus */\r
+    OMX_BU32 sDelay;           /**< average delay in milliseconds */\r
+    OMX_BU32 sModulationRate;  /**< rate of modulation in millihertz */\r
+    OMX_U32 nModulationDepth;  /**< depth of modulation as a percentage of \r
+                                    delay (i.e. 0 to 100) */\r
+    OMX_BU32 nFeedback;        /**< Feedback from chorus output to input in percentage */\r
+} OMX_AUDIO_CONFIG_CHORUSTYPE;\r
+\r
+\r
+/** Reverberation is part of the reflected sound that follows the early \r
+ *  reflections. In a typical room, this consists of a dense succession of \r
+ *  echoes whose energy decays exponentially. The reverberation effect structure \r
+ *  as defined here includes both (early) reflections as well as (late) reverberations. \r
+ * @ingroup effects\r
+ */\r
+typedef struct OMX_AUDIO_CONFIG_REVERBERATIONTYPE {\r
+    OMX_U32 nSize;                /**< size of the structure in bytes */\r
+    OMX_VERSIONTYPE nVersion;     /**< OMX specification version information */\r
+    OMX_U32 nPortIndex;           /**< port that this structure applies to */\r
+    OMX_BOOL bEnable;             /**< Enable/disable for reverberation control */\r
+    OMX_BS32 sRoomLevel;          /**< Intensity level for the whole room effect \r
+                                       (i.e. both early reflections and late \r
+                                       reverberation) in millibels */\r
+    OMX_BS32 sRoomHighFreqLevel;  /**< Attenuation at high frequencies\r
+                                       relative to the intensity at low\r
+                                       frequencies in millibels */\r
+    OMX_BS32 sReflectionsLevel;   /**< Intensity level of early reflections\r
+                                       (relative to room value), in millibels */\r
+    OMX_BU32 sReflectionsDelay;   /**< Delay time of the first reflection relative \r
+                                       to the direct path, in milliseconds */\r
+    OMX_BS32 sReverbLevel;        /**< Intensity level of late reverberation\r
+                                       relative to room level, in millibels */\r
+    OMX_BU32 sReverbDelay;        /**< Time delay from the first early reflection \r
+                                       to the beginning of the late reverberation \r
+                                       section, in milliseconds */\r
+    OMX_BU32 sDecayTime;          /**< Late reverberation decay time at low\r
+                                       frequencies, in milliseconds */\r
+    OMX_BU32 nDecayHighFreqRatio; /**< Ratio of high frequency decay time relative \r
+                                       to low frequency decay time in percent  */\r
+    OMX_U32 nDensity;             /**< Modal density in the late reverberation decay,\r
+                                       in percent (i.e. 0 - 100) */\r
+    OMX_U32 nDiffusion;           /**< Echo density in the late reverberation decay,\r
+                                       in percent (i.e. 0 - 100) */\r
+    OMX_BU32 sReferenceHighFreq;  /**< Reference high frequency in Hertz. This is \r
+                                       the frequency used as the reference for all \r
+                                       the high-frequency settings above */\r
+\r
+} OMX_AUDIO_CONFIG_REVERBERATIONTYPE;\r
+\r
+\r
+/** Possible settings for the Echo Cancelation structure to use \r
+ * @ingroup effects\r
+ */\r
+typedef enum OMX_AUDIO_ECHOCANTYPE {\r
+   OMX_AUDIO_EchoCanOff = 0,    /**< Echo Cancellation is disabled */\r
+   OMX_AUDIO_EchoCanNormal,     /**< Echo Cancellation normal operation - \r
+                                     echo from plastics and face */\r
+   OMX_AUDIO_EchoCanHFree,      /**< Echo Cancellation optimized for \r
+                                     Hands Free operation */\r
+   OMX_AUDIO_EchoCanCarKit,    /**< Echo Cancellation optimized for \r
+                                     Car Kit (longer echo) */\r
+   OMX_AUDIO_EchoCanKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ \r
+   OMX_AUDIO_EchoCanVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */\r
+   OMX_AUDIO_EchoCanMax = 0x7FFFFFFF\r
+} OMX_AUDIO_ECHOCANTYPE;\r
+\r
+\r
+/** Enable / Disable for echo cancelation, which removes undesired echo's\r
+ *  from the audio\r
+ * @ingroup effects\r
+ */ \r
+typedef struct OMX_AUDIO_CONFIG_ECHOCANCELATIONTYPE {\r
+    OMX_U32 nSize;             /**< size of the structure in bytes */\r
+    OMX_VERSIONTYPE nVersion;  /**< OMX specification version information */\r
+    OMX_U32 nPortIndex;        /**< port that this structure applies to */\r
+    OMX_AUDIO_ECHOCANTYPE eEchoCancelation; /**< Echo cancelation settings */\r
+} OMX_AUDIO_CONFIG_ECHOCANCELATIONTYPE;\r
+\r
+\r
+/** Enable / Disable for noise reduction, which undesired noise from\r
+ * the audio\r
+ * @ingroup effects\r
+ */ \r
+typedef struct OMX_AUDIO_CONFIG_NOISEREDUCTIONTYPE {\r
+    OMX_U32 nSize;             /**< size of the structure in bytes */\r
+    OMX_VERSIONTYPE nVersion;  /**< OMX specification version information */\r
+    OMX_U32 nPortIndex;        /**< port that this structure applies to */\r
+    OMX_BOOL bNoiseReduction;  /**< Enable/disable for noise reduction */\r
+} OMX_AUDIO_CONFIG_NOISEREDUCTIONTYPE;\r
+\r
+/** @} */\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif /* __cplusplus */\r
+\r
+#endif\r
+/* File EOF */\r
+\r
diff --git a/modules/codec/omxil/OMX_Component.h b/modules/codec/omxil/OMX_Component.h
new file mode 100644 (file)
index 0000000..d595640
--- /dev/null
@@ -0,0 +1,579 @@
+/*
+ * Copyright (c) 2008 The Khronos Group Inc. 
+ * 
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject
+ * to the following conditions: 
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software. 
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 
+ *
+ */
+
+/** OMX_Component.h - OpenMax IL version 1.1.2
+ *  The OMX_Component header file contains the definitions used to define
+ *  the public interface of a component.  This header file is intended to
+ *  be used by both the application and the component.
+ */
+
+#ifndef OMX_Component_h
+#define OMX_Component_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
+
+/* Each OMX header must include all required header files to allow the
+ *  header to compile without errors.  The includes below are required
+ *  for this header file to compile successfully 
+ */
+
+#include <OMX_Audio.h>
+#include <OMX_Video.h>
+#include <OMX_Image.h>
+#include <OMX_Other.h>
+
+/** @ingroup comp */
+typedef enum OMX_PORTDOMAINTYPE { 
+    OMX_PortDomainAudio, 
+    OMX_PortDomainVideo, 
+    OMX_PortDomainImage, 
+    OMX_PortDomainOther,
+    OMX_PortDomainKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ 
+    OMX_PortDomainVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+    OMX_PortDomainMax = 0x7ffffff
+} OMX_PORTDOMAINTYPE;
+
+/** @ingroup comp */
+typedef struct OMX_PARAM_PORTDEFINITIONTYPE {
+    OMX_U32 nSize;                 /**< Size of the structure in bytes */
+    OMX_VERSIONTYPE nVersion;      /**< OMX specification version information */
+    OMX_U32 nPortIndex;            /**< Port number the structure applies to */
+    OMX_DIRTYPE eDir;              /**< Direction (input or output) of this port */
+    OMX_U32 nBufferCountActual;    /**< The actual number of buffers allocated on this port */
+    OMX_U32 nBufferCountMin;       /**< The minimum number of buffers this port requires */
+    OMX_U32 nBufferSize;           /**< Size, in bytes, for buffers to be used for this channel */
+    OMX_BOOL bEnabled;             /**< Ports default to enabled and are enabled/disabled by
+                                        OMX_CommandPortEnable/OMX_CommandPortDisable.
+                                        When disabled a port is unpopulated. A disabled port
+                                        is not populated with buffers on a transition to IDLE. */
+    OMX_BOOL bPopulated;           /**< Port is populated with all of its buffers as indicated by
+                                        nBufferCountActual. A disabled port is always unpopulated. 
+                                        An enabled port is populated on a transition to OMX_StateIdle
+                                        and unpopulated on a transition to loaded. */
+    OMX_PORTDOMAINTYPE eDomain;    /**< Domain of the port. Determines the contents of metadata below. */
+    union {
+        OMX_AUDIO_PORTDEFINITIONTYPE audio;
+        OMX_VIDEO_PORTDEFINITIONTYPE video;
+        OMX_IMAGE_PORTDEFINITIONTYPE image;
+        OMX_OTHER_PORTDEFINITIONTYPE other;
+    } format;
+    OMX_BOOL bBuffersContiguous;
+    OMX_U32 nBufferAlignment;
+} OMX_PARAM_PORTDEFINITIONTYPE;
+
+/** @ingroup comp */
+typedef struct OMX_PARAM_U32TYPE { 
+    OMX_U32 nSize;                    /**< Size of this structure, in Bytes */ 
+    OMX_VERSIONTYPE nVersion;         /**< OMX specification version information */ 
+    OMX_U32 nPortIndex;               /**< port that this structure applies to */ 
+    OMX_U32 nU32;                     /**< U32 value */
+} OMX_PARAM_U32TYPE;
+
+/** @ingroup rpm */
+typedef enum OMX_SUSPENSIONPOLICYTYPE {
+    OMX_SuspensionDisabled, /**< No suspension; v1.0 behavior */
+    OMX_SuspensionEnabled,  /**< Suspension allowed */   
+    OMX_SuspensionPolicyKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ 
+    OMX_SuspensionPolicyStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+    OMX_SuspensionPolicyMax = 0x7fffffff
+} OMX_SUSPENSIONPOLICYTYPE;
+
+/** @ingroup rpm */
+typedef struct OMX_PARAM_SUSPENSIONPOLICYTYPE {
+    OMX_U32 nSize;                  
+    OMX_VERSIONTYPE nVersion;        
+    OMX_SUSPENSIONPOLICYTYPE ePolicy;
+} OMX_PARAM_SUSPENSIONPOLICYTYPE;
+
+/** @ingroup rpm */
+typedef enum OMX_SUSPENSIONTYPE {
+    OMX_NotSuspended, /**< component is not suspended */
+    OMX_Suspended,    /**< component is suspended */
+    OMX_SuspensionKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ 
+    OMX_SuspensionVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+    OMX_SuspendMax = 0x7FFFFFFF
+} OMX_SUSPENSIONTYPE;
+
+/** @ingroup rpm */
+typedef struct OMX_PARAM_SUSPENSIONTYPE {
+    OMX_U32 nSize;                  
+    OMX_VERSIONTYPE nVersion;       
+    OMX_SUSPENSIONTYPE eType;             
+} OMX_PARAM_SUSPENSIONTYPE ;
+
+typedef struct OMX_CONFIG_BOOLEANTYPE {
+    OMX_U32 nSize;
+    OMX_VERSIONTYPE nVersion;
+    OMX_BOOL bEnabled;    
+} OMX_CONFIG_BOOLEANTYPE;
+
+/* Parameter specifying the content uri to use. */
+/** @ingroup cp */
+typedef struct OMX_PARAM_CONTENTURITYPE
+{
+    OMX_U32 nSize;                      /**< size of the structure in bytes, including
+                                             actual URI name */
+    OMX_VERSIONTYPE nVersion;           /**< OMX specification version information */
+    OMX_U8 contentURI[1];               /**< The URI name */
+} OMX_PARAM_CONTENTURITYPE;
+
+/* Parameter specifying the pipe to use. */
+/** @ingroup cp */
+typedef struct OMX_PARAM_CONTENTPIPETYPE
+{
+    OMX_U32 nSize;              /**< size of the structure in bytes */
+    OMX_VERSIONTYPE nVersion;   /**< OMX specification version information */
+    OMX_HANDLETYPE hPipe;       /**< The pipe handle*/
+} OMX_PARAM_CONTENTPIPETYPE;
+
+/** @ingroup rpm */
+typedef struct OMX_RESOURCECONCEALMENTTYPE {
+    OMX_U32 nSize;             /**< size of the structure in bytes */
+    OMX_VERSIONTYPE nVersion;  /**< OMX specification version information */
+    OMX_BOOL bResourceConcealmentForbidden; /**< disallow the use of resource concealment 
+                                            methods (like degrading algorithm quality to 
+                                            lower resource consumption or functional bypass) 
+                                            on a component as a resolution to resource conflicts. */
+} OMX_RESOURCECONCEALMENTTYPE;
+
+
+/** @ingroup metadata */
+typedef enum OMX_METADATACHARSETTYPE {
+    OMX_MetadataCharsetUnknown = 0,
+    OMX_MetadataCharsetASCII,
+    OMX_MetadataCharsetBinary,
+    OMX_MetadataCharsetCodePage1252,
+    OMX_MetadataCharsetUTF8,
+    OMX_MetadataCharsetJavaConformantUTF8,
+    OMX_MetadataCharsetUTF7,
+    OMX_MetadataCharsetImapUTF7,
+    OMX_MetadataCharsetUTF16LE, 
+    OMX_MetadataCharsetUTF16BE,
+    OMX_MetadataCharsetGB12345,
+    OMX_MetadataCharsetHZGB2312,
+    OMX_MetadataCharsetGB2312,
+    OMX_MetadataCharsetGB18030,
+    OMX_MetadataCharsetGBK,
+    OMX_MetadataCharsetBig5,
+    OMX_MetadataCharsetISO88591,
+    OMX_MetadataCharsetISO88592,
+    OMX_MetadataCharsetISO88593,
+    OMX_MetadataCharsetISO88594,
+    OMX_MetadataCharsetISO88595,
+    OMX_MetadataCharsetISO88596,
+    OMX_MetadataCharsetISO88597,
+    OMX_MetadataCharsetISO88598,
+    OMX_MetadataCharsetISO88599,
+    OMX_MetadataCharsetISO885910,
+    OMX_MetadataCharsetISO885913,
+    OMX_MetadataCharsetISO885914,
+    OMX_MetadataCharsetISO885915,
+    OMX_MetadataCharsetShiftJIS,
+    OMX_MetadataCharsetISO2022JP,
+    OMX_MetadataCharsetISO2022JP1,
+    OMX_MetadataCharsetISOEUCJP,
+    OMX_MetadataCharsetSMS7Bit,
+    OMX_MetadataCharsetKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ 
+    OMX_MetadataCharsetVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+    OMX_MetadataCharsetTypeMax= 0x7FFFFFFF
+} OMX_METADATACHARSETTYPE;
+
+/** @ingroup metadata */
+typedef enum OMX_METADATASCOPETYPE
+{
+    OMX_MetadataScopeAllLevels,
+    OMX_MetadataScopeTopLevel,
+    OMX_MetadataScopePortLevel,
+    OMX_MetadataScopeNodeLevel,
+    OMX_MetadataScopeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ 
+    OMX_MetadataScopeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+    OMX_MetadataScopeTypeMax = 0x7fffffff
+} OMX_METADATASCOPETYPE;
+
+/** @ingroup metadata */
+typedef enum OMX_METADATASEARCHMODETYPE
+{
+    OMX_MetadataSearchValueSizeByIndex,
+    OMX_MetadataSearchItemByIndex,
+    OMX_MetadataSearchNextItemByKey,
+    OMX_MetadataSearchKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ 
+    OMX_MetadataSearchVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+    OMX_MetadataSearchTypeMax = 0x7fffffff
+} OMX_METADATASEARCHMODETYPE;
+/** @ingroup metadata */
+typedef struct OMX_CONFIG_METADATAITEMCOUNTTYPE
+{
+    OMX_U32 nSize;
+    OMX_VERSIONTYPE nVersion;
+    OMX_METADATASCOPETYPE eScopeMode;
+    OMX_U32 nScopeSpecifier;
+    OMX_U32 nMetadataItemCount;
+} OMX_CONFIG_METADATAITEMCOUNTTYPE;
+
+/** @ingroup metadata */
+typedef struct OMX_CONFIG_METADATAITEMTYPE
+{
+    OMX_U32 nSize;
+    OMX_VERSIONTYPE nVersion;
+    OMX_METADATASCOPETYPE eScopeMode;
+    OMX_U32 nScopeSpecifier;
+    OMX_U32 nMetadataItemIndex;  
+    OMX_METADATASEARCHMODETYPE eSearchMode;
+    OMX_METADATACHARSETTYPE eKeyCharset;
+    OMX_U8 nKeySizeUsed;
+    OMX_U8 nKey[128];
+    OMX_METADATACHARSETTYPE eValueCharset;
+    OMX_STRING sLanguageCountry;
+    OMX_U32 nValueMaxSize;
+    OMX_U32 nValueSizeUsed;
+    OMX_U8 nValue[1];
+} OMX_CONFIG_METADATAITEMTYPE;
+
+/* @ingroup metadata */
+typedef struct OMX_CONFIG_CONTAINERNODECOUNTTYPE
+{
+    OMX_U32 nSize;
+    OMX_VERSIONTYPE nVersion;
+    OMX_BOOL bAllKeys;
+    OMX_U32 nParentNodeID;
+    OMX_U32 nNumNodes;
+} OMX_CONFIG_CONTAINERNODECOUNTTYPE;
+
+/** @ingroup metadata */
+typedef struct OMX_CONFIG_CONTAINERNODEIDTYPE
+{
+    OMX_U32 nSize;
+    OMX_VERSIONTYPE nVersion;
+    OMX_BOOL bAllKeys;
+    OMX_U32 nParentNodeID;
+    OMX_U32 nNodeIndex; 
+    OMX_U32 nNodeID; 
+    OMX_STRING cNodeName;
+    OMX_BOOL bIsLeafType;
+} OMX_CONFIG_CONTAINERNODEIDTYPE;
+
+/** @ingroup metadata */
+typedef struct OMX_PARAM_METADATAFILTERTYPE 
+{ 
+    OMX_U32 nSize; 
+    OMX_VERSIONTYPE nVersion; 
+    OMX_BOOL bAllKeys; /* if true then this structure refers to all keys and 
+                         * the three key fields below are ignored */
+    OMX_METADATACHARSETTYPE eKeyCharset;
+    OMX_U32 nKeySizeUsed; 
+    OMX_U8   nKey [128]; 
+    OMX_U32 nLanguageCountrySizeUsed;
+    OMX_U8 nLanguageCountry[128];
+    OMX_BOOL bEnabled; /* if true then key is part of filter (e.g. 
+                         * retained for query later). If false then
+                         * key is not part of filter */
+} OMX_PARAM_METADATAFILTERTYPE; 
+
+/** The OMX_HANDLETYPE structure defines the component handle.  The component 
+ *  handle is used to access all of the component's public methods and also
+ *  contains pointers to the component's private data area.  The component
+ *  handle is initialized by the OMX core (with help from the component)
+ *  during the process of loading the component.  After the component is
+ *  successfully loaded, the application can safely access any of the
+ *  component's public functions (although some may return an error because
+ *  the state is inappropriate for the access).
+ * 
+ *  @ingroup comp
+ */
+typedef struct OMX_COMPONENTTYPE
+{
+    /** The size of this structure, in bytes.  It is the responsibility
+        of the allocator of this structure to fill in this value.  Since
+        this structure is allocated by the GetHandle function, this
+        function will fill in this value. */
+    OMX_U32 nSize;
+
+    /** nVersion is the version of the OMX specification that the structure 
+        is built against.  It is the responsibility of the creator of this 
+        structure to initialize this value and every user of this structure 
+        should verify that it knows how to use the exact version of 
+        this structure found herein. */
+    OMX_VERSIONTYPE nVersion;
+
+    /** pComponentPrivate is a pointer to the component private data area.  
+        This member is allocated and initialized by the component when the 
+        component is first loaded.  The application should not access this 
+        data area. */
+    OMX_PTR pComponentPrivate;
+
+    /** pApplicationPrivate is a pointer that is a parameter to the 
+        OMX_GetHandle method, and contains an application private value 
+        provided by the IL client.  This application private data is 
+        returned to the IL Client by OMX in all callbacks */
+    OMX_PTR pApplicationPrivate;
+
+    /** refer to OMX_GetComponentVersion in OMX_core.h or the OMX IL 
+        specification for details on the GetComponentVersion method.
+     */
+    OMX_ERRORTYPE (*GetComponentVersion)(
+            OMX_IN  OMX_HANDLETYPE hComponent,
+            OMX_OUT OMX_STRING pComponentName,
+            OMX_OUT OMX_VERSIONTYPE* pComponentVersion,
+            OMX_OUT OMX_VERSIONTYPE* pSpecVersion,
+            OMX_OUT OMX_UUIDTYPE* pComponentUUID);
+
+    /** refer to OMX_SendCommand in OMX_core.h or the OMX IL 
+        specification for details on the SendCommand method.
+     */
+    OMX_ERRORTYPE (*SendCommand)(
+            OMX_IN  OMX_HANDLETYPE hComponent,
+            OMX_IN  OMX_COMMANDTYPE Cmd,
+            OMX_IN  OMX_U32 nParam1,
+            OMX_IN  OMX_PTR pCmdData);
+
+    /** refer to OMX_GetParameter in OMX_core.h or the OMX IL 
+        specification for details on the GetParameter method.
+     */
+    OMX_ERRORTYPE (*GetParameter)(
+            OMX_IN  OMX_HANDLETYPE hComponent, 
+            OMX_IN  OMX_INDEXTYPE nParamIndex,  
+            OMX_INOUT OMX_PTR pComponentParameterStructure);
+
+
+    /** refer to OMX_SetParameter in OMX_core.h or the OMX IL 
+        specification for details on the SetParameter method.
+     */
+    OMX_ERRORTYPE (*SetParameter)(
+            OMX_IN  OMX_HANDLETYPE hComponent, 
+            OMX_IN  OMX_INDEXTYPE nIndex,
+            OMX_IN  OMX_PTR pComponentParameterStructure);
+
+
+    /** refer to OMX_GetConfig in OMX_core.h or the OMX IL 
+        specification for details on the GetConfig method.
+     */
+    OMX_ERRORTYPE (*GetConfig)(
+            OMX_IN  OMX_HANDLETYPE hComponent,
+            OMX_IN  OMX_INDEXTYPE nIndex, 
+            OMX_INOUT OMX_PTR pComponentConfigStructure);
+
+
+    /** refer to OMX_SetConfig in OMX_core.h or the OMX IL 
+        specification for details on the SetConfig method.
+     */
+    OMX_ERRORTYPE (*SetConfig)(
+            OMX_IN  OMX_HANDLETYPE hComponent,
+            OMX_IN  OMX_INDEXTYPE nIndex, 
+            OMX_IN  OMX_PTR pComponentConfigStructure);
+
+
+    /** refer to OMX_GetExtensionIndex in OMX_core.h or the OMX IL 
+        specification for details on the GetExtensionIndex method.
+     */
+    OMX_ERRORTYPE (*GetExtensionIndex)(
+            OMX_IN  OMX_HANDLETYPE hComponent,
+            OMX_IN  OMX_STRING cParameterName,
+            OMX_OUT OMX_INDEXTYPE* pIndexType);
+
+
+    /** refer to OMX_GetState in OMX_core.h or the OMX IL 
+        specification for details on the GetState method.
+     */
+    OMX_ERRORTYPE (*GetState)(
+            OMX_IN  OMX_HANDLETYPE hComponent,
+            OMX_OUT OMX_STATETYPE* pState);
+
+    
+    /** The ComponentTunnelRequest method will interact with another OMX
+        component to determine if tunneling is possible and to setup the
+        tunneling.  The return codes for this method can be used to 
+        determine if tunneling is not possible, or if tunneling is not
+        supported.  
+        
+        Base profile components (i.e. non-interop) do not support this
+        method and should return OMX_ErrorNotImplemented 
+
+        The interop profile component MUST support tunneling to another 
+        interop profile component with a compatible port parameters.  
+        A component may also support proprietary communication.
+        
+        If proprietary communication is supported the negotiation of 
+        proprietary communication is done outside of OMX in a vendor 
+        specific way. It is only required that the proper result be 
+        returned and the details of how the setup is done is left 
+        to the component implementation.  
+    
+        When this method is invoked when nPort in an output port, the
+        component will:
+        1.  Populate the pTunnelSetup structure with the output port's 
+            requirements and constraints for the tunnel.
+
+        When this method is invoked when nPort in an input port, the
+        component will:
+        1.  Query the necessary parameters from the output port to 
+            determine if the ports are compatible for tunneling
+        2.  If the ports are compatible, the component should store
+            the tunnel step provided by the output port
+        3.  Determine which port (either input or output) is the buffer
+            supplier, and call OMX_SetParameter on the output port to
+            indicate this selection.
+        
+        The component will return from this call within 5 msec.
+    
+        @param [in] hComp
+            Handle of the component to be accessed.  This is the component
+            handle returned by the call to the OMX_GetHandle method.
+        @param [in] nPort
+            nPort is used to select the port on the component to be used
+            for tunneling.
+        @param [in] hTunneledComp
+            Handle of the component to tunnel with.  This is the component 
+            handle returned by the call to the OMX_GetHandle method.  When
+            this parameter is 0x0 the component should setup the port for
+            communication with the application / IL Client.
+        @param [in] nPortOutput
+            nPortOutput is used indicate the port the component should
+            tunnel with.
+        @param [in] pTunnelSetup
+            Pointer to the tunnel setup structure.  When nPort is an output port
+            the component should populate the fields of this structure.  When
+            When nPort is an input port the component should review the setup
+            provided by the component with the output port.
+        @return OMX_ERRORTYPE
+            If the command successfully executes, the return code will be
+            OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.
+        @ingroup tun
+    */
+
+    OMX_ERRORTYPE (*ComponentTunnelRequest)(
+        OMX_IN  OMX_HANDLETYPE hComp,
+        OMX_IN  OMX_U32 nPort,
+        OMX_IN  OMX_HANDLETYPE hTunneledComp,
+        OMX_IN  OMX_U32 nTunneledPort,
+        OMX_INOUT  OMX_TUNNELSETUPTYPE* pTunnelSetup); 
+
+    /** refer to OMX_UseBuffer in OMX_core.h or the OMX IL 
+        specification for details on the UseBuffer method.
+        @ingroup buf
+     */
+    OMX_ERRORTYPE (*UseBuffer)(
+            OMX_IN OMX_HANDLETYPE hComponent,
+            OMX_INOUT OMX_BUFFERHEADERTYPE** ppBufferHdr,
+            OMX_IN OMX_U32 nPortIndex,
+            OMX_IN OMX_PTR pAppPrivate,
+            OMX_IN OMX_U32 nSizeBytes,
+            OMX_IN OMX_U8* pBuffer);
+
+    /** refer to OMX_AllocateBuffer in OMX_core.h or the OMX IL 
+        specification for details on the AllocateBuffer method.
+        @ingroup buf
+     */
+    OMX_ERRORTYPE (*AllocateBuffer)(
+            OMX_IN OMX_HANDLETYPE hComponent,
+            OMX_INOUT OMX_BUFFERHEADERTYPE** ppBuffer,
+            OMX_IN OMX_U32 nPortIndex,
+            OMX_IN OMX_PTR pAppPrivate,
+            OMX_IN OMX_U32 nSizeBytes);
+
+    /** refer to OMX_FreeBuffer in OMX_core.h or the OMX IL 
+        specification for details on the FreeBuffer method.
+        @ingroup buf
+     */
+    OMX_ERRORTYPE (*FreeBuffer)(
+            OMX_IN  OMX_HANDLETYPE hComponent,
+            OMX_IN  OMX_U32 nPortIndex,
+            OMX_IN  OMX_BUFFERHEADERTYPE* pBuffer);
+
+    /** refer to OMX_EmptyThisBuffer in OMX_core.h or the OMX IL 
+        specification for details on the EmptyThisBuffer method.
+        @ingroup buf
+     */
+    OMX_ERRORTYPE (*EmptyThisBuffer)(
+            OMX_IN  OMX_HANDLETYPE hComponent,
+            OMX_IN  OMX_BUFFERHEADERTYPE* pBuffer);
+
+    /** refer to OMX_FillThisBuffer in OMX_core.h or the OMX IL 
+        specification for details on the FillThisBuffer method.
+        @ingroup buf
+     */
+    OMX_ERRORTYPE (*FillThisBuffer)(
+            OMX_IN  OMX_HANDLETYPE hComponent,
+            OMX_IN  OMX_BUFFERHEADERTYPE* pBuffer);
+
+    /** The SetCallbacks method is used by the core to specify the callback
+        structure from the application to the component.  This is a blocking
+        call.  The component will return from this call within 5 msec.
+        @param [in] hComponent
+            Handle of the component to be accessed.  This is the component
+            handle returned by the call to the GetHandle function.
+        @param [in] pCallbacks
+            pointer to an OMX_CALLBACKTYPE structure used to provide the 
+            callback information to the component
+        @param [in] pAppData
+            pointer to an application defined value.  It is anticipated that 
+            the application will pass a pointer to a data structure or a "this
+            pointer" in this area to allow the callback (in the application)
+            to determine the context of the call
+        @return OMX_ERRORTYPE
+            If the command successfully executes, the return code will be
+            OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.
+     */
+    OMX_ERRORTYPE (*SetCallbacks)(
+            OMX_IN  OMX_HANDLETYPE hComponent,
+            OMX_IN  OMX_CALLBACKTYPE* pCallbacks, 
+            OMX_IN  OMX_PTR pAppData);
+
+    /** ComponentDeInit method is used to deinitialize the component
+        providing a means to free any resources allocated at component
+        initialization.  NOTE:  After this call the component handle is
+        not valid for further use.
+        @param [in] hComponent
+            Handle of the component to be accessed.  This is the component
+            handle returned by the call to the GetHandle function.
+        @return OMX_ERRORTYPE
+            If the command successfully executes, the return code will be
+            OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.
+     */
+    OMX_ERRORTYPE (*ComponentDeInit)(
+            OMX_IN  OMX_HANDLETYPE hComponent);
+
+    /** @ingroup buf */
+    OMX_ERRORTYPE (*UseEGLImage)(
+            OMX_IN OMX_HANDLETYPE hComponent,
+            OMX_INOUT OMX_BUFFERHEADERTYPE** ppBufferHdr,
+            OMX_IN OMX_U32 nPortIndex,
+            OMX_IN OMX_PTR pAppPrivate,
+            OMX_IN void* eglImage);
+
+    OMX_ERRORTYPE (*ComponentRoleEnum)(
+        OMX_IN OMX_HANDLETYPE hComponent,
+               OMX_OUT OMX_U8 *cRole,
+               OMX_IN OMX_U32 nIndex);
+
+} OMX_COMPONENTTYPE;
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
+/* File EOF */
diff --git a/modules/codec/omxil/OMX_Core.h b/modules/codec/omxil/OMX_Core.h
new file mode 100644 (file)
index 0000000..19c03b6
--- /dev/null
@@ -0,0 +1,1431 @@
+/*\r
+ * Copyright (c) 2008 The Khronos Group Inc. \r
+ * \r
+ * Permission is hereby granted, free of charge, to any person obtaining\r
+ * a copy of this software and associated documentation files (the\r
+ * "Software"), to deal in the Software without restriction, including\r
+ * without limitation the rights to use, copy, modify, merge, publish,\r
+ * distribute, sublicense, and/or sell copies of the Software, and to\r
+ * permit persons to whom the Software is furnished to do so, subject\r
+ * to the following conditions: \r
+ * The above copyright notice and this permission notice shall be included\r
+ * in all copies or substantial portions of the Software. \r
+ * \r
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS\r
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\r
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\r
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\r
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\r
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \r
+ *\r
+ */\r
+\r
+/** OMX_Core.h - OpenMax IL version 1.1.2\r
+ *  The OMX_Core header file contains the definitions used by both the\r
+ *  application and the component to access common items.\r
+ */\r
+\r
+#ifndef OMX_Core_h\r
+#define OMX_Core_h\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif /* __cplusplus */\r
+\r
+\r
+/* Each OMX header shall include all required header files to allow the\r
+ *  header to compile without errors.  The includes below are required\r
+ *  for this header file to compile successfully \r
+ */\r
+\r
+#include <OMX_Index.h>\r
+\r
+\r
+/** The OMX_COMMANDTYPE enumeration is used to specify the action in the\r
+ *  OMX_SendCommand macro.  \r
+ *  @ingroup core\r
+ */\r
+typedef enum OMX_COMMANDTYPE\r
+{\r
+    OMX_CommandStateSet,    /**< Change the component state */\r
+    OMX_CommandFlush,       /**< Flush the data queue(s) of a component */\r
+    OMX_CommandPortDisable, /**< Disable a port on a component. */\r
+    OMX_CommandPortEnable,  /**< Enable a port on a component. */\r
+    OMX_CommandMarkBuffer,  /**< Mark a component/buffer for observation */\r
+    OMX_CommandKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ \r
+    OMX_CommandVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */\r
+    OMX_CommandMax = 0X7FFFFFFF\r
+} OMX_COMMANDTYPE;\r
+\r
+\r
+\r
+/** The OMX_STATETYPE enumeration is used to indicate or change the component\r
+ *  state.  This enumeration reflects the current state of the component when\r
+ *  used with the OMX_GetState macro or becomes the parameter in a state change\r
+ *  command when used with the OMX_SendCommand macro.\r
+ *\r
+ *  The component will be in the Loaded state after the component is initially\r
+ *  loaded into memory.  In the Loaded state, the component is not allowed to\r
+ *  allocate or hold resources other than to build it's internal parameter\r
+ *  and configuration tables.  The application will send one or more\r
+ *  SetParameters/GetParameters and SetConfig/GetConfig commands to the\r
+ *  component and the component will record each of these parameter and\r
+ *  configuration changes for use later.  When the application sends the\r
+ *  Idle command, the component will acquire the resources needed for the\r
+ *  specified configuration and will transition to the idle state if the\r
+ *  allocation is successful.  If the component cannot successfully\r
+ *  transition to the idle state for any reason, the state of the component\r
+ *  shall be fully rolled back to the Loaded state (e.g. all allocated \r
+ *  resources shall be released).  When the component receives the command\r
+ *  to go to the Executing state, it shall begin processing buffers by\r
+ *  sending all input buffers it holds to the application.  While\r
+ *  the component is in the Idle state, the application may also send the\r
+ *  Pause command.  If the component receives the pause command while in the\r
+ *  Idle state, the component shall send all input buffers it holds to the \r
+ *  application, but shall not begin processing buffers.  This will allow the\r
+ *  application to prefill buffers.\r
+ * \r
+ *  @ingroup comp\r
+ */\r
+\r
+typedef enum OMX_STATETYPE\r
+{\r
+    OMX_StateInvalid,      /**< component has detected that it's internal data \r
+                                structures are corrupted to the point that\r
+                                it cannot determine it's state properly */\r
+    OMX_StateLoaded,      /**< component has been loaded but has not completed\r
+                                initialization.  The OMX_SetParameter macro\r
+                                and the OMX_GetParameter macro are the only \r
+                                valid macros allowed to be sent to the \r
+                                component in this state. */\r
+    OMX_StateIdle,        /**< component initialization has been completed\r
+                                successfully and the component is ready to\r
+                                to start. */\r
+    OMX_StateExecuting,   /**< component has accepted the start command and\r
+                                is processing data (if data is available) */\r
+    OMX_StatePause,       /**< component has received pause command */\r
+    OMX_StateWaitForResources, /**< component is waiting for resources, either after \r
+                                preemption or before it gets the resources requested.\r
+                                See specification for complete details. */\r
+    OMX_StateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ \r
+    OMX_StateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */\r
+    OMX_StateMax = 0X7FFFFFFF\r
+} OMX_STATETYPE;\r
+\r
+/** The OMX_ERRORTYPE enumeration defines the standard OMX Errors.  These \r
+ *  errors should cover most of the common failure cases.  However, \r
+ *  vendors are free to add additional error messages of their own as \r
+ *  long as they follow these rules:\r
+ *  1.  Vendor error messages shall be in the range of 0x90000000 to\r
+ *      0x9000FFFF.\r
+ *  2.  Vendor error messages shall be defined in a header file provided\r
+ *      with the component.  No error messages are allowed that are\r
+ *      not defined.\r
+ */\r
+typedef enum OMX_ERRORTYPE\r
+{\r
+  OMX_ErrorNone = 0,\r
+\r
+  /** There were insufficient resources to perform the requested operation */\r
+  OMX_ErrorInsufficientResources = (OMX_S32) 0x80001000,\r
+\r
+  /** There was an error, but the cause of the error could not be determined */\r
+  OMX_ErrorUndefined = (OMX_S32) 0x80001001,\r
+\r
+  /** The component name string was not valid */\r
+  OMX_ErrorInvalidComponentName = (OMX_S32) 0x80001002,\r
+\r
+  /** No component with the specified name string was found */\r
+  OMX_ErrorComponentNotFound = (OMX_S32) 0x80001003,\r
+\r
+  /** The component specified did not have a "OMX_ComponentInit" or\r
+      "OMX_ComponentDeInit entry point */\r
+  OMX_ErrorInvalidComponent = (OMX_S32) 0x80001004,\r
+\r
+  /** One or more parameters were not valid */\r
+  OMX_ErrorBadParameter = (OMX_S32) 0x80001005,\r
+\r
+  /** The requested function is not implemented */\r
+  OMX_ErrorNotImplemented = (OMX_S32) 0x80001006,\r
+\r
+  /** The buffer was emptied before the next buffer was ready */\r
+  OMX_ErrorUnderflow = (OMX_S32) 0x80001007,\r
+\r
+  /** The buffer was not available when it was needed */\r
+  OMX_ErrorOverflow = (OMX_S32) 0x80001008,\r
+\r
+  /** The hardware failed to respond as expected */\r
+  OMX_ErrorHardware = (OMX_S32) 0x80001009,\r
+\r
+  /** The component is in the state OMX_StateInvalid */\r
+  OMX_ErrorInvalidState = (OMX_S32) 0x8000100A,\r
+\r
+  /** Stream is found to be corrupt */\r
+  OMX_ErrorStreamCorrupt = (OMX_S32) 0x8000100B,\r
+\r
+  /** Ports being connected are not compatible */\r
+  OMX_ErrorPortsNotCompatible = (OMX_S32) 0x8000100C,\r
+\r
+  /** Resources allocated to an idle component have been\r
+      lost resulting in the component returning to the loaded state */\r
+  OMX_ErrorResourcesLost = (OMX_S32) 0x8000100D,\r
+\r
+  /** No more indicies can be enumerated */\r
+  OMX_ErrorNoMore = (OMX_S32) 0x8000100E,\r
+\r
+  /** The component detected a version mismatch */\r
+  OMX_ErrorVersionMismatch = (OMX_S32) 0x8000100F,\r
+\r
+  /** The component is not ready to return data at this time */\r
+  OMX_ErrorNotReady = (OMX_S32) 0x80001010,\r
+\r
+  /** There was a timeout that occurred */\r
+  OMX_ErrorTimeout = (OMX_S32) 0x80001011,\r
+\r
+  /** This error occurs when trying to transition into the state you are already in */\r
+  OMX_ErrorSameState = (OMX_S32) 0x80001012,\r
+\r
+  /** Resources allocated to an executing or paused component have been \r
+      preempted, causing the component to return to the idle state */\r
+  OMX_ErrorResourcesPreempted = (OMX_S32) 0x80001013, \r
+\r
+  /** A non-supplier port sends this error to the IL client (via the EventHandler callback) \r
+      during the allocation of buffers (on a transition from the LOADED to the IDLE state or\r
+      on a port restart) when it deems that it has waited an unusually long time for the supplier \r
+      to send it an allocated buffer via a UseBuffer call. */\r
+  OMX_ErrorPortUnresponsiveDuringAllocation = (OMX_S32) 0x80001014,\r
+\r
+  /** A non-supplier port sends this error to the IL client (via the EventHandler callback) \r
+      during the deallocation of buffers (on a transition from the IDLE to LOADED state or \r
+      on a port stop) when it deems that it has waited an unusually long time for the supplier \r
+      to request the deallocation of a buffer header via a FreeBuffer call. */\r
+  OMX_ErrorPortUnresponsiveDuringDeallocation = (OMX_S32) 0x80001015,\r
+\r
+  /** A supplier port sends this error to the IL client (via the EventHandler callback) \r
+      during the stopping of a port (either on a transition from the IDLE to LOADED \r
+      state or a port stop) when it deems that it has waited an unusually long time for \r
+      the non-supplier to return a buffer via an EmptyThisBuffer or FillThisBuffer call. */\r
+  OMX_ErrorPortUnresponsiveDuringStop = (OMX_S32) 0x80001016,\r
+\r
+  /** Attempting a state transtion that is not allowed */\r
+  OMX_ErrorIncorrectStateTransition = (OMX_S32) 0x80001017,\r
+\r
+  /* Attempting a command that is not allowed during the present state. */\r
+  OMX_ErrorIncorrectStateOperation = (OMX_S32) 0x80001018, \r
+\r
+  /** The values encapsulated in the parameter or config structure are not supported. */\r
+  OMX_ErrorUnsupportedSetting = (OMX_S32) 0x80001019,\r
+\r
+  /** The parameter or config indicated by the given index is not supported. */\r
+  OMX_ErrorUnsupportedIndex = (OMX_S32) 0x8000101A,\r
+\r
+  /** The port index supplied is incorrect. */\r
+  OMX_ErrorBadPortIndex = (OMX_S32) 0x8000101B,\r
+\r
+  /** The port has lost one or more of its buffers and it thus unpopulated. */\r
+  OMX_ErrorPortUnpopulated = (OMX_S32) 0x8000101C,\r
+\r
+  /** Component suspended due to temporary loss of resources */\r
+  OMX_ErrorComponentSuspended = (OMX_S32) 0x8000101D,\r
+\r
+  /** Component suspended due to an inability to acquire dynamic resources */\r
+  OMX_ErrorDynamicResourcesUnavailable = (OMX_S32) 0x8000101E,\r
+\r
+  /** When the macroblock error reporting is enabled the component returns new error \r
+  for every frame that has errors */\r
+  OMX_ErrorMbErrorsInFrame = (OMX_S32) 0x8000101F,\r
+\r
+  /** A component reports this error when it cannot parse or determine the format of an input stream. */\r
+  OMX_ErrorFormatNotDetected = (OMX_S32) 0x80001020, \r
+\r
+  /** The content open operation failed. */\r
+  OMX_ErrorContentPipeOpenFailed = (OMX_S32) 0x80001021,\r
+\r
+  /** The content creation operation failed. */\r
+  OMX_ErrorContentPipeCreationFailed = (OMX_S32) 0x80001022,\r
+\r
+  /** Separate table information is being used */\r
+  OMX_ErrorSeperateTablesUsed = (OMX_S32) 0x80001023,\r
+\r
+  /** Tunneling is unsupported by the component*/\r
+  OMX_ErrorTunnelingUnsupported = (OMX_S32) 0x80001024,\r
+\r
+  OMX_ErrorKhronosExtensions = (OMX_S32)0x8F000000, /**< Reserved region for introducing Khronos Standard Extensions */ \r
+  OMX_ErrorVendorStartUnused = (OMX_S32)0x90000000, /**< Reserved region for introducing Vendor Extensions */\r
+  OMX_ErrorMax = 0x7FFFFFFF\r
+} OMX_ERRORTYPE;\r
+\r
+/** @ingroup core */\r
+typedef OMX_ERRORTYPE (* OMX_COMPONENTINITTYPE)(OMX_IN  OMX_HANDLETYPE hComponent);\r
+\r
+/** @ingroup core */\r
+typedef struct OMX_COMPONENTREGISTERTYPE\r
+{\r
+  const char          * pName;       /* Component name, 128 byte limit (including '\0') applies */\r
+  OMX_COMPONENTINITTYPE pInitialize; /* Component instance initialization function */\r
+} OMX_COMPONENTREGISTERTYPE;\r
+\r
+/** @ingroup core */\r
+extern OMX_COMPONENTREGISTERTYPE OMX_ComponentRegistered[];\r
+\r
+/** @ingroup rpm */\r
+typedef struct OMX_PRIORITYMGMTTYPE {\r
+ OMX_U32 nSize;             /**< size of the structure in bytes */\r
+ OMX_VERSIONTYPE nVersion;  /**< OMX specification version information */\r
+ OMX_U32 nGroupPriority;            /**< Priority of the component group */\r
+ OMX_U32 nGroupID;                  /**< ID of the component group */\r
+} OMX_PRIORITYMGMTTYPE;\r
+\r
+/* Component name and Role names are limited to 128 characters including the terminating '\0'. */\r
+#define OMX_MAX_STRINGNAME_SIZE 128\r
+\r
+/** @ingroup comp */\r
+typedef struct OMX_PARAM_COMPONENTROLETYPE {\r
+    OMX_U32 nSize;              /**< size of the structure in bytes */\r
+    OMX_VERSIONTYPE nVersion;   /**< OMX specification version information */\r
+    OMX_U8 cRole[OMX_MAX_STRINGNAME_SIZE];  /**< name of standard component which defines component role */\r
+} OMX_PARAM_COMPONENTROLETYPE;\r
+\r
+/** End of Stream Buffer Flag: \r
+  *\r
+  * A component sets EOS when it has no more data to emit on a particular \r
+  * output port. Thus an output port shall set EOS on the last buffer it \r
+  * emits. A component's determination of when an output port should \r
+  * cease sending data is implemenation specific.\r
+  * @ingroup buf\r
+  */\r
+\r
+#define OMX_BUFFERFLAG_EOS 0x00000001 \r
+\r
+/** Start Time Buffer Flag: \r
+ *\r
+ * The source of a stream (e.g. a demux component) sets the STARTTIME\r
+ * flag on the buffer that contains the starting timestamp for the\r
+ * stream. The starting timestamp corresponds to the first data that\r
+ * should be displayed at startup or after a seek.\r
+ * The first timestamp of the stream is not necessarily the start time.\r
+ * For instance, in the case of a seek to a particular video frame, \r
+ * the target frame may be an interframe. Thus the first buffer of \r
+ * the stream will be the intra-frame preceding the target frame and\r
+ * the starttime will occur with the target frame (with any other\r
+ * required frames required to reconstruct the target intervening).\r
+ *\r
+ * The STARTTIME flag is directly associated with the buffer's \r
+ * timestamp ' thus its association to buffer data and its \r
+ * propagation is identical to the timestamp's.\r
+ *\r
+ * When a Sync Component client receives a buffer with the \r
+ * STARTTIME flag it shall perform a SetConfig on its sync port \r
+ * using OMX_ConfigTimeClientStartTime and passing the buffer's\r
+ * timestamp.\r
+ * \r
+ * @ingroup buf\r
+ */\r
+\r
+#define OMX_BUFFERFLAG_STARTTIME 0x00000002\r
+\r
\r
+\r
+/** Decode Only Buffer Flag: \r
+ *\r
+ * The source of a stream (e.g. a demux component) sets the DECODEONLY\r
+ * flag on any buffer that should shall be decoded but should not be\r
+ * displayed. This flag is used, for instance, when a source seeks to \r
+ * a target interframe that requires the decode of frames preceding the \r
+ * target to facilitate the target's reconstruction. In this case the \r
+ * source would emit the frames preceding the target downstream \r
+ * but mark them as decode only.\r
+ *\r
+ * The DECODEONLY is associated with buffer data and propagated in a \r
+ * manner identical to the buffer timestamp.\r
+ *\r
+ * A component that renders data should ignore all buffers with \r
+ * the DECODEONLY flag set.\r
+ * \r
+ * @ingroup buf\r
+ */\r
+\r
+#define OMX_BUFFERFLAG_DECODEONLY 0x00000004\r
+\r
+\r
+/* Data Corrupt Flag: This flag is set when the IL client believes the data in the associated buffer is corrupt \r
+ * @ingroup buf\r
+ */\r
+\r
+#define OMX_BUFFERFLAG_DATACORRUPT 0x00000008\r
+\r
+/* End of Frame: The buffer contains exactly one end of frame and no data\r
+ *  occurs after the end of frame. This flag is an optional hint. The absence\r
+ *  of this flag does not imply the absence of an end of frame within the buffer. \r
+ * @ingroup buf\r
+*/\r
+#define OMX_BUFFERFLAG_ENDOFFRAME 0x00000010\r
+\r
+/* Sync Frame Flag: This flag is set when the buffer content contains a coded sync frame ' \r
+ *  a frame that has no dependency on any other frame information \r
+ *  @ingroup buf\r
+ */\r
+#define OMX_BUFFERFLAG_SYNCFRAME 0x00000020\r
+\r
+/* Extra data present flag: there is extra data appended to the data stream\r
+ * residing in the buffer \r
+ * @ingroup buf  \r
+ */\r
+#define OMX_BUFFERFLAG_EXTRADATA 0x00000040\r
+\r
+/** Codec Config Buffer Flag: \r
+* OMX_BUFFERFLAG_CODECCONFIG is an optional flag that is set by an\r
+* output port when all bytes in the buffer form part or all of a set of\r
+* codec specific configuration data.  Examples include SPS/PPS nal units\r
+* for OMX_VIDEO_CodingAVC or AudioSpecificConfig data for\r
+* OMX_AUDIO_CodingAAC.  Any component that for a given stream sets \r
+* OMX_BUFFERFLAG_CODECCONFIG shall not mix codec configuration bytes\r
+* with frame data in the same buffer, and shall send all buffers\r
+* containing codec configuration bytes before any buffers containing\r
+* frame data that those configurations bytes describe.\r
+* If the stream format for a particular codec has a frame specific\r
+* header at the start of each frame, for example OMX_AUDIO_CodingMP3 or\r
+* OMX_AUDIO_CodingAAC in ADTS mode, then these shall be presented as\r
+* normal without setting OMX_BUFFERFLAG_CODECCONFIG.\r
+ * @ingroup buf\r
+ */\r
+#define OMX_BUFFERFLAG_CODECCONFIG 0x00000080\r
+\r
+\r
+\r
+/** @ingroup buf */\r
+typedef struct OMX_BUFFERHEADERTYPE\r
+{\r
+    OMX_U32 nSize;              /**< size of the structure in bytes */\r
+    OMX_VERSIONTYPE nVersion;   /**< OMX specification version information */\r
+    OMX_U8* pBuffer;            /**< Pointer to actual block of memory \r
+                                     that is acting as the buffer */\r
+    OMX_U32 nAllocLen;          /**< size of the buffer allocated, in bytes */\r
+    OMX_U32 nFilledLen;         /**< number of bytes currently in the \r
+                                     buffer */\r
+    OMX_U32 nOffset;            /**< start offset of valid data in bytes from\r
+                                     the start of the buffer */\r
+    OMX_PTR pAppPrivate;        /**< pointer to any data the application\r
+                                     wants to associate with this buffer */\r
+    OMX_PTR pPlatformPrivate;   /**< pointer to any data the platform\r
+                                     wants to associate with this buffer */ \r
+    OMX_PTR pInputPortPrivate;  /**< pointer to any data the input port\r
+                                     wants to associate with this buffer */\r
+    OMX_PTR pOutputPortPrivate; /**< pointer to any data the output port\r
+                                     wants to associate with this buffer */\r
+    OMX_HANDLETYPE hMarkTargetComponent; /**< The component that will generate a \r
+                                              mark event upon processing this buffer. */\r
+    OMX_PTR pMarkData;          /**< Application specific data associated with \r
+                                     the mark sent on a mark event to disambiguate \r
+                                     this mark from others. */\r
+    OMX_U32 nTickCount;         /**< Optional entry that the component and\r
+                                     application can update with a tick count\r
+                                     when they access the component.  This\r
+                                     value should be in microseconds.  Since\r
+                                     this is a value relative to an arbitrary\r
+                                     starting point, this value cannot be used \r
+                                     to determine absolute time.  This is an\r
+                                     optional entry and not all components\r
+                                     will update it.*/\r
+ OMX_TICKS nTimeStamp;          /**< Timestamp corresponding to the sample \r
+                                     starting at the first logical sample \r
+                                     boundary in the buffer. Timestamps of \r
+                                     successive samples within the buffer may\r
+                                     be inferred by adding the duration of the \r
+                                     of the preceding buffer to the timestamp\r
+                                     of the preceding buffer.*/\r
+  OMX_U32     nFlags;           /**< buffer specific flags */\r
+  OMX_U32 nOutputPortIndex;     /**< The index of the output port (if any) using \r
+                                     this buffer */\r
+  OMX_U32 nInputPortIndex;      /**< The index of the input port (if any) using\r
+                                     this buffer */\r
+} OMX_BUFFERHEADERTYPE;\r
+\r
+/** The OMX_EXTRADATATYPE enumeration is used to define the \r
+ * possible extra data payload types.\r
+ * NB: this enum is binary backwards compatible with the previous\r
+ * OMX_EXTRADATA_QUANT define.  This should be replaced with\r
+ * OMX_ExtraDataQuantization.\r
+ */\r
+typedef enum OMX_EXTRADATATYPE\r
+{\r
+   OMX_ExtraDataNone = 0,                       /**< Indicates that no more extra data sections follow */        \r
+   OMX_ExtraDataQuantization,                   /**< The data payload contains quantization data */\r
+   OMX_ExtraDataKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ \r
+   OMX_ExtraDataVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */\r
+   OMX_ExtraDataMax = 0x7FFFFFFF\r
+} OMX_EXTRADATATYPE;\r
+\r
+\r
+typedef struct OMX_OTHER_EXTRADATATYPE  {\r
+    OMX_U32 nSize;\r
+    OMX_VERSIONTYPE nVersion;               \r
+    OMX_U32 nPortIndex;\r
+    OMX_EXTRADATATYPE eType;       /* Extra Data type */\r
+    OMX_U32 nDataSize;   /* Size of the supporting data to follow */\r
+    OMX_U8  data[1];     /* Supporting data hint  */\r
+} OMX_OTHER_EXTRADATATYPE;\r
+\r
+/** @ingroup comp */\r
+typedef struct OMX_PORT_PARAM_TYPE {\r
+    OMX_U32 nSize;              /**< size of the structure in bytes */\r
+    OMX_VERSIONTYPE nVersion;   /**< OMX specification version information */\r
+    OMX_U32 nPorts;             /**< The number of ports for this component */\r
+    OMX_U32 nStartPortNumber;   /** first port number for this type of port */\r
+} OMX_PORT_PARAM_TYPE; \r
+\r
+/** @ingroup comp */\r
+typedef enum OMX_EVENTTYPE\r
+{\r
+    OMX_EventCmdComplete,         /**< component has sucessfully completed a command */\r
+    OMX_EventError,               /**< component has detected an error condition */\r
+    OMX_EventMark,                /**< component has detected a buffer mark */\r
+    OMX_EventPortSettingsChanged, /**< component is reported a port settings change */\r
+    OMX_EventBufferFlag,          /**< component has detected an EOS */ \r
+    OMX_EventResourcesAcquired,   /**< component has been granted resources and is\r
+                                       automatically starting the state change from\r
+                                       OMX_StateWaitForResources to OMX_StateIdle. */\r
+   OMX_EventComponentResumed,     /**< Component resumed due to reacquisition of resources */\r
+   OMX_EventDynamicResourcesAvailable, /**< Component has acquired previously unavailable dynamic resources */\r
+   OMX_EventPortFormatDetected,      /**< Component has detected a supported format. */\r
+   OMX_EventKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ \r
+   OMX_EventVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */\r
+   OMX_EventMax = 0x7FFFFFFF\r
+} OMX_EVENTTYPE;\r
+\r
+typedef struct OMX_CALLBACKTYPE\r
+{\r
+    /** The EventHandler method is used to notify the application when an\r
+        event of interest occurs.  Events are defined in the OMX_EVENTTYPE\r
+        enumeration.  Please see that enumeration for details of what will\r
+        be returned for each type of event. Callbacks should not return\r
+        an error to the component, so if an error occurs, the application \r
+        shall handle it internally.  This is a blocking call.\r
+\r
+        The application should return from this call within 5 msec to avoid\r
+        blocking the component for an excessively long period of time.\r
+\r
+        @param hComponent\r
+            handle of the component to access.  This is the component\r
+            handle returned by the call to the GetHandle function.\r
+        @param pAppData\r
+            pointer to an application defined value that was provided in the \r
+            pAppData parameter to the OMX_GetHandle method for the component.\r
+            This application defined value is provided so that the application \r
+            can have a component specific context when receiving the callback.\r
+        @param eEvent\r
+            Event that the component wants to notify the application about.\r
+        @param nData1\r
+            nData will be the OMX_ERRORTYPE for an error event and will be \r
+            an OMX_COMMANDTYPE for a command complete event and OMX_INDEXTYPE for a OMX_PortSettingsChanged event.\r
+         @param nData2\r
+            nData2 will hold further information related to the event. Can be OMX_STATETYPE for\r
+            a OMX_CommandStateSet command or port index for a OMX_PortSettingsChanged event.\r
+            Default value is 0 if not used. )\r
+        @param pEventData\r
+            Pointer to additional event-specific data (see spec for meaning).\r
+      */\r
+\r
+   OMX_ERRORTYPE (*EventHandler)(\r
+        OMX_IN OMX_HANDLETYPE hComponent,\r
+        OMX_IN OMX_PTR pAppData,\r
+        OMX_IN OMX_EVENTTYPE eEvent,\r
+        OMX_IN OMX_U32 nData1,\r
+        OMX_IN OMX_U32 nData2,\r
+        OMX_IN OMX_PTR pEventData);\r
+\r
+    /** The EmptyBufferDone method is used to return emptied buffers from an\r
+        input port back to the application for reuse.  This is a blocking call \r
+        so the application should not attempt to refill the buffers during this\r
+        call, but should queue them and refill them in another thread.  There\r
+        is no error return, so the application shall handle any errors generated\r
+        internally.  \r
+        \r
+        The application should return from this call within 5 msec.\r
+        \r
+        @param hComponent\r
+            handle of the component to access.  This is the component\r
+            handle returned by the call to the GetHandle function.\r
+        @param pAppData\r
+            pointer to an application defined value that was provided in the \r
+            pAppData parameter to the OMX_GetHandle method for the component.\r
+            This application defined value is provided so that the application \r
+            can have a component specific context when receiving the callback.\r
+        @param pBuffer\r
+            pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer\r
+            or AllocateBuffer indicating the buffer that was emptied.\r
+        @ingroup buf\r
+     */\r
+    OMX_ERRORTYPE (*EmptyBufferDone)(\r
+        OMX_IN OMX_HANDLETYPE hComponent,\r
+        OMX_IN OMX_PTR pAppData,\r
+        OMX_IN OMX_BUFFERHEADERTYPE* pBuffer);\r
+\r
+    /** The FillBufferDone method is used to return filled buffers from an\r
+        output port back to the application for emptying and then reuse.  \r
+        This is a blocking call so the application should not attempt to \r
+        empty the buffers during this call, but should queue the buffers \r
+        and empty them in another thread.  There is no error return, so \r
+        the application shall handle any errors generated internally.  The \r
+        application shall also update the buffer header to indicate the\r
+        number of bytes placed into the buffer.  \r
+\r
+        The application should return from this call within 5 msec.\r
+        \r
+        @param hComponent\r
+            handle of the component to access.  This is the component\r
+            handle returned by the call to the GetHandle function.\r
+        @param pAppData\r
+            pointer to an application defined value that was provided in the \r
+            pAppData parameter to the OMX_GetHandle method for the component.\r
+            This application defined value is provided so that the application \r
+            can have a component specific context when receiving the callback.\r
+        @param pBuffer\r
+            pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer\r
+            or AllocateBuffer indicating the buffer that was filled.\r
+        @ingroup buf\r
+     */\r
+    OMX_ERRORTYPE (*FillBufferDone)(\r
+        OMX_OUT OMX_HANDLETYPE hComponent,\r
+        OMX_OUT OMX_PTR pAppData,\r
+        OMX_OUT OMX_BUFFERHEADERTYPE* pBuffer);\r
+\r
+} OMX_CALLBACKTYPE;\r
+\r
+/** The OMX_BUFFERSUPPLIERTYPE enumeration is used to dictate port supplier\r
+    preference when tunneling between two ports.\r
+    @ingroup tun buf\r
+*/\r
+typedef enum OMX_BUFFERSUPPLIERTYPE\r
+{\r
+    OMX_BufferSupplyUnspecified = 0x0, /**< port supplying the buffers is unspecified,\r
+                                              or don't care */\r
+    OMX_BufferSupplyInput,             /**< input port supplies the buffers */\r
+    OMX_BufferSupplyOutput,            /**< output port supplies the buffers */\r
+    OMX_BufferSupplyKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ \r
+    OMX_BufferSupplyVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */\r
+    OMX_BufferSupplyMax = 0x7FFFFFFF\r
+} OMX_BUFFERSUPPLIERTYPE;\r
+\r
+\r
+/** buffer supplier parameter \r
+ * @ingroup tun\r
+ */\r
+typedef struct OMX_PARAM_BUFFERSUPPLIERTYPE {\r
+    OMX_U32 nSize; /**< size of the structure in bytes */\r
+    OMX_VERSIONTYPE nVersion; /**< OMX specification version information */\r
+    OMX_U32 nPortIndex; /**< port that this structure applies to */\r
+    OMX_BUFFERSUPPLIERTYPE eBufferSupplier; /**< buffer supplier */\r
+} OMX_PARAM_BUFFERSUPPLIERTYPE;\r
+\r
+\r
+/**< indicates that buffers received by an input port of a tunnel \r
+     may not modify the data in the buffers \r
+     @ingroup tun\r
+ */\r
+#define OMX_PORTTUNNELFLAG_READONLY 0x00000001 \r
+\r
+\r
+/** The OMX_TUNNELSETUPTYPE structure is used to pass data from an output\r
+    port to an input port as part the two ComponentTunnelRequest calls\r
+    resulting from a OMX_SetupTunnel call from the IL Client. \r
+    @ingroup tun\r
+ */   \r
+typedef struct OMX_TUNNELSETUPTYPE\r
+{\r
+    OMX_U32 nTunnelFlags;             /**< bit flags for tunneling */\r
+    OMX_BUFFERSUPPLIERTYPE eSupplier; /**< supplier preference */\r
+} OMX_TUNNELSETUPTYPE; \r
+\r
+/* OMX Component headers is included to enable the core to use\r
+   macros for functions into the component for OMX release 1.0.  \r
+   Developers should not access any structures or data from within\r
+   the component header directly */\r
+/* TO BE REMOVED - #include <OMX_Component.h> */\r
+\r
+/** GetComponentVersion will return information about the component.  \r
+    This is a blocking call.  This macro will go directly from the\r
+    application to the component (via a core macro).  The\r
+    component will return from this call within 5 msec.\r
+    @param [in] hComponent\r
+        handle of component to execute the command\r
+    @param [out] pComponentName\r
+        pointer to an empty string of length 128 bytes.  The component \r
+        will write its name into this string.  The name will be \r
+        terminated by a single zero byte.  The name of a component will \r
+        be 127 bytes or less to leave room for the trailing zero byte.  \r
+        An example of a valid component name is "OMX.ABC.ChannelMixer\0".\r
+    @param [out] pComponentVersion\r
+        pointer to an OMX Version structure that the component will fill \r
+        in.  The component will fill in a value that indicates the \r
+        component version.  NOTE: the component version is NOT the same \r
+        as the OMX Specification version (found in all structures).  The \r
+        component version is defined by the vendor of the component and \r
+        its value is entirely up to the component vendor.\r
+    @param [out] pSpecVersion\r
+        pointer to an OMX Version structure that the component will fill \r
+        in.  The SpecVersion is the version of the specification that the \r
+        component was built against.  Please note that this value may or \r
+        may not match the structure's version.  For example, if the \r
+        component was built against the 2.0 specification, but the \r
+        application (which creates the structure is built against the \r
+        1.0 specification the versions would be different.\r
+    @param [out] pComponentUUID\r
+        pointer to the UUID of the component which will be filled in by \r
+        the component.  The UUID is a unique identifier that is set at \r
+        RUN time for the component and is unique to each instantion of \r
+        the component.\r
+    @return OMX_ERRORTYPE\r
+        If the command successfully executes, the return code will be\r
+        OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.\r
+    @ingroup comp\r
+ */\r
+#define OMX_GetComponentVersion(                            \\r
+        hComponent,                                         \\r
+        pComponentName,                                     \\r
+        pComponentVersion,                                  \\r
+        pSpecVersion,                                       \\r
+        pComponentUUID)                                     \\r
+    ((OMX_COMPONENTTYPE*)hComponent)->GetComponentVersion(  \\r
+        hComponent,                                         \\r
+        pComponentName,                                     \\r
+        pComponentVersion,                                  \\r
+        pSpecVersion,                                       \\r
+        pComponentUUID)                 /* Macro End */\r
+\r
+\r
+/** Send a command to the component.  This call is a non-blocking call.\r
+    The component should check the parameters and then queue the command\r
+    to the component thread to be executed.  The component thread shall \r
+    send the EventHandler() callback at the conclusion of the command. \r
+    This macro will go directly from the application to the component (via\r
+    a core macro).  The component will return from this call within 5 msec.\r
+    \r
+    When the command is "OMX_CommandStateSet" the component will queue a\r
+    state transition to the new state idenfied in nParam.\r
+    \r
+    When the command is "OMX_CommandFlush", to flush a port's buffer queues,\r
+    the command will force the component to return all buffers NOT CURRENTLY \r
+    BEING PROCESSED to the application, in the order in which the buffers \r
+    were received.\r
+    \r
+    When the command is "OMX_CommandPortDisable" or \r
+    "OMX_CommandPortEnable", the component's port (given by the value of\r
+    nParam) will be stopped or restarted. \r
+    \r
+    When the command "OMX_CommandMarkBuffer" is used to mark a buffer, the\r
+    pCmdData will point to a OMX_MARKTYPE structure containing the component\r
+    handle of the component to examine the buffer chain for the mark.  nParam1\r
+    contains the index of the port on which the buffer mark is applied.\r
+\r
+    Specification text for more details. \r
+    \r
+    @param [in] hComponent\r
+        handle of component to execute the command\r
+    @param [in] Cmd\r
+        Command for the component to execute\r
+    @param [in] nParam\r
+        Parameter for the command to be executed.  When Cmd has the value \r
+        OMX_CommandStateSet, value is a member of OMX_STATETYPE.  When Cmd has \r
+        the value OMX_CommandFlush, value of nParam indicates which port(s) \r
+        to flush. -1 is used to flush all ports a single port index will \r
+        only flush that port.  When Cmd has the value "OMX_CommandPortDisable"\r
+        or "OMX_CommandPortEnable", the component's port is given by \r
+        the value of nParam.  When Cmd has the value "OMX_CommandMarkBuffer"\r
+        the components pot is given by the value of nParam.\r
+    @param [in] pCmdData\r
+        Parameter pointing to the OMX_MARKTYPE structure when Cmd has the value\r
+        "OMX_CommandMarkBuffer".     \r
+    @return OMX_ERRORTYPE\r
+        If the command successfully executes, the return code will be\r
+        OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.\r
+    @ingroup comp\r
+ */\r
+#define OMX_SendCommand(                                    \\r
+         hComponent,                                        \\r
+         Cmd,                                               \\r
+         nParam,                                            \\r
+         pCmdData)                                          \\r
+     ((OMX_COMPONENTTYPE*)hComponent)->SendCommand(         \\r
+         hComponent,                                        \\r
+         Cmd,                                               \\r
+         nParam,                                            \\r
+         pCmdData)                          /* Macro End */\r
+\r
+\r
+/** The OMX_GetParameter macro will get one of the current parameter \r
+    settings from the component.  This macro cannot only be invoked when \r
+    the component is in the OMX_StateInvalid state.  The nParamIndex\r
+    parameter is used to indicate which structure is being requested from\r
+    the component.  The application shall allocate the correct structure \r
+    and shall fill in the structure size and version information before \r
+    invoking this macro.  When the parameter applies to a port, the\r
+    caller shall fill in the appropriate nPortIndex value indicating the\r
+    port on which the parameter applies. If the component has not had \r
+    any settings changed, then the component should return a set of \r
+    valid DEFAULT  parameters for the component.  This is a blocking \r
+    call.  \r
+    \r
+    The component should return from this call within 20 msec.\r
+    \r
+    @param [in] hComponent\r
+        Handle of the component to be accessed.  This is the component\r
+        handle returned by the call to the OMX_GetHandle function.\r
+    @param [in] nParamIndex\r
+        Index of the structure to be filled.  This value is from the\r
+        OMX_INDEXTYPE enumeration.\r
+    @param [in,out] pComponentParameterStructure\r
+        Pointer to application allocated structure to be filled by the \r
+        component.\r
+    @return OMX_ERRORTYPE\r
+        If the command successfully executes, the return code will be\r
+        OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.\r
+    @ingroup comp\r
+ */\r
+#define OMX_GetParameter(                                   \\r
+        hComponent,                                         \\r
+        nParamIndex,                                        \\r
+        pComponentParameterStructure)                        \\r
+    ((OMX_COMPONENTTYPE*)hComponent)->GetParameter(         \\r
+        hComponent,                                         \\r
+        nParamIndex,                                        \\r
+        pComponentParameterStructure)    /* Macro End */\r
+\r
+\r
+/** The OMX_SetParameter macro will send an initialization parameter\r
+    structure to a component.  Each structure shall be sent one at a time,\r
+    in a separate invocation of the macro.  This macro can only be\r
+    invoked when the component is in the OMX_StateLoaded state, or the\r
+    port is disabled (when the parameter applies to a port). The \r
+    nParamIndex parameter is used to indicate which structure is being\r
+    passed to the component.  The application shall allocate the \r
+    correct structure and shall fill in the structure size and version \r
+    information (as well as the actual data) before invoking this macro.\r
+    The application is free to dispose of this structure after the call\r
+    as the component is required to copy any data it shall retain.  This \r
+    is a blocking call.  \r
+    \r
+    The component should return from this call within 20 msec.\r
+    \r
+    @param [in] hComponent\r
+        Handle of the component to be accessed.  This is the component\r
+        handle returned by the call to the OMX_GetHandle function.\r
+    @param [in] nIndex\r
+        Index of the structure to be sent.  This value is from the\r
+        OMX_INDEXTYPE enumeration.\r
+    @param [in] pComponentParameterStructure\r
+        pointer to application allocated structure to be used for\r
+        initialization by the component.\r
+    @return OMX_ERRORTYPE\r
+        If the command successfully executes, the return code will be\r
+        OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.\r
+    @ingroup comp\r
+ */\r
+#define OMX_SetParameter(                                   \\r
+        hComponent,                                         \\r
+        nParamIndex,                                        \\r
+        pComponentParameterStructure)                        \\r
+    ((OMX_COMPONENTTYPE*)hComponent)->SetParameter(         \\r
+        hComponent,                                         \\r
+        nParamIndex,                                        \\r
+        pComponentParameterStructure)    /* Macro End */\r
+\r
+\r
+/** The OMX_GetConfig macro will get one of the configuration structures \r
+    from a component.  This macro can be invoked anytime after the \r
+    component has been loaded.  The nParamIndex call parameter is used to \r
+    indicate which structure is being requested from the component.  The \r
+    application shall allocate the correct structure and shall fill in the \r
+    structure size and version information before invoking this macro.  \r
+    If the component has not had this configuration parameter sent before, \r
+    then the component should return a set of valid DEFAULT values for the \r
+    component.  This is a blocking call.  \r
+    \r
+    The component should return from this call within 5 msec.\r
+    \r
+    @param [in] hComponent\r
+        Handle of the component to be accessed.  This is the component\r
+        handle returned by the call to the OMX_GetHandle function.\r
+    @param [in] nIndex\r
+        Index of the structure to be filled.  This value is from the\r
+        OMX_INDEXTYPE enumeration.\r
+    @param [in,out] pComponentConfigStructure\r
+        pointer to application allocated structure to be filled by the \r
+        component.\r
+    @return OMX_ERRORTYPE\r
+        If the command successfully executes, the return code will be\r
+        OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.\r
+    @ingroup comp\r
+*/        \r
+#define OMX_GetConfig(                                      \\r
+        hComponent,                                         \\r
+        nConfigIndex,                                       \\r
+        pComponentConfigStructure)                           \\r
+    ((OMX_COMPONENTTYPE*)hComponent)->GetConfig(            \\r
+        hComponent,                                         \\r
+        nConfigIndex,                                       \\r
+        pComponentConfigStructure)       /* Macro End */\r
+\r
+\r
+/** The OMX_SetConfig macro will send one of the configuration \r
+    structures to a component.  Each structure shall be sent one at a time,\r
+    each in a separate invocation of the macro.  This macro can be invoked \r
+    anytime after the component has been loaded.  The application shall \r
+    allocate the correct structure and shall fill in the structure size \r
+    and version information (as well as the actual data) before invoking \r
+    this macro.  The application is free to dispose of this structure after \r
+    the call as the component is required to copy any data it shall retain.  \r
+    This is a blocking call.  \r
+    \r
+    The component should return from this call within 5 msec.\r
+    \r
+    @param [in] hComponent\r
+        Handle of the component to be accessed.  This is the component\r
+        handle returned by the call to the OMX_GetHandle function.\r
+    @param [in] nConfigIndex\r
+        Index of the structure to be sent.  This value is from the\r
+        OMX_INDEXTYPE enumeration above.\r
+    @param [in] pComponentConfigStructure\r
+        pointer to application allocated structure to be used for\r
+        initialization by the component.\r
+    @return OMX_ERRORTYPE\r
+        If the command successfully executes, the return code will be\r
+        OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.\r
+    @ingroup comp\r
+ */\r
+#define OMX_SetConfig(                                      \\r
+        hComponent,                                         \\r
+        nConfigIndex,                                       \\r
+        pComponentConfigStructure)                           \\r
+    ((OMX_COMPONENTTYPE*)hComponent)->SetConfig(            \\r
+        hComponent,                                         \\r
+        nConfigIndex,                                       \\r
+        pComponentConfigStructure)       /* Macro End */\r
+\r
+\r
+/** The OMX_GetExtensionIndex macro will invoke a component to translate \r
+    a vendor specific configuration or parameter string into an OMX \r
+    structure index.  There is no requirement for the vendor to support \r
+    this command for the indexes already found in the OMX_INDEXTYPE \r
+    enumeration (this is done to save space in small components).  The \r
+    component shall support all vendor supplied extension indexes not found\r
+    in the master OMX_INDEXTYPE enumeration.  This is a blocking call.  \r
+    \r
+    The component should return from this call within 5 msec.\r
+    \r
+    @param [in] hComponent\r
+        Handle of the component to be accessed.  This is the component\r
+        handle returned by the call to the GetHandle function.\r
+    @param [in] cParameterName\r
+        OMX_STRING that shall be less than 128 characters long including\r
+        the trailing null byte.  This is the string that will get \r
+        translated by the component into a configuration index.\r
+    @param [out] pIndexType\r
+        a pointer to a OMX_INDEXTYPE to receive the index value.\r
+    @return OMX_ERRORTYPE\r
+        If the command successfully executes, the return code will be\r
+        OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.\r
+    @ingroup comp\r
+ */\r
+#define OMX_GetExtensionIndex(                              \\r
+        hComponent,                                         \\r
+        cParameterName,                                     \\r
+        pIndexType)                                         \\r
+    ((OMX_COMPONENTTYPE*)hComponent)->GetExtensionIndex(    \\r
+        hComponent,                                         \\r
+        cParameterName,                                     \\r
+        pIndexType)                     /* Macro End */\r
+\r
+\r
+/** The OMX_GetState macro will invoke the component to get the current \r
+    state of the component and place the state value into the location\r
+    pointed to by pState.  \r
+    \r
+    The component should return from this call within 5 msec.\r
+    \r
+    @param [in] hComponent\r
+        Handle of the component to be accessed.  This is the component\r
+        handle returned by the call to the OMX_GetHandle function.\r
+    @param [out] pState\r
+        pointer to the location to receive the state.  The value returned\r
+        is one of the OMX_STATETYPE members \r
+    @return OMX_ERRORTYPE\r
+        If the command successfully executes, the return code will be\r
+        OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.\r
+    @ingroup comp\r
+ */\r
+#define OMX_GetState(                                       \\r
+        hComponent,                                         \\r
+        pState)                                             \\r
+    ((OMX_COMPONENTTYPE*)hComponent)->GetState(             \\r
+        hComponent,                                         \\r
+        pState)                         /* Macro End */\r
+\r
+\r
+/** The OMX_UseBuffer macro will request that the component use\r
+    a buffer (and allocate its own buffer header) already allocated \r
+    by another component, or by the IL Client. This is a blocking \r
+    call.\r
+    \r
+    The component should return from this call within 20 msec.\r
+    \r
+    @param [in] hComponent\r
+        Handle of the component to be accessed.  This is the component\r
+        handle returned by the call to the OMX_GetHandle function.\r
+    @param [out] ppBuffer\r
+        pointer to an OMX_BUFFERHEADERTYPE structure used to receive the \r
+        pointer to the buffer header\r
+    @return OMX_ERRORTYPE\r
+        If the command successfully executes, the return code will be\r
+        OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.\r
+    @ingroup comp buf\r
+ */\r
+\r
+#define OMX_UseBuffer(                                      \\r
+           hComponent,                                      \\r
+           ppBufferHdr,                                     \\r
+           nPortIndex,                                      \\r
+           pAppPrivate,                                     \\r
+           nSizeBytes,                                      \\r
+           pBuffer)                                         \\r
+    ((OMX_COMPONENTTYPE*)hComponent)->UseBuffer(            \\r
+           hComponent,                                      \\r
+           ppBufferHdr,                                     \\r
+           nPortIndex,                                      \\r
+           pAppPrivate,                                     \\r
+           nSizeBytes,                                      \\r
+           pBuffer)\r
+\r
+\r
+/** The OMX_AllocateBuffer macro will request that the component allocate \r
+    a new buffer and buffer header.  The component will allocate the \r
+    buffer and the buffer header and return a pointer to the buffer \r
+    header.  This is a blocking call.\r
+    \r
+    The component should return from this call within 5 msec.\r
+    \r
+    @param [in] hComponent\r
+        Handle of the component to be accessed.  This is the component\r
+        handle returned by the call to the OMX_GetHandle function.\r
+    @param [out] ppBuffer\r
+        pointer to an OMX_BUFFERHEADERTYPE structure used to receive \r
+        the pointer to the buffer header\r
+    @param [in] nPortIndex\r
+        nPortIndex is used to select the port on the component the buffer will\r
+        be used with.  The port can be found by using the nPortIndex\r
+        value as an index into the Port Definition array of the component.\r
+    @param [in] pAppPrivate\r
+        pAppPrivate is used to initialize the pAppPrivate member of the \r
+        buffer header structure.\r
+    @param [in] nSizeBytes\r
+        size of the buffer to allocate.  Used when bAllocateNew is true.\r
+    @return OMX_ERRORTYPE\r
+        If the command successfully executes, the return code will be\r
+        OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.\r
+    @ingroup comp buf\r
+ */    \r
+#define OMX_AllocateBuffer(                                 \\r
+        hComponent,                                         \\r
+        ppBuffer,                                           \\r
+        nPortIndex,                                         \\r
+        pAppPrivate,                                        \\r
+        nSizeBytes)                                         \\r
+    ((OMX_COMPONENTTYPE*)hComponent)->AllocateBuffer(       \\r
+        hComponent,                                         \\r
+        ppBuffer,                                           \\r
+        nPortIndex,                                         \\r
+        pAppPrivate,                                        \\r
+        nSizeBytes)                     /* Macro End */\r
+\r
+\r
+/** The OMX_FreeBuffer macro will release a buffer header from the component\r
+    which was allocated using either OMX_AllocateBuffer or OMX_UseBuffer. If  \r
+    the component allocated the buffer (see the OMX_UseBuffer macro) then \r
+    the component shall free the buffer and buffer header. This is a \r
+    blocking call. \r
+    \r
+    The component should return from this call within 20 msec.\r
+    \r
+    @param [in] hComponent\r
+        Handle of the component to be accessed.  This is the component\r
+        handle returned by the call to the OMX_GetHandle function.\r
+    @param [in] nPortIndex\r
+        nPortIndex is used to select the port on the component the buffer will\r
+        be used with.\r
+    @param [in] pBuffer\r
+        pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer\r
+        or AllocateBuffer.\r
+    @return OMX_ERRORTYPE\r
+        If the command successfully executes, the return code will be\r
+        OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.\r
+    @ingroup comp buf\r
+ */\r
+#define OMX_FreeBuffer(                                     \\r
+        hComponent,                                         \\r
+        nPortIndex,                                         \\r
+        pBuffer)                                            \\r
+    ((OMX_COMPONENTTYPE*)hComponent)->FreeBuffer(           \\r
+        hComponent,                                         \\r
+        nPortIndex,                                         \\r
+        pBuffer)                        /* Macro End */\r
+\r
+\r
+/** The OMX_EmptyThisBuffer macro will send a buffer full of data to an \r
+    input port of a component.  The buffer will be emptied by the component\r
+    and returned to the application via the EmptyBufferDone call back.\r
+    This is a non-blocking call in that the component will record the buffer\r
+    and return immediately and then empty the buffer, later, at the proper \r
+    time.  As expected, this macro may be invoked only while the component \r
+    is in the OMX_StateExecuting.  If nPortIndex does not specify an input\r
+    port, the component shall return an error.  \r
+    \r
+    The component should return from this call within 5 msec.\r
+    \r
+    @param [in] hComponent\r
+        Handle of the component to be accessed.  This is the component\r
+        handle returned by the call to the OMX_GetHandle function.\r
+    @param [in] pBuffer\r
+        pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer\r
+        or AllocateBuffer.\r
+    @return OMX_ERRORTYPE\r
+        If the command successfully executes, the return code will be\r
+        OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.\r
+    @ingroup comp buf\r
+ */\r
+#define OMX_EmptyThisBuffer(                                \\r
+        hComponent,                                         \\r
+        pBuffer)                                            \\r
+    ((OMX_COMPONENTTYPE*)hComponent)->EmptyThisBuffer(      \\r
+        hComponent,                                         \\r
+        pBuffer)                        /* Macro End */\r
+\r
+\r
+/** The OMX_FillThisBuffer macro will send an empty buffer to an \r
+    output port of a component.  The buffer will be filled by the component\r
+    and returned to the application via the FillBufferDone call back.\r
+    This is a non-blocking call in that the component will record the buffer\r
+    and return immediately and then fill the buffer, later, at the proper \r
+    time.  As expected, this macro may be invoked only while the component \r
+    is in the OMX_ExecutingState.  If nPortIndex does not specify an output\r
+    port, the component shall return an error.  \r
+    \r
+    The component should return from this call within 5 msec.\r
+    \r
+    @param [in] hComponent\r
+        Handle of the component to be accessed.  This is the component\r
+        handle returned by the call to the OMX_GetHandle function.\r
+    @param [in] pBuffer\r
+        pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer\r
+        or AllocateBuffer.\r
+    @return OMX_ERRORTYPE\r
+        If the command successfully executes, the return code will be\r
+        OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.\r
+    @ingroup comp buf\r
+ */\r
+#define OMX_FillThisBuffer(                                 \\r
+        hComponent,                                         \\r
+        pBuffer)                                            \\r
+    ((OMX_COMPONENTTYPE*)hComponent)->FillThisBuffer(       \\r
+        hComponent,                                         \\r
+        pBuffer)                        /* Macro End */\r
+\r
+\r
+\r
+/** The OMX_UseEGLImage macro will request that the component use\r
+    a EGLImage provided by EGL (and allocate its own buffer header)\r
+    This is a blocking call.\r
+    \r
+    The component should return from this call within 20 msec.\r
+    \r
+    @param [in] hComponent\r
+        Handle of the component to be accessed.  This is the component\r
+        handle returned by the call to the OMX_GetHandle function.\r
+    @param [out] ppBuffer\r
+        pointer to an OMX_BUFFERHEADERTYPE structure used to receive the \r
+        pointer to the buffer header.  Note that the memory location used\r
+        for this buffer is NOT visible to the IL Client.\r
+    @param [in] nPortIndex\r
+        nPortIndex is used to select the port on the component the buffer will\r
+        be used with.  The port can be found by using the nPortIndex\r
+        value as an index into the Port Definition array of the component.\r
+    @param [in] pAppPrivate\r
+        pAppPrivate is used to initialize the pAppPrivate member of the \r
+        buffer header structure.\r
+    @param [in] eglImage\r
+        eglImage contains the handle of the EGLImage to use as a buffer on the\r
+        specified port.  The component is expected to validate properties of \r
+        the EGLImage against the configuration of the port to ensure the component\r
+        can use the EGLImage as a buffer.          \r
+    @return OMX_ERRORTYPE\r
+        If the command successfully executes, the return code will be\r
+        OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.\r
+    @ingroup comp buf\r
+ */\r
+#define OMX_UseEGLImage(                                    \\r
+           hComponent,                                      \\r
+           ppBufferHdr,                                     \\r
+           nPortIndex,                                      \\r
+           pAppPrivate,                                     \\r
+           eglImage)                                        \\r
+    ((OMX_COMPONENTTYPE*)hComponent)->UseEGLImage(          \\r
+           hComponent,                                      \\r
+           ppBufferHdr,                                     \\r
+           nPortIndex,                                      \\r
+           pAppPrivate,                                     \\r
+           eglImage)\r
+\r
+/** The OMX_Init method is used to initialize the OMX core.  It shall be the\r
+    first call made into OMX and it should only be executed one time without\r
+    an interviening OMX_Deinit call.  \r
+    \r
+    The core should return from this call within 20 msec.\r
+\r
+    @return OMX_ERRORTYPE\r
+        If the command successfully executes, the return code will be\r
+        OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.\r
+    @ingroup core\r
+ */\r
+OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_Init(void);\r
+\r
+\r
+/** The OMX_Deinit method is used to deinitialize the OMX core.  It shall be \r
+    the last call made into OMX. In the event that the core determines that \r
+    thare are components loaded when this call is made, the core may return \r
+    with an error rather than try to unload the components.\r
+        \r
+    The core should return from this call within 20 msec.\r
+    \r
+    @return OMX_ERRORTYPE\r
+        If the command successfully executes, the return code will be\r
+        OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.\r
+    @ingroup core\r
+ */\r
+OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_Deinit(void);\r
+\r
+\r
+/** The OMX_ComponentNameEnum method will enumerate through all the names of\r
+    recognised valid components in the system. This function is provided\r
+    as a means to detect all the components in the system run-time. There is\r
+    no strict ordering to the enumeration order of component names, although\r
+    each name will only be enumerated once.  If the OMX core supports run-time\r
+    installation of new components, it is only requried to detect newly\r
+    installed components when the first call to enumerate component names\r
+    is made (i.e. when nIndex is 0x0).\r
+    \r
+    The core should return from this call in 20 msec.\r
+    \r
+    @param [out] cComponentName\r
+        pointer to a null terminated string with the component name.  The\r
+        names of the components are strings less than 127 bytes in length\r
+        plus the trailing null for a maximum size of 128 bytes.  An example \r
+        of a valid component name is "OMX.TI.AUDIO.DSP.MIXER\0".  Names are \r
+        assigned by the vendor, but shall start with "OMX." and then have \r
+        the Vendor designation next.\r
+    @param [in] nNameLength\r
+        number of characters in the cComponentName string.  With all \r
+        component name strings restricted to less than 128 characters \r
+        (including the trailing null) it is recomended that the caller\r
+        provide a input string for the cComponentName of 128 characters.\r
+    @param [in] nIndex\r
+        number containing the enumeration index for the component. \r
+        Multiple calls to OMX_ComponentNameEnum with increasing values\r
+        of nIndex will enumerate through the component names in the\r
+        system until OMX_ErrorNoMore is returned.  The value of nIndex\r
+        is 0 to (N-1), where N is the number of valid installed components\r
+        in the system.\r
+    @return OMX_ERRORTYPE\r
+        If the command successfully executes, the return code will be\r
+        OMX_ErrorNone.  When the value of nIndex exceeds the number of \r
+        components in the system minus 1, OMX_ErrorNoMore will be\r
+        returned. Otherwise the appropriate OMX error will be returned.\r
+    @ingroup core\r
+ */\r
+OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_ComponentNameEnum(\r
+    OMX_OUT OMX_STRING cComponentName,\r
+    OMX_IN  OMX_U32 nNameLength,\r
+    OMX_IN  OMX_U32 nIndex);\r
+\r
+\r
+/** The OMX_GetHandle method will locate the component specified by the\r
+    component name given, load that component into memory and then invoke\r
+    the component's methods to create an instance of the component.  \r
+    \r
+    The core should return from this call within 20 msec.\r
+    \r
+    @param [out] pHandle\r
+        pointer to an OMX_HANDLETYPE pointer to be filled in by this method.\r
+    @param [in] cComponentName\r
+        pointer to a null terminated string with the component name.  The\r
+        names of the components are strings less than 127 bytes in length\r
+        plus the trailing null for a maximum size of 128 bytes.  An example \r
+        of a valid component name is "OMX.TI.AUDIO.DSP.MIXER\0".  Names are \r
+        assigned by the vendor, but shall start with "OMX." and then have \r
+        the Vendor designation next.\r
+    @param [in] pAppData\r
+        pointer to an application defined value that will be returned\r
+        during callbacks so that the application can identify the source\r
+        of the callback.\r
+    @param [in] pCallBacks\r
+        pointer to a OMX_CALLBACKTYPE structure that will be passed to the\r
+        component to initialize it with.  \r
+    @return OMX_ERRORTYPE\r
+        If the command successfully executes, the return code will be\r
+        OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.\r
+    @ingroup core\r
+ */\r
+OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_GetHandle(\r
+    OMX_OUT OMX_HANDLETYPE* pHandle, \r
+    OMX_IN  OMX_STRING cComponentName,\r
+    OMX_IN  OMX_PTR pAppData,\r
+    OMX_IN  OMX_CALLBACKTYPE* pCallBacks);\r
+\r
+\r
+/** The OMX_FreeHandle method will free a handle allocated by the OMX_GetHandle \r
+    method.  If the component reference count goes to zero, the component will\r
+    be unloaded from memory.  \r
+    \r
+    The core should return from this call within 20 msec when the component is \r
+    in the OMX_StateLoaded state.\r
+\r
+    @param [in] hComponent\r
+        Handle of the component to be accessed.  This is the component\r
+        handle returned by the call to the GetHandle function.\r
+    @return OMX_ERRORTYPE\r
+        If the command successfully executes, the return code will be\r
+        OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.\r
+    @ingroup core\r
+ */\r
+OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_FreeHandle(\r
+    OMX_IN  OMX_HANDLETYPE hComponent);\r
+\r
+\r
+\r
+/** The OMX_SetupTunnel method will handle the necessary calls to the components\r
+    to setup the specified tunnel the two components.  NOTE: This is\r
+    an actual method (not a #define macro).  This method will make calls into\r
+    the component ComponentTunnelRequest method to do the actual tunnel \r
+    connection.  \r
+\r
+    The ComponentTunnelRequest method on both components will be called. \r
+    This method shall not be called unless the component is in the \r
+    OMX_StateLoaded state except when the ports used for the tunnel are\r
+    disabled. In this case, the component may be in the OMX_StateExecuting,\r
+    OMX_StatePause, or OMX_StateIdle states. \r
+\r
+    The core should return from this call within 20 msec.\r
+    \r
+    @param [in] hOutput\r
+        Handle of the component to be accessed.  Also this is the handle\r
+        of the component whose port, specified in the nPortOutput parameter\r
+        will be used the source for the tunnel. This is the component handle\r
+        returned by the call to the OMX_GetHandle function.  There is a \r
+        requirement that hOutput be the source for the data when\r
+        tunelling (i.e. nPortOutput is an output port).  If 0x0, the component\r
+        specified in hInput will have it's port specified in nPortInput\r
+        setup for communication with the application / IL client.\r
+    @param [in] nPortOutput\r
+        nPortOutput is used to select the source port on component to be\r
+        used in the tunnel. \r
+    @param [in] hInput\r
+        This is the component to setup the tunnel with. This is the handle\r
+        of the component whose port, specified in the nPortInput parameter\r
+        will be used the destination for the tunnel. This is the component handle\r
+        returned by the call to the OMX_GetHandle function.  There is a \r
+        requirement that hInput be the destination for the data when\r
+        tunelling (i.e. nPortInut is an input port).   If 0x0, the component\r
+        specified in hOutput will have it's port specified in nPortPOutput\r
+        setup for communication with the application / IL client.\r
+    @param [in] nPortInput\r
+        nPortInput is used to select the destination port on component to be\r
+        used in the tunnel.\r
+    @return OMX_ERRORTYPE\r
+        If the command successfully executes, the return code will be\r
+        OMX_ErrorNone.  Otherwise the appropriate OMX error will be returned.\r
+        When OMX_ErrorNotImplemented is returned, one or both components is \r
+        a non-interop component and does not support tunneling.\r
+        \r
+        On failure, the ports of both components are setup for communication\r
+        with the application / IL Client.\r
+    @ingroup core tun\r
+ */\r
+OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_SetupTunnel(\r
+    OMX_IN  OMX_HANDLETYPE hOutput,\r
+    OMX_IN  OMX_U32 nPortOutput,\r
+    OMX_IN  OMX_HANDLETYPE hInput,\r
+    OMX_IN  OMX_U32 nPortInput);\r
+    \r
+/** @ingroup cp */\r
+OMX_API OMX_ERRORTYPE   OMX_GetContentPipe(\r
+    OMX_OUT OMX_HANDLETYPE *hPipe,\r
+    OMX_IN OMX_STRING szURI);\r
+\r
+/** The OMX_GetComponentsOfRole method will return the number of components that support the given\r
+    role and (if the compNames field is non-NULL) the names of those components. The call will fail if \r
+    an insufficiently sized array of names is supplied. To ensure the array is sufficiently sized the\r
+    client should:\r
+        * first call this function with the compNames field NULL to determine the number of component names\r
+        * second call this function with the compNames field pointing to an array of names allocated \r
+          according to the number returned by the first call.\r
+\r
+    The core should return from this call within 5 msec.\r
+    \r
+    @param [in] role\r
+        This is generic standard component name consisting only of component class \r
+        name and the type within that class (e.g. 'audio_decoder.aac').\r
+    @param [inout] pNumComps\r
+        This is used both as input and output. \r
\r
+        If compNames is NULL, the input is ignored and the output specifies how many components support\r
+        the given role.\r
+     \r
+        If compNames is not NULL, on input it bounds the size of the input structure and \r
+        on output, it specifies the number of components string names listed within the compNames parameter.\r
+    @param [inout] compNames\r
+        If NULL this field is ignored. If non-NULL this points to an array of 128-byte strings which accepts \r
+        a list of the names of all physical components that implement the specified standard component name. \r
+        Each name is NULL terminated. numComps indicates the number of names.\r
+    @ingroup core\r
+ */\r
+OMX_API OMX_ERRORTYPE OMX_GetComponentsOfRole ( \r
+       OMX_IN      OMX_STRING role,\r
+    OMX_INOUT   OMX_U32 *pNumComps,\r
+    OMX_INOUT   OMX_U8  **compNames);\r
+\r
+/** The OMX_GetRolesOfComponent method will return the number of roles supported by the given\r
+    component and (if the roles field is non-NULL) the names of those roles. The call will fail if \r
+    an insufficiently sized array of names is supplied. To ensure the array is sufficiently sized the\r
+    client should:\r
+        * first call this function with the roles field NULL to determine the number of role names\r
+        * second call this function with the roles field pointing to an array of names allocated \r
+          according to the number returned by the first call.\r
+\r
+    The core should return from this call within 5 msec.\r
+\r
+    @param [in] compName\r
+        This is the name of the component being queried about.\r
+    @param [inout] pNumRoles\r
+        This is used both as input and output. \r
\r
+        If roles is NULL, the input is ignored and the output specifies how many roles the component supports.\r
+     \r
+        If compNames is not NULL, on input it bounds the size of the input structure and \r
+        on output, it specifies the number of roles string names listed within the roles parameter.\r
+    @param [out] roles\r
+        If NULL this field is ignored. If non-NULL this points to an array of 128-byte strings \r
+        which accepts a list of the names of all standard components roles implemented on the \r
+        specified component name. numComps indicates the number of names.\r
+    @ingroup core\r
+ */\r
+OMX_API OMX_ERRORTYPE OMX_GetRolesOfComponent ( \r
+       OMX_IN      OMX_STRING compName, \r
+    OMX_INOUT   OMX_U32 *pNumRoles,\r
+    OMX_OUT     OMX_U8 **roles);\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif /* __cplusplus */\r
+\r
+#endif\r
+/* File EOF */\r
+\r
diff --git a/modules/codec/omxil/OMX_IVCommon.h b/modules/codec/omxil/OMX_IVCommon.h
new file mode 100644 (file)
index 0000000..9b2ce2b
--- /dev/null
@@ -0,0 +1,920 @@
+/**\r
+ * Copyright (c) 2008 The Khronos Group Inc. \r
+ * \r
+ * Permission is hereby granted, free of charge, to any person obtaining\r
+ * a copy of this software and associated documentation files (the\r
+ * "Software"), to deal in the Software without restriction, including\r
+ * without limitation the rights to use, copy, modify, merge, publish,\r
+ * distribute, sublicense, and/or sell copies of the Software, and to\r
+ * permit persons to whom the Software is furnished to do so, subject\r
+ * to the following conditions: \r
+ * The above copyright notice and this permission notice shall be included\r
+ * in all copies or substantial portions of the Software. \r
+ * \r
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS\r
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\r
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\r
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\r
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\r
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \r
+ *\r
+ */\r
+\r
+/** \r
+ * @file OMX_IVCommon.h - OpenMax IL version 1.1.2\r
+ *  The structures needed by Video and Image components to exchange\r
+ *  parameters and configuration data with the components.\r
+ */\r
+#ifndef OMX_IVCommon_h\r
+#define OMX_IVCommon_h\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif /* __cplusplus */\r
+\r
+/**\r
+ * Each OMX header must include all required header files to allow the header\r
+ * to compile without errors.  The includes below are required for this header\r
+ * file to compile successfully \r
+ */\r
+\r
+#include <OMX_Core.h>\r
+\r
+/** @defgroup iv OpenMAX IL Imaging and Video Domain\r
+ * Common structures for OpenMAX IL Imaging and Video domains\r
+ * @{\r
+ */\r
+\r
+\r
+/** \r
+ * Enumeration defining possible uncompressed image/video formats. \r
+ *\r
+ * ENUMS:\r
+ *  Unused                 : Placeholder value when format is N/A\r
+ *  Monochrome             : black and white\r
+ *  8bitRGB332             : Red 7:5, Green 4:2, Blue 1:0\r
+ *  12bitRGB444            : Red 11:8, Green 7:4, Blue 3:0\r
+ *  16bitARGB4444          : Alpha 15:12, Red 11:8, Green 7:4, Blue 3:0\r
+ *  16bitARGB1555          : Alpha 15, Red 14:10, Green 9:5, Blue 4:0\r
+ *  16bitRGB565            : Red 15:11, Green 10:5, Blue 4:0\r
+ *  16bitBGR565            : Blue 15:11, Green 10:5, Red 4:0\r
+ *  18bitRGB666            : Red 17:12, Green 11:6, Blue 5:0\r
+ *  18bitARGB1665          : Alpha 17, Red 16:11, Green 10:5, Blue 4:0\r
+ *  19bitARGB1666          : Alpha 18, Red 17:12, Green 11:6, Blue 5:0\r
+ *  24bitRGB888            : Red 24:16, Green 15:8, Blue 7:0\r
+ *  24bitBGR888            : Blue 24:16, Green 15:8, Red 7:0\r
+ *  24bitARGB1887          : Alpha 23, Red 22:15, Green 14:7, Blue 6:0\r
+ *  25bitARGB1888          : Alpha 24, Red 23:16, Green 15:8, Blue 7:0\r
+ *  32bitBGRA8888          : Blue 31:24, Green 23:16, Red 15:8, Alpha 7:0\r
+ *  32bitARGB8888          : Alpha 31:24, Red 23:16, Green 15:8, Blue 7:0\r
+ *  YUV411Planar           : U,Y are subsampled by a factor of 4 horizontally\r
+ *  YUV411PackedPlanar     : packed per payload in planar slices\r
+ *  YUV420Planar           : Three arrays Y,U,V.\r
+ *  YUV420PackedPlanar     : packed per payload in planar slices\r
+ *  YUV420SemiPlanar       : Two arrays, one is all Y, the other is U and V\r
+ *  YUV422Planar           : Three arrays Y,U,V.\r
+ *  YUV422PackedPlanar     : packed per payload in planar slices\r
+ *  YUV422SemiPlanar       : Two arrays, one is all Y, the other is U and V\r
+ *  YCbYCr                 : Organized as 16bit YUYV (i.e. YCbYCr)\r
+ *  YCrYCb                 : Organized as 16bit YVYU (i.e. YCrYCb)\r
+ *  CbYCrY                 : Organized as 16bit UYVY (i.e. CbYCrY)\r
+ *  CrYCbY                 : Organized as 16bit VYUY (i.e. CrYCbY)\r
+ *  YUV444Interleaved      : Each pixel contains equal parts YUV\r
+ *  RawBayer8bit           : SMIA camera output format\r
+ *  RawBayer10bit          : SMIA camera output format\r
+ *  RawBayer8bitcompressed : SMIA camera output format\r
+ */\r
+typedef enum OMX_COLOR_FORMATTYPE {\r
+    OMX_COLOR_FormatUnused,\r
+    OMX_COLOR_FormatMonochrome,\r
+    OMX_COLOR_Format8bitRGB332,\r
+    OMX_COLOR_Format12bitRGB444,\r
+    OMX_COLOR_Format16bitARGB4444,\r
+    OMX_COLOR_Format16bitARGB1555,\r
+    OMX_COLOR_Format16bitRGB565,\r
+    OMX_COLOR_Format16bitBGR565,\r
+    OMX_COLOR_Format18bitRGB666,\r
+    OMX_COLOR_Format18bitARGB1665,\r
+    OMX_COLOR_Format19bitARGB1666, \r
+    OMX_COLOR_Format24bitRGB888,\r
+    OMX_COLOR_Format24bitBGR888,\r
+    OMX_COLOR_Format24bitARGB1887,\r
+    OMX_COLOR_Format25bitARGB1888,\r
+    OMX_COLOR_Format32bitBGRA8888,\r
+    OMX_COLOR_Format32bitARGB8888,\r
+    OMX_COLOR_FormatYUV411Planar,\r
+    OMX_COLOR_FormatYUV411PackedPlanar,\r
+    OMX_COLOR_FormatYUV420Planar,\r
+    OMX_COLOR_FormatYUV420PackedPlanar,\r
+    OMX_COLOR_FormatYUV420SemiPlanar,\r
+    OMX_COLOR_FormatYUV422Planar,\r
+    OMX_COLOR_FormatYUV422PackedPlanar,\r
+    OMX_COLOR_FormatYUV422SemiPlanar,\r
+    OMX_COLOR_FormatYCbYCr,\r
+    OMX_COLOR_FormatYCrYCb,\r
+    OMX_COLOR_FormatCbYCrY,\r
+    OMX_COLOR_FormatCrYCbY,\r
+    OMX_COLOR_FormatYUV444Interleaved,\r
+    OMX_COLOR_FormatRawBayer8bit,\r
+    OMX_COLOR_FormatRawBayer10bit,\r
+    OMX_COLOR_FormatRawBayer8bitcompressed,\r
+    OMX_COLOR_FormatL2, \r
+    OMX_COLOR_FormatL4, \r
+    OMX_COLOR_FormatL8, \r
+    OMX_COLOR_FormatL16, \r
+    OMX_COLOR_FormatL24, \r
+    OMX_COLOR_FormatL32,\r
+    OMX_COLOR_FormatYUV420PackedSemiPlanar,\r
+    OMX_COLOR_FormatYUV422PackedSemiPlanar,\r
+    OMX_COLOR_Format18BitBGR666,\r
+    OMX_COLOR_Format24BitARGB6666,\r
+    OMX_COLOR_Format24BitABGR6666,\r
+    OMX_COLOR_FormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ \r
+    OMX_COLOR_FormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */\r
+    OMX_COLOR_FormatMax = 0x7FFFFFFF\r
+} OMX_COLOR_FORMATTYPE;\r
+\r
+\r
+/** \r
+ * Defines the matrix for conversion from RGB to YUV or vice versa.\r
+ * iColorMatrix should be initialized with the fixed point values \r
+ * used in converting between formats.\r
+ */\r
+typedef struct OMX_CONFIG_COLORCONVERSIONTYPE {\r
+    OMX_U32 nSize;              /**< Size of the structure in bytes */\r
+    OMX_VERSIONTYPE nVersion;   /**< OMX specification version info */ \r
+    OMX_U32 nPortIndex;         /**< Port that this struct applies to */\r
+    OMX_S32 xColorMatrix[3][3]; /**< Stored in signed Q16 format */\r
+    OMX_S32 xColorOffset[4];    /**< Stored in signed Q16 format */\r
+}OMX_CONFIG_COLORCONVERSIONTYPE;\r
+\r
+\r
+/** \r
+ * Structure defining percent to scale each frame dimension.  For example:  \r
+ * To make the width 50% larger, use fWidth = 1.5 and to make the width\r
+ * 1/2 the original size, use fWidth = 0.5\r
+ */\r
+typedef struct OMX_CONFIG_SCALEFACTORTYPE {\r
+    OMX_U32 nSize;            /**< Size of the structure in bytes */\r
+    OMX_VERSIONTYPE nVersion; /**< OMX specification version info */ \r
+    OMX_U32 nPortIndex;       /**< Port that this struct applies to */\r
+    OMX_S32 xWidth;           /**< Fixed point value stored as Q16 */\r
+    OMX_S32 xHeight;          /**< Fixed point value stored as Q16 */\r
+}OMX_CONFIG_SCALEFACTORTYPE;\r
+\r
+\r
+/** \r
+ * Enumeration of possible image filter types \r
+ */\r
+typedef enum OMX_IMAGEFILTERTYPE {\r
+    OMX_ImageFilterNone,\r
+    OMX_ImageFilterNoise,\r
+    OMX_ImageFilterEmboss,\r
+    OMX_ImageFilterNegative,\r
+    OMX_ImageFilterSketch,\r
+    OMX_ImageFilterOilPaint,\r
+    OMX_ImageFilterHatch,\r
+    OMX_ImageFilterGpen,\r
+    OMX_ImageFilterAntialias, \r
+    OMX_ImageFilterDeRing,       \r
+    OMX_ImageFilterSolarize,\r
+    OMX_ImageFilterKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ \r
+    OMX_ImageFilterVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */\r
+    OMX_ImageFilterMax = 0x7FFFFFFF\r
+} OMX_IMAGEFILTERTYPE;\r
+\r
+\r
+/** \r
+ * Image filter configuration \r
+ *\r
+ * STRUCT MEMBERS:\r
+ *  nSize        : Size of the structure in bytes       \r
+ *  nVersion     : OMX specification version information\r
+ *  nPortIndex   : Port that this structure applies to \r
+ *  eImageFilter : Image filter type enumeration      \r
+ */\r
+typedef struct OMX_CONFIG_IMAGEFILTERTYPE {\r
+    OMX_U32 nSize;\r
+    OMX_VERSIONTYPE nVersion;\r
+    OMX_U32 nPortIndex;\r
+    OMX_IMAGEFILTERTYPE eImageFilter;\r
+} OMX_CONFIG_IMAGEFILTERTYPE;\r
+\r
+\r
+/** \r
+ * Customized U and V for color enhancement \r
+ *\r
+ * STRUCT MEMBERS:\r
+ *  nSize             : Size of the structure in bytes\r
+ *  nVersion          : OMX specification version information \r
+ *  nPortIndex        : Port that this structure applies to\r
+ *  bColorEnhancement : Enable/disable color enhancement\r
+ *  nCustomizedU      : Practical values: 16-240, range: 0-255, value set for \r
+ *                      U component\r
+ *  nCustomizedV      : Practical values: 16-240, range: 0-255, value set for \r
+ *                      V component\r
+ */\r
+typedef struct OMX_CONFIG_COLORENHANCEMENTTYPE {\r
+    OMX_U32 nSize;\r
+    OMX_VERSIONTYPE nVersion; \r
+    OMX_U32 nPortIndex;\r
+    OMX_BOOL bColorEnhancement;\r
+    OMX_U8 nCustomizedU;\r
+    OMX_U8 nCustomizedV;\r
+} OMX_CONFIG_COLORENHANCEMENTTYPE;\r
+\r
+\r
+/** \r
+ * Define color key and color key mask \r
+ *\r
+ * STRUCT MEMBERS:\r
+ *  nSize      : Size of the structure in bytes\r
+ *  nVersion   : OMX specification version information \r
+ *  nPortIndex : Port that this structure applies to\r
+ *  nARGBColor : 32bit Alpha, Red, Green, Blue Color\r
+ *  nARGBMask  : 32bit Mask for Alpha, Red, Green, Blue channels\r
+ */\r
+typedef struct OMX_CONFIG_COLORKEYTYPE {\r
+    OMX_U32 nSize;\r
+    OMX_VERSIONTYPE nVersion;\r
+    OMX_U32 nPortIndex;\r
+    OMX_U32 nARGBColor;\r
+    OMX_U32 nARGBMask;\r
+} OMX_CONFIG_COLORKEYTYPE;\r
+\r
+\r
+/** \r
+ * List of color blend types for pre/post processing \r
+ *\r
+ * ENUMS:\r
+ *  None          : No color blending present\r
+ *  AlphaConstant : Function is (alpha_constant * src) + \r
+ *                  (1 - alpha_constant) * dst)\r
+ *  AlphaPerPixel : Function is (alpha * src) + (1 - alpha) * dst)\r
+ *  Alternate     : Function is alternating pixels from src and dst\r
+ *  And           : Function is (src & dst)\r
+ *  Or            : Function is (src | dst)\r
+ *  Invert        : Function is ~src\r
+ */\r
+typedef enum OMX_COLORBLENDTYPE {\r
+    OMX_ColorBlendNone,\r
+    OMX_ColorBlendAlphaConstant,\r
+    OMX_ColorBlendAlphaPerPixel,\r
+    OMX_ColorBlendAlternate,\r
+    OMX_ColorBlendAnd,\r
+    OMX_ColorBlendOr,\r
+    OMX_ColorBlendInvert,\r
+    OMX_ColorBlendKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ \r
+    OMX_ColorBlendVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */\r
+    OMX_ColorBlendMax = 0x7FFFFFFF\r
+} OMX_COLORBLENDTYPE;\r
+\r
+\r
+/** \r
+ * Color blend configuration \r
+ *\r
+ * STRUCT MEMBERS:\r
+ *  nSize             : Size of the structure in bytes                        \r
+ *  nVersion          : OMX specification version information                \r
+ *  nPortIndex        : Port that this structure applies to                   \r
+ *  nRGBAlphaConstant : Constant global alpha values when global alpha is used\r
+ *  eColorBlend       : Color blend type enumeration                         \r
+ */\r
+typedef struct OMX_CONFIG_COLORBLENDTYPE {\r
+    OMX_U32 nSize;\r
+    OMX_VERSIONTYPE nVersion;\r
+    OMX_U32 nPortIndex;\r
+    OMX_U32 nRGBAlphaConstant;\r
+    OMX_COLORBLENDTYPE  eColorBlend;\r
+} OMX_CONFIG_COLORBLENDTYPE;\r
+\r
+\r
+/** \r
+ * Hold frame dimension\r
+ *\r
+ * STRUCT MEMBERS:\r
+ *  nSize      : Size of the structure in bytes      \r
+ *  nVersion   : OMX specification version information\r
+ *  nPortIndex : Port that this structure applies to     \r
+ *  nWidth     : Frame width in pixels                 \r
+ *  nHeight    : Frame height in pixels                \r
+ */\r
+typedef struct OMX_FRAMESIZETYPE {\r
+    OMX_U32 nSize;\r
+    OMX_VERSIONTYPE nVersion;\r
+    OMX_U32 nPortIndex;\r
+    OMX_U32 nWidth;\r
+    OMX_U32 nHeight;\r
+} OMX_FRAMESIZETYPE;\r
+\r
+\r
+/**\r
+ * Rotation configuration \r
+ *\r
+ * STRUCT MEMBERS:\r
+ *  nSize      : Size of the structure in bytes             \r
+ *  nVersion   : OMX specification version information\r
+ *  nPortIndex : Port that this structure applies to\r
+ *  nRotation  : +/- integer rotation value               \r
+ */\r
+typedef struct OMX_CONFIG_ROTATIONTYPE {\r
+    OMX_U32 nSize;\r
+    OMX_VERSIONTYPE nVersion;\r
+    OMX_U32 nPortIndex;\r
+    OMX_S32 nRotation; \r
+} OMX_CONFIG_ROTATIONTYPE;\r
+\r
+\r
+/** \r
+ * Possible mirroring directions for pre/post processing \r
+ *\r
+ * ENUMS:\r
+ *  None       : No mirroring                         \r
+ *  Vertical   : Vertical mirroring, flip on X axis   \r
+ *  Horizontal : Horizontal mirroring, flip on Y axis  \r
+ *  Both       : Both vertical and horizontal mirroring\r
+ */\r
+typedef enum OMX_MIRRORTYPE {\r
+    OMX_MirrorNone = 0,\r
+    OMX_MirrorVertical,\r
+    OMX_MirrorHorizontal,\r
+    OMX_MirrorBoth, \r
+    OMX_MirrorKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ \r
+    OMX_MirrorVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */\r
+    OMX_MirrorMax = 0x7FFFFFFF   \r
+} OMX_MIRRORTYPE;\r
+\r
+\r
+/** \r
+ * Mirroring configuration \r
+ *\r
+ * STRUCT MEMBERS:\r
+ *  nSize      : Size of the structure in bytes      \r
+ *  nVersion   : OMX specification version information\r
+ *  nPortIndex : Port that this structure applies to  \r
+ *  eMirror    : Mirror type enumeration              \r
+ */\r
+typedef struct OMX_CONFIG_MIRRORTYPE {\r
+    OMX_U32 nSize;\r
+    OMX_VERSIONTYPE nVersion; \r
+    OMX_U32 nPortIndex;\r
+    OMX_MIRRORTYPE  eMirror;\r
+} OMX_CONFIG_MIRRORTYPE;\r
+\r
+\r
+/** \r
+ * Position information only \r
+ *\r
+ * STRUCT MEMBERS:\r
+ *  nSize      : Size of the structure in bytes               \r
+ *  nVersion   : OMX specification version information\r
+ *  nPortIndex : Port that this structure applies to\r
+ *  nX         : X coordinate for the point                     \r
+ *  nY         : Y coordinate for the point \r
+ */                      \r
+typedef struct OMX_CONFIG_POINTTYPE {\r
+    OMX_U32 nSize;\r
+    OMX_VERSIONTYPE nVersion;\r
+    OMX_U32 nPortIndex;\r
+    OMX_S32 nX;\r
+    OMX_S32 nY;\r
+} OMX_CONFIG_POINTTYPE;\r
+\r
+\r
+/** \r
+ * Frame size plus position \r
+ *\r
+ * STRUCT MEMBERS:\r
+ *  nSize      : Size of the structure in bytes                    \r
+ *  nVersion   : OMX specification version information      \r
+ *  nPortIndex : Port that this structure applies to    \r
+ *  nLeft      : X Coordinate of the top left corner of the rectangle\r
+ *  nTop       : Y Coordinate of the top left corner of the rectangle\r
+ *  nWidth     : Width of the rectangle                              \r
+ *  nHeight    : Height of the rectangle                             \r
+ */\r
+typedef struct OMX_CONFIG_RECTTYPE {\r
+    OMX_U32 nSize;\r
+    OMX_VERSIONTYPE nVersion;  \r
+    OMX_U32 nPortIndex; \r
+    OMX_S32 nLeft; \r
+    OMX_S32 nTop;\r
+    OMX_U32 nWidth;\r
+    OMX_U32 nHeight;\r
+} OMX_CONFIG_RECTTYPE;\r
+\r
+\r
+/** \r
+ * Deblocking state; it is required to be set up before starting the codec \r
+ *\r
+ * STRUCT MEMBERS:\r
+ *  nSize       : Size of the structure in bytes      \r
+ *  nVersion    : OMX specification version information \r
+ *  nPortIndex  : Port that this structure applies to\r
+ *  bDeblocking : Enable/disable deblocking mode    \r
+ */\r
+typedef struct OMX_PARAM_DEBLOCKINGTYPE {\r
+    OMX_U32 nSize;\r
+    OMX_VERSIONTYPE nVersion;\r
+    OMX_U32 nPortIndex;\r
+    OMX_BOOL bDeblocking;\r
+} OMX_PARAM_DEBLOCKINGTYPE;\r
+\r
+\r
+/** \r
+ * Stabilization state \r
+ *\r
+ * STRUCT MEMBERS:\r
+ *  nSize      : Size of the structure in bytes          \r
+ *  nVersion   : OMX specification version information    \r
+ *  nPortIndex : Port that this structure applies to   \r
+ *  bStab      : Enable/disable frame stabilization state\r
+ */\r
+typedef struct OMX_CONFIG_FRAMESTABTYPE {\r
+    OMX_U32 nSize;\r
+    OMX_VERSIONTYPE nVersion;\r
+    OMX_U32 nPortIndex;\r
+    OMX_BOOL bStab;\r
+} OMX_CONFIG_FRAMESTABTYPE;\r
+\r
+\r
+/** \r
+ * White Balance control type \r
+ *\r
+ * STRUCT MEMBERS:\r
+ *  SunLight : Referenced in JSR-234\r
+ *  Flash    : Optimal for device's integrated flash\r
+ */\r
+typedef enum OMX_WHITEBALCONTROLTYPE {\r
+    OMX_WhiteBalControlOff = 0,\r
+    OMX_WhiteBalControlAuto,\r
+    OMX_WhiteBalControlSunLight,\r
+    OMX_WhiteBalControlCloudy,\r
+    OMX_WhiteBalControlShade,\r
+    OMX_WhiteBalControlTungsten,\r
+    OMX_WhiteBalControlFluorescent,\r
+    OMX_WhiteBalControlIncandescent,\r
+    OMX_WhiteBalControlFlash,\r
+    OMX_WhiteBalControlHorizon,\r
+    OMX_WhiteBalControlKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ \r
+    OMX_WhiteBalControlVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */\r
+    OMX_WhiteBalControlMax = 0x7FFFFFFF\r
+} OMX_WHITEBALCONTROLTYPE;\r
+\r
+\r
+/** \r
+ * White Balance control configuration \r
+ *\r
+ * STRUCT MEMBERS:\r
+ *  nSize            : Size of the structure in bytes       \r
+ *  nVersion         : OMX specification version information\r
+ *  nPortIndex       : Port that this structure applies to                 \r
+ *  eWhiteBalControl : White balance enumeration            \r
+ */\r
+typedef struct OMX_CONFIG_WHITEBALCONTROLTYPE {\r
+    OMX_U32 nSize;\r
+    OMX_VERSIONTYPE nVersion;\r
+    OMX_U32 nPortIndex;\r
+    OMX_WHITEBALCONTROLTYPE eWhiteBalControl;\r
+} OMX_CONFIG_WHITEBALCONTROLTYPE;\r
+\r
+\r
+/** \r
+ * Exposure control type \r
+ */\r
+typedef enum OMX_EXPOSURECONTROLTYPE {\r
+    OMX_ExposureControlOff = 0,\r
+    OMX_ExposureControlAuto,\r
+    OMX_ExposureControlNight,\r
+    OMX_ExposureControlBackLight,\r
+    OMX_ExposureControlSpotLight,\r
+    OMX_ExposureControlSports,\r
+    OMX_ExposureControlSnow,\r
+    OMX_ExposureControlBeach,\r
+    OMX_ExposureControlLargeAperture,\r
+    OMX_ExposureControlSmallApperture,\r
+    OMX_ExposureControlKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ \r
+    OMX_ExposureControlVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */\r
+    OMX_ExposureControlMax = 0x7FFFFFFF\r
+} OMX_EXPOSURECONTROLTYPE;\r
+\r
+\r
+/** \r
+ * White Balance control configuration \r
+ *\r
+ * STRUCT MEMBERS:\r
+ *  nSize            : Size of the structure in bytes      \r
+ *  nVersion         : OMX specification version information\r
+ *  nPortIndex       : Port that this structure applies to                \r
+ *  eExposureControl : Exposure control enumeration         \r
+ */\r
+typedef struct OMX_CONFIG_EXPOSURECONTROLTYPE {\r
+    OMX_U32 nSize;\r
+    OMX_VERSIONTYPE nVersion;\r
+    OMX_U32 nPortIndex;\r
+    OMX_EXPOSURECONTROLTYPE eExposureControl;\r
+} OMX_CONFIG_EXPOSURECONTROLTYPE;\r
+\r
+\r
+/** \r
+ * Defines sensor supported mode. \r
+ *\r
+ * STRUCT MEMBERS:\r
+ *  nSize      : Size of the structure in bytes           \r
+ *  nVersion   : OMX specification version information\r
+ *  nPortIndex : Port that this structure applies to \r
+ *  nFrameRate : Single shot mode is indicated by a 0     \r
+ *  bOneShot   : Enable for single shot, disable for streaming\r
+ *  sFrameSize : Framesize                                          \r
+ */\r
+typedef struct OMX_PARAM_SENSORMODETYPE {\r
+    OMX_U32 nSize;\r
+    OMX_VERSIONTYPE nVersion;\r
+    OMX_U32 nPortIndex;\r
+    OMX_U32 nFrameRate;\r
+    OMX_BOOL bOneShot;\r
+    OMX_FRAMESIZETYPE sFrameSize;\r
+} OMX_PARAM_SENSORMODETYPE;\r
+\r
+\r
+/** \r
+ * Defines contrast level \r
+ *\r
+ * STRUCT MEMBERS:\r
+ *  nSize      : Size of the structure in bytes                              \r
+ *  nVersion   : OMX specification version information                \r
+ *  nPortIndex : Port that this structure applies to                 \r
+ *  nContrast  : Values allowed for contrast -100 to 100, zero means no change\r
+ */\r
+typedef struct OMX_CONFIG_CONTRASTTYPE {\r
+    OMX_U32 nSize;\r
+    OMX_VERSIONTYPE nVersion;\r
+    OMX_U32 nPortIndex;\r
+    OMX_S32 nContrast;\r
+} OMX_CONFIG_CONTRASTTYPE;\r
+\r
+\r
+/** \r
+ * Defines brightness level \r
+ *\r
+ * STRUCT MEMBERS:\r
+ *  nSize       : Size of the structure in bytes          \r
+ *  nVersion    : OMX specification version information \r
+ *  nPortIndex  : Port that this structure applies to \r
+ *  nBrightness : 0-100%        \r
+ */\r
+typedef struct OMX_CONFIG_BRIGHTNESSTYPE {\r
+    OMX_U32 nSize;\r
+    OMX_VERSIONTYPE nVersion;\r
+    OMX_U32 nPortIndex;\r
+    OMX_U32 nBrightness;\r
+} OMX_CONFIG_BRIGHTNESSTYPE;\r
+\r
+\r
+/** \r
+ * Defines backlight level configuration for a video sink, e.g. LCD panel \r
+ *\r
+ * STRUCT MEMBERS:\r
+ *  nSize      : Size of the structure in bytes\r
+ *  nVersion   : OMX specification version information \r
+ *  nPortIndex : Port that this structure applies to\r
+ *  nBacklight : Values allowed for backlight 0-100%\r
+ *  nTimeout   : Number of milliseconds before backlight automatically turns \r
+ *               off.  A value of 0x0 disables backight timeout \r
+ */\r
+typedef struct OMX_CONFIG_BACKLIGHTTYPE {\r
+    OMX_U32 nSize;\r
+    OMX_VERSIONTYPE nVersion;\r
+    OMX_U32 nPortIndex;\r
+    OMX_U32 nBacklight;\r
+    OMX_U32 nTimeout;\r
+} OMX_CONFIG_BACKLIGHTTYPE;\r
+\r
+\r
+/** \r
+ * Defines setting for Gamma \r
+ *\r
+ * STRUCT MEMBERS:\r
+ *  nSize      : Size of the structure in bytes\r
+ *  nVersion   : OMX specification version information \r
+ *  nPortIndex : Port that this structure applies to\r
+ *  nGamma     : Values allowed for gamma -100 to 100, zero means no change\r
+ */\r
+typedef struct OMX_CONFIG_GAMMATYPE {\r
+    OMX_U32 nSize;\r
+    OMX_VERSIONTYPE nVersion;\r
+    OMX_U32 nPortIndex;\r
+    OMX_S32 nGamma;\r
+} OMX_CONFIG_GAMMATYPE;\r
+\r
+\r
+/** \r
+ * Define for setting saturation \r
+ * \r
+ * STRUCT MEMBERS:\r
+ *  nSize       : Size of the structure in bytes\r
+ *  nVersion    : OMX specification version information\r
+ *  nPortIndex  : Port that this structure applies to\r
+ *  nSaturation : Values allowed for saturation -100 to 100, zero means \r
+ *                no change\r
+ */\r
+typedef struct OMX_CONFIG_SATURATIONTYPE {\r
+    OMX_U32 nSize;\r
+    OMX_VERSIONTYPE nVersion;\r
+    OMX_U32 nPortIndex;\r
+    OMX_S32 nSaturation;\r
+} OMX_CONFIG_SATURATIONTYPE;\r
+\r
+\r
+/** \r
+ * Define for setting Lightness \r
+ *\r
+ * STRUCT MEMBERS:\r
+ *  nSize      : Size of the structure in bytes\r
+ *  nVersion   : OMX specification version information\r
+ *  nPortIndex : Port that this structure applies to\r
+ *  nLightness : Values allowed for lightness -100 to 100, zero means no \r
+ *               change\r
+ */\r
+typedef struct OMX_CONFIG_LIGHTNESSTYPE {\r
+    OMX_U32 nSize;\r
+    OMX_VERSIONTYPE nVersion;\r
+    OMX_U32 nPortIndex;\r
+    OMX_S32 nLightness;\r
+} OMX_CONFIG_LIGHTNESSTYPE;\r
+\r
+\r
+/** \r
+ * Plane blend configuration \r
+ *\r
+ * STRUCT MEMBERS:\r
+ *  nSize      : Size of the structure in bytes \r
+ *  nVersion   : OMX specification version information\r
+ *  nPortIndex : Index of input port associated with the plane.\r
+ *  nDepth     : Depth of the plane in relation to the screen. Higher \r
+ *               numbered depths are "behind" lower number depths.  \r
+ *               This number defaults to the Port Index number.\r
+ *  nAlpha     : Transparency blending component for the entire plane.  \r
+ *               See blending modes for more detail.\r
+ */\r
+typedef struct OMX_CONFIG_PLANEBLENDTYPE {\r
+    OMX_U32 nSize;\r
+    OMX_VERSIONTYPE nVersion;\r
+    OMX_U32 nPortIndex;\r
+    OMX_U32 nDepth;\r
+    OMX_U32 nAlpha;\r
+} OMX_CONFIG_PLANEBLENDTYPE;\r
+\r
+\r
+/** \r
+ * Define interlace type\r
+ *\r
+ * STRUCT MEMBERS:\r
+ *  nSize                 : Size of the structure in bytes \r
+ *  nVersion              : OMX specification version information \r
+ *  nPortIndex            : Port that this structure applies to\r
+ *  bEnable               : Enable control variable for this functionality \r
+ *                          (see below)\r
+ *  nInterleavePortIndex  : Index of input or output port associated with  \r
+ *                          the interleaved plane. \r
+ *  pPlanarPortIndexes[4] : Index of input or output planar ports.\r
+ */\r
+typedef struct OMX_PARAM_INTERLEAVETYPE {\r
+    OMX_U32 nSize;\r
+    OMX_VERSIONTYPE nVersion;\r
+    OMX_U32 nPortIndex;\r
+    OMX_BOOL bEnable;\r
+    OMX_U32 nInterleavePortIndex;\r
+} OMX_PARAM_INTERLEAVETYPE;\r
+\r
+\r
+/** \r
+ * Defines the picture effect used for an input picture \r
+ */\r
+typedef enum OMX_TRANSITIONEFFECTTYPE {\r
+    OMX_EffectNone,\r
+    OMX_EffectFadeFromBlack,\r
+    OMX_EffectFadeToBlack,\r
+    OMX_EffectUnspecifiedThroughConstantColor,\r
+    OMX_EffectDissolve,\r
+    OMX_EffectWipe,\r
+    OMX_EffectUnspecifiedMixOfTwoScenes,\r
+    OMX_EffectKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ \r
+    OMX_EffectVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */\r
+    OMX_EffectMax = 0x7FFFFFFF\r
+} OMX_TRANSITIONEFFECTTYPE;\r
+\r
+\r
+/** \r
+ * Structure used to configure current transition effect \r
+ *\r
+ * STRUCT MEMBERS:\r
+ * nSize      : Size of the structure in bytes\r
+ * nVersion   : OMX specification version information \r
+ * nPortIndex : Port that this structure applies to\r
+ * eEffect    : Effect to enable\r
+ */\r
+typedef struct OMX_CONFIG_TRANSITIONEFFECTTYPE {\r
+    OMX_U32 nSize;\r
+    OMX_VERSIONTYPE nVersion;\r
+    OMX_U32 nPortIndex;\r
+    OMX_TRANSITIONEFFECTTYPE eEffect;\r
+} OMX_CONFIG_TRANSITIONEFFECTTYPE;\r
+\r
+\r
+/** \r
+ * Defines possible data unit types for encoded video data. The data unit \r
+ * types are used both for encoded video input for playback as well as\r
+ * encoded video output from recording. \r
+ */\r
+typedef enum OMX_DATAUNITTYPE {\r
+    OMX_DataUnitCodedPicture,\r
+    OMX_DataUnitVideoSegment,\r
+    OMX_DataUnitSeveralSegments,\r
+    OMX_DataUnitArbitraryStreamSection,\r
+    OMX_DataUnitKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ \r
+    OMX_DataUnitVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */\r
+    OMX_DataUnitMax = 0x7FFFFFFF\r
+} OMX_DATAUNITTYPE;\r
+\r
+\r
+/** \r
+ * Defines possible encapsulation types for coded video data unit. The \r
+ * encapsulation information is used both for encoded video input for \r
+ * playback as well as encoded video output from recording. \r
+ */\r
+typedef enum OMX_DATAUNITENCAPSULATIONTYPE {\r
+    OMX_DataEncapsulationElementaryStream,\r
+    OMX_DataEncapsulationGenericPayload,\r
+    OMX_DataEncapsulationRtpPayload,\r
+    OMX_DataEncapsulationKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ \r
+    OMX_DataEncapsulationVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */\r
+    OMX_DataEncapsulationMax = 0x7FFFFFFF\r
+} OMX_DATAUNITENCAPSULATIONTYPE;\r
+\r
+\r
+/** \r
+ * Structure used to configure the type of being decoded/encoded \r
+ */\r
+typedef struct OMX_PARAM_DATAUNITTYPE {\r
+    OMX_U32 nSize;            /**< Size of the structure in bytes */\r
+    OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ \r
+    OMX_U32 nPortIndex;       /**< Port that this structure applies to */\r
+    OMX_DATAUNITTYPE eUnitType;\r
+    OMX_DATAUNITENCAPSULATIONTYPE eEncapsulationType;\r
+} OMX_PARAM_DATAUNITTYPE;\r
+\r
+\r
+/**\r
+ * Defines dither types \r
+ */\r
+typedef enum OMX_DITHERTYPE {\r
+    OMX_DitherNone,\r
+    OMX_DitherOrdered,\r
+    OMX_DitherErrorDiffusion,\r
+    OMX_DitherOther,\r
+    OMX_DitherKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ \r
+    OMX_DitherVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */\r
+    OMX_DitherMax = 0x7FFFFFFF\r
+} OMX_DITHERTYPE;\r
+\r
+\r
+/** \r
+ * Structure used to configure current type of dithering \r
+ */\r
+typedef struct OMX_CONFIG_DITHERTYPE {\r
+    OMX_U32 nSize;            /**< Size of the structure in bytes */\r
+    OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ \r
+    OMX_U32 nPortIndex;       /**< Port that this structure applies to */\r
+    OMX_DITHERTYPE eDither;   /**< Type of dithering to use */\r
+} OMX_CONFIG_DITHERTYPE;\r
+\r
+typedef struct OMX_CONFIG_CAPTUREMODETYPE {\r
+    OMX_U32 nSize;\r
+    OMX_VERSIONTYPE nVersion;\r
+    OMX_U32 nPortIndex;     /**< Port that this structure applies to */\r
+    OMX_BOOL bContinuous;   /**< If true then ignore frame rate and emit capture \r
+                             *   data as fast as possible (otherwise obey port's frame rate). */\r
+    OMX_BOOL bFrameLimited; /**< If true then terminate capture after the port emits the \r
+                             *   specified number of frames (otherwise the port does not \r
+                             *   terminate the capture until instructed to do so by the client). \r
+                             *   Even if set, the client may manually terminate the capture prior \r
+                             *   to reaching the limit. */\r
+    OMX_U32 nFrameLimit;      /**< Limit on number of frames emitted during a capture (only\r
+                               *   valid if bFrameLimited is set). */\r
+} OMX_CONFIG_CAPTUREMODETYPE;\r
+\r
+typedef enum OMX_METERINGTYPE {\r
\r
+    OMX_MeteringModeAverage,     /**< Center-weighted average metering. */\r
+    OMX_MeteringModeSpot,            /**< Spot (partial) metering. */\r
+    OMX_MeteringModeMatrix,      /**< Matrix or evaluative metering. */\r
\r
+    OMX_MeteringKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ \r
+    OMX_MeteringVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */\r
+    OMX_EVModeMax = 0x7fffffff\r
+} OMX_METERINGTYPE;\r
\r
+typedef struct OMX_CONFIG_EXPOSUREVALUETYPE {\r
+    OMX_U32 nSize;\r
+    OMX_VERSIONTYPE nVersion;\r
+    OMX_U32 nPortIndex;\r
+    OMX_METERINGTYPE eMetering;\r
+    OMX_S32 xEVCompensation;      /**< Fixed point value stored as Q16 */\r
+    OMX_U32 nApertureFNumber;     /**< e.g. nApertureFNumber = 2 implies "f/2" - Q16 format */\r
+    OMX_BOOL bAutoAperture;            /**< Whether aperture number is defined automatically */\r
+    OMX_U32 nShutterSpeedMsec;    /**< Shutterspeed in milliseconds */ \r
+    OMX_BOOL bAutoShutterSpeed;        /**< Whether shutter speed is defined automatically */ \r
+    OMX_U32 nSensitivity;         /**< e.g. nSensitivity = 100 implies "ISO 100" */\r
+    OMX_BOOL bAutoSensitivity; /**< Whether sensitivity is defined automatically */\r
+} OMX_CONFIG_EXPOSUREVALUETYPE;\r
+\r
+/** \r
+ * Focus region configuration \r
+ *\r
+ * STRUCT MEMBERS:\r
+ *  nSize           : Size of the structure in bytes\r
+ *  nVersion        : OMX specification version information\r
+ *  nPortIndex      : Port that this structure applies to\r
+ *  bCenter         : Use center region as focus region of interest\r
+ *  bLeft           : Use left region as focus region of interest\r
+ *  bRight          : Use right region as focus region of interest\r
+ *  bTop            : Use top region as focus region of interest\r
+ *  bBottom         : Use bottom region as focus region of interest\r
+ *  bTopLeft        : Use top left region as focus region of interest\r
+ *  bTopRight       : Use top right region as focus region of interest\r
+ *  bBottomLeft     : Use bottom left region as focus region of interest\r
+ *  bBottomRight    : Use bottom right region as focus region of interest\r
+ */\r
+typedef struct OMX_CONFIG_FOCUSREGIONTYPE {\r
+    OMX_U32 nSize;\r
+    OMX_VERSIONTYPE nVersion;\r
+    OMX_U32 nPortIndex;\r
+    OMX_BOOL bCenter;\r
+    OMX_BOOL bLeft;\r
+    OMX_BOOL bRight;\r
+    OMX_BOOL bTop;\r
+    OMX_BOOL bBottom;\r
+    OMX_BOOL bTopLeft;\r
+    OMX_BOOL bTopRight;\r
+    OMX_BOOL bBottomLeft;\r
+    OMX_BOOL bBottomRight;\r
+} OMX_CONFIG_FOCUSREGIONTYPE;\r
+\r
+/** \r
+ * Focus Status type \r
+ */\r
+typedef enum OMX_FOCUSSTATUSTYPE {\r
+    OMX_FocusStatusOff = 0,\r
+    OMX_FocusStatusRequest,\r
+    OMX_FocusStatusReached,\r
+    OMX_FocusStatusUnableToReach,\r
+    OMX_FocusStatusLost,\r
+    OMX_FocusStatusKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ \r
+    OMX_FocusStatusVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */\r
+    OMX_FocusStatusMax = 0x7FFFFFFF\r
+} OMX_FOCUSSTATUSTYPE;\r
+\r
+/** \r
+ * Focus status configuration \r
+ *\r
+ * STRUCT MEMBERS:\r
+ *  nSize               : Size of the structure in bytes\r
+ *  nVersion            : OMX specification version information\r
+ *  nPortIndex          : Port that this structure applies to\r
+ *  eFocusStatus        : Specifies the focus status\r
+ *  bCenterStatus       : Use center region as focus region of interest\r
+ *  bLeftStatus         : Use left region as focus region of interest\r
+ *  bRightStatus        : Use right region as focus region of interest\r
+ *  bTopStatus          : Use top region as focus region of interest\r
+ *  bBottomStatus       : Use bottom region as focus region of interest\r
+ *  bTopLeftStatus      : Use top left region as focus region of interest\r
+ *  bTopRightStatus     : Use top right region as focus region of interest\r
+ *  bBottomLeftStatus   : Use bottom left region as focus region of interest\r
+ *  bBottomRightStatus  : Use bottom right region as focus region of interest\r
+ */\r
+typedef struct OMX_PARAM_FOCUSSTATUSTYPE {\r
+    OMX_U32 nSize;\r
+    OMX_VERSIONTYPE nVersion;\r
+    OMX_U32 nPortIndex;\r
+    OMX_FOCUSSTATUSTYPE eFocusStatus;\r
+    OMX_BOOL bCenterStatus;\r
+    OMX_BOOL bLeftStatus;\r
+    OMX_BOOL bRightStatus;\r
+    OMX_BOOL bTopStatus;\r
+    OMX_BOOL bBottomStatus;\r
+    OMX_BOOL bTopLeftStatus;\r
+    OMX_BOOL bTopRightStatus;\r
+    OMX_BOOL bBottomLeftStatus;\r
+    OMX_BOOL bBottomRightStatus;\r
+} OMX_PARAM_FOCUSSTATUSTYPE;\r
+\r
+/** @} */\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif /* __cplusplus */\r
+\r
+#endif\r
+/* File EOF */\r
diff --git a/modules/codec/omxil/OMX_Image.h b/modules/codec/omxil/OMX_Image.h
new file mode 100644 (file)
index 0000000..840a068
--- /dev/null
@@ -0,0 +1,328 @@
+/**\r
+ * Copyright (c) 2008 The Khronos Group Inc. \r
+ * \r
+ * Permission is hereby granted, free of charge, to any person obtaining\r
+ * a copy of this software and associated documentation files (the\r
+ * "Software"), to deal in the Software without restriction, including\r
+ * without limitation the rights to use, copy, modify, merge, publish,\r
+ * distribute, sublicense, and/or sell copies of the Software, and to\r
+ * permit persons to whom the Software is furnished to do so, subject\r
+ * to the following conditions: \r
+ * The above copyright notice and this permission notice shall be included\r
+ * in all copies or substantial portions of the Software. \r
+ * \r
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS\r
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\r
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\r
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\r
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\r
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \r
+ */\r
+\r
+/** \r
+ * @file OMX_Image.h - OpenMax IL version 1.1.2\r
+ * The structures needed by Image components to exchange parameters and \r
+ * configuration data with the components.\r
+ */\r
+#ifndef OMX_Image_h\r
+#define OMX_Image_h\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif /* __cplusplus */\r
+\r
+\r
+/**\r
+ * Each OMX header must include all required header files to allow the \r
+ * header to compile without errors.  The includes below are required  \r
+ * for this header file to compile successfully \r
+ */\r
+\r
+#include <OMX_IVCommon.h>\r
+\r
+/** @defgroup imaging OpenMAX IL Imaging Domain\r
+ * @ingroup iv\r
+ * Structures for OpenMAX IL Imaging domain\r
+ * @{\r
+ */\r
+\r
+/** \r
+ * Enumeration used to define the possible image compression coding. \r
+ */\r
+typedef enum OMX_IMAGE_CODINGTYPE {\r
+    OMX_IMAGE_CodingUnused,      /**< Value when format is N/A */\r
+    OMX_IMAGE_CodingAutoDetect,  /**< Auto detection of image format */\r
+    OMX_IMAGE_CodingJPEG,        /**< JPEG/JFIF image format */\r
+    OMX_IMAGE_CodingJPEG2K,      /**< JPEG 2000 image format */\r
+    OMX_IMAGE_CodingEXIF,        /**< EXIF image format */\r
+    OMX_IMAGE_CodingTIFF,        /**< TIFF image format */\r
+    OMX_IMAGE_CodingGIF,         /**< Graphics image format */\r
+    OMX_IMAGE_CodingPNG,         /**< PNG image format */\r
+    OMX_IMAGE_CodingLZW,         /**< LZW image format */\r
+    OMX_IMAGE_CodingBMP,         /**< Windows Bitmap format */\r
+    OMX_IMAGE_CodingKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ \r
+    OMX_IMAGE_CodingVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */\r
+    OMX_IMAGE_CodingMax = 0x7FFFFFFF\r
+} OMX_IMAGE_CODINGTYPE;\r
+\r
+\r
+/**\r
+ * Data structure used to define an image path. The number of image paths \r
+ * for input and output will vary by type of the image component.  \r
+ * \r
+ *  Input (aka Source) : Zero Inputs, one Output,\r
+ *  Splitter           : One Input, 2 or more Outputs,\r
+ *  Processing Element : One Input, one output,\r
+ *  Mixer              : 2 or more inputs, one output,\r
+ *  Output (aka Sink)  : One Input, zero outputs.\r
+ * \r
+ * The PortDefinition structure is used to define all of the parameters \r
+ * necessary for the compliant component to setup an input or an output  \r
+ * image path.  If additional vendor specific data is required, it should  \r
+ * be transmitted to the component using the CustomCommand function.   \r
+ * Compliant components will prepopulate this structure with optimal  \r
+ * values during the OMX_GetParameter() command.\r
+ *\r
+ * STRUCT MEMBERS:\r
+ *  cMIMEType             : MIME type of data for the port\r
+ *  pNativeRender         : Platform specific reference for a display if a \r
+ *                          sync, otherwise this field is 0\r
+ *  nFrameWidth           : Width of frame to be used on port if \r
+ *                          uncompressed format is used.  Use 0 for \r
+ *                          unknown, don't care or variable\r
+ *  nFrameHeight          : Height of frame to be used on port if \r
+ *                          uncompressed format is used. Use 0 for \r
+ *                          unknown, don't care or variable\r
+ *  nStride               : Number of bytes per span of an image (i.e. \r
+ *                          indicates the number of bytes to get from\r
+ *                          span N to span N+1, where negative stride \r
+ *                          indicates the image is bottom up\r
+ *  nSliceHeight          : Height used when encoding in slices\r
+ *  bFlagErrorConcealment : Turns on error concealment if it is supported by \r
+ *                          the OMX component\r
+ *  eCompressionFormat    : Compression format used in this instance of  \r
+ *                          the component. When OMX_IMAGE_CodingUnused is \r
+ *                          specified, eColorFormat is valid\r
+ *  eColorFormat          : Decompressed format used by this component\r
+ *  pNativeWindow         : Platform specific reference for a window object if a \r
+ *                          display sink , otherwise this field is 0x0. \r
+ */\r
+typedef struct OMX_IMAGE_PORTDEFINITIONTYPE {\r
+    OMX_STRING cMIMEType;\r
+    OMX_NATIVE_DEVICETYPE pNativeRender;\r
+    OMX_U32 nFrameWidth; \r
+    OMX_U32 nFrameHeight;\r
+    OMX_S32 nStride;     \r
+    OMX_U32 nSliceHeight;\r
+    OMX_BOOL bFlagErrorConcealment;\r
+    OMX_IMAGE_CODINGTYPE eCompressionFormat;\r
+    OMX_COLOR_FORMATTYPE eColorFormat;\r
+    OMX_NATIVE_WINDOWTYPE pNativeWindow;\r
+} OMX_IMAGE_PORTDEFINITIONTYPE;\r
+\r
+\r
+/**  \r
+ * Port format parameter.  This structure is used to enumerate the various \r
+ * data input/output format supported by the port.\r
+ * \r
+ * STRUCT MEMBERS:\r
+ *  nSize              : Size of the structure in bytes\r
+ *  nVersion           : OMX specification version information\r
+ *  nPortIndex         : Indicates which port to set\r
+ *  nIndex             : Indicates the enumeration index for the format from \r
+ *                       0x0 to N-1\r
+ *  eCompressionFormat : Compression format used in this instance of the \r
+ *                       component. When OMX_IMAGE_CodingUnused is specified, \r
+ *                       eColorFormat is valid\r
+ *  eColorFormat       : Decompressed format used by this component\r
+ */\r
+typedef struct OMX_IMAGE_PARAM_PORTFORMATTYPE {\r
+    OMX_U32 nSize;\r
+    OMX_VERSIONTYPE nVersion;\r
+    OMX_U32 nPortIndex;\r
+    OMX_U32 nIndex;\r
+    OMX_IMAGE_CODINGTYPE eCompressionFormat;\r
+    OMX_COLOR_FORMATTYPE eColorFormat;\r
+} OMX_IMAGE_PARAM_PORTFORMATTYPE;\r
+\r
+\r
+/** \r
+ * Flash control type \r
+ *\r
+ * ENUMS\r
+ *  Torch : Flash forced constantly on\r
+ */\r
+typedef enum OMX_IMAGE_FLASHCONTROLTYPE {\r
+    OMX_IMAGE_FlashControlOn = 0,\r
+    OMX_IMAGE_FlashControlOff,\r
+    OMX_IMAGE_FlashControlAuto,\r
+    OMX_IMAGE_FlashControlRedEyeReduction,\r
+    OMX_IMAGE_FlashControlFillin,\r
+    OMX_IMAGE_FlashControlTorch,\r
+    OMX_IMAGE_FlashControlKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ \r
+    OMX_IMAGE_FlashControlVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */\r
+    OMX_IMAGE_FlashControlMax = 0x7FFFFFFF\r
+} OMX_IMAGE_FLASHCONTROLTYPE;\r
+\r
+\r
+/** \r
+ * Flash control configuration \r
+ *\r
+ * STRUCT MEMBERS:\r
+ *  nSize         : Size of the structure in bytes\r
+ *  nVersion      : OMX specification version information\r
+ *  nPortIndex    : Port that this structure applies to\r
+ *  eFlashControl : Flash control type\r
+ */\r
+typedef struct OMX_IMAGE_PARAM_FLASHCONTROLTYPE {\r
+    OMX_U32 nSize;\r
+    OMX_VERSIONTYPE nVersion;\r
+    OMX_U32 nPortIndex;\r
+    OMX_IMAGE_FLASHCONTROLTYPE eFlashControl;\r
+} OMX_IMAGE_PARAM_FLASHCONTROLTYPE;\r
+\r
+\r
+/** \r
+ * Focus control type \r
+ */\r
+typedef enum OMX_IMAGE_FOCUSCONTROLTYPE {\r
+    OMX_IMAGE_FocusControlOn = 0,\r
+    OMX_IMAGE_FocusControlOff,\r
+    OMX_IMAGE_FocusControlAuto,\r
+    OMX_IMAGE_FocusControlAutoLock,\r
+    OMX_IMAGE_FocusControlKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ \r
+    OMX_IMAGE_FocusControlVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */\r
+    OMX_IMAGE_FocusControlMax = 0x7FFFFFFF\r
+} OMX_IMAGE_FOCUSCONTROLTYPE;\r
+\r
\r
+/** \r
+ * Focus control configuration \r
+ *\r
+ * STRUCT MEMBERS:\r
+ *  nSize           : Size of the structure in bytes\r
+ *  nVersion        : OMX specification version information\r
+ *  nPortIndex      : Port that this structure applies to\r
+ *  eFocusControl   : Focus control\r
+ *  nFocusSteps     : Focus can take on values from 0 mm to infinity. \r
+ *                    Interest is only in number of steps over this range.\r
+ *  nFocusStepIndex : Current focus step index\r
+ */\r
+typedef struct OMX_IMAGE_CONFIG_FOCUSCONTROLTYPE {\r
+    OMX_U32 nSize;\r
+    OMX_VERSIONTYPE nVersion;\r
+    OMX_U32 nPortIndex;\r
+    OMX_IMAGE_FOCUSCONTROLTYPE eFocusControl;\r
+    OMX_U32 nFocusSteps;\r
+    OMX_U32 nFocusStepIndex;\r
+} OMX_IMAGE_CONFIG_FOCUSCONTROLTYPE;\r
+\r
+\r
+/** \r
+ * Q Factor for JPEG compression, which controls the tradeoff between image\r
+ * quality and size.  Q Factor provides a more simple means of controlling\r
+ * JPEG compression quality, without directly programming Quantization\r
+ * tables for chroma and luma \r
+ *\r
+ * STRUCT MEMBERS:\r
+ *  nSize      : Size of the structure in bytes         \r
+ *  nVersion   : OMX specification version information \r
+ *  nPortIndex : Port that this structure applies to \r
+ *  nQFactor   : JPEG Q factor value in the range of 1-100. A factor of 1 \r
+ *               produces the smallest, worst quality images, and a factor \r
+ *               of 100 produces the largest, best quality images.  A \r
+ *               typical default is 75 for small good quality images               \r
+ */\r
+typedef struct OMX_IMAGE_PARAM_QFACTORTYPE {\r
+    OMX_U32 nSize;            \r
+    OMX_VERSIONTYPE nVersion; \r
+    OMX_U32 nPortIndex;       \r
+    OMX_U32 nQFactor;                                        \r
+} OMX_IMAGE_PARAM_QFACTORTYPE;\r
+\r
+/** \r
+ * Quantization table type \r
+ */\r
+\r
+typedef enum OMX_IMAGE_QUANTIZATIONTABLETYPE {\r
+    OMX_IMAGE_QuantizationTableLuma = 0,\r
+    OMX_IMAGE_QuantizationTableChroma,\r
+    OMX_IMAGE_QuantizationTableChromaCb,\r
+    OMX_IMAGE_QuantizationTableChromaCr,\r
+    OMX_IMAGE_QuantizationTableKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ \r
+    OMX_IMAGE_QuantizationTableVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */\r
+    OMX_IMAGE_QuantizationTableMax = 0x7FFFFFFF\r
+} OMX_IMAGE_QUANTIZATIONTABLETYPE;\r
+\r
+/** \r
+ * JPEG quantization tables are used to determine DCT compression for\r
+ * YUV data, as an alternative to specifying Q factor, providing exact \r
+ * control of compression \r
+ *\r
+ * STRUCT MEMBERS:\r
+ *  nSize                   : Size of the structure in bytes\r
+ *  nVersion                : OMX specification version information \r
+ *  nPortIndex              : Port that this structure applies to\r
+ *  eQuantizationTable      : Quantization table type\r
+ *  nQuantizationMatrix[64] : JPEG quantization table of coefficients stored \r
+ *                            in increasing columns then by rows of data (i.e. \r
+ *                            row 1, ... row 8). Quantization values are in \r
+ *                            the range 0-255 and stored in linear order\r
+ *                            (i.e. the component will zig-zag the \r
+ *                            quantization table data if required internally) \r
+ */\r
+typedef struct OMX_IMAGE_PARAM_QUANTIZATIONTABLETYPE {\r
+    OMX_U32 nSize;\r
+    OMX_VERSIONTYPE nVersion;\r
+    OMX_U32 nPortIndex;\r
+    OMX_IMAGE_QUANTIZATIONTABLETYPE eQuantizationTable;\r
+    OMX_U8 nQuantizationMatrix[64];\r
+} OMX_IMAGE_PARAM_QUANTIZATIONTABLETYPE;\r
+\r
+\r
+/** \r
+ * Huffman table type, the same Huffman table is applied for chroma and \r
+ * luma component \r
+ */\r
+typedef enum OMX_IMAGE_HUFFMANTABLETYPE {\r
+    OMX_IMAGE_HuffmanTableAC = 0,\r
+    OMX_IMAGE_HuffmanTableDC,\r
+    OMX_IMAGE_HuffmanTableACLuma,\r
+    OMX_IMAGE_HuffmanTableACChroma,\r
+    OMX_IMAGE_HuffmanTableDCLuma,\r
+    OMX_IMAGE_HuffmanTableDCChroma,\r
+    OMX_IMAGE_HuffmanTableKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ \r
+    OMX_IMAGE_HuffmanTableVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */\r
+    OMX_IMAGE_HuffmanTableMax = 0x7FFFFFFF\r
+} OMX_IMAGE_HUFFMANTABLETYPE;\r
+\r
+/** \r
+ * JPEG Huffman table \r
+ *\r
+ * STRUCT MEMBERS:\r
+ *  nSize                            : Size of the structure in bytes\r
+ *  nVersion                         : OMX specification version information\r
+ *  nPortIndex                       : Port that this structure applies to\r
+ *  eHuffmanTable                    : Huffman table type\r
+ *  nNumberOfHuffmanCodeOfLength[16] : 0-16, number of Huffman codes of each \r
+ *                                     possible length\r
+ *  nHuffmanTable[256]               : 0-255, the size used for AC and DC \r
+ *                                     HuffmanTable are 16 and 162 \r
+ */\r
+typedef struct OMX_IMAGE_PARAM_HUFFMANTTABLETYPE {\r
+    OMX_U32 nSize;\r
+    OMX_VERSIONTYPE nVersion;\r
+    OMX_U32 nPortIndex;\r
+    OMX_IMAGE_HUFFMANTABLETYPE eHuffmanTable;\r
+    OMX_U8 nNumberOfHuffmanCodeOfLength[16];\r
+    OMX_U8 nHuffmanTable[256];\r
+}OMX_IMAGE_PARAM_HUFFMANTTABLETYPE;\r
+\r
+/** @} */\r
+#ifdef __cplusplus\r
+}\r
+#endif /* __cplusplus */\r
+\r
+#endif\r
+/* File EOF */\r
diff --git a/modules/codec/omxil/OMX_Index.h b/modules/codec/omxil/OMX_Index.h
new file mode 100644 (file)
index 0000000..101595a
--- /dev/null
@@ -0,0 +1,258 @@
+/*\r
+ * Copyright (c) 2008 The Khronos Group Inc. \r
+ * \r
+ * Permission is hereby granted, free of charge, to any person obtaining\r
+ * a copy of this software and associated documentation files (the\r
+ * "Software"), to deal in the Software without restriction, including\r
+ * without limitation the rights to use, copy, modify, merge, publish,\r
+ * distribute, sublicense, and/or sell copies of the Software, and to\r
+ * permit persons to whom the Software is furnished to do so, subject\r
+ * to the following conditions: \r
+ * The above copyright notice and this permission notice shall be included\r
+ * in all copies or substantial portions of the Software. \r
+ * \r
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS\r
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\r
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\r
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\r
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\r
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \r
+ *\r
+ */\r
+\r
+/** @file OMX_Index.h - OpenMax IL version 1.1.2\r
+ *  The OMX_Index header file contains the definitions for both applications\r
+ *  and components .\r
+ */\r
+\r
+\r
+#ifndef OMX_Index_h\r
+#define OMX_Index_h\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif /* __cplusplus */\r
+\r
+\r
+/* Each OMX header must include all required header files to allow the\r
+ *  header to compile without errors.  The includes below are required\r
+ *  for this header file to compile successfully \r
+ */\r
+#include <OMX_Types.h>\r
+\r
+\r
+/** The OMX_INDEXTYPE enumeration is used to select a structure when either\r
+ *  getting or setting parameters and/or configuration data.  Each entry in \r
+ *  this enumeration maps to an OMX specified structure.  When the \r
+ *  OMX_GetParameter, OMX_SetParameter, OMX_GetConfig or OMX_SetConfig methods\r
+ *  are used, the second parameter will always be an entry from this enumeration\r
+ *  and the third entry will be the structure shown in the comments for the entry.\r
+ *  For example, if the application is initializing a cropping function, the \r
+ *  OMX_SetConfig command would have OMX_IndexConfigCommonInputCrop as the second parameter \r
+ *  and would send a pointer to an initialized OMX_RECTTYPE structure as the \r
+ *  third parameter.\r
+ *  \r
+ *  The enumeration entries named with the OMX_Config prefix are sent using\r
+ *  the OMX_SetConfig command and the enumeration entries named with the\r
+ *  OMX_PARAM_ prefix are sent using the OMX_SetParameter command.\r
+ */\r
+typedef enum OMX_INDEXTYPE {\r
+\r
+    OMX_IndexComponentStartUnused = 0x01000000,\r
+    OMX_IndexParamPriorityMgmt,             /**< reference: OMX_PRIORITYMGMTTYPE */\r
+    OMX_IndexParamAudioInit,                /**< reference: OMX_PORT_PARAM_TYPE */\r
+    OMX_IndexParamImageInit,                /**< reference: OMX_PORT_PARAM_TYPE */\r
+    OMX_IndexParamVideoInit,                /**< reference: OMX_PORT_PARAM_TYPE */\r
+    OMX_IndexParamOtherInit,                /**< reference: OMX_PORT_PARAM_TYPE */\r
+    OMX_IndexParamNumAvailableStreams,      /**< reference: OMX_PARAM_U32TYPE */\r
+    OMX_IndexParamActiveStream,             /**< reference: OMX_PARAM_U32TYPE */\r
+    OMX_IndexParamSuspensionPolicy,         /**< reference: OMX_PARAM_SUSPENSIONPOLICYTYPE */\r
+    OMX_IndexParamComponentSuspended,       /**< reference: OMX_PARAM_SUSPENSIONTYPE */\r
+    OMX_IndexConfigCapturing,               /**< reference: OMX_CONFIG_BOOLEANTYPE */ \r
+    OMX_IndexConfigCaptureMode,             /**< reference: OMX_CONFIG_CAPTUREMODETYPE */ \r
+    OMX_IndexAutoPauseAfterCapture,         /**< reference: OMX_CONFIG_BOOLEANTYPE */ \r
+    OMX_IndexParamContentURI,               /**< reference: OMX_PARAM_CONTENTURITYPE */\r
+    OMX_IndexParamCustomContentPipe,        /**< reference: OMX_PARAM_CONTENTPIPETYPE */ \r
+    OMX_IndexParamDisableResourceConcealment, /**< reference: OMX_RESOURCECONCEALMENTTYPE */\r
+    OMX_IndexConfigMetadataItemCount,       /**< reference: OMX_CONFIG_METADATAITEMCOUNTTYPE */\r
+    OMX_IndexConfigContainerNodeCount,      /**< reference: OMX_CONFIG_CONTAINERNODECOUNTTYPE */\r
+    OMX_IndexConfigMetadataItem,            /**< reference: OMX_CONFIG_METADATAITEMTYPE */\r
+    OMX_IndexConfigCounterNodeID,           /**< reference: OMX_CONFIG_CONTAINERNODEIDTYPE */\r
+    OMX_IndexParamMetadataFilterType,       /**< reference: OMX_PARAM_METADATAFILTERTYPE */\r
+    OMX_IndexParamMetadataKeyFilter,        /**< reference: OMX_PARAM_METADATAFILTERTYPE */\r
+    OMX_IndexConfigPriorityMgmt,            /**< reference: OMX_PRIORITYMGMTTYPE */\r
+    OMX_IndexParamStandardComponentRole,    /**< reference: OMX_PARAM_COMPONENTROLETYPE */\r
+\r
+    OMX_IndexPortStartUnused = 0x02000000,\r
+    OMX_IndexParamPortDefinition,           /**< reference: OMX_PARAM_PORTDEFINITIONTYPE */\r
+    OMX_IndexParamCompBufferSupplier,       /**< reference: OMX_PARAM_BUFFERSUPPLIERTYPE */ \r
+    OMX_IndexReservedStartUnused = 0x03000000,\r
+\r
+    /* Audio parameters and configurations */\r
+    OMX_IndexAudioStartUnused = 0x04000000,\r
+    OMX_IndexParamAudioPortFormat,          /**< reference: OMX_AUDIO_PARAM_PORTFORMATTYPE */\r
+    OMX_IndexParamAudioPcm,                 /**< reference: OMX_AUDIO_PARAM_PCMMODETYPE */\r
+    OMX_IndexParamAudioAac,                 /**< reference: OMX_AUDIO_PARAM_AACPROFILETYPE */\r
+    OMX_IndexParamAudioRa,                  /**< reference: OMX_AUDIO_PARAM_RATYPE */\r
+    OMX_IndexParamAudioMp3,                 /**< reference: OMX_AUDIO_PARAM_MP3TYPE */\r
+    OMX_IndexParamAudioAdpcm,               /**< reference: OMX_AUDIO_PARAM_ADPCMTYPE */\r
+    OMX_IndexParamAudioG723,                /**< reference: OMX_AUDIO_PARAM_G723TYPE */\r
+    OMX_IndexParamAudioG729,                /**< reference: OMX_AUDIO_PARAM_G729TYPE */\r
+    OMX_IndexParamAudioAmr,                 /**< reference: OMX_AUDIO_PARAM_AMRTYPE */\r
+    OMX_IndexParamAudioWma,                 /**< reference: OMX_AUDIO_PARAM_WMATYPE */\r
+    OMX_IndexParamAudioSbc,                 /**< reference: OMX_AUDIO_PARAM_SBCTYPE */\r
+    OMX_IndexParamAudioMidi,                /**< reference: OMX_AUDIO_PARAM_MIDITYPE */\r
+    OMX_IndexParamAudioGsm_FR,              /**< reference: OMX_AUDIO_PARAM_GSMFRTYPE */\r
+    OMX_IndexParamAudioMidiLoadUserSound,   /**< reference: OMX_AUDIO_PARAM_MIDILOADUSERSOUNDTYPE */\r
+    OMX_IndexParamAudioG726,                /**< reference: OMX_AUDIO_PARAM_G726TYPE */\r
+    OMX_IndexParamAudioGsm_EFR,             /**< reference: OMX_AUDIO_PARAM_GSMEFRTYPE */\r
+    OMX_IndexParamAudioGsm_HR,              /**< reference: OMX_AUDIO_PARAM_GSMHRTYPE */\r
+    OMX_IndexParamAudioPdc_FR,              /**< reference: OMX_AUDIO_PARAM_PDCFRTYPE */\r
+    OMX_IndexParamAudioPdc_EFR,             /**< reference: OMX_AUDIO_PARAM_PDCEFRTYPE */\r
+    OMX_IndexParamAudioPdc_HR,              /**< reference: OMX_AUDIO_PARAM_PDCHRTYPE */\r
+    OMX_IndexParamAudioTdma_FR,             /**< reference: OMX_AUDIO_PARAM_TDMAFRTYPE */\r
+    OMX_IndexParamAudioTdma_EFR,            /**< reference: OMX_AUDIO_PARAM_TDMAEFRTYPE */\r
+    OMX_IndexParamAudioQcelp8,              /**< reference: OMX_AUDIO_PARAM_QCELP8TYPE */\r
+    OMX_IndexParamAudioQcelp13,             /**< reference: OMX_AUDIO_PARAM_QCELP13TYPE */\r
+    OMX_IndexParamAudioEvrc,                /**< reference: OMX_AUDIO_PARAM_EVRCTYPE */\r
+    OMX_IndexParamAudioSmv,                 /**< reference: OMX_AUDIO_PARAM_SMVTYPE */\r
+    OMX_IndexParamAudioVorbis,              /**< reference: OMX_AUDIO_PARAM_VORBISTYPE */\r
+\r
+    OMX_IndexConfigAudioMidiImmediateEvent, /**< reference: OMX_AUDIO_CONFIG_MIDIIMMEDIATEEVENTTYPE */\r
+    OMX_IndexConfigAudioMidiControl,        /**< reference: OMX_AUDIO_CONFIG_MIDICONTROLTYPE */\r
+    OMX_IndexConfigAudioMidiSoundBankProgram, /**< reference: OMX_AUDIO_CONFIG_MIDISOUNDBANKPROGRAMTYPE */\r
+    OMX_IndexConfigAudioMidiStatus,         /**< reference: OMX_AUDIO_CONFIG_MIDISTATUSTYPE */\r
+    OMX_IndexConfigAudioMidiMetaEvent,      /**< reference: OMX_AUDIO_CONFIG_MIDIMETAEVENTTYPE */\r
+    OMX_IndexConfigAudioMidiMetaEventData,  /**< reference: OMX_AUDIO_CONFIG_MIDIMETAEVENTDATATYPE */\r
+    OMX_IndexConfigAudioVolume,             /**< reference: OMX_AUDIO_CONFIG_VOLUMETYPE */\r
+    OMX_IndexConfigAudioBalance,            /**< reference: OMX_AUDIO_CONFIG_BALANCETYPE */\r
+    OMX_IndexConfigAudioChannelMute,        /**< reference: OMX_AUDIO_CONFIG_CHANNELMUTETYPE */\r
+    OMX_IndexConfigAudioMute,               /**< reference: OMX_AUDIO_CONFIG_MUTETYPE */\r
+    OMX_IndexConfigAudioLoudness,           /**< reference: OMX_AUDIO_CONFIG_LOUDNESSTYPE */\r
+    OMX_IndexConfigAudioEchoCancelation,    /**< reference: OMX_AUDIO_CONFIG_ECHOCANCELATIONTYPE */\r
+    OMX_IndexConfigAudioNoiseReduction,     /**< reference: OMX_AUDIO_CONFIG_NOISEREDUCTIONTYPE */\r
+    OMX_IndexConfigAudioBass,               /**< reference: OMX_AUDIO_CONFIG_BASSTYPE */\r
+    OMX_IndexConfigAudioTreble,             /**< reference: OMX_AUDIO_CONFIG_TREBLETYPE */\r
+    OMX_IndexConfigAudioStereoWidening,     /**< reference: OMX_AUDIO_CONFIG_STEREOWIDENINGTYPE */\r
+    OMX_IndexConfigAudioChorus,             /**< reference: OMX_AUDIO_CONFIG_CHORUSTYPE */\r
+    OMX_IndexConfigAudioEqualizer,          /**< reference: OMX_AUDIO_CONFIG_EQUALIZERTYPE */\r
+    OMX_IndexConfigAudioReverberation,      /**< reference: OMX_AUDIO_CONFIG_REVERBERATIONTYPE */\r
+    OMX_IndexConfigAudioChannelVolume,      /**< reference: OMX_AUDIO_CONFIG_CHANNELVOLUMETYPE */\r
+\r
+    /* Image specific parameters and configurations */\r
+    OMX_IndexImageStartUnused = 0x05000000,\r
+    OMX_IndexParamImagePortFormat,          /**< reference: OMX_IMAGE_PARAM_PORTFORMATTYPE */\r
+    OMX_IndexParamFlashControl,             /**< reference: OMX_IMAGE_PARAM_FLASHCONTROLTYPE */\r
+    OMX_IndexConfigFocusControl,            /**< reference: OMX_IMAGE_CONFIG_FOCUSCONTROLTYPE */\r
+    OMX_IndexParamQFactor,                  /**< reference: OMX_IMAGE_PARAM_QFACTORTYPE */\r
+    OMX_IndexParamQuantizationTable,        /**< reference: OMX_IMAGE_PARAM_QUANTIZATIONTABLETYPE */\r
+    OMX_IndexParamHuffmanTable,             /**< reference: OMX_IMAGE_PARAM_HUFFMANTTABLETYPE */\r
+    OMX_IndexConfigFlashControl,            /**< reference: OMX_IMAGE_PARAM_FLASHCONTROLTYPE */\r
+\r
+    /* Video specific parameters and configurations */\r
+    OMX_IndexVideoStartUnused = 0x06000000,\r
+    OMX_IndexParamVideoPortFormat,          /**< reference: OMX_VIDEO_PARAM_PORTFORMATTYPE */\r
+    OMX_IndexParamVideoQuantization,        /**< reference: OMX_VIDEO_PARAM_QUANTIZATIONTYPE */\r
+    OMX_IndexParamVideoFastUpdate,          /**< reference: OMX_VIDEO_PARAM_VIDEOFASTUPDATETYPE */\r
+    OMX_IndexParamVideoBitrate,             /**< reference: OMX_VIDEO_PARAM_BITRATETYPE */\r
+    OMX_IndexParamVideoMotionVector,        /**< reference: OMX_VIDEO_PARAM_MOTIONVECTORTYPE */\r
+    OMX_IndexParamVideoIntraRefresh,        /**< reference: OMX_VIDEO_PARAM_INTRAREFRESHTYPE */\r
+    OMX_IndexParamVideoErrorCorrection,     /**< reference: OMX_VIDEO_PARAM_ERRORCORRECTIONTYPE */\r
+    OMX_IndexParamVideoVBSMC,               /**< reference: OMX_VIDEO_PARAM_VBSMCTYPE */\r
+    OMX_IndexParamVideoMpeg2,               /**< reference: OMX_VIDEO_PARAM_MPEG2TYPE */\r
+    OMX_IndexParamVideoMpeg4,               /**< reference: OMX_VIDEO_PARAM_MPEG4TYPE */\r
+    OMX_IndexParamVideoWmv,                 /**< reference: OMX_VIDEO_PARAM_WMVTYPE */\r
+    OMX_IndexParamVideoRv,                  /**< reference: OMX_VIDEO_PARAM_RVTYPE */\r
+    OMX_IndexParamVideoAvc,                 /**< reference: OMX_VIDEO_PARAM_AVCTYPE */\r
+    OMX_IndexParamVideoH263,                /**< reference: OMX_VIDEO_PARAM_H263TYPE */\r
+    OMX_IndexParamVideoProfileLevelQuerySupported, /**< reference: OMX_VIDEO_PARAM_PROFILELEVELTYPE */\r
+    OMX_IndexParamVideoProfileLevelCurrent, /**< reference: OMX_VIDEO_PARAM_PROFILELEVELTYPE */\r
+    OMX_IndexConfigVideoBitrate,            /**< reference: OMX_VIDEO_CONFIG_BITRATETYPE */\r
+    OMX_IndexConfigVideoFramerate,          /**< reference: OMX_CONFIG_FRAMERATETYPE */\r
+    OMX_IndexConfigVideoIntraVOPRefresh,    /**< reference: OMX_CONFIG_INTRAREFRESHVOPTYPE */\r
+    OMX_IndexConfigVideoIntraMBRefresh,     /**< reference: OMX_CONFIG_MACROBLOCKERRORMAPTYPE */\r
+    OMX_IndexConfigVideoMBErrorReporting,   /**< reference: OMX_CONFIG_MBERRORREPORTINGTYPE */\r
+    OMX_IndexParamVideoMacroblocksPerFrame, /**< reference: OMX_PARAM_MACROBLOCKSTYPE */\r
+    OMX_IndexConfigVideoMacroBlockErrorMap, /**< reference: OMX_CONFIG_MACROBLOCKERRORMAPTYPE */\r
+    OMX_IndexParamVideoSliceFMO,            /**< reference: OMX_VIDEO_PARAM_AVCSLICEFMO */\r
+    OMX_IndexConfigVideoAVCIntraPeriod,     /**< reference: OMX_VIDEO_CONFIG_AVCINTRAPERIOD */\r
+    OMX_IndexConfigVideoNalSize,            /**< reference: OMX_VIDEO_CONFIG_NALSIZE */\r
+\r
+    /* Image & Video common Configurations */\r
+    OMX_IndexCommonStartUnused = 0x07000000,\r
+    OMX_IndexParamCommonDeblocking,         /**< reference: OMX_PARAM_DEBLOCKINGTYPE */\r
+    OMX_IndexParamCommonSensorMode,         /**< reference: OMX_PARAM_SENSORMODETYPE */\r
+    OMX_IndexParamCommonInterleave,         /**< reference: OMX_PARAM_INTERLEAVETYPE */\r
+    OMX_IndexConfigCommonColorFormatConversion, /**< reference: OMX_CONFIG_COLORCONVERSIONTYPE */\r
+    OMX_IndexConfigCommonScale,             /**< reference: OMX_CONFIG_SCALEFACTORTYPE */\r
+    OMX_IndexConfigCommonImageFilter,       /**< reference: OMX_CONFIG_IMAGEFILTERTYPE */\r
+    OMX_IndexConfigCommonColorEnhancement,  /**< reference: OMX_CONFIG_COLORENHANCEMENTTYPE */\r
+    OMX_IndexConfigCommonColorKey,          /**< reference: OMX_CONFIG_COLORKEYTYPE */\r
+    OMX_IndexConfigCommonColorBlend,        /**< reference: OMX_CONFIG_COLORBLENDTYPE */\r
+    OMX_IndexConfigCommonFrameStabilisation,/**< reference: OMX_CONFIG_FRAMESTABTYPE */\r
+    OMX_IndexConfigCommonRotate,            /**< reference: OMX_CONFIG_ROTATIONTYPE */\r
+    OMX_IndexConfigCommonMirror,            /**< reference: OMX_CONFIG_MIRRORTYPE */\r
+    OMX_IndexConfigCommonOutputPosition,    /**< reference: OMX_CONFIG_POINTTYPE */\r
+    OMX_IndexConfigCommonInputCrop,         /**< reference: OMX_CONFIG_RECTTYPE */\r
+    OMX_IndexConfigCommonOutputCrop,        /**< reference: OMX_CONFIG_RECTTYPE */\r
+    OMX_IndexConfigCommonDigitalZoom,       /**< reference: OMX_CONFIG_SCALEFACTORTYPE */\r
+    OMX_IndexConfigCommonOpticalZoom,       /**< reference: OMX_CONFIG_SCALEFACTORTYPE*/\r
+    OMX_IndexConfigCommonWhiteBalance,      /**< reference: OMX_CONFIG_WHITEBALCONTROLTYPE */\r
+    OMX_IndexConfigCommonExposure,          /**< reference: OMX_CONFIG_EXPOSURECONTROLTYPE */\r
+    OMX_IndexConfigCommonContrast,          /**< reference: OMX_CONFIG_CONTRASTTYPE */\r
+    OMX_IndexConfigCommonBrightness,        /**< reference: OMX_CONFIG_BRIGHTNESSTYPE */\r
+    OMX_IndexConfigCommonBacklight,         /**< reference: OMX_CONFIG_BACKLIGHTTYPE */\r
+    OMX_IndexConfigCommonGamma,             /**< reference: OMX_CONFIG_GAMMATYPE */\r
+    OMX_IndexConfigCommonSaturation,        /**< reference: OMX_CONFIG_SATURATIONTYPE */\r
+    OMX_IndexConfigCommonLightness,         /**< reference: OMX_CONFIG_LIGHTNESSTYPE */\r
+    OMX_IndexConfigCommonExclusionRect,     /**< reference: OMX_CONFIG_RECTTYPE */\r
+    OMX_IndexConfigCommonDithering,         /**< reference: OMX_CONFIG_DITHERTYPE */\r
+    OMX_IndexConfigCommonPlaneBlend,        /**< reference: OMX_CONFIG_PLANEBLENDTYPE */\r
+    OMX_IndexConfigCommonExposureValue,     /**< reference: OMX_CONFIG_EXPOSUREVALUETYPE */\r
+    OMX_IndexConfigCommonOutputSize,        /**< reference: OMX_FRAMESIZETYPE */\r
+    OMX_IndexParamCommonExtraQuantData,     /**< reference: OMX_OTHER_EXTRADATATYPE */\r
+    OMX_IndexConfigCommonFocusRegion,       /**< reference: OMX_CONFIG_FOCUSREGIONTYPE */\r
+    OMX_IndexConfigCommonFocusStatus,       /**< reference: OMX_PARAM_FOCUSSTATUSTYPE */\r
+    OMX_IndexConfigCommonTransitionEffect,  /**< reference: OMX_CONFIG_TRANSITIONEFFECTTYPE */\r
+\r
+    /* Reserved Configuration range */\r
+    OMX_IndexOtherStartUnused = 0x08000000,\r
+    OMX_IndexParamOtherPortFormat,          /**< reference: OMX_OTHER_PARAM_PORTFORMATTYPE */\r
+    OMX_IndexConfigOtherPower,              /**< reference: OMX_OTHER_CONFIG_POWERTYPE */\r
+    OMX_IndexConfigOtherStats,              /**< reference: OMX_OTHER_CONFIG_STATSTYPE */\r
+\r
+\r
+    /* Reserved Time range */\r
+    OMX_IndexTimeStartUnused = 0x09000000,\r
+    OMX_IndexConfigTimeScale,               /**< reference: OMX_TIME_CONFIG_SCALETYPE */\r
+    OMX_IndexConfigTimeClockState,          /**< reference: OMX_TIME_CONFIG_CLOCKSTATETYPE */\r
+    OMX_IndexConfigTimeActiveRefClock,      /**< reference: OMX_TIME_CONFIG_ACTIVEREFCLOCKTYPE */\r
+    OMX_IndexConfigTimeCurrentMediaTime,    /**< reference: OMX_TIME_CONFIG_TIMESTAMPTYPE (read only) */\r
+    OMX_IndexConfigTimeCurrentWallTime,     /**< reference: OMX_TIME_CONFIG_TIMESTAMPTYPE (read only) */\r
+    OMX_IndexConfigTimeCurrentAudioReference, /**< reference: OMX_TIME_CONFIG_TIMESTAMPTYPE (write only) */\r
+    OMX_IndexConfigTimeCurrentVideoReference, /**< reference: OMX_TIME_CONFIG_TIMESTAMPTYPE (write only) */\r
+    OMX_IndexConfigTimeMediaTimeRequest,    /**< reference: OMX_TIME_CONFIG_MEDIATIMEREQUESTTYPE (write only) */\r
+    OMX_IndexConfigTimeClientStartTime,     /**<reference:  OMX_TIME_CONFIG_TIMESTAMPTYPE (write only) */\r
+    OMX_IndexConfigTimePosition,            /**< reference: OMX_TIME_CONFIG_TIMESTAMPTYPE */\r
+    OMX_IndexConfigTimeSeekMode,            /**< reference: OMX_TIME_CONFIG_SEEKMODETYPE */\r
+\r
+\r
+    OMX_IndexKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ \r
+    /* Vendor specific area */\r
+    OMX_IndexVendorStartUnused = 0x7F000000,\r
+    /* Vendor specific structures should be in the range of 0x7F000000 \r
+       to 0x7FFFFFFE.  This range is not broken out by vendor, so\r
+       private indexes are not guaranteed unique and therefore should\r
+       only be sent to the appropriate component. */\r
+\r
+    OMX_IndexMax = 0x7FFFFFFF\r
+\r
+} OMX_INDEXTYPE;\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif /* __cplusplus */\r
+\r
+#endif\r
+/* File EOF */\r
diff --git a/modules/codec/omxil/OMX_Other.h b/modules/codec/omxil/OMX_Other.h
new file mode 100644 (file)
index 0000000..d5cd976
--- /dev/null
@@ -0,0 +1,337 @@
+/*\r
+ * Copyright (c) 2008 The Khronos Group Inc. \r
+ * \r
+ * Permission is hereby granted, free of charge, to any person obtaining\r
+ * a copy of this software and associated documentation files (the\r
+ * "Software"), to deal in the Software without restriction, including\r
+ * without limitation the rights to use, copy, modify, merge, publish,\r
+ * distribute, sublicense, and/or sell copies of the Software, and to\r
+ * permit persons to whom the Software is furnished to do so, subject\r
+ * to the following conditions: \r
+ * The above copyright notice and this permission notice shall be included\r
+ * in all copies or substantial portions of the Software. \r
+ * \r
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS\r
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\r
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\r
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\r
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\r
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \r
+ *\r
+ */\r
+\r
+/** @file OMX_Other.h - OpenMax IL version 1.1.2\r
+ *  The structures needed by Other components to exchange\r
+ *  parameters and configuration data with the components.\r
+ */\r
+\r
+#ifndef OMX_Other_h\r
+#define OMX_Other_h\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif /* __cplusplus */\r
+\r
+\r
+/* Each OMX header must include all required header files to allow the\r
+ *  header to compile without errors.  The includes below are required\r
+ *  for this header file to compile successfully \r
+ */\r
+\r
+#include <OMX_Core.h>\r
+\r
+\r
+/** \r
+ * Enumeration of possible data types which match to multiple domains or no\r
+ * domain at all.  For types which are vendor specific, a value above\r
+ * OMX_OTHER_VENDORTSTART should be used.\r
+ */\r
+typedef enum OMX_OTHER_FORMATTYPE {\r
+    OMX_OTHER_FormatTime = 0, /**< Transmission of various timestamps, elapsed time, \r
+                                   time deltas, etc */\r
+    OMX_OTHER_FormatPower,    /**< Perhaps used for enabling/disabling power \r
+                                   management, setting clocks? */\r
+    OMX_OTHER_FormatStats,    /**< Could be things such as frame rate, frames \r
+                                   dropped, etc */\r
+    OMX_OTHER_FormatBinary,   /**< Arbitrary binary data */\r
+    OMX_OTHER_FormatVendorReserved = 1000, /**< Starting value for vendor specific \r
+                                                formats */\r
+\r
+    OMX_OTHER_FormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ \r
+    OMX_OTHER_FormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */\r
+    OMX_OTHER_FormatMax = 0x7FFFFFFF\r
+} OMX_OTHER_FORMATTYPE;\r
+\r
+/** \r
+ * Enumeration of seek modes.\r
+ */\r
+typedef enum OMX_TIME_SEEKMODETYPE {\r
+    OMX_TIME_SeekModeFast = 0, /**< Prefer seeking to an approximation\r
+                                * of the requested seek position over   \r
+                                * the actual seek position if it\r
+                                * results in a faster seek. */\r
+    OMX_TIME_SeekModeAccurate, /**< Prefer seeking to the actual seek \r
+                                * position over an approximation\r
+                                * of the requested seek position even\r
+                                * if it results in a slower seek. */\r
+    OMX_TIME_SeekModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ \r
+    OMX_TIME_SeekModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */\r
+    OMX_TIME_SeekModeMax = 0x7FFFFFFF\r
+} OMX_TIME_SEEKMODETYPE;\r
+\r
+/* Structure representing the seekmode of the component */\r
+typedef struct OMX_TIME_CONFIG_SEEKMODETYPE {\r
+    OMX_U32 nSize;                  /**< size of the structure in bytes */\r
+    OMX_VERSIONTYPE nVersion;       /**< OMX specification version information */\r
+    OMX_TIME_SEEKMODETYPE eType;    /**< The seek mode */\r
+} OMX_TIME_CONFIG_SEEKMODETYPE;\r
+\r
+/** Structure representing a time stamp used with the following configs \r
+ * on the Clock Component (CC):\r
+ * \r
+ * OMX_IndexConfigTimeCurrentWallTime: query of the CC\92s current wall  \r
+ *     time\r
+ * OMX_IndexConfigTimeCurrentMediaTime: query of the CC\92s current media\r
+ *     time\r
+ * OMX_IndexConfigTimeCurrentAudioReference and  \r
+ * OMX_IndexConfigTimeCurrentVideoReference: audio/video reference \r
+ *     clock sending SC its reference time\r
+ * OMX_IndexConfigTimeClientStartTime: a Clock Component client sends \r
+ *     this structure to the Clock Component via a SetConfig on its \r
+ *     client port when it receives a buffer with\r
+ *     OMX_BUFFERFLAG_STARTTIME set. It must use the timestamp\r
+ *     specified by that buffer for nStartTimestamp. \r
+ *\r
+ * It\92s also used with the following config on components in general:\r
+ *\r
+ * OMX_IndexConfigTimePosition: IL client querying component position \r
+ * (GetConfig) or commanding a component to seek to the given location\r
+ * (SetConfig)\r
+ */    \r
+typedef struct OMX_TIME_CONFIG_TIMESTAMPTYPE {\r
+    OMX_U32 nSize;               /**< size of the structure in bytes */\r
+    OMX_VERSIONTYPE nVersion;    /**< OMX specification version\r
+                                  *   information */\r
+    OMX_U32 nPortIndex;     /**< port that this structure applies to */\r
+    OMX_TICKS nTimestamp;           /**< timestamp .*/ \r
+} OMX_TIME_CONFIG_TIMESTAMPTYPE;  \r
+\r
+/** Enumeration of possible reference clocks to the media time. */\r
+typedef enum OMX_TIME_UPDATETYPE {\r
+      OMX_TIME_UpdateRequestFulfillment,    /**< Update is the fulfillment of a media time request. */\r
+      OMX_TIME_UpdateScaleChanged,             /**< Update was generated because the scale chagned. */\r
+      OMX_TIME_UpdateClockStateChanged,     /**< Update was generated because the clock state changed. */\r
+      OMX_TIME_UpdateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ \r
+      OMX_TIME_UpdateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */\r
+      OMX_TIME_UpdateMax = 0x7FFFFFFF\r
+} OMX_TIME_UPDATETYPE;\r
+\r
+/** Enumeration of possible reference clocks to the media time. */\r
+typedef enum OMX_TIME_REFCLOCKTYPE {\r
+      OMX_TIME_RefClockNone,    /**< Use no references. */\r
+      OMX_TIME_RefClockAudio,  /**< Use references sent through OMX_IndexConfigTimeCurrentAudioReference */\r
+      OMX_TIME_RefClockVideo,   /**< Use references sent through OMX_IndexConfigTimeCurrentVideoReference */\r
+      OMX_TIME_RefClockKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ \r
+      OMX_TIME_RefClockVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */\r
+      OMX_TIME_RefClockMax = 0x7FFFFFFF\r
+} OMX_TIME_REFCLOCKTYPE;\r
+\r
+/** Enumeration of clock states. */\r
+typedef enum OMX_TIME_CLOCKSTATE {\r
+      OMX_TIME_ClockStateRunning,             /**< Clock running. */\r
+      OMX_TIME_ClockStateWaitingForStartTime, /**< Clock waiting until the \r
+                                               *   prescribed clients emit their\r
+                                               *   start time. */\r
+      OMX_TIME_ClockStateStopped,             /**< Clock stopped. */\r
+      OMX_TIME_ClockStateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ \r
+      OMX_TIME_ClockStateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */\r
+      OMX_TIME_ClockStateMax = 0x7FFFFFFF\r
+} OMX_TIME_CLOCKSTATE;\r
+\r
+/** Structure representing a media time request to the clock component.\r
+ *\r
+ *  A client component sends this structure to the Clock Component via a SetConfig\r
+ *  on its client port to specify a media timestamp the Clock Component\r
+ *  should emit.  The Clock Component should fulfill the request by sending a\r
+ *  OMX_TIME_MEDIATIMETYPE when its media clock matches the requested \r
+ *  timestamp.\r
+ *\r
+ *  The client may require a media time request be fulfilled slightly\r
+ *  earlier than the media time specified. In this case the client specifies \r
+ *  an offset which is equal to the difference between wall time corresponding \r
+ *  to the requested media time and the wall time when it will be \r
+ *  fulfilled. \r
+ *\r
+ *  A client component may uses these requests and the OMX_TIME_MEDIATIMETYPE to\r
+ *  time events according to timestamps. If a client must perform an operation O at\r
+ *  a time T (e.g. deliver a video frame at its corresponding timestamp), it makes a \r
+ *  media time request at T (perhaps specifying an offset to ensure the request fulfillment\r
+ *  is a little early). When the clock component passes the resulting OMX_TIME_MEDIATIMETYPE\r
+ *  structure back to the client component, the client may perform operation O (perhaps having\r
+ *  to wait a slight amount more time itself as specified by the return values).\r
+ */\r
+\r
+typedef struct OMX_TIME_CONFIG_MEDIATIMEREQUESTTYPE {\r
+    OMX_U32 nSize;              /**< size of the structure in bytes */\r
+    OMX_VERSIONTYPE nVersion;   /**< OMX specification version information */\r
+    OMX_U32 nPortIndex;         /**< port that this structure applies to */\r
+    OMX_PTR pClientPrivate;     /**< Client private data to disabiguate this media time \r
+                                 *   from others (e.g. the number of the frame to deliver). \r
+                                 *   Duplicated in the media time structure that fulfills \r
+                                 *   this request. A value of zero is reserved for time scale \r
+                                 *   updates. */\r
+    OMX_TICKS nMediaTimestamp;  /**< Media timestamp requested.*/ \r
+    OMX_TICKS nOffset;          /**< Amount of wall clock time by which this\r
+                                 *   request should be fulfilled early */\r
+} OMX_TIME_CONFIG_MEDIATIMEREQUESTTYPE;\r
+\r
+/**< Structure sent from the clock component client either when fulfilling \r
+ *   a media time request or when the time scale has changed. \r
+ *\r
+ *   In the former case the Clock Component fills this structure and times its emission \r
+ *   to a client component (via the client port) according to the corresponding media \r
+ *   time request sent by the client. The Clock Component should time the emission to occur\r
+ *   when the requested timestamp matches the Clock Component's media time but also the \r
+ *   prescribed offset early. \r
+ *\r
+ *   Upon scale changes the clock component clears the nClientPrivate data, sends the current\r
+ *   media time and sets the nScale to the new scale via the client port. It emits a \r
+ *   OMX_TIME_MEDIATIMETYPE to all clients independent of any requests. This allows clients to \r
+ *   alter processing to accomodate scaling. For instance a video component might skip inter-frames \r
+ *   in the case of extreme fastforward. Likewise an audio component might add or remove samples \r
+ *   from an audio frame to scale audio data. \r
+ *\r
+ *   It is expected that some clock components may not be able to fulfill requests\r
+ *   at exactly the prescribed time. This is acceptable so long as the request is \r
+ *   fulfilled at least as early as described and not later. This structure provides \r
+ *   fields the client may use to wait for the remaining time.\r
+ *\r
+ *   The client may use either the nOffset or nWallTimeAtMedia fields to determine the \r
+ *   wall time until the nMediaTimestamp actually occurs. In the latter case the\r
+ *   client can get a more accurate value for offset by getting the current wall\r
+ *   from the cloc component and subtracting it from nWallTimeAtMedia. \r
+ */\r
+\r
+typedef struct OMX_TIME_MEDIATIMETYPE {\r
+    OMX_U32 nSize;                  /**< size of the structure in bytes */\r
+    OMX_VERSIONTYPE nVersion;       /**< OMX specification version information */\r
+    OMX_U32 nClientPrivate;         /**< Client private data to disabiguate this media time \r
+                                     *   from others. Copied from the media time request. \r
+                                     *   A value of zero is reserved for time scale updates. */\r
+    OMX_TIME_UPDATETYPE eUpdateType; /**< Reason for the update */\r
+    OMX_TICKS nMediaTimestamp;      /**< Media time requested. If no media time was \r
+                                     *   requested then this is the current media time. */ \r
+    OMX_TICKS nOffset;              /**< Amount of wall clock time by which this\r
+                                     *   request was actually fulfilled early */\r
+\r
+    OMX_TICKS nWallTimeAtMediaTime; /**< Wall time corresponding to nMediaTimeStamp.\r
+                                     *   A client may compare this value to current\r
+                                     *   media time obtained from the Clock Component to determine\r
+                                     *   the wall time until the media timestamp is really\r
+                                     *   current. */\r
+    OMX_S32 xScale;                 /**< Current media time scale in Q16 format. */\r
+    OMX_TIME_CLOCKSTATE eState;     /* Seeking Change. Added 7/12.*/\r
+                                    /**< State of the media time. */\r
+} OMX_TIME_MEDIATIMETYPE;  \r
+\r
+/** Structure representing the current media time scale factor. Applicable only to clock \r
+ *  component, other components see scale changes via OMX_TIME_MEDIATIMETYPE buffers sent via\r
+ *  the clock component client ports. Upon recieving this config the clock component changes \r
+ *  the rate by which the media time increases or decreases effectively implementing trick modes. \r
+ */ \r
+typedef struct OMX_TIME_CONFIG_SCALETYPE {\r
+    OMX_U32 nSize;                  /**< size of the structure in bytes */\r
+    OMX_VERSIONTYPE nVersion;       /**< OMX specification version information */\r
+    OMX_S32 xScale;                 /**< This is a value in Q16 format which is used for\r
+                                     * scaling the media time */\r
+} OMX_TIME_CONFIG_SCALETYPE;\r
\r
+/** Bits used to identify a clock port. Used in OMX_TIME_CONFIG_CLOCKSTATETYPE\92s nWaitMask field */\r
+#define OMX_CLOCKPORT0 0x00000001\r
+#define OMX_CLOCKPORT1 0x00000002\r
+#define OMX_CLOCKPORT2 0x00000004\r
+#define OMX_CLOCKPORT3 0x00000008\r
+#define OMX_CLOCKPORT4 0x00000010\r
+#define OMX_CLOCKPORT5 0x00000020\r
+#define OMX_CLOCKPORT6 0x00000040\r
+#define OMX_CLOCKPORT7 0x00000080\r
+\r
+/** Structure representing the current mode of the media clock. \r
+ *  IL Client uses this config to change or query the mode of the \r
+ *  media clock of the clock component. Applicable only to clock\r
+ *  component. \r
+ *  \r
+ *  On a SetConfig if eState is OMX_TIME_ClockStateRunning media time\r
+ *  starts immediately at the prescribed start time. If\r
+ *  OMX_TIME_ClockStateWaitingForStartTime the Clock Component ignores\r
+ *  the given nStartTime and waits for all clients specified in the \r
+ *  nWaitMask to send starttimes (via \r
+ *  OMX_IndexConfigTimeClientStartTime). The Clock Component then starts \r
+ *  the media clock using the earliest start time supplied. */    \r
+typedef struct OMX_TIME_CONFIG_CLOCKSTATETYPE {\r
+    OMX_U32 nSize;              /**< size of the structure in bytes */\r
+    OMX_VERSIONTYPE nVersion;   /**< OMX specification version \r
+                                 *   information */\r
+    OMX_TIME_CLOCKSTATE eState; /**< State of the media time. */\r
+    OMX_TICKS nStartTime;       /**< Start time of the media time. */\r
+    OMX_TICKS nOffset;          /**< Time to offset the media time by \r
+                                 * (e.g. preroll). Media time will be\r
+                                 * reported to be nOffset ticks earlier.     \r
+                                 */\r
+    OMX_U32 nWaitMask;          /**< Mask of OMX_CLOCKPORT values. */\r
+} OMX_TIME_CONFIG_CLOCKSTATETYPE;\r
+\r
+/** Structure representing the reference clock currently being used to\r
+ *  compute media time. IL client uses this config to change or query the \r
+ *  clock component's active reference clock */\r
+typedef struct OMX_TIME_CONFIG_ACTIVEREFCLOCKTYPE {\r
+    OMX_U32 nSize;                  /**< size of the structure in bytes */\r
+    OMX_VERSIONTYPE nVersion;       /**< OMX specification version information */\r
+    OMX_TIME_REFCLOCKTYPE eClock;   /**< Reference clock used to compute media time */                        \r
+} OMX_TIME_CONFIG_ACTIVEREFCLOCKTYPE;\r
+\r
+/** Descriptor for setting specifics of power type.\r
+ *  Note: this structure is listed for backwards compatibility. */\r
+typedef struct OMX_OTHER_CONFIG_POWERTYPE {\r
+    OMX_U32 nSize;            /**< size of the structure in bytes */\r
+    OMX_VERSIONTYPE nVersion; /**< OMX specification version information */\r
+    OMX_BOOL bEnablePM;       /**< Flag to enable Power Management */\r
+} OMX_OTHER_CONFIG_POWERTYPE;\r
+\r
+\r
+/** Descriptor for setting specifics of stats type.\r
+ *  Note: this structure is listed for backwards compatibility. */\r
+typedef struct OMX_OTHER_CONFIG_STATSTYPE {\r
+    OMX_U32 nSize;            /**< size of the structure in bytes */\r
+    OMX_VERSIONTYPE nVersion; /**< OMX specification version information */\r
+    /* what goes here */\r
+} OMX_OTHER_CONFIG_STATSTYPE;\r
+\r
+\r
+/**\r
+ * The PortDefinition structure is used to define all of the parameters \r
+ * necessary for the compliant component to setup an input or an output other \r
+ * path.\r
+ */\r
+typedef struct OMX_OTHER_PORTDEFINITIONTYPE {\r
+    OMX_OTHER_FORMATTYPE eFormat;  /**< Type of data expected for this channel */\r
+} OMX_OTHER_PORTDEFINITIONTYPE;\r
+\r
+/**  Port format parameter.  This structure is used to enumerate\r
+  *  the various data input/output format supported by the port.\r
+  */\r
+typedef struct OMX_OTHER_PARAM_PORTFORMATTYPE {\r
+    OMX_U32 nSize; /**< size of the structure in bytes */\r
+    OMX_VERSIONTYPE nVersion; /**< OMX specification version information */\r
+    OMX_U32 nPortIndex; /**< Indicates which port to set */\r
+    OMX_U32 nIndex; /**< Indicates the enumeration index for the format from 0x0 to N-1 */\r
+    OMX_OTHER_FORMATTYPE eFormat; /**< Type of data expected for this channel */\r
+} OMX_OTHER_PARAM_PORTFORMATTYPE; \r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif /* __cplusplus */\r
+\r
+#endif\r
+/* File EOF */\r
diff --git a/modules/codec/omxil/OMX_Types.h b/modules/codec/omxil/OMX_Types.h
new file mode 100644 (file)
index 0000000..96bd703
--- /dev/null
@@ -0,0 +1,347 @@
+/*\r
+ * Copyright (c) 2008 The Khronos Group Inc. \r
+ * \r
+ * Permission is hereby granted, free of charge, to any person obtaining\r
+ * a copy of this software and associated documentation files (the\r
+ * "Software"), to deal in the Software without restriction, including\r
+ * without limitation the rights to use, copy, modify, merge, publish,\r
+ * distribute, sublicense, and/or sell copies of the Software, and to\r
+ * permit persons to whom the Software is furnished to do so, subject\r
+ * to the following conditions: \r
+ * The above copyright notice and this permission notice shall be included\r
+ * in all copies or substantial portions of the Software. \r
+ * \r
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS\r
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\r
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\r
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\r
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\r
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \r
+ *\r
+ */\r
+\r
+/** OMX_Types.h - OpenMax IL version 1.1.2\r
+ *  The OMX_Types header file contains the primitive type definitions used by \r
+ *  the core, the application and the component.  This file may need to be\r
+ *  modified to be used on systems that do not have "char" set to 8 bits, \r
+ *  "short" set to 16 bits and "long" set to 32 bits.\r
+ */\r
+\r
+#ifndef OMX_Types_h\r
+#define OMX_Types_h\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif /* __cplusplus */\r
+\r
+/** The OMX_API and OMX_APIENTRY are platform specific definitions used\r
+ *  to declare OMX function prototypes.  They are modified to meet the\r
+ *  requirements for a particular platform */\r
+#ifdef __SYMBIAN32__   \r
+#   ifdef __OMX_EXPORTS\r
+#       define OMX_API __declspec(dllexport)\r
+#   else\r
+#       ifdef _WIN32\r
+#           define OMX_API __declspec(dllexport) \r
+#       else\r
+#           define OMX_API __declspec(dllimport)\r
+#       endif\r
+#   endif\r
+#else\r
+#   ifdef _WIN32\r
+#      ifdef __OMX_EXPORTS\r
+#          define OMX_API __declspec(dllexport)\r
+#      else\r
+#          define OMX_API __declspec(dllimport)\r
+#      endif\r
+#   else\r
+#      ifdef __OMX_EXPORTS\r
+#          define OMX_API\r
+#      else\r
+#          define OMX_API extern\r
+#      endif\r
+#   endif\r
+#endif\r
+\r
+#ifndef OMX_APIENTRY\r
+#define OMX_APIENTRY \r
+#endif \r
+\r
+/** OMX_IN is used to identify inputs to an OMX function.  This designation \r
+    will also be used in the case of a pointer that points to a parameter \r
+    that is used as an output. */\r
+#ifndef OMX_IN\r
+#define OMX_IN\r
+#endif\r
+\r
+/** OMX_OUT is used to identify outputs from an OMX function.  This \r
+    designation will also be used in the case of a pointer that points \r
+    to a parameter that is used as an input. */\r
+#ifndef OMX_OUT\r
+#define OMX_OUT\r
+#endif\r
+\r
+\r
+/** OMX_INOUT is used to identify parameters that may be either inputs or\r
+    outputs from an OMX function at the same time.  This designation will \r
+    also be used in the case of a pointer that  points to a parameter that \r
+    is used both as an input and an output. */\r
+#ifndef OMX_INOUT\r
+#define OMX_INOUT\r
+#endif\r
+\r
+/** OMX_ALL is used to as a wildcard to select all entities of the same type\r
+ *  when specifying the index, or referring to a object by an index.  (i.e.\r
+ *  use OMX_ALL to indicate all N channels). When used as a port index\r
+ *  for a config or parameter this OMX_ALL denotes that the config or\r
+ *  parameter applies to the entire component not just one port. */\r
+#define OMX_ALL 0xFFFFFFFF\r
+\r
+/** In the following we define groups that help building doxygen documentation */\r
+\r
+/** @defgroup core OpenMAX IL core\r
+ * Functions and structure related to the OMX IL core\r
+ */\r
\r
+ /** @defgroup comp OpenMAX IL component\r
+ * Functions and structure related to the OMX IL component\r
+ */\r
\r
+/** @defgroup rpm Resource and Policy Management \r
+ * Structures for resource and policy management of components\r
+ */\r
+\r
+/** @defgroup buf Buffer Management\r
+ * Buffer handling functions and structures\r
+ */\r
+  \r
+/** @defgroup tun Tunneling\r
+ * @ingroup core comp\r
+ * Structures and functions to manage tunnels among component ports\r
+ */\r
\r
+/** @defgroup cp Content Pipes\r
+ *  @ingroup core\r
+ */\r
\r
+ /** @defgroup metadata Metadata handling\r
+  * \r
+  */ \r
+\r
+/** OMX_U8 is an 8 bit unsigned quantity that is byte aligned */\r
+typedef unsigned char OMX_U8;\r
+\r
+/** OMX_S8 is an 8 bit signed quantity that is byte aligned */\r
+typedef signed char OMX_S8;\r
+\r
+/** OMX_U16 is a 16 bit unsigned quantity that is 16 bit word aligned */\r
+typedef unsigned short OMX_U16;\r
+\r
+/** OMX_S16 is a 16 bit signed quantity that is 16 bit word aligned */\r
+typedef signed short OMX_S16;\r
+\r
+/** OMX_U32 is a 32 bit unsigned quantity that is 32 bit word aligned */\r
+typedef unsigned long OMX_U32;\r
+\r
+/** OMX_S32 is a 32 bit signed quantity that is 32 bit word aligned */\r
+typedef signed long OMX_S32;\r
+\r
+\r
+/* Users with compilers that cannot accept the "long long" designation should\r
+   define the OMX_SKIP64BIT macro.  It should be noted that this may cause \r
+   some components to fail to compile if the component was written to require\r
+   64 bit integral types.  However, these components would NOT compile anyway\r
+   since the compiler does not support the way the component was written.\r
+*/\r
+#ifndef OMX_SKIP64BIT\r
+#ifdef __SYMBIAN32__\r
+/** OMX_U64 is a 64 bit unsigned quantity that is 64 bit word aligned */\r
+typedef unsigned long long OMX_U64;\r
+\r
+/** OMX_S64 is a 64 bit signed quantity that is 64 bit word aligned */\r
+typedef signed long long OMX_S64;\r
+\r
+#elif defined(WIN32)\r
+\r
+/** OMX_U64 is a 64 bit unsigned quantity that is 64 bit word aligned */   \r
+typedef unsigned __int64  OMX_U64;\r
+\r
+/** OMX_S64 is a 64 bit signed quantity that is 64 bit word aligned */\r
+typedef signed   __int64  OMX_S64;\r
+\r
+#else /* WIN32 */\r
+\r
+/** OMX_U64 is a 64 bit unsigned quantity that is 64 bit word aligned */\r
+typedef unsigned long long OMX_U64;\r
+\r
+/** OMX_S64 is a 64 bit signed quantity that is 64 bit word aligned */\r
+typedef signed long long OMX_S64;\r
+\r
+#endif /* WIN32 */\r
+#endif\r
+\r
+\r
+/** The OMX_BOOL type is intended to be used to represent a true or a false \r
+    value when passing parameters to and from the OMX core and components.  The\r
+    OMX_BOOL is a 32 bit quantity and is aligned on a 32 bit word boundary.\r
+ */\r
+typedef enum OMX_BOOL {\r
+    OMX_FALSE = 0,\r
+    OMX_TRUE = !OMX_FALSE,\r
+    OMX_BOOL_MAX = 0x7FFFFFFF\r
+} OMX_BOOL; \r
\r
+/** The OMX_PTR type is intended to be used to pass pointers between the OMX\r
+    applications and the OMX Core and components.  This is a 32 bit pointer and\r
+    is aligned on a 32 bit boundary.\r
+ */\r
+typedef void* OMX_PTR;\r
+\r
+/** The OMX_STRING type is intended to be used to pass "C" type strings between\r
+    the application and the core and component.  The OMX_STRING type is a 32 \r
+    bit pointer to a zero terminated string.  The  pointer is word aligned and \r
+    the string is byte aligned.  \r
+ */\r
+typedef char* OMX_STRING;\r
+\r
+/** The OMX_BYTE type is intended to be used to pass arrays of bytes such as\r
+    buffers between the application and the component and core.  The OMX_BYTE \r
+    type is a 32 bit pointer to a zero terminated string.  The  pointer is word\r
+    aligned and the string is byte aligned.\r
+ */\r
+typedef unsigned char* OMX_BYTE;\r
+\r
+/** OMX_UUIDTYPE is a very long unique identifier to uniquely identify\r
+    at runtime.  This identifier should be generated by a component in a way\r
+    that guarantees that every instance of the identifier running on the system\r
+    is unique. */\r
+typedef unsigned char OMX_UUIDTYPE[128];\r
+\r
+/** The OMX_DIRTYPE enumeration is used to indicate if a port is an input or\r
+    an output port.  This enumeration is common across all component types.    \r
+ */\r
+typedef enum OMX_DIRTYPE\r
+{\r
+    OMX_DirInput,              /**< Port is an input port */\r
+    OMX_DirOutput,             /**< Port is an output port */\r
+    OMX_DirMax = 0x7FFFFFFF\r
+} OMX_DIRTYPE;\r
+\r
+/** The OMX_ENDIANTYPE enumeration is used to indicate the bit ordering \r
+    for numerical data (i.e. big endian, or little endian).    \r
+ */\r
+typedef enum OMX_ENDIANTYPE\r
+{\r
+    OMX_EndianBig, /**< big endian */\r
+    OMX_EndianLittle, /**< little endian */\r
+    OMX_EndianMax = 0x7FFFFFFF\r
+} OMX_ENDIANTYPE;\r
+\r
+\r
+/** The OMX_NUMERICALDATATYPE enumeration is used to indicate if data \r
+    is signed or unsigned\r
+ */\r
+typedef enum OMX_NUMERICALDATATYPE\r
+{\r
+    OMX_NumericalDataSigned, /**< signed data */\r
+    OMX_NumericalDataUnsigned, /**< unsigned data */\r
+    OMX_NumercialDataMax = 0x7FFFFFFF\r
+} OMX_NUMERICALDATATYPE;\r
+\r
+\r
+/** Unsigned bounded value type */\r
+typedef struct OMX_BU32 {\r
+    OMX_U32 nValue; /**< actual value */\r
+    OMX_U32 nMin;   /**< minimum for value (i.e. nValue >= nMin) */\r
+    OMX_U32 nMax;   /**< maximum for value (i.e. nValue <= nMax) */\r
+} OMX_BU32;\r
+\r
+\r
+/** Signed bounded value type */\r
+typedef struct OMX_BS32 {\r
+    OMX_S32 nValue; /**< actual value */\r
+    OMX_S32 nMin;   /**< minimum for value (i.e. nValue >= nMin) */\r
+    OMX_S32 nMax;   /**< maximum for value (i.e. nValue <= nMax) */\r
+} OMX_BS32;\r
+\r
+\r
+/** Structure representing some time or duration in microseconds. This structure\r
+  *  must be interpreted as a signed 64 bit value. The quantity is signed to accommodate \r
+  *  negative deltas and preroll scenarios. The quantity is represented in microseconds \r
+  *  to accomodate high resolution timestamps (e.g. DVD presentation timestamps based\r
+  *  on a 90kHz clock) and to allow more accurate and synchronized delivery (e.g. \r
+  *  individual audio samples delivered at 192 kHz). The quantity is 64 bit to \r
+  *  accommodate a large dynamic range (signed 32 bit values would allow only for plus\r
+  *  or minus 35 minutes).\r
+  *\r
+  *  Implementations with limited precision may convert the signed 64 bit value to \r
+  *  a signed 32 bit value internally but risk loss of precision.  \r
+  */\r
+#ifndef OMX_SKIP64BIT\r
+typedef OMX_S64 OMX_TICKS;\r
+#else\r
+typedef struct OMX_TICKS\r
+{\r
+    OMX_U32 nLowPart;    /** low bits of the signed 64 bit tick value */\r
+    OMX_U32 nHighPart;   /** high bits of the signed 64 bit tick value */\r
+} OMX_TICKS;\r
+#endif\r
+#define OMX_TICKS_PER_SECOND 1000000\r
+\r
+/** Define the public interface for the OMX Handle.  The core will not use\r
+    this value internally, but the application should only use this value.\r
+ */\r
+typedef void* OMX_HANDLETYPE;\r
+\r
+typedef struct OMX_MARKTYPE\r
+{\r
+    OMX_HANDLETYPE hMarkTargetComponent;   /**< The component that will \r
+                                                generate a mark event upon \r
+                                                processing the mark. */\r
+    OMX_PTR pMarkData;   /**< Application specific data associated with \r
+                              the mark sent on a mark event to disambiguate \r
+                              this mark from others. */\r
+} OMX_MARKTYPE;\r
+\r
+\r
+/** OMX_NATIVE_DEVICETYPE is used to map a OMX video port to the\r
+ *  platform & operating specific object used to reference the display \r
+ *  or can be used by a audio port for native audio rendering */\r
+typedef void* OMX_NATIVE_DEVICETYPE;\r
+\r
+/** OMX_NATIVE_WINDOWTYPE is used to map a OMX video port to the\r
+ *  platform & operating specific object used to reference the window */\r
+typedef void* OMX_NATIVE_WINDOWTYPE;\r
+\r
+/** The OMX_VERSIONTYPE union is used to specify the version for\r
+    a structure or component.  For a component, the version is entirely\r
+    specified by the component vendor.  Components doing the same function\r
+    from different vendors may or may not have the same version.  For \r
+    structures, the version shall be set by the entity that allocates the\r
+    structure.  For structures specified in the OMX 1.1 specification, the\r
+    value of the version shall be set to 1.1.0.0 in all cases.  Access to the\r
+    OMX_VERSIONTYPE can be by a single 32 bit access (e.g. by nVersion) or\r
+    by accessing one of the structure elements to, for example, check only\r
+    the Major revision.\r
+ */\r
+typedef union OMX_VERSIONTYPE\r
+{\r
+    struct\r
+    {\r
+        OMX_U8 nVersionMajor;   /**< Major version accessor element */\r
+        OMX_U8 nVersionMinor;   /**< Minor version accessor element */\r
+        OMX_U8 nRevision;       /**< Revision version accessor element */\r
+        OMX_U8 nStep;           /**< Step version accessor element */\r
+    } s;\r
+    OMX_U32 nVersion;           /**< 32 bit value to make accessing the\r
+                                    version easily done in a single word\r
+                                    size copy/compare operation */\r
+} OMX_VERSIONTYPE;\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif /* __cplusplus */\r
+\r
+#endif\r
+/* File EOF */\r
diff --git a/modules/codec/omxil/OMX_Video.h b/modules/codec/omxil/OMX_Video.h
new file mode 100644 (file)
index 0000000..049f936
--- /dev/null
@@ -0,0 +1,1060 @@
+/**\r
+ * Copyright (c) 2008 The Khronos Group Inc. \r
+ * \r
+ * Permission is hereby granted, free of charge, to any person obtaining\r
+ * a copy of this software and associated documentation files (the\r
+ * "Software"), to deal in the Software without restriction, including\r
+ * without limitation the rights to use, copy, modify, merge, publish,\r
+ * distribute, sublicense, and/or sell copies of the Software, and to\r
+ * permit persons to whom the Software is furnished to do so, subject\r
+ * to the following conditions: \r
+ * The above copyright notice and this permission notice shall be included\r
+ * in all copies or substantial portions of the Software. \r
+ * \r
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS\r
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\r
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\r
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\r
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\r
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \r
+ *\r
+ */\r
+\r
+/** \r
+ *  @file OMX_Video.h - OpenMax IL version 1.1.2\r
+ *  The structures is needed by Video components to exchange parameters \r
+ *  and configuration data with OMX components.\r
+ */\r
+#ifndef OMX_Video_h\r
+#define OMX_Video_h\r
+\r
+/** @defgroup video OpenMAX IL Video Domain\r
+ * @ingroup iv\r
+ * Structures for OpenMAX IL Video domain\r
+ * @{\r
+ */\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif /* __cplusplus */\r
+\r
+\r
+/**\r
+ * Each OMX header must include all required header files to allow the\r
+ * header to compile without errors.  The includes below are required\r
+ * for this header file to compile successfully \r
+ */\r
+\r
+#include <OMX_IVCommon.h>\r
+\r
+\r
+/**\r
+ * Enumeration used to define the possible video compression codings.  \r
+ * NOTE:  This essentially refers to file extensions. If the coding is \r
+ *        being used to specify the ENCODE type, then additional work \r
+ *        must be done to configure the exact flavor of the compression \r
+ *        to be used.  For decode cases where the user application can \r
+ *        not differentiate between MPEG-4 and H.264 bit streams, it is \r
+ *        up to the codec to handle this.\r
+ */\r
+typedef enum OMX_VIDEO_CODINGTYPE {\r
+    OMX_VIDEO_CodingUnused,     /**< Value when coding is N/A */\r
+    OMX_VIDEO_CodingAutoDetect, /**< Autodetection of coding type */\r
+    OMX_VIDEO_CodingMPEG2,      /**< AKA: H.262 */\r
+    OMX_VIDEO_CodingH263,       /**< H.263 */\r
+    OMX_VIDEO_CodingMPEG4,      /**< MPEG-4 */\r
+    OMX_VIDEO_CodingWMV,        /**< all versions of Windows Media Video */\r
+    OMX_VIDEO_CodingRV,         /**< all versions of Real Video */\r
+    OMX_VIDEO_CodingAVC,        /**< H.264/AVC */\r
+    OMX_VIDEO_CodingMJPEG,      /**< Motion JPEG */\r
+    OMX_VIDEO_CodingKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ \r
+    OMX_VIDEO_CodingVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */\r
+    OMX_VIDEO_CodingMax = 0x7FFFFFFF\r
+} OMX_VIDEO_CODINGTYPE;\r
+\r
+\r
+/**\r
+ * Data structure used to define a video path.  The number of Video paths for \r
+ * input and output will vary by type of the Video component.  \r
+ * \r
+ *    Input (aka Source) : zero Inputs, one Output,\r
+ *    Splitter           : one Input, 2 or more Outputs,\r
+ *    Processing Element : one Input, one output,\r
+ *    Mixer              : 2 or more inputs, one output,\r
+ *    Output (aka Sink)  : one Input, zero outputs.\r
+ * \r
+ * The PortDefinition structure is used to define all of the parameters \r
+ * necessary for the compliant component to setup an input or an output video \r
+ * path.  If additional vendor specific data is required, it should be \r
+ * transmitted to the component using the CustomCommand function.  Compliant \r
+ * components will prepopulate this structure with optimal values during the \r
+ * GetDefaultInitParams command.\r
+ *\r
+ * STRUCT MEMBERS:\r
+ *  cMIMEType             : MIME type of data for the port\r
+ *  pNativeRender         : Platform specific reference for a display if a \r
+ *                          sync, otherwise this field is 0\r
+ *  nFrameWidth           : Width of frame to be used on channel if \r
+ *                          uncompressed format is used.  Use 0 for unknown,\r
+ *                          don't care or variable\r
+ *  nFrameHeight          : Height of frame to be used on channel if \r
+ *                          uncompressed format is used. Use 0 for unknown,\r
+ *                          don't care or variable\r
+ *  nStride               : Number of bytes per span of an image \r
+ *                          (i.e. indicates the number of bytes to get\r
+ *                          from span N to span N+1, where negative stride\r
+ *                          indicates the image is bottom up\r
+ *  nSliceHeight          : Height used when encoding in slices\r
+ *  nBitrate              : Bit rate of frame to be used on channel if \r
+ *                          compressed format is used. Use 0 for unknown, \r
+ *                          don't care or variable\r
+ *  xFramerate            : Frame rate to be used on channel if uncompressed \r
+ *                          format is used. Use 0 for unknown, don't care or \r
+ *                          variable.  Units are Q16 frames per second.\r
+ *  bFlagErrorConcealment : Turns on error concealment if it is supported by \r
+ *                          the OMX component\r
+ *  eCompressionFormat    : Compression format used in this instance of the \r
+ *                          component. When OMX_VIDEO_CodingUnused is \r
+ *                          specified, eColorFormat is used\r
+ *  eColorFormat : Decompressed format used by this component\r
+ *  pNativeWindow : Platform specific reference for a window object if a \r
+ *                          display sink , otherwise this field is 0x0. \r
+ */\r
+typedef struct OMX_VIDEO_PORTDEFINITIONTYPE {\r
+    OMX_STRING cMIMEType;\r
+    OMX_NATIVE_DEVICETYPE pNativeRender;\r
+    OMX_U32 nFrameWidth;\r
+    OMX_U32 nFrameHeight;\r
+    OMX_S32 nStride;\r
+    OMX_U32 nSliceHeight;\r
+    OMX_U32 nBitrate;\r
+    OMX_U32 xFramerate;\r
+    OMX_BOOL bFlagErrorConcealment;\r
+    OMX_VIDEO_CODINGTYPE eCompressionFormat;\r
+    OMX_COLOR_FORMATTYPE eColorFormat;\r
+    OMX_NATIVE_WINDOWTYPE pNativeWindow;\r
+} OMX_VIDEO_PORTDEFINITIONTYPE;\r
+\r
+/**  \r
+ * Port format parameter.  This structure is used to enumerate the various \r
+ * data input/output format supported by the port.\r
+ * \r
+ * STRUCT MEMBERS:\r
+ *  nSize              : Size of the structure in bytes\r
+ *  nVersion           : OMX specification version information\r
+ *  nPortIndex         : Indicates which port to set\r
+ *  nIndex             : Indicates the enumeration index for the format from \r
+ *                       0x0 to N-1\r
+ *  eCompressionFormat : Compression format used in this instance of the \r
+ *                       component. When OMX_VIDEO_CodingUnused is specified, \r
+ *                       eColorFormat is used \r
+ *  eColorFormat       : Decompressed format used by this component\r
+ *  xFrameRate         : Indicates the video frame rate in Q16 format\r
+ */\r
+typedef struct OMX_VIDEO_PARAM_PORTFORMATTYPE {\r
+    OMX_U32 nSize;\r
+    OMX_VERSIONTYPE nVersion;\r
+    OMX_U32 nPortIndex;\r
+    OMX_U32 nIndex;\r
+    OMX_VIDEO_CODINGTYPE eCompressionFormat; \r
+    OMX_COLOR_FORMATTYPE eColorFormat;\r
+    OMX_U32 xFramerate;\r
+} OMX_VIDEO_PARAM_PORTFORMATTYPE;\r
+\r
+\r
+/**\r
+ * This is a structure for configuring video compression quantization \r
+ * parameter values.  Codecs may support different QP values for different\r
+ * frame types.\r
+ *\r
+ * STRUCT MEMBERS:\r
+ *  nSize      : Size of the structure in bytes\r
+ *  nVersion   : OMX specification version info\r
+ *  nPortIndex : Port that this structure applies to\r
+ *  nQpI       : QP value to use for index frames\r
+ *  nQpP       : QP value to use for P frames\r
+ *  nQpB       : QP values to use for bidirectional frames \r
+ */\r
+typedef struct OMX_VIDEO_PARAM_QUANTIZATIONTYPE {\r
+    OMX_U32 nSize;            \r
+    OMX_VERSIONTYPE nVersion;\r
+    OMX_U32 nPortIndex;\r
+    OMX_U32 nQpI;\r
+    OMX_U32 nQpP;\r
+    OMX_U32 nQpB;\r
+} OMX_VIDEO_PARAM_QUANTIZATIONTYPE;\r
+\r
+\r
+/** \r
+ * Structure for configuration of video fast update parameters. \r
+ *  \r
+ * STRUCT MEMBERS:\r
+ *  nSize      : Size of the structure in bytes\r
+ *  nVersion   : OMX specification version info \r
+ *  nPortIndex : Port that this structure applies to\r
+ *  bEnableVFU : Enable/Disable video fast update\r
+ *  nFirstGOB  : Specifies the number of the first macroblock row\r
+ *  nFirstMB   : specifies the first MB relative to the specified first GOB\r
+ *  nNumMBs    : Specifies the number of MBs to be refreshed from nFirstGOB \r
+ *               and nFirstMB\r
+ */\r
+typedef struct OMX_VIDEO_PARAM_VIDEOFASTUPDATETYPE {\r
+    OMX_U32 nSize;            \r
+    OMX_VERSIONTYPE nVersion; \r
+    OMX_U32 nPortIndex;       \r
+    OMX_BOOL bEnableVFU;      \r
+    OMX_U32 nFirstGOB;                            \r
+    OMX_U32 nFirstMB;                            \r
+    OMX_U32 nNumMBs;                                  \r
+} OMX_VIDEO_PARAM_VIDEOFASTUPDATETYPE;\r
+\r
+\r
+/** \r
+ * Enumeration of possible bitrate control types \r
+ */\r
+typedef enum OMX_VIDEO_CONTROLRATETYPE {\r
+    OMX_Video_ControlRateDisable,\r
+    OMX_Video_ControlRateVariable,\r
+    OMX_Video_ControlRateConstant,\r
+    OMX_Video_ControlRateVariableSkipFrames,\r
+    OMX_Video_ControlRateConstantSkipFrames,\r
+    OMX_Video_ControlRateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ \r
+    OMX_Video_ControlRateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */\r
+    OMX_Video_ControlRateMax = 0x7FFFFFFF\r
+} OMX_VIDEO_CONTROLRATETYPE;\r
+\r
+\r
+/** \r
+ * Structure for configuring bitrate mode of a codec. \r
+ *\r
+ * STRUCT MEMBERS:\r
+ *  nSize          : Size of the struct in bytes\r
+ *  nVersion       : OMX spec version info\r
+ *  nPortIndex     : Port that this struct applies to\r
+ *  eControlRate   : Control rate type enum\r
+ *  nTargetBitrate : Target bitrate to encode with\r
+ */\r
+typedef struct OMX_VIDEO_PARAM_BITRATETYPE {\r
+    OMX_U32 nSize;                          \r
+    OMX_VERSIONTYPE nVersion;               \r
+    OMX_U32 nPortIndex;                     \r
+    OMX_VIDEO_CONTROLRATETYPE eControlRate; \r
+    OMX_U32 nTargetBitrate;                 \r
+} OMX_VIDEO_PARAM_BITRATETYPE;\r
+\r
+\r
+/** \r
+ * Enumeration of possible motion vector (MV) types \r
+ */\r
+typedef enum OMX_VIDEO_MOTIONVECTORTYPE {\r
+    OMX_Video_MotionVectorPixel,\r
+    OMX_Video_MotionVectorHalfPel,\r
+    OMX_Video_MotionVectorQuarterPel,\r
+    OMX_Video_MotionVectorEighthPel,\r
+    OMX_Video_MotionVectorKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ \r
+    OMX_Video_MotionVectorVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */\r
+    OMX_Video_MotionVectorMax = 0x7FFFFFFF\r
+} OMX_VIDEO_MOTIONVECTORTYPE;\r
+\r
+\r
+/**\r
+ * Structure for configuring the number of motion vectors used as well\r
+ * as their accuracy.\r
+ * \r
+ * STRUCT MEMBERS:\r
+ *  nSize            : Size of the struct in bytes\r
+ *  nVersion         : OMX spec version info\r
+ *  nPortIndex       : port that this structure applies to\r
+ *  eAccuracy        : Enumerated MV accuracy\r
+ *  bUnrestrictedMVs : Allow unrestricted MVs\r
+ *  bFourMV          : Allow use of 4 MVs\r
+ *  sXSearchRange    : Search range in horizontal direction for MVs\r
+ *  sYSearchRange    : Search range in vertical direction for MVs\r
+ */\r
+typedef struct OMX_VIDEO_PARAM_MOTIONVECTORTYPE {\r
+    OMX_U32 nSize;\r
+    OMX_VERSIONTYPE nVersion;\r
+    OMX_U32 nPortIndex;\r
+    OMX_VIDEO_MOTIONVECTORTYPE eAccuracy;\r
+    OMX_BOOL bUnrestrictedMVs;\r
+    OMX_BOOL bFourMV;\r
+    OMX_S32 sXSearchRange;\r
+    OMX_S32 sYSearchRange;\r
+} OMX_VIDEO_PARAM_MOTIONVECTORTYPE;\r
+\r
+\r
+/** \r
+ * Enumeration of possible methods to use for Intra Refresh \r
+ */\r
+typedef enum OMX_VIDEO_INTRAREFRESHTYPE {\r
+    OMX_VIDEO_IntraRefreshCyclic,\r
+    OMX_VIDEO_IntraRefreshAdaptive,\r
+    OMX_VIDEO_IntraRefreshBoth,\r
+    OMX_VIDEO_IntraRefreshKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ \r
+    OMX_VIDEO_IntraRefreshVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */\r
+    OMX_VIDEO_IntraRefreshMax = 0x7FFFFFFF\r
+} OMX_VIDEO_INTRAREFRESHTYPE;\r
+\r
+\r
+/**\r
+ * Structure for configuring intra refresh mode \r
+ * \r
+ * STRUCT MEMBERS:\r
+ *  nSize        : Size of the structure in bytes\r
+ *  nVersion     : OMX specification version information\r
+ *  nPortIndex   : Port that this structure applies to\r
+ *  eRefreshMode : Cyclic, Adaptive, or Both\r
+ *  nAirMBs      : Number of intra macroblocks to refresh in a frame when \r
+ *                 AIR is enabled\r
+ *  nAirRef      : Number of times a motion marked macroblock has to be  \r
+ *                 intra coded\r
+ *  nCirMBs      : Number of consecutive macroblocks to be coded as "intra"  \r
+ *                 when CIR is enabled\r
+ */\r
+typedef struct OMX_VIDEO_PARAM_INTRAREFRESHTYPE {\r
+    OMX_U32 nSize;\r
+    OMX_VERSIONTYPE nVersion;\r
+    OMX_U32 nPortIndex;\r
+    OMX_VIDEO_INTRAREFRESHTYPE eRefreshMode;\r
+    OMX_U32 nAirMBs;\r
+    OMX_U32 nAirRef;\r
+    OMX_U32 nCirMBs;\r
+} OMX_VIDEO_PARAM_INTRAREFRESHTYPE;\r
+\r
+\r
+/**\r
+ * Structure for enabling various error correction methods for video \r
+ * compression.\r
+ *\r
+ * STRUCT MEMBERS:\r
+ *  nSize                   : Size of the structure in bytes\r
+ *  nVersion                : OMX specification version information \r
+ *  nPortIndex              : Port that this structure applies to \r
+ *  bEnableHEC              : Enable/disable header extension codes (HEC)\r
+ *  bEnableResync           : Enable/disable resynchronization markers\r
+ *  nResynchMarkerSpacing   : Resynch markers interval (in bits) to be \r
+ *                            applied in the stream \r
+ *  bEnableDataPartitioning : Enable/disable data partitioning \r
+ *  bEnableRVLC             : Enable/disable reversible variable length \r
+ *                            coding\r
+ */\r
+typedef struct OMX_VIDEO_PARAM_ERRORCORRECTIONTYPE {\r
+    OMX_U32 nSize;\r
+    OMX_VERSIONTYPE nVersion;\r
+    OMX_U32 nPortIndex;\r
+    OMX_BOOL bEnableHEC;\r
+    OMX_BOOL bEnableResync;\r
+    OMX_U32  nResynchMarkerSpacing;\r
+    OMX_BOOL bEnableDataPartitioning;\r
+    OMX_BOOL bEnableRVLC;\r
+} OMX_VIDEO_PARAM_ERRORCORRECTIONTYPE;\r
+\r
+\r
+/** \r
+ * Configuration of variable block-size motion compensation (VBSMC) \r
+ * \r
+ * STRUCT MEMBERS:\r
+ *  nSize      : Size of the structure in bytes\r
+ *  nVersion   : OMX specification version information \r
+ *  nPortIndex : Port that this structure applies to\r
+ *  b16x16     : Enable inter block search 16x16\r
+ *  b16x8      : Enable inter block search 16x8\r
+ *  b8x16      : Enable inter block search 8x16\r
+ *  b8x8       : Enable inter block search 8x8\r
+ *  b8x4       : Enable inter block search 8x4\r
+ *  b4x8       : Enable inter block search 4x8\r
+ *  b4x4       : Enable inter block search 4x4\r
+ */\r
+typedef struct OMX_VIDEO_PARAM_VBSMCTYPE {\r
+    OMX_U32 nSize; \r
+    OMX_VERSIONTYPE nVersion; \r
+    OMX_U32 nPortIndex;       \r
+    OMX_BOOL b16x16; \r
+    OMX_BOOL b16x8; \r
+    OMX_BOOL b8x16;\r
+    OMX_BOOL b8x8;\r
+    OMX_BOOL b8x4;\r
+    OMX_BOOL b4x8;\r
+    OMX_BOOL b4x4;\r
+} OMX_VIDEO_PARAM_VBSMCTYPE;\r
+\r
+\r
+/** \r
+ * H.263 profile types, each profile indicates support for various \r
+ * performance bounds and different annexes.\r
+ *\r
+ * ENUMS:\r
+ *  Baseline           : Baseline Profile: H.263 (V1), no optional modes                                                    \r
+ *  H320 Coding        : H.320 Coding Efficiency Backward Compatibility \r
+ *                       Profile: H.263+ (V2), includes annexes I, J, L.4\r
+ *                       and T\r
+ *  BackwardCompatible : Backward Compatibility Profile: H.263 (V1), \r
+ *                       includes annex F                                    \r
+ *  ISWV2              : Interactive Streaming Wireless Profile: H.263+ \r
+ *                       (V2), includes annexes I, J, K and T                 \r
+ *  ISWV3              : Interactive Streaming Wireless Profile: H.263++  \r
+ *                       (V3), includes profile 3 and annexes V and W.6.3.8   \r
+ *  HighCompression    : Conversational High Compression Profile: H.263++  \r
+ *                       (V3), includes profiles 1 & 2 and annexes D and U   \r
+ *  Internet           : Conversational Internet Profile: H.263++ (V3),  \r
+ *                       includes profile 5 and annex K                       \r
+ *  Interlace          : Conversational Interlace Profile: H.263++ (V3),  \r
+ *                       includes profile 5 and annex W.6.3.11               \r
+ *  HighLatency        : High Latency Profile: H.263++ (V3), includes  \r
+ *                       profile 6 and annexes O.1 and P.5                       \r
+ */\r
+typedef enum OMX_VIDEO_H263PROFILETYPE {\r
+    OMX_VIDEO_H263ProfileBaseline            = 0x01,        \r
+    OMX_VIDEO_H263ProfileH320Coding          = 0x02,          \r
+    OMX_VIDEO_H263ProfileBackwardCompatible  = 0x04,  \r
+    OMX_VIDEO_H263ProfileISWV2               = 0x08,               \r
+    OMX_VIDEO_H263ProfileISWV3               = 0x10,               \r
+    OMX_VIDEO_H263ProfileHighCompression     = 0x20,     \r
+    OMX_VIDEO_H263ProfileInternet            = 0x40,            \r
+    OMX_VIDEO_H263ProfileInterlace           = 0x80,           \r
+    OMX_VIDEO_H263ProfileHighLatency         = 0x100,         \r
+    OMX_VIDEO_H263ProfileKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ \r
+    OMX_VIDEO_H263ProfileVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */\r
+    OMX_VIDEO_H263ProfileMax                 = 0x7FFFFFFF  \r
+} OMX_VIDEO_H263PROFILETYPE;\r
+\r
+\r
+/** \r
+ * H.263 level types, each level indicates support for various frame sizes, \r
+ * bit rates, decoder frame rates.\r
+ */\r
+typedef enum OMX_VIDEO_H263LEVELTYPE {\r
+    OMX_VIDEO_H263Level10  = 0x01,  \r
+    OMX_VIDEO_H263Level20  = 0x02,      \r
+    OMX_VIDEO_H263Level30  = 0x04,      \r
+    OMX_VIDEO_H263Level40  = 0x08,      \r
+    OMX_VIDEO_H263Level45  = 0x10,      \r
+    OMX_VIDEO_H263Level50  = 0x20,      \r
+    OMX_VIDEO_H263Level60  = 0x40,      \r
+    OMX_VIDEO_H263Level70  = 0x80, \r
+    OMX_VIDEO_H263LevelKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ \r
+    OMX_VIDEO_H263LevelVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */\r
+    OMX_VIDEO_H263LevelMax = 0x7FFFFFFF  \r
+} OMX_VIDEO_H263LEVELTYPE;\r
+\r
+\r
+/** \r
+ * Specifies the picture type. These values should be OR'd to signal all \r
+ * pictures types which are allowed.\r
+ *\r
+ * ENUMS:\r
+ *  Generic Picture Types:          I, P and B\r
+ *  H.263 Specific Picture Types:   SI and SP\r
+ *  H.264 Specific Picture Types:   EI and EP\r
+ *  MPEG-4 Specific Picture Types:  S\r
+ */\r
+typedef enum OMX_VIDEO_PICTURETYPE {\r
+    OMX_VIDEO_PictureTypeI   = 0x01,\r
+    OMX_VIDEO_PictureTypeP   = 0x02,\r
+    OMX_VIDEO_PictureTypeB   = 0x04,\r
+    OMX_VIDEO_PictureTypeSI  = 0x08,\r
+    OMX_VIDEO_PictureTypeSP  = 0x10,\r
+    OMX_VIDEO_PictureTypeEI  = 0x11,\r
+    OMX_VIDEO_PictureTypeEP  = 0x12,\r
+    OMX_VIDEO_PictureTypeS   = 0x14,\r
+    OMX_VIDEO_PictureTypeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ \r
+    OMX_VIDEO_PictureTypeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */\r
+    OMX_VIDEO_PictureTypeMax = 0x7FFFFFFF\r
+} OMX_VIDEO_PICTURETYPE;\r
+\r
+\r
+/** \r
+ * H.263 Params \r
+ *\r
+ * STRUCT MEMBERS:\r
+ *  nSize                    : Size of the structure in bytes\r
+ *  nVersion                 : OMX specification version information \r
+ *  nPortIndex               : Port that this structure applies to\r
+ *  nPFrames                 : Number of P frames between each I frame\r
+ *  nBFrames                 : Number of B frames between each I frame\r
+ *  eProfile                 : H.263 profile(s) to use\r
+ *  eLevel                   : H.263 level(s) to use\r
+ *  bPLUSPTYPEAllowed        : Indicating that it is allowed to use PLUSPTYPE \r
+ *                             (specified in the 1998 version of H.263) to \r
+ *                             indicate custom picture sizes or clock \r
+ *                             frequencies \r
+ *  nAllowedPictureTypes     : Specifies the picture types allowed in the \r
+ *                             bitstream\r
+ *  bForceRoundingTypeToZero : value of the RTYPE bit (bit 6 of MPPTYPE) is \r
+ *                             not constrained. It is recommended to change \r
+ *                             the value of the RTYPE bit for each reference \r
+ *                             picture in error-free communication\r
+ *  nPictureHeaderRepetition : Specifies the frequency of picture header \r
+ *                             repetition\r
+ *  nGOBHeaderInterval       : Specifies the interval of non-empty GOB  \r
+ *                             headers in units of GOBs\r
+ */\r
+typedef struct OMX_VIDEO_PARAM_H263TYPE {\r
+    OMX_U32 nSize;\r
+    OMX_VERSIONTYPE nVersion;\r
+    OMX_U32 nPortIndex;\r
+    OMX_U32 nPFrames;\r
+    OMX_U32 nBFrames;\r
+    OMX_VIDEO_H263PROFILETYPE eProfile;\r
+       OMX_VIDEO_H263LEVELTYPE eLevel;\r
+    OMX_BOOL bPLUSPTYPEAllowed;\r
+    OMX_U32 nAllowedPictureTypes;\r
+    OMX_BOOL bForceRoundingTypeToZero;\r
+    OMX_U32 nPictureHeaderRepetition;\r
+    OMX_U32 nGOBHeaderInterval;\r
+} OMX_VIDEO_PARAM_H263TYPE;\r
+\r
+\r
+/** \r
+ * MPEG-2 profile types, each profile indicates support for various \r
+ * performance bounds and different annexes.\r
+ */\r
+typedef enum OMX_VIDEO_MPEG2PROFILETYPE {\r
+    OMX_VIDEO_MPEG2ProfileSimple = 0,  /**< Simple Profile */\r
+    OMX_VIDEO_MPEG2ProfileMain,        /**< Main Profile */\r
+    OMX_VIDEO_MPEG2Profile422,         /**< 4:2:2 Profile */\r
+    OMX_VIDEO_MPEG2ProfileSNR,         /**< SNR Profile */\r
+    OMX_VIDEO_MPEG2ProfileSpatial,     /**< Spatial Profile */\r
+    OMX_VIDEO_MPEG2ProfileHigh,        /**< High Profile */\r
+    OMX_VIDEO_MPEG2ProfileKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ \r
+    OMX_VIDEO_MPEG2ProfileVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */\r
+    OMX_VIDEO_MPEG2ProfileMax = 0x7FFFFFFF  \r
+} OMX_VIDEO_MPEG2PROFILETYPE;\r
+\r
+\r
+/** \r
+ * MPEG-2 level types, each level indicates support for various frame \r
+ * sizes, bit rates, decoder frame rates.  No need \r
+ */\r
+typedef enum OMX_VIDEO_MPEG2LEVELTYPE {\r
+    OMX_VIDEO_MPEG2LevelLL = 0,  /**< Low Level */ \r
+    OMX_VIDEO_MPEG2LevelML,      /**< Main Level */ \r
+    OMX_VIDEO_MPEG2LevelH14,     /**< High 1440 */ \r
+    OMX_VIDEO_MPEG2LevelHL,      /**< High Level */   \r
+    OMX_VIDEO_MPEG2LevelKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ \r
+    OMX_VIDEO_MPEG2LevelVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */\r
+    OMX_VIDEO_MPEG2LevelMax = 0x7FFFFFFF  \r
+} OMX_VIDEO_MPEG2LEVELTYPE;\r
+\r
+\r
+/** \r
+ * MPEG-2 params \r
+ *\r
+ * STRUCT MEMBERS:\r
+ *  nSize      : Size of the structure in bytes\r
+ *  nVersion   : OMX specification version information\r
+ *  nPortIndex : Port that this structure applies to\r
+ *  nPFrames   : Number of P frames between each I frame\r
+ *  nBFrames   : Number of B frames between each I frame\r
+ *  eProfile   : MPEG-2 profile(s) to use\r
+ *  eLevel     : MPEG-2 levels(s) to use\r
+ */\r
+typedef struct OMX_VIDEO_PARAM_MPEG2TYPE {\r
+    OMX_U32 nSize;           \r
+    OMX_VERSIONTYPE nVersion;\r
+    OMX_U32 nPortIndex;      \r
+    OMX_U32 nPFrames;        \r
+    OMX_U32 nBFrames;        \r
+    OMX_VIDEO_MPEG2PROFILETYPE eProfile;\r
+       OMX_VIDEO_MPEG2LEVELTYPE eLevel;   \r
+} OMX_VIDEO_PARAM_MPEG2TYPE;\r
+\r
+\r
+/** \r
+ * MPEG-4 profile types, each profile indicates support for various \r
+ * performance bounds and different annexes.\r
+ * \r
+ * ENUMS:\r
+ *  - Simple Profile, Levels 1-3\r
+ *  - Simple Scalable Profile, Levels 1-2\r
+ *  - Core Profile, Levels 1-2\r
+ *  - Main Profile, Levels 2-4\r
+ *  - N-bit Profile, Level 2\r
+ *  - Scalable Texture Profile, Level 1\r
+ *  - Simple Face Animation Profile, Levels 1-2\r
+ *  - Simple Face and Body Animation (FBA) Profile, Levels 1-2\r
+ *  - Basic Animated Texture Profile, Levels 1-2\r
+ *  - Hybrid Profile, Levels 1-2\r
+ *  - Advanced Real Time Simple Profiles, Levels 1-4\r
+ *  - Core Scalable Profile, Levels 1-3\r
+ *  - Advanced Coding Efficiency Profile, Levels 1-4\r
+ *  - Advanced Core Profile, Levels 1-2\r
+ *  - Advanced Scalable Texture, Levels 2-3\r
+ */\r
+typedef enum OMX_VIDEO_MPEG4PROFILETYPE {\r
+    OMX_VIDEO_MPEG4ProfileSimple           = 0x01,        \r
+    OMX_VIDEO_MPEG4ProfileSimpleScalable   = 0x02,    \r
+    OMX_VIDEO_MPEG4ProfileCore             = 0x04,              \r
+    OMX_VIDEO_MPEG4ProfileMain             = 0x08,             \r
+    OMX_VIDEO_MPEG4ProfileNbit             = 0x10,              \r
+    OMX_VIDEO_MPEG4ProfileScalableTexture  = 0x20,   \r
+    OMX_VIDEO_MPEG4ProfileSimpleFace       = 0x40,        \r
+    OMX_VIDEO_MPEG4ProfileSimpleFBA        = 0x80,         \r
+    OMX_VIDEO_MPEG4ProfileBasicAnimated    = 0x100,     \r
+    OMX_VIDEO_MPEG4ProfileHybrid           = 0x200,            \r
+    OMX_VIDEO_MPEG4ProfileAdvancedRealTime = 0x400,  \r
+    OMX_VIDEO_MPEG4ProfileCoreScalable     = 0x800,      \r
+    OMX_VIDEO_MPEG4ProfileAdvancedCoding   = 0x1000,    \r
+    OMX_VIDEO_MPEG4ProfileAdvancedCore     = 0x2000,      \r
+    OMX_VIDEO_MPEG4ProfileAdvancedScalable = 0x4000,\r
+    OMX_VIDEO_MPEG4ProfileAdvancedSimple   = 0x8000,\r
+    OMX_VIDEO_MPEG4ProfileKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ \r
+    OMX_VIDEO_MPEG4ProfileVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */\r
+    OMX_VIDEO_MPEG4ProfileMax              = 0x7FFFFFFF  \r
+} OMX_VIDEO_MPEG4PROFILETYPE;\r
+\r
+\r
+/** \r
+ * MPEG-4 level types, each level indicates support for various frame \r
+ * sizes, bit rates, decoder frame rates.  No need \r
+ */\r
+typedef enum OMX_VIDEO_MPEG4LEVELTYPE {\r
+    OMX_VIDEO_MPEG4Level0  = 0x01,   /**< Level 0 */   \r
+    OMX_VIDEO_MPEG4Level0b = 0x02,   /**< Level 0b */   \r
+    OMX_VIDEO_MPEG4Level1  = 0x04,   /**< Level 1 */ \r
+    OMX_VIDEO_MPEG4Level2  = 0x08,   /**< Level 2 */ \r
+    OMX_VIDEO_MPEG4Level3  = 0x10,   /**< Level 3 */ \r
+    OMX_VIDEO_MPEG4Level4  = 0x20,   /**< Level 4 */  \r
+    OMX_VIDEO_MPEG4Level4a = 0x40,   /**< Level 4a */  \r
+    OMX_VIDEO_MPEG4Level5  = 0x80,   /**< Level 5 */  \r
+    OMX_VIDEO_MPEG4LevelKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ \r
+    OMX_VIDEO_MPEG4LevelVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */\r
+    OMX_VIDEO_MPEG4LevelMax = 0x7FFFFFFF  \r
+} OMX_VIDEO_MPEG4LEVELTYPE;\r
+\r
+\r
+/** \r
+ * MPEG-4 configuration.  This structure handles configuration options\r
+ * which are specific to MPEG4 algorithms\r
+ *\r
+ * STRUCT MEMBERS:\r
+ *  nSize                : Size of the structure in bytes\r
+ *  nVersion             : OMX specification version information\r
+ *  nPortIndex           : Port that this structure applies to\r
+ *  nSliceHeaderSpacing  : Number of macroblocks between slice header (H263+ \r
+ *                         Annex K). Put zero if not used\r
+ *  bSVH                 : Enable Short Video Header mode\r
+ *  bGov                 : Flag to enable GOV\r
+ *  nPFrames             : Number of P frames between each I frame (also called \r
+ *                         GOV period)\r
+ *  nBFrames             : Number of B frames between each I frame\r
+ *  nIDCVLCThreshold     : Value of intra DC VLC threshold\r
+ *  bACPred              : Flag to use ac prediction\r
+ *  nMaxPacketSize       : Maximum size of packet in bytes.\r
+ *  nTimeIncRes          : Used to pass VOP time increment resolution for MPEG4. \r
+ *                         Interpreted as described in MPEG4 standard.\r
+ *  eProfile             : MPEG-4 profile(s) to use.\r
+ *  eLevel               : MPEG-4 level(s) to use.\r
+ *  nAllowedPictureTypes : Specifies the picture types allowed in the bitstream\r
+ *  nHeaderExtension     : Specifies the number of consecutive video packet\r
+ *                         headers within a VOP\r
+ *  bReversibleVLC       : Specifies whether reversible variable length coding \r
+ *                         is in use\r
+ */\r
+typedef struct OMX_VIDEO_PARAM_MPEG4TYPE {\r
+    OMX_U32 nSize;\r
+    OMX_VERSIONTYPE nVersion;\r
+    OMX_U32 nPortIndex;\r
+    OMX_U32 nSliceHeaderSpacing;\r
+    OMX_BOOL bSVH;\r
+    OMX_BOOL bGov;\r
+    OMX_U32 nPFrames;\r
+    OMX_U32 nBFrames;\r
+    OMX_U32 nIDCVLCThreshold;\r
+    OMX_BOOL bACPred;\r
+    OMX_U32 nMaxPacketSize;\r
+    OMX_U32 nTimeIncRes;\r
+    OMX_VIDEO_MPEG4PROFILETYPE eProfile;\r
+    OMX_VIDEO_MPEG4LEVELTYPE eLevel;\r
+    OMX_U32 nAllowedPictureTypes;\r
+    OMX_U32 nHeaderExtension;\r
+    OMX_BOOL bReversibleVLC;\r
+} OMX_VIDEO_PARAM_MPEG4TYPE;\r
+\r
+\r
+/** \r
+ * WMV Versions \r
+ */\r
+typedef enum OMX_VIDEO_WMVFORMATTYPE {\r
+    OMX_VIDEO_WMVFormatUnused = 0x01,   /**< Format unused or unknown */\r
+    OMX_VIDEO_WMVFormat7      = 0x02,   /**< Windows Media Video format 7 */\r
+    OMX_VIDEO_WMVFormat8      = 0x04,   /**< Windows Media Video format 8 */\r
+    OMX_VIDEO_WMVFormat9      = 0x08,   /**< Windows Media Video format 9 */\r
+    OMX_VIDEO_WMFFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ \r
+    OMX_VIDEO_WMFFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */\r
+    OMX_VIDEO_WMVFormatMax    = 0x7FFFFFFF\r
+} OMX_VIDEO_WMVFORMATTYPE;\r
+\r
+\r
+/** \r
+ * WMV Params \r
+ *\r
+ * STRUCT MEMBERS:\r
+ *  nSize      : Size of the structure in bytes\r
+ *  nVersion   : OMX specification version information\r
+ *  nPortIndex : Port that this structure applies to\r
+ *  eFormat    : Version of WMV stream / data\r
+ */\r
+typedef struct OMX_VIDEO_PARAM_WMVTYPE {\r
+    OMX_U32 nSize; \r
+    OMX_VERSIONTYPE nVersion;\r
+    OMX_U32 nPortIndex;\r
+    OMX_VIDEO_WMVFORMATTYPE eFormat;\r
+} OMX_VIDEO_PARAM_WMVTYPE;\r
+\r
+\r
+/** \r
+ * Real Video Version \r
+ */\r
+typedef enum OMX_VIDEO_RVFORMATTYPE {\r
+    OMX_VIDEO_RVFormatUnused = 0, /**< Format unused or unknown */\r
+    OMX_VIDEO_RVFormat8,          /**< Real Video format 8 */\r
+    OMX_VIDEO_RVFormat9,          /**< Real Video format 9 */\r
+    OMX_VIDEO_RVFormatG2,         /**< Real Video Format G2 */\r
+    OMX_VIDEO_RVFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ \r
+    OMX_VIDEO_RVFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */\r
+    OMX_VIDEO_RVFormatMax = 0x7FFFFFFF\r
+} OMX_VIDEO_RVFORMATTYPE;\r
+\r
+\r
+/** \r
+ * Real Video Params \r
+ *\r
+ * STUCT MEMBERS:\r
+ *  nSize              : Size of the structure in bytes\r
+ *  nVersion           : OMX specification version information \r
+ *  nPortIndex         : Port that this structure applies to\r
+ *  eFormat            : Version of RV stream / data\r
+ *  nBitsPerPixel      : Bits per pixel coded in the frame\r
+ *  nPaddedWidth       : Padded width in pixel of a video frame\r
+ *  nPaddedHeight      : Padded Height in pixels of a video frame\r
+ *  nFrameRate         : Rate of video in frames per second\r
+ *  nBitstreamFlags    : Flags which internal information about the bitstream\r
+ *  nBitstreamVersion  : Bitstream version\r
+ *  nMaxEncodeFrameSize: Max encoded frame size\r
+ *  bEnablePostFilter  : Turn on/off post filter\r
+ *  bEnableTemporalInterpolation : Turn on/off temporal interpolation\r
+ *  bEnableLatencyMode : When enabled, the decoder does not display a decoded \r
+ *                       frame until it has detected that no enhancement layer \r
+ *                                      frames or dependent B frames will be coming. This \r
+ *                                      detection usually occurs when a subsequent non-B \r
+ *                                      frame is encountered \r
+ */\r
+typedef struct OMX_VIDEO_PARAM_RVTYPE {\r
+    OMX_U32 nSize;\r
+    OMX_VERSIONTYPE nVersion;\r
+    OMX_U32 nPortIndex;\r
+    OMX_VIDEO_RVFORMATTYPE eFormat;\r
+    OMX_U16 nBitsPerPixel;\r
+    OMX_U16 nPaddedWidth;\r
+    OMX_U16 nPaddedHeight;\r
+    OMX_U32 nFrameRate;\r
+    OMX_U32 nBitstreamFlags;\r
+    OMX_U32 nBitstreamVersion;\r
+    OMX_U32 nMaxEncodeFrameSize;\r
+    OMX_BOOL bEnablePostFilter;\r
+    OMX_BOOL bEnableTemporalInterpolation;\r
+    OMX_BOOL bEnableLatencyMode;\r
+} OMX_VIDEO_PARAM_RVTYPE;\r
+\r
+\r
+/** \r
+ * AVC profile types, each profile indicates support for various \r
+ * performance bounds and different annexes.\r
+ */\r
+typedef enum OMX_VIDEO_AVCPROFILETYPE {\r
+    OMX_VIDEO_AVCProfileBaseline = 0x01,   /**< Baseline profile */\r
+    OMX_VIDEO_AVCProfileMain     = 0x02,   /**< Main profile */\r
+    OMX_VIDEO_AVCProfileExtended = 0x04,   /**< Extended profile */\r
+    OMX_VIDEO_AVCProfileHigh     = 0x08,   /**< High profile */\r
+    OMX_VIDEO_AVCProfileHigh10   = 0x10,   /**< High 10 profile */\r
+    OMX_VIDEO_AVCProfileHigh422  = 0x20,   /**< High 4:2:2 profile */\r
+    OMX_VIDEO_AVCProfileHigh444  = 0x40,   /**< High 4:4:4 profile */\r
+    OMX_VIDEO_AVCProfileKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ \r
+    OMX_VIDEO_AVCProfileVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */\r
+    OMX_VIDEO_AVCProfileMax      = 0x7FFFFFFF  \r
+} OMX_VIDEO_AVCPROFILETYPE;\r
+\r
+\r
+/** \r
+ * AVC level types, each level indicates support for various frame sizes, \r
+ * bit rates, decoder frame rates.  No need \r
+ */\r
+typedef enum OMX_VIDEO_AVCLEVELTYPE {\r
+    OMX_VIDEO_AVCLevel1   = 0x01,     /**< Level 1 */\r
+    OMX_VIDEO_AVCLevel1b  = 0x02,     /**< Level 1b */\r
+    OMX_VIDEO_AVCLevel11  = 0x04,     /**< Level 1.1 */\r
+    OMX_VIDEO_AVCLevel12  = 0x08,     /**< Level 1.2 */\r
+    OMX_VIDEO_AVCLevel13  = 0x10,     /**< Level 1.3 */\r
+    OMX_VIDEO_AVCLevel2   = 0x20,     /**< Level 2 */\r
+    OMX_VIDEO_AVCLevel21  = 0x40,     /**< Level 2.1 */\r
+    OMX_VIDEO_AVCLevel22  = 0x80,     /**< Level 2.2 */\r
+    OMX_VIDEO_AVCLevel3   = 0x100,    /**< Level 3 */\r
+    OMX_VIDEO_AVCLevel31  = 0x200,    /**< Level 3.1 */\r
+    OMX_VIDEO_AVCLevel32  = 0x400,    /**< Level 3.2 */\r
+    OMX_VIDEO_AVCLevel4   = 0x800,    /**< Level 4 */\r
+    OMX_VIDEO_AVCLevel41  = 0x1000,   /**< Level 4.1 */\r
+    OMX_VIDEO_AVCLevel42  = 0x2000,   /**< Level 4.2 */\r
+    OMX_VIDEO_AVCLevel5   = 0x4000,   /**< Level 5 */\r
+    OMX_VIDEO_AVCLevel51  = 0x8000,   /**< Level 5.1 */\r
+    OMX_VIDEO_AVCLevelKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ \r
+    OMX_VIDEO_AVCLevelVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */\r
+    OMX_VIDEO_AVCLevelMax = 0x7FFFFFFF  \r
+} OMX_VIDEO_AVCLEVELTYPE;\r
+\r
+\r
+/** \r
+ * AVC loop filter modes \r
+ *\r
+ * OMX_VIDEO_AVCLoopFilterEnable               : Enable\r
+ * OMX_VIDEO_AVCLoopFilterDisable              : Disable\r
+ * OMX_VIDEO_AVCLoopFilterDisableSliceBoundary : Disabled on slice boundaries\r
+ */\r
+typedef enum OMX_VIDEO_AVCLOOPFILTERTYPE {\r
+    OMX_VIDEO_AVCLoopFilterEnable = 0,\r
+    OMX_VIDEO_AVCLoopFilterDisable,\r
+    OMX_VIDEO_AVCLoopFilterDisableSliceBoundary,\r
+    OMX_VIDEO_AVCLoopFilterKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ \r
+    OMX_VIDEO_AVCLoopFilterVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */\r
+    OMX_VIDEO_AVCLoopFilterMax = 0x7FFFFFFF\r
+} OMX_VIDEO_AVCLOOPFILTERTYPE;\r
+\r
+\r
+/** \r
+ * AVC params \r
+ *\r
+ * STRUCT MEMBERS:\r
+ *  nSize                     : Size of the structure in bytes\r
+ *  nVersion                  : OMX specification version information\r
+ *  nPortIndex                : Port that this structure applies to\r
+ *  nSliceHeaderSpacing       : Number of macroblocks between slice header, put  \r
+ *                              zero if not used\r
+ *  nPFrames                  : Number of P frames between each I frame\r
+ *  nBFrames                  : Number of B frames between each I frame\r
+ *  bUseHadamard              : Enable/disable Hadamard transform\r
+ *  nRefFrames                : Max number of reference frames to use for inter\r
+ *                              motion search (1-16)\r
+ *  nRefIdxTrailing           : Pic param set ref frame index (index into ref\r
+ *                              frame buffer of trailing frames list), B frame\r
+ *                              support\r
+ *  nRefIdxForward            : Pic param set ref frame index (index into ref\r
+ *                              frame buffer of forward frames list), B frame\r
+ *                              support\r
+ *  bEnableUEP                : Enable/disable unequal error protection. This \r
+ *                              is only valid of data partitioning is enabled.\r
+ *  bEnableFMO                : Enable/disable flexible macroblock ordering\r
+ *  bEnableASO                : Enable/disable arbitrary slice ordering\r
+ *  bEnableRS                 : Enable/disable sending of redundant slices\r
+ *  eProfile                  : AVC profile(s) to use\r
+ *  eLevel                    : AVC level(s) to use\r
+ *  nAllowedPictureTypes      : Specifies the picture types allowed in the \r
+ *                              bitstream\r
+ *  bFrameMBsOnly             : specifies that every coded picture of the \r
+ *                              coded video sequence is a coded frame \r
+ *                              containing only frame macroblocks\r
+ *  bMBAFF                    : Enable/disable switching between frame and \r
+ *                              field macroblocks within a picture\r
+ *  bEntropyCodingCABAC       : Entropy decoding method to be applied for the \r
+ *                              syntax elements for which two descriptors appear \r
+ *                              in the syntax tables\r
+ *  bWeightedPPrediction      : Enable/disable weighted prediction shall not \r
+ *                              be applied to P and SP slices\r
+ *  nWeightedBipredicitonMode : Default weighted prediction is applied to B \r
+ *                              slices \r
+ *  bconstIpred               : Enable/disable intra prediction\r
+ *  bDirect8x8Inference       : Specifies the method used in the derivation \r
+ *                              process for luma motion vectors for B_Skip, \r
+ *                              B_Direct_16x16 and B_Direct_8x8 as specified \r
+ *                              in subclause 8.4.1.2 of the AVC spec \r
+ *  bDirectSpatialTemporal    : Flag indicating spatial or temporal direct\r
+ *                              mode used in B slice coding (related to \r
+ *                              bDirect8x8Inference) . Spatial direct mode is \r
+ *                              more common and should be the default.\r
+ *  nCabacInitIdx             : Index used to init CABAC contexts\r
+ *  eLoopFilterMode           : Enable/disable loop filter\r
+ */\r
+typedef struct OMX_VIDEO_PARAM_AVCTYPE {\r
+    OMX_U32 nSize;                 \r
+    OMX_VERSIONTYPE nVersion;      \r
+    OMX_U32 nPortIndex;            \r
+    OMX_U32 nSliceHeaderSpacing;  \r
+    OMX_U32 nPFrames;     \r
+    OMX_U32 nBFrames;     \r
+    OMX_BOOL bUseHadamard;\r
+    OMX_U32 nRefFrames;  \r
+       OMX_U32 nRefIdx10ActiveMinus1;\r
+       OMX_U32 nRefIdx11ActiveMinus1;\r
+    OMX_BOOL bEnableUEP;  \r
+    OMX_BOOL bEnableFMO;  \r
+    OMX_BOOL bEnableASO;  \r
+    OMX_BOOL bEnableRS;   \r
+    OMX_VIDEO_AVCPROFILETYPE eProfile;\r
+       OMX_VIDEO_AVCLEVELTYPE eLevel; \r
+    OMX_U32 nAllowedPictureTypes;  \r
+       OMX_BOOL bFrameMBsOnly;                                                                         \r
+    OMX_BOOL bMBAFF;               \r
+    OMX_BOOL bEntropyCodingCABAC;  \r
+    OMX_BOOL bWeightedPPrediction; \r
+    OMX_U32 nWeightedBipredicitonMode; \r
+    OMX_BOOL bconstIpred ;\r
+    OMX_BOOL bDirect8x8Inference;  \r
+       OMX_BOOL bDirectSpatialTemporal;\r
+       OMX_U32 nCabacInitIdc;\r
+       OMX_VIDEO_AVCLOOPFILTERTYPE eLoopFilterMode;\r
+} OMX_VIDEO_PARAM_AVCTYPE;\r
+\r
+typedef struct OMX_VIDEO_PARAM_PROFILELEVELTYPE {\r
+   OMX_U32 nSize;                 \r
+   OMX_VERSIONTYPE nVersion;      \r
+   OMX_U32 nPortIndex;            \r
+   OMX_U32 eProfile;      /**< type is OMX_VIDEO_AVCPROFILETYPE, OMX_VIDEO_H263PROFILETYPE, \r
+                                 or OMX_VIDEO_MPEG4PROFILETYPE depending on context */\r
+   OMX_U32 eLevel;        /**< type is OMX_VIDEO_AVCLEVELTYPE, OMX_VIDEO_H263LEVELTYPE, \r
+                                 or OMX_VIDEO_MPEG4PROFILETYPE depending on context */\r
+   OMX_U32 nProfileIndex; /**< Used to query for individual profile support information,\r
+                               This parameter is valid only for \r
+                               OMX_IndexParamVideoProfileLevelQuerySupported index,\r
+                               For all other indices this parameter is to be ignored. */\r
+} OMX_VIDEO_PARAM_PROFILELEVELTYPE;\r
+\r
+/** \r
+ * Structure for dynamically configuring bitrate mode of a codec. \r
+ *\r
+ * STRUCT MEMBERS:\r
+ *  nSize          : Size of the struct in bytes\r
+ *  nVersion       : OMX spec version info\r
+ *  nPortIndex     : Port that this struct applies to\r
+ *  nEncodeBitrate : Target average bitrate to be generated in bps\r
+ */\r
+typedef struct OMX_VIDEO_CONFIG_BITRATETYPE {\r
+    OMX_U32 nSize;                          \r
+    OMX_VERSIONTYPE nVersion;               \r
+    OMX_U32 nPortIndex;                     \r
+    OMX_U32 nEncodeBitrate;                 \r
+} OMX_VIDEO_CONFIG_BITRATETYPE;\r
+\r
+/** \r
+ * Defines Encoder Frame Rate setting\r
+ *\r
+ * STRUCT MEMBERS:\r
+ *  nSize            : Size of the structure in bytes\r
+ *  nVersion         : OMX specification version information \r
+ *  nPortIndex       : Port that this structure applies to\r
+ *  xEncodeFramerate : Encoding framerate represented in Q16 format\r
+ */\r
+typedef struct OMX_CONFIG_FRAMERATETYPE {\r
+    OMX_U32 nSize;\r
+    OMX_VERSIONTYPE nVersion;\r
+    OMX_U32 nPortIndex;\r
+    OMX_U32 xEncodeFramerate; /* Q16 format */\r
+} OMX_CONFIG_FRAMERATETYPE;\r
+\r
+typedef struct OMX_CONFIG_INTRAREFRESHVOPTYPE {\r
+    OMX_U32 nSize;\r
+    OMX_VERSIONTYPE nVersion;\r
+    OMX_U32 nPortIndex;\r
+    OMX_BOOL IntraRefreshVOP;\r
+} OMX_CONFIG_INTRAREFRESHVOPTYPE;\r
+\r
+typedef struct OMX_CONFIG_MACROBLOCKERRORMAPTYPE {\r
+    OMX_U32 nSize;\r
+    OMX_VERSIONTYPE nVersion;\r
+    OMX_U32 nPortIndex;\r
+    OMX_U32 nErrMapSize;           /* Size of the Error Map in bytes */\r
+    OMX_U8  ErrMap[1];             /* Error map hint */\r
+} OMX_CONFIG_MACROBLOCKERRORMAPTYPE;\r
+\r
+typedef struct OMX_CONFIG_MBERRORREPORTINGTYPE {\r
+    OMX_U32 nSize;\r
+    OMX_VERSIONTYPE nVersion;\r
+    OMX_U32 nPortIndex;\r
+    OMX_BOOL bEnabled;\r
+} OMX_CONFIG_MBERRORREPORTINGTYPE;\r
+\r
+typedef struct OMX_PARAM_MACROBLOCKSTYPE {\r
+    OMX_U32 nSize;\r
+    OMX_VERSIONTYPE nVersion;\r
+    OMX_U32 nPortIndex;\r
+    OMX_U32 nMacroblocks;\r
+} OMX_PARAM_MACROBLOCKSTYPE;\r
+\r
+/** \r
+ * AVC Slice Mode modes \r
+ *\r
+ * OMX_VIDEO_SLICEMODE_AVCDefault   : Normal frame encoding, one slice per frame\r
+ * OMX_VIDEO_SLICEMODE_AVCMBSlice   : NAL mode, number of MBs per frame\r
+ * OMX_VIDEO_SLICEMODE_AVCByteSlice : NAL mode, number of bytes per frame\r
+ */\r
+typedef enum OMX_VIDEO_AVCSLICEMODETYPE {\r
+    OMX_VIDEO_SLICEMODE_AVCDefault = 0,\r
+    OMX_VIDEO_SLICEMODE_AVCMBSlice,\r
+    OMX_VIDEO_SLICEMODE_AVCByteSlice,\r
+    OMX_VIDEO_SLICEMODE_AVCKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ \r
+    OMX_VIDEO_SLICEMODE_AVCVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */\r
+    OMX_VIDEO_SLICEMODE_AVCLevelMax = 0x7FFFFFFF\r
+} OMX_VIDEO_AVCSLICEMODETYPE;\r
+\r
+/** \r
+ * AVC FMO Slice Mode Params \r
+ *\r
+ * STRUCT MEMBERS:\r
+ *  nSize      : Size of the structure in bytes\r
+ *  nVersion   : OMX specification version information\r
+ *  nPortIndex : Port that this structure applies to\r
+ *  nNumSliceGroups : Specifies the number of slice groups\r
+ *  nSliceGroupMapType : Specifies the type of slice groups\r
+ *  eSliceMode : Specifies the type of slice\r
+ */\r
+typedef struct OMX_VIDEO_PARAM_AVCSLICEFMO {\r
+    OMX_U32 nSize; \r
+    OMX_VERSIONTYPE nVersion;\r
+    OMX_U32 nPortIndex;\r
+    OMX_U8 nNumSliceGroups;\r
+    OMX_U8 nSliceGroupMapType;\r
+    OMX_VIDEO_AVCSLICEMODETYPE eSliceMode;\r
+} OMX_VIDEO_PARAM_AVCSLICEFMO;\r
+\r
+/** \r
+ * AVC IDR Period Configs\r
+ *\r
+ * STRUCT MEMBERS:\r
+ *  nSize      : Size of the structure in bytes\r
+ *  nVersion   : OMX specification version information\r
+ *  nPortIndex : Port that this structure applies to\r
+ *  nIDRPeriod : Specifies periodicity of IDR frames\r
+ *  nPFrames : Specifies internal of coding Intra frames\r
+ */\r
+typedef struct OMX_VIDEO_CONFIG_AVCINTRAPERIOD {\r
+    OMX_U32 nSize; \r
+    OMX_VERSIONTYPE nVersion;\r
+    OMX_U32 nPortIndex;\r
+    OMX_U32 nIDRPeriod;\r
+    OMX_U32 nPFrames;\r
+} OMX_VIDEO_CONFIG_AVCINTRAPERIOD;\r
+\r
+/** \r
+ * AVC NAL Size Configs\r
+ *\r
+ * STRUCT MEMBERS:\r
+ *  nSize      : Size of the structure in bytes\r
+ *  nVersion   : OMX specification version information\r
+ *  nPortIndex : Port that this structure applies to\r
+ *  nNaluBytes : Specifies the NAL unit size\r
+ */\r
+typedef struct OMX_VIDEO_CONFIG_NALSIZE {\r
+    OMX_U32 nSize; \r
+    OMX_VERSIONTYPE nVersion;\r
+    OMX_U32 nPortIndex;\r
+    OMX_U32 nNaluBytes;\r
+} OMX_VIDEO_CONFIG_NALSIZE;\r
+\r
+/** @} */\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif /* __cplusplus */\r
+\r
+#endif\r
+/* File EOF */\r
+\r
diff --git a/modules/codec/omxil/omxil.c b/modules/codec/omxil/omxil.c
new file mode 100644 (file)
index 0000000..bc53cc7
--- /dev/null
@@ -0,0 +1,1406 @@
+/*****************************************************************************
+ * omxil.c: Video decoder module making use of OpenMAX IL components.
+ *****************************************************************************
+ * Copyright (C) 2010 the VideoLAN team
+ * $Id$
+ *
+ * Authors: Gildas Bazin <gbazin@videolan.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+
+/*****************************************************************************
+ * Preamble
+ *****************************************************************************/
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#if defined(HAVE_DL_DLOPEN)
+# include <dlfcn.h>
+#endif
+
+#include <vlc_common.h>
+#include <vlc_plugin.h>
+#include <vlc_codec.h>
+#include <vlc_aout.h>
+#include <vlc_block_helper.h>
+#include <vlc_cpu.h>
+
+#include "omxil.h"
+
+//#define OMXIL_EXTRA_DEBUG
+
+/*****************************************************************************
+ * List of OpenMAX IL core we will try in order
+ *****************************************************************************/
+static const char *ppsz_dll_list[] =
+{
+    "libOMX_Core.so", /* TI OMAP IL core */
+    "libomxil-bellagio.so",  /* Bellagio IL core */
+    0
+};
+
+/*****************************************************************************
+ * defines
+ *****************************************************************************/
+#if defined(HAVE_DL_DLOPEN)
+# define dll_open(name) dlopen( name, RTLD_NOW );
+# define dll_close(handle) dlclose(handle);
+#else
+# define dll_open(name) NULL
+# define dll_close(handle)
+#endif
+
+/*****************************************************************************
+ * Local prototypes
+ *****************************************************************************/
+static int  OpenDecoder( vlc_object_t * );
+static int  OpenEncoder( vlc_object_t * );
+static int  OpenGeneric( vlc_object_t *, bool b_encode );
+static void CloseGeneric( vlc_object_t * );
+
+static picture_t *DecodeVideo( decoder_t *, block_t ** );
+static aout_buffer_t *DecodeAudio ( decoder_t *, block_t ** );
+static block_t *EncodeVideo( encoder_t *, picture_t * );
+
+static OMX_ERRORTYPE OmxEventHandler( OMX_HANDLETYPE, OMX_PTR, OMX_EVENTTYPE,
+                                      OMX_U32, OMX_U32, OMX_PTR );
+static OMX_ERRORTYPE OmxEmptyBufferDone( OMX_HANDLETYPE, OMX_PTR,
+                                         OMX_BUFFERHEADERTYPE * );
+static OMX_ERRORTYPE OmxFillBufferDone( OMX_HANDLETYPE, OMX_PTR,
+                                        OMX_BUFFERHEADERTYPE * );
+
+/*****************************************************************************
+ * Module descriptor
+ *****************************************************************************/
+vlc_module_begin ()
+    set_description( N_("Audio/Video decoder (using OpenMAX IL)") )
+    set_category( CAT_INPUT )
+    set_subcategory( SUBCAT_INPUT_SCODEC )
+    set_section( N_("Decoding") , NULL )
+    set_capability( "decoder", 0 )
+    set_callbacks( OpenDecoder, CloseGeneric )
+
+    add_submodule ()
+    set_section( N_("Encoding") , NULL )
+    set_description( N_("Video encoder (using OpenMAX IL)") )
+    set_capability( "encoder", 0 )
+    set_callbacks( OpenEncoder, CloseGeneric )
+vlc_module_end ()
+
+/*****************************************************************************
+ * CreateComponentsList: creates a list of components matching the given role
+ *****************************************************************************/
+static int CreateComponentsList(decoder_t *p_dec, const char *psz_role)
+{
+    decoder_sys_t *p_sys = p_dec->p_sys;
+    char psz_name[OMX_MAX_STRINGNAME_SIZE];
+    OMX_ERRORTYPE omx_error;
+    OMX_U32 roles = 0;
+    OMX_U8 **ppsz_roles = 0;
+    unsigned int i, j, len;
+
+    if(!psz_role) goto end;
+    len = strlen(psz_role);
+
+    for( i = 0; ; i++ )
+    {
+        bool b_found = false;
+
+        omx_error = p_sys->pf_component_enum(psz_name, OMX_MAX_STRINGNAME_SIZE, i);
+        if(omx_error != OMX_ErrorNone) break;
+
+        msg_Dbg(p_dec, "component %s", psz_name);
+
+        omx_error = p_sys->pf_get_roles_of_component(psz_name, &roles, 0);
+        if(omx_error != OMX_ErrorNone || !roles) continue;
+
+        ppsz_roles = malloc(roles * (sizeof(OMX_U8*) + OMX_MAX_STRINGNAME_SIZE));
+        if(!ppsz_roles) continue;
+
+        for( j = 0; j < roles; j++ )
+            ppsz_roles[j] = ((OMX_U8 *)(&ppsz_roles[roles])) +
+                j * OMX_MAX_STRINGNAME_SIZE;
+
+        omx_error = p_sys->pf_get_roles_of_component(psz_name, &roles, ppsz_roles);
+        if(omx_error != OMX_ErrorNone) roles = 0;
+
+        for(j = 0; j < roles; j++)
+        {
+            msg_Dbg(p_dec, "  - role: %s", ppsz_roles[j]);
+            if(!strncmp((char *)ppsz_roles[j], psz_role, len)) b_found = true;
+        }
+
+        free(ppsz_roles);
+
+        if(!b_found) continue;
+
+        if(p_sys->components >= MAX_COMPONENTS_LIST_SIZE)
+        {
+            msg_Dbg(p_dec, "too many matching components");
+            continue;
+        }
+
+        strncpy(p_sys->ppsz_components[p_sys->components], psz_name,
+                OMX_MAX_STRINGNAME_SIZE-1);
+        p_sys->components++;
+    }
+
+ end:
+    msg_Dbg(p_dec, "found %i matching components for role %s",
+            p_sys->components, psz_role);
+    for( i = 0; i < p_sys->components; i++ )
+        msg_Dbg(p_dec, "- %s", p_sys->ppsz_components[i]);
+
+    return p_sys->components;
+}
+
+static OMX_ERRORTYPE SetPortDefinition(decoder_t *p_dec, OmxPort *p_port,
+                                       es_format_t *p_fmt)
+{
+    OMX_PARAM_PORTDEFINITIONTYPE *def = &p_port->definition;
+    OMX_ERRORTYPE omx_error;
+
+    omx_error = OMX_GetParameter(p_port->omx_handle,
+                                 OMX_IndexParamPortDefinition, def);
+    CHECK_ERROR(omx_error, "OMX_GetParameter failed (%x : %s)",
+                omx_error, ErrorToString(omx_error));
+
+    switch(p_fmt->i_cat)
+    {
+    case VIDEO_ES:
+        def->format.video.nFrameWidth = p_fmt->video.i_width;
+        def->format.video.nFrameHeight = p_fmt->video.i_height;
+        if(def->format.video.eCompressionFormat == OMX_VIDEO_CodingUnused)
+            def->format.video.nStride = def->format.video.nFrameWidth;
+        if( p_fmt->video.i_frame_rate > 0 &&
+            p_fmt->video.i_frame_rate_base > 0 )
+#if 0
+            def->format.video.xFramerate = (p_fmt->video.i_frame_rate << 16) /
+                p_fmt->video.i_frame_rate_base;
+#else
+        def->format.video.xFramerate = p_fmt->video.i_frame_rate;
+#endif
+
+        if(def->eDir == OMX_DirInput || p_dec->p_sys->b_enc)
+        {
+            def->nBufferSize = def->format.video.nFrameWidth *
+              def->format.video.nFrameHeight * 2;
+            p_port->i_frame_size = def->nBufferSize;
+
+            if(!GetOmxVideoFormat(p_fmt->i_codec,
+                                  &def->format.video.eCompressionFormat, 0) )
+            {
+                if(!GetOmxChromaFormat(p_fmt->i_codec,
+                                       &def->format.video.eColorFormat, 0) )
+                {
+                    omx_error = OMX_ErrorNotImplemented;
+                    CHECK_ERROR(omx_error, "codec %4.4s doesn't match any OMX format",
+                                (char *)&p_fmt->i_codec );
+                }
+                GetVlcChromaSizes( p_fmt->i_codec,
+                                   def->format.video.nFrameWidth,
+                                   def->format.video.nFrameHeight,
+                                   &p_port->i_frame_size, &p_port->i_frame_stride,
+                                   &p_port->i_frame_stride_chroma_div );
+                def->format.video.nStride = p_port->i_frame_stride;
+                def->nBufferSize = p_port->i_frame_size;
+            }
+        }
+        else
+        {
+            //def->format.video.eColorFormat = OMX_COLOR_FormatCbYCrY;
+            if( !GetVlcChromaFormat( def->format.video.eColorFormat,
+                                     &p_fmt->i_codec, 0 ) )
+            {
+                omx_error = OMX_ErrorNotImplemented;
+                CHECK_ERROR(omx_error, "OMX color format %i not supported",
+                            (int)def->format.video.eColorFormat );
+            }
+            GetVlcChromaSizes( p_fmt->i_codec,
+                               def->format.video.nFrameWidth,
+                               def->format.video.nFrameHeight,
+                               &p_port->i_frame_size, &p_port->i_frame_stride,
+                               &p_port->i_frame_stride_chroma_div );
+            def->format.video.nStride = p_port->i_frame_stride;
+            def->nBufferSize = p_port->i_frame_size;
+        }
+        break;
+
+    case AUDIO_ES:
+        p_port->i_frame_size = def->nBufferSize;
+        if(def->eDir == OMX_DirInput)
+        {
+            if(!GetOmxAudioFormat(p_fmt->i_codec,
+                                  &def->format.audio.eEncoding, 0) )
+            {
+                omx_error = OMX_ErrorNotImplemented;
+                CHECK_ERROR(omx_error, "codec %4.4s doesn't match any OMX format",
+                            (char *)&p_fmt->i_codec );
+            }
+        }
+        else
+        {
+            if( !GetVlcAudioFormat(def->format.audio.eEncoding,
+                                   &p_fmt->i_codec, 0 ) )
+            {
+                omx_error = OMX_ErrorNotImplemented;
+                CHECK_ERROR(omx_error, "OMX audio encoding %i not supported",
+                            (int)def->format.audio.eEncoding );
+            }
+        }
+        break;
+
+    default: return OMX_ErrorNotImplemented;
+    }
+
+    omx_error = OMX_SetParameter(p_port->omx_handle,
+                                 OMX_IndexParamPortDefinition, def);
+    CHECK_ERROR(omx_error, "OMX_SetParameter failed (%x : %s)",
+                omx_error, ErrorToString(omx_error));
+
+    omx_error = OMX_GetParameter(p_port->omx_handle,
+                                 OMX_IndexParamPortDefinition, def);
+    CHECK_ERROR(omx_error, "OMX_GetParameter failed (%x : %s)",
+                omx_error, ErrorToString(omx_error));
+
+    if(p_port->i_frame_size > def->nBufferSize)
+        def->nBufferSize = p_port->i_frame_size;
+    p_port->i_frame_size = def->nBufferSize;
+
+    /* Deal with audio params */
+    if(p_fmt->i_cat == AUDIO_ES)
+    {
+        omx_error = SetAudioParameters(p_port->omx_handle,
+                                       &p_port->format_param, def->nPortIndex,
+                                       def->format.audio.eEncoding,
+                                       p_fmt->audio.i_channels,
+                                       p_fmt->audio.i_rate,
+                                       p_fmt->i_bitrate,
+                                       p_fmt->audio.i_bitspersample,
+                                       p_fmt->audio.i_blockalign);
+        CHECK_ERROR(omx_error, "SetAudioParameters failed (%x : %s)",
+                    omx_error, ErrorToString(omx_error));
+    }
+
+ error:
+    return omx_error;
+}
+
+static OMX_ERRORTYPE GetPortDefinition(decoder_t *p_dec, OmxPort *p_port,
+                                       es_format_t *p_fmt)
+{
+    OMX_PARAM_PORTDEFINITIONTYPE *def = &p_port->definition;
+    OMX_ERRORTYPE omx_error;
+
+    omx_error = OMX_GetParameter(p_port->omx_handle,
+                                 OMX_IndexParamPortDefinition, def);
+    CHECK_ERROR(omx_error, "OMX_GetParameter failed (%x : %s)",
+                omx_error, ErrorToString(omx_error));
+
+    switch(p_fmt->i_cat)
+    {
+    case VIDEO_ES:
+        p_fmt->video.i_width = def->format.video.nFrameWidth;
+        p_fmt->video.i_visible_width = def->format.video.nFrameWidth;
+        p_fmt->video.i_height = def->format.video.nFrameHeight;
+        p_fmt->video.i_visible_height = def->format.video.nFrameHeight;
+        p_fmt->video.i_frame_rate = p_dec->fmt_in.video.i_frame_rate;
+        p_fmt->video.i_frame_rate_base = p_dec->fmt_in.video.i_frame_rate_base;
+
+        if(!GetVlcVideoFormat( def->format.video.eCompressionFormat,
+                               &p_fmt->i_codec, 0 ) )
+        {
+            if( !GetVlcChromaFormat( def->format.video.eColorFormat,
+                                     &p_fmt->i_codec, 0 ) )
+            {
+                omx_error = OMX_ErrorNotImplemented;
+                CHECK_ERROR(omx_error, "OMX color format %i not supported",
+                            (int)def->format.video.eColorFormat );
+            }
+            GetVlcChromaSizes( p_fmt->i_codec,
+                               def->format.video.nFrameWidth,
+                               def->format.video.nFrameHeight,
+                               &p_port->i_frame_size, &p_port->i_frame_stride,
+                               &p_port->i_frame_stride_chroma_div );
+        }
+        if(p_port->i_frame_size > def->nBufferSize)
+            def->nBufferSize = p_port->i_frame_size;
+        p_port->i_frame_size = def->nBufferSize;
+#if 0
+        if((int)p_port->i_frame_stride > def->format.video.nStride)
+            def->format.video.nStride = p_port->i_frame_stride;
+#endif
+        p_port->i_frame_stride = def->format.video.nStride;
+        break;
+
+    case AUDIO_ES:
+        if( !GetVlcAudioFormat( def->format.audio.eEncoding,
+                                &p_fmt->i_codec, 0 ) )
+        {
+            omx_error = OMX_ErrorNotImplemented;
+            CHECK_ERROR(omx_error, "OMX audio format %i not supported",
+                        (int)def->format.audio.eEncoding );
+        }
+
+        omx_error = GetAudioParameters(p_port->omx_handle,
+                                       &p_port->format_param, def->nPortIndex,
+                                       def->format.audio.eEncoding,
+                                       &p_fmt->audio.i_channels,
+                                       &p_fmt->audio.i_rate,
+                                       &p_fmt->i_bitrate,
+                                       &p_fmt->audio.i_bitspersample,
+                                       &p_fmt->audio.i_blockalign);
+        CHECK_ERROR(omx_error, "GetAudioParameters failed (%x : %s)",
+                    omx_error, ErrorToString(omx_error));
+
+        if(p_fmt->audio.i_channels < 9)
+        {
+            static const int pi_channels_maps[9] =
+            {
+                0, AOUT_CHAN_CENTER, AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT,
+                AOUT_CHAN_CENTER | AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT,
+                AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT | AOUT_CHAN_REARLEFT
+                | AOUT_CHAN_REARRIGHT,
+                AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT | AOUT_CHAN_CENTER
+                | AOUT_CHAN_REARLEFT | AOUT_CHAN_REARRIGHT,
+                AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT | AOUT_CHAN_CENTER
+                | AOUT_CHAN_REARLEFT | AOUT_CHAN_REARRIGHT | AOUT_CHAN_LFE,
+                AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT | AOUT_CHAN_CENTER
+                | AOUT_CHAN_REARLEFT | AOUT_CHAN_REARRIGHT | AOUT_CHAN_MIDDLELEFT
+                | AOUT_CHAN_MIDDLERIGHT,
+                AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT | AOUT_CHAN_CENTER | AOUT_CHAN_REARLEFT
+                | AOUT_CHAN_REARRIGHT | AOUT_CHAN_MIDDLELEFT | AOUT_CHAN_MIDDLERIGHT
+                | AOUT_CHAN_LFE
+            };
+            p_fmt->audio.i_physical_channels =
+                p_fmt->audio.i_original_channels =
+                    pi_channels_maps[p_fmt->audio.i_channels];
+        }
+
+        date_Init( &p_dec->p_sys->end_date, p_fmt->audio.i_rate, 1 );
+
+        break;
+
+    default: return OMX_ErrorNotImplemented;
+    }
+
+ error:
+    return omx_error;
+}
+
+/*****************************************************************************
+ * DeinitialiseComponent: Deinitialise and unload an OMX component
+ *****************************************************************************/
+static OMX_ERRORTYPE DeinitialiseComponent(decoder_t *p_dec,
+                                           OMX_HANDLETYPE omx_handle)
+{
+    decoder_sys_t *p_sys = p_dec->p_sys;
+    OMX_ERRORTYPE omx_error;
+    OMX_STATETYPE state;
+    unsigned int i, j;
+
+    if(!omx_handle) return OMX_ErrorNone;
+
+    omx_error = OMX_GetState(omx_handle, &state);
+    CHECK_ERROR(omx_error, "ONX_GetState failed (%x)", omx_error );
+
+    if(state == OMX_StateExecuting)
+    {
+        omx_error = OMX_SendCommand( omx_handle, OMX_CommandStateSet,
+                                     OMX_StateIdle, 0 );
+        CHECK_ERROR(omx_error, "ONX_CommandStateSet Idle failed (%x)", omx_error );
+        omx_error = WaitForSpecificOmxEvent(p_dec, OMX_EventCmdComplete, 0, 0, 0);
+        CHECK_ERROR(omx_error, "Wait for Idle failed (%x)", omx_error );
+    }
+
+    omx_error = OMX_GetState(omx_handle, &state);
+    CHECK_ERROR(omx_error, "ONX_GetState failed (%x)", omx_error );
+
+    if(state == OMX_StateIdle)
+    {
+        omx_error = OMX_SendCommand( omx_handle, OMX_CommandStateSet,
+                                     OMX_StateLoaded, 0 );
+        CHECK_ERROR(omx_error, "ONX_CommandStateSet Idle failed (%x)", omx_error );
+
+        for(i = 0; i < p_sys->ports; i++)
+        {
+            OmxPort *p_port = &p_sys->p_ports[i];
+            OMX_BUFFERHEADERTYPE *p_buffer;
+
+            for(j = 0; j < p_port->i_buffers; j++)
+            {
+                OMX_FIFO_GET(&p_port->fifo, p_buffer);
+                omx_error = OMX_FreeBuffer( omx_handle,
+                                            p_port->i_port_index, p_buffer );
+
+                if(omx_error != OMX_ErrorNone) break;
+            }
+            CHECK_ERROR(omx_error, "ONX_FreeBuffer failed (%x, %i, %i)",
+                        omx_error, (int)p_port->i_port_index, j );
+        }
+
+        omx_error = WaitForSpecificOmxEvent(p_dec, OMX_EventCmdComplete, 0, 0, 0);
+        CHECK_ERROR(omx_error, "Wait for Idle failed (%x)", omx_error );
+    }
+
+ error:
+    for(i = 0; i < p_sys->ports; i++)
+    {
+        OmxPort *p_port = &p_sys->p_ports[i];
+        free(p_port->pp_buffers);
+        p_port->pp_buffers = 0;
+    }
+    omx_error = p_sys->pf_free_handle( omx_handle );
+    return omx_error;
+}
+
+/*****************************************************************************
+ * InitialiseComponent: Load and initialise an OMX component
+ *****************************************************************************/
+static OMX_ERRORTYPE InitialiseComponent(decoder_t *p_dec,
+    OMX_STRING psz_component, OMX_HANDLETYPE *p_handle)
+{
+    static OMX_CALLBACKTYPE callbacks =
+        { OmxEventHandler, OmxEmptyBufferDone, OmxFillBufferDone };
+    decoder_sys_t *p_sys = p_dec->p_sys;
+    OMX_HANDLETYPE omx_handle;
+    OMX_ERRORTYPE omx_error;
+    unsigned int i;
+    OMX_U8 psz_role[OMX_MAX_STRINGNAME_SIZE];
+    OMX_PARAM_COMPONENTROLETYPE role;
+    OMX_PARAM_PORTDEFINITIONTYPE definition;
+    OMX_PORT_PARAM_TYPE param;
+
+    /* Load component */
+    omx_error = p_sys->pf_get_handle( &omx_handle, psz_component,
+                                      p_dec, &callbacks );
+    if(omx_error != OMX_ErrorNone)
+    {
+        msg_Warn( p_dec, "OMX_GetHandle(%s) failed (%x: %s)", psz_component,
+                  omx_error, ErrorToString(omx_error) );
+        return omx_error;
+    }
+
+    OMX_ComponentRoleEnum(omx_handle, psz_role, 0);
+    msg_Dbg(p_dec, "loaded component %s of role %s", psz_component, psz_role);
+    PrintOmx(p_dec, omx_handle, OMX_ALL);
+
+    /* Set component role */
+    OMX_INIT_STRUCTURE(role);
+    strcpy((char*)role.cRole,
+           GetOmxRole(p_sys->b_enc ? p_dec->fmt_out.i_codec : p_dec->fmt_in.i_codec,
+                      p_dec->fmt_in.i_cat, p_sys->b_enc));
+
+    omx_error = OMX_SetParameter(omx_handle, OMX_IndexParamStandardComponentRole,
+                                 &role);
+    omx_error = OMX_GetParameter(omx_handle, OMX_IndexParamStandardComponentRole,
+                                 &role);
+    if(omx_error == OMX_ErrorNone)
+        msg_Dbg(p_dec, "component standard role set to %s", role.cRole);
+
+    /* Find the input / output ports */
+    OMX_INIT_STRUCTURE(param);
+    OMX_INIT_STRUCTURE(definition);
+    omx_error = OMX_GetParameter(omx_handle, p_dec->fmt_in.i_cat == VIDEO_ES ?
+                                 OMX_IndexParamVideoInit : OMX_IndexParamAudioInit, &param);
+    if(omx_error != OMX_ErrorNone) param.nPorts = 0;
+
+    for(i = 0; i < param.nPorts; i++)
+    {
+        OmxPort *p_port;
+
+        /* Get port definition */
+        definition.nPortIndex = param.nStartPortNumber + i;
+        omx_error = OMX_GetParameter(omx_handle, OMX_IndexParamPortDefinition,
+                                     &definition);
+        if(omx_error != OMX_ErrorNone) continue;
+
+        if(definition.eDir == OMX_DirInput) p_port = &p_sys->in;
+        else  p_port = &p_sys->out;
+
+        p_port->b_valid = true;
+        p_port->i_port_index = definition.nPortIndex;
+        p_port->definition = definition;
+        p_port->omx_handle = omx_handle;
+    }
+
+    if(!p_sys->in.b_valid || !p_sys->out.b_valid)
+    {
+        omx_error = OMX_ErrorInvalidComponent;
+        CHECK_ERROR(omx_error, "couldn't find an input and output port");
+    }
+
+    /* Set port definitions */
+    for(i = 0; i < p_sys->ports; i++)
+    {
+        omx_error = SetPortDefinition(p_dec, &p_sys->p_ports[i],
+                                      p_sys->p_ports[i].p_fmt);
+        if(omx_error != OMX_ErrorNone) goto error;
+    }
+
+    /* Allocate our array for the omx buffers and enable ports */
+    for(i = 0; i < p_sys->ports; i++)
+    {
+        OmxPort *p_port = &p_sys->p_ports[i];
+
+        p_port->pp_buffers =
+            malloc(p_port->definition.nBufferCountActual *
+                   sizeof(OMX_BUFFERHEADERTYPE*));
+        if(!p_port->pp_buffers)
+        {
+          omx_error = OMX_ErrorInsufficientResources;
+          CHECK_ERROR(omx_error, "memory allocation failed");
+        }
+        p_port->i_buffers = p_port->definition.nBufferCountActual;
+
+        /* Enable port */
+        if(!p_port->definition.bEnabled)
+        {
+            omx_error = OMX_SendCommand( omx_handle, OMX_CommandPortEnable,
+                                         p_port->i_port_index, NULL);
+            CHECK_ERROR(omx_error, "ONX_CommandPortEnable on %i failed (%x)",
+                        (int)p_port->i_port_index, omx_error );
+            omx_error = WaitForSpecificOmxEvent(p_dec, OMX_EventCmdComplete, 0, 0, 0);
+            CHECK_ERROR(omx_error, "Wait for PortEnable on %i failed (%x)",
+                        (int)p_port->i_port_index, omx_error );
+        }
+    }
+
+    *p_handle = omx_handle;
+    return OMX_ErrorNone;
+
+ error:
+    DeinitialiseComponent(p_dec, omx_handle);
+    *p_handle = 0;
+    return omx_error;
+}
+
+/*****************************************************************************
+ * OpenDecoder: Create the decoder instance
+ *****************************************************************************/
+static int OpenDecoder( vlc_object_t *p_this )
+{
+    decoder_t *p_dec = (decoder_t*)p_this;
+    int status;
+
+    if( 0 || !GetOmxRole(p_dec->fmt_in.i_codec, p_dec->fmt_in.i_cat, false) )
+        return VLC_EGENERIC;
+
+    status = OpenGeneric( p_this, false );
+    if(status != VLC_SUCCESS) return status;
+
+    p_dec->pf_decode_video = DecodeVideo;
+    p_dec->pf_decode_audio = DecodeAudio;
+
+    return VLC_SUCCESS;
+}
+
+/*****************************************************************************
+ * OpenEncoder: Create the encoder instance
+ *****************************************************************************/
+static int OpenEncoder( vlc_object_t *p_this )
+{
+    encoder_t *p_enc = (encoder_t*)p_this;
+    int status;
+
+    if( !GetOmxRole(p_enc->fmt_out.i_codec, p_enc->fmt_in.i_cat, true) )
+        return VLC_EGENERIC;
+
+    status = OpenGeneric( p_this, true );
+    if(status != VLC_SUCCESS) return status;
+
+    p_enc->pf_encode_video = EncodeVideo;
+
+    return VLC_SUCCESS;
+}
+
+/*****************************************************************************
+ * OpenGeneric: Create the generic decoder/encoder instance
+ *****************************************************************************/
+static int OpenGeneric( vlc_object_t *p_this, bool b_encode )
+{
+    void *dll_handle = 0, *pf_init = 0, *pf_deinit = 0;
+    void *pf_get_handle = 0, *pf_free_handle = 0, *pf_component_enum = 0;
+    void *pf_get_roles_of_component = 0;
+    decoder_t *p_dec = (decoder_t*)p_this;
+    decoder_sys_t *p_sys;
+    OMX_ERRORTYPE omx_error;
+    OMX_BUFFERHEADERTYPE *p_header;
+    unsigned int i, j;
+
+    /* Load the OMX core */
+    for( i = 0; ppsz_dll_list[i]; i++ )
+    {
+        dll_handle = dll_open( ppsz_dll_list[i] );
+        if( dll_handle ) break;
+    }
+    if( !dll_handle ) return VLC_EGENERIC;
+
+    pf_init = dlsym( dll_handle, "OMX_Init" );
+    pf_deinit = dlsym( dll_handle, "OMX_Deinit" );
+    pf_get_handle = dlsym( dll_handle, "OMX_GetHandle" );
+    pf_free_handle = dlsym( dll_handle, "OMX_FreeHandle" );
+    pf_component_enum = dlsym( dll_handle, "OMX_ComponentNameEnum" );
+    pf_get_roles_of_component = dlsym( dll_handle, "OMX_GetRolesOfComponent" );
+    if( !pf_init || !pf_deinit || !pf_get_handle || !pf_free_handle ||
+        !pf_component_enum || !pf_get_roles_of_component )
+    {
+        msg_Warn( p_this, "cannot find OMX_* symbols in `%s' (%s)",
+                  ppsz_dll_list[i], dlerror() );
+        dll_close(dll_handle);
+    }
+
+    if( !pf_init || !pf_deinit || !pf_get_handle || !pf_free_handle || !pf_component_enum )
+    {
+        dll_close(dll_handle);
+        return VLC_EGENERIC;
+    }
+
+    /* Allocate the memory needed to store the decoder's structure */
+    if( ( p_dec->p_sys = p_sys = calloc( 1, sizeof(*p_sys)) ) == NULL )
+    {
+        dll_close(dll_handle);
+        return VLC_ENOMEM;
+    }
+
+    /* Initialise the thread properties */
+    if(!b_encode)
+    {
+        p_dec->fmt_out.i_cat = p_dec->fmt_in.i_cat;
+        p_dec->fmt_out.video = p_dec->fmt_in.video;
+        p_dec->fmt_out.audio = p_dec->fmt_in.audio;
+        p_dec->fmt_out.i_codec = 0;
+    }
+    p_sys->b_enc = b_encode;
+    p_sys->dll_handle = dll_handle;
+    p_sys->pf_init = pf_init;
+    p_sys->pf_deinit = pf_deinit;
+    p_sys->pf_get_handle = pf_get_handle;
+    p_sys->pf_free_handle = pf_free_handle;
+    p_sys->pf_component_enum = pf_component_enum;
+    p_sys->pf_get_roles_of_component = pf_get_roles_of_component;
+    p_sys->pp_last_event = &p_sys->p_events;
+    vlc_mutex_init (&p_sys->mutex);
+    vlc_cond_init (&p_sys->cond);
+    vlc_mutex_init (&p_sys->lock);
+    vlc_mutex_init (&p_sys->in.fifo.lock);
+    vlc_cond_init (&p_sys->in.fifo.wait);
+    p_sys->in.fifo.offset = offsetof(OMX_BUFFERHEADERTYPE, pOutputPortPrivate) / sizeof(void *);
+    p_sys->in.fifo.pp_last = &p_sys->in.fifo.p_first;
+    p_sys->in.b_direct = false;
+    p_sys->in.b_flushed = true;
+    p_sys->in.p_fmt = &p_dec->fmt_in;
+    vlc_mutex_init (&p_sys->out.fifo.lock);
+    vlc_cond_init (&p_sys->out.fifo.wait);
+    p_sys->out.fifo.offset = offsetof(OMX_BUFFERHEADERTYPE, pInputPortPrivate) / sizeof(void *);
+    p_sys->out.fifo.pp_last = &p_sys->out.fifo.p_first;
+    p_sys->out.b_direct = true;
+    p_sys->out.b_flushed = true;
+    p_sys->out.p_fmt = &p_dec->fmt_out;
+    p_sys->ports = 2;
+    p_sys->p_ports = &p_sys->in;
+
+    msg_Dbg(p_dec, "fmt in:%4.4s, out: %4.4s", (char *)&p_dec->fmt_in.i_codec,
+            (char *)&p_dec->fmt_out.i_codec);
+
+    /* Initialise the OMX core */
+    omx_error = p_sys->pf_init();
+    if(omx_error != OMX_ErrorNone)
+    {
+        msg_Warn( p_this, "OMX_Init failed (%x: %s)", omx_error,
+                  ErrorToString(omx_error) );
+        CloseGeneric(p_this);
+        return VLC_EGENERIC;
+    }
+    p_sys->b_init = true;
+
+    /* Enumerate components and build a list of the one we want to try */
+    if( !CreateComponentsList(p_dec,
+             GetOmxRole(p_sys->b_enc ? p_dec->fmt_out.i_codec :
+                        p_dec->fmt_in.i_codec, p_dec->fmt_in.i_cat,
+                        p_sys->b_enc)) )
+    {
+        msg_Warn( p_this, "couldn't find an omx component for codec %4.4s",
+                  (char *)&p_dec->fmt_in.i_codec );
+        CloseGeneric(p_this);
+        return VLC_EGENERIC;
+    }
+
+    /* Try to load and initialise a component */
+    for(i = 0; i < p_sys->components; i++)
+    {
+        omx_error = InitialiseComponent(p_dec, p_sys->ppsz_components[i],
+                                        &p_sys->omx_handle);
+        if(omx_error == OMX_ErrorNone) break;
+    }
+    CHECK_ERROR(omx_error, "no component could be initialised" );
+
+    /* Move component to Idle then Executing state */
+    OMX_SendCommand( p_sys->omx_handle, OMX_CommandStateSet, OMX_StateIdle, 0 );
+    CHECK_ERROR(omx_error, "ONX_CommandStateSet Idle failed (%x)", omx_error );
+
+    /* Allocate omx buffers */
+    for(i = 0; i < p_sys->ports; i++)
+    {
+        OmxPort *p_port = &p_sys->p_ports[i];
+
+        for(j = 0; j < p_port->i_buffers; j++)
+        {
+#if 0
+#define ALIGN(x,BLOCKLIGN) (((x) + BLOCKLIGN - 1) & ~(BLOCKLIGN - 1))
+            char *p_buf = malloc(p_port->definition.nBufferSize +
+                                 p_port->definition.nBufferAlignment);
+            p_port->pp_buffers[i] = (void *)ALIGN((uintptr_t)p_buf, p_port->definition.nBufferAlignment);
+#endif
+
+            if(0 && p_port->b_direct)
+                omx_error =
+                    OMX_UseBuffer( p_sys->omx_handle, &p_port->pp_buffers[j],
+                                   p_port->i_port_index, 0,
+                                   p_port->definition.nBufferSize, (void*)1);
+            else
+                omx_error =
+                    OMX_AllocateBuffer( p_sys->omx_handle, &p_port->pp_buffers[j],
+                                        p_port->i_port_index, 0,
+                                        p_port->definition.nBufferSize);
+
+            if(omx_error != OMX_ErrorNone) break;
+            OMX_FIFO_PUT(&p_port->fifo, p_port->pp_buffers[j]);
+        }
+        p_port->i_buffers = j;
+        CHECK_ERROR(omx_error, "ONX_UseBuffer failed (%x, %i, %i)",
+                    omx_error, (int)p_port->i_port_index, j );
+    }
+
+    omx_error = WaitForSpecificOmxEvent(p_dec, OMX_EventCmdComplete, 0, 0, 0);
+    CHECK_ERROR(omx_error, "Wait for Idle failed (%x)", omx_error );
+
+    omx_error = OMX_SendCommand( p_sys->omx_handle, OMX_CommandStateSet,
+                                 OMX_StateExecuting, 0);
+    CHECK_ERROR(omx_error, "ONX_CommandStateSet Executing failed (%x)", omx_error );
+    omx_error = WaitForSpecificOmxEvent(p_dec, OMX_EventCmdComplete, 0, 0, 0);
+    CHECK_ERROR(omx_error, "Wait for Executing failed (%x)", omx_error );
+
+    /* Send codec configuration data */
+    if( p_dec->fmt_in.i_extra )
+    {
+        OMX_FIFO_GET(&p_sys->in.fifo, p_header);
+        p_header->nFilledLen = p_dec->fmt_in.i_extra;
+
+        if(p_sys->in.b_direct)
+        {
+            p_header->pOutputPortPrivate = p_header->pBuffer;
+            p_header->pBuffer = p_dec->fmt_in.p_extra;
+        }
+        else
+        {
+            if(p_header->nFilledLen > p_header->nAllocLen)
+            {
+                msg_Dbg(p_dec, "buffer too small (%i,%i)", (int)p_header->nFilledLen,
+                        (int)p_header->nAllocLen);
+                p_header->nFilledLen = p_header->nAllocLen;
+            }
+            memcpy(p_header->pBuffer, p_dec->fmt_in.p_extra, p_header->nFilledLen);
+        }
+
+        p_header->nOffset = 0;
+        p_header->nFlags = OMX_BUFFERFLAG_CODECCONFIG;
+        msg_Dbg(p_dec, "sending codec config data %p, %p, %i", p_header,
+                p_header->pBuffer, (int)p_header->nFilledLen);
+        OMX_EmptyThisBuffer(p_sys->omx_handle, p_header);
+    }
+
+    /* Get back output port definition */
+    omx_error = GetPortDefinition(p_dec, &p_sys->out, p_sys->out.p_fmt);
+    if(omx_error != OMX_ErrorNone) goto error;
+
+    PrintOmx(p_dec, p_sys->omx_handle, p_dec->p_sys->in.i_port_index);
+    PrintOmx(p_dec, p_sys->omx_handle, p_dec->p_sys->out.i_port_index);
+
+    if(p_sys->b_error) goto error;
+
+    p_dec->b_need_packetized = true;
+    return VLC_SUCCESS;
+
+ error:
+    CloseGeneric(p_this);
+    return VLC_EGENERIC;
+}
+
+/*****************************************************************************
+ * PortReconfigure
+ *****************************************************************************/
+static OMX_ERRORTYPE PortReconfigure(decoder_t *p_dec, OmxPort *p_port)
+{
+    decoder_sys_t *p_sys = p_dec->p_sys;
+    OMX_PARAM_PORTDEFINITIONTYPE definition;
+    OMX_BUFFERHEADERTYPE *p_buffer;
+    OMX_ERRORTYPE omx_error;
+    unsigned int i;
+
+    /* Sanity checking */
+    OMX_INIT_STRUCTURE(definition);
+    definition.nPortIndex = p_port->i_port_index;
+    omx_error = OMX_GetParameter(p_dec->p_sys->omx_handle, OMX_IndexParamPortDefinition,
+                                 &definition);
+    if(omx_error != OMX_ErrorNone ||
+       !definition.format.video.nFrameWidth ||
+       !definition.format.video.nFrameHeight )
+        return OMX_ErrorUndefined;
+
+    omx_error = OMX_SendCommand( p_sys->omx_handle, OMX_CommandPortDisable,
+                                 p_port->i_port_index, NULL);
+    CHECK_ERROR(omx_error, "ONX_CommandPortDisable on %i failed (%x)",
+                (int)p_port->i_port_index, omx_error );
+
+    for(i = 0; i < p_port->i_buffers; i++)
+    {
+        OMX_FIFO_GET(&p_port->fifo, p_buffer);
+        omx_error = OMX_FreeBuffer( p_sys->omx_handle,
+                                    p_port->i_port_index, p_buffer );
+
+        if(omx_error != OMX_ErrorNone) break;
+    }
+    CHECK_ERROR(omx_error, "ONX_FreeBuffer failed (%x, %i, %i)",
+                omx_error, (int)p_port->i_port_index, i );
+
+    omx_error = WaitForSpecificOmxEvent(p_dec, OMX_EventCmdComplete, 0, 0, 0);
+    CHECK_ERROR(omx_error, "Wait for PortDisable failed (%x)", omx_error );
+
+    /* Get the new port definition */
+    omx_error = GetPortDefinition(p_dec, &p_sys->out, p_sys->out.p_fmt);
+    if(omx_error != OMX_ErrorNone) goto error;
+    omx_error = OMX_SetParameter(p_dec->p_sys->omx_handle, OMX_IndexParamPortDefinition,
+                                 &definition);
+    CHECK_ERROR(omx_error, "OMX_SetParameter failed (%x : %s)",
+                omx_error, ErrorToString(omx_error));
+
+    omx_error = OMX_SendCommand( p_sys->omx_handle, OMX_CommandPortEnable,
+                                 p_port->i_port_index, NULL);
+    CHECK_ERROR(omx_error, "ONX_CommandPortEnable on %i failed (%x)",
+                (int)p_port->i_port_index, omx_error );
+
+    for(i = 0; i < p_port->i_buffers; i++)
+    {
+        if(0 && p_port->b_direct)
+            omx_error =
+                OMX_UseBuffer( p_sys->omx_handle, &p_port->pp_buffers[i],
+                               p_port->i_port_index, 0,
+                               p_port->definition.nBufferSize, (void*)1);
+        else
+            omx_error =
+                OMX_AllocateBuffer( p_sys->omx_handle, &p_port->pp_buffers[i],
+                                    p_port->i_port_index, 0,
+                                    p_port->definition.nBufferSize);
+
+        if(omx_error != OMX_ErrorNone) break;
+        OMX_FIFO_PUT(&p_port->fifo, p_port->pp_buffers[i]);
+    }
+    p_port->i_buffers = i;
+    CHECK_ERROR(omx_error, "ONX_UseBuffer failed (%x, %i, %i)",
+                omx_error, (int)p_port->i_port_index, i );
+
+    omx_error = WaitForSpecificOmxEvent(p_dec, OMX_EventCmdComplete, 0, 0, 0);
+    CHECK_ERROR(omx_error, "Wait for PortEnable failed (%x)", omx_error );
+
+    PrintOmx(p_dec, p_sys->omx_handle, p_dec->p_sys->in.i_port_index);
+    PrintOmx(p_dec, p_sys->omx_handle, p_dec->p_sys->out.i_port_index);
+
+ error:
+    return omx_error;
+}
+
+/*****************************************************************************
+ * DecodeVideo: Called to decode one frame
+ *****************************************************************************/
+static picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block )
+{
+    decoder_sys_t *p_sys = p_dec->p_sys;
+    picture_t *p_pic = NULL, *p_next_pic;
+    OMX_ERRORTYPE omx_error;
+    unsigned int i;
+
+    OMX_BUFFERHEADERTYPE *p_header;
+    block_t *p_block;
+
+    if( !pp_block || !*pp_block )
+        return NULL;
+
+    p_block = *pp_block;
+
+    /* Check for errors from codec */
+    if(p_sys->b_error)
+    {
+        msg_Dbg(p_dec, "error during decoding");
+        block_Release( p_block );
+        return 0;
+    }
+
+    if( p_block->i_flags & (BLOCK_FLAG_DISCONTINUITY|BLOCK_FLAG_CORRUPTED) )
+    {
+        block_Release( p_block );
+        if(!p_sys->in.b_flushed)
+        {
+            msg_Dbg(p_dec, "flushing");
+            OMX_SendCommand( p_sys->omx_handle, OMX_CommandFlush,
+                             p_sys->in.definition.nPortIndex, 0 );
+        }
+        p_sys->in.b_flushed = true;
+        return NULL;
+    }
+
+    /* Take care of decoded frames first */
+    while(!p_pic)
+    {
+        OMX_FIFO_PEEK(&p_sys->out.fifo, p_header);
+        if(!p_header) break; /* No frame available */
+
+        if(p_header->nFilledLen)
+        {
+            p_pic = p_header->pAppPrivate;
+            if(!p_pic)
+            {
+                /* We're not in direct rendering mode.
+                 * Get a new picture and copy the content */
+                p_pic = decoder_NewPicture( p_dec );
+                if( !p_pic ) break; /* No picture available */
+
+                CopyOmxPicture(p_dec, p_pic, p_header);
+            }
+
+            p_pic->date = p_header->nTimeStamp;
+            p_header->nFilledLen = 0;
+            p_header->pAppPrivate = 0;
+        }
+
+        /* Get a new picture */
+        if(p_sys->in.b_direct && !p_header->pAppPrivate)
+        {
+            p_next_pic = decoder_NewPicture( p_dec );
+            if(!p_next_pic) break;
+
+            OMX_FIFO_GET(&p_sys->out.fifo, p_header);
+            p_header->pAppPrivate = p_next_pic;
+            p_header->pInputPortPrivate = p_header->pBuffer;
+            p_header->pBuffer = p_next_pic->p[0].p_pixels;
+        }
+        else
+        {
+            OMX_FIFO_GET(&p_sys->out.fifo, p_header);
+        }
+
+#ifdef OMXIL_EXTRA_DEBUG
+        msg_Dbg( p_dec, "FillThisBuffer %p, %p", p_header, p_header->pBuffer );
+#endif
+        OMX_FillThisBuffer(p_sys->omx_handle, p_header);
+    }
+
+    /* Send the input buffer to the component */
+    OMX_FIFO_GET(&p_sys->in.fifo, p_header);
+    if(p_header)
+    {
+        /* In direct mode we pass the input pointer as is.
+         * Otherwise we memcopy the data */
+        if(p_sys->in.b_direct)
+        {
+            p_header->pOutputPortPrivate = p_header->pBuffer;
+            p_header->pBuffer = p_block->p_buffer;
+            p_header->pAppPrivate = p_block;
+        }
+        else
+        {
+            if(p_block->i_buffer > p_header->nAllocLen)
+            {
+                msg_Dbg(p_dec, "buffer too small (%i,%i)", p_block->i_buffer,
+                        (int)p_header->nAllocLen);
+                p_block->i_buffer = p_header->nAllocLen;
+            }
+            memcpy(p_header->pBuffer, p_block->p_buffer, p_block->i_buffer );
+            block_Release(p_block);
+        }
+
+        p_header->nFilledLen = p_block->i_buffer;
+        p_header->nOffset = 0;
+        p_header->nFlags = OMX_BUFFERFLAG_ENDOFFRAME;
+        p_header->nTimeStamp = p_block->i_dts;
+#ifdef OMXIL_EXTRA_DEBUG
+        msg_Dbg( p_dec, "EmptyThisBuffer %p, %p, %i", p_header, p_header->pBuffer,
+                 (int)p_header->nFilledLen );
+#endif
+        OMX_EmptyThisBuffer(p_sys->omx_handle, p_header);
+        p_sys->in.b_flushed = false;
+        *pp_block = NULL; /* Avoid being fed the same packet again */
+    }
+
+    /* Handle the PortSettingsChanged events */
+    for(i = 0; i < p_sys->ports; i++)
+    {
+        OmxPort *p_port = &p_sys->p_ports[i];
+        if(!p_port->b_reconfigure) continue;
+        p_port->b_reconfigure = 0;
+        omx_error = PortReconfigure(p_dec, p_port);
+    }
+
+    return p_pic;
+}
+
+/*****************************************************************************
+ * DecodeAudio: Called to decode one frame
+ *****************************************************************************/
+aout_buffer_t *DecodeAudio ( decoder_t *p_dec, block_t **pp_block )
+{
+    decoder_sys_t *p_sys = p_dec->p_sys;
+    aout_buffer_t *p_buffer = 0;
+    OMX_BUFFERHEADERTYPE *p_header;
+    OMX_ERRORTYPE omx_error;
+    block_t *p_block;
+    unsigned int i;
+
+    if( !pp_block || !*pp_block ) return NULL;
+
+    p_block = *pp_block;
+
+    /* Check for errors from codec */
+    if(p_sys->b_error)
+    {
+        msg_Dbg(p_dec, "error during decoding");
+        block_Release( p_block );
+        return 0;
+    }
+
+    if( p_block->i_flags & (BLOCK_FLAG_DISCONTINUITY|BLOCK_FLAG_CORRUPTED) )
+    {
+        block_Release( p_block );
+        date_Set( &p_sys->end_date, 0 );
+        if(!p_sys->in.b_flushed)
+        {
+            msg_Dbg(p_dec, "flushing");
+            OMX_SendCommand( p_sys->omx_handle, OMX_CommandFlush,
+                             p_sys->in.definition.nPortIndex, 0 );
+        }
+        p_sys->in.b_flushed = true;
+        return NULL;
+    }
+
+    if( !date_Get( &p_sys->end_date ) )
+    {
+        if( !p_block->i_pts )
+        {
+            /* We've just started the stream, wait for the first PTS. */
+            block_Release( p_block );
+            return NULL;
+        }
+        date_Set( &p_sys->end_date, p_block->i_pts );
+    }
+
+    /* Take care of decoded frames first */
+    while(!p_buffer)
+    {
+        unsigned int i_samples;
+
+        OMX_FIFO_PEEK(&p_sys->out.fifo, p_header);
+        if(!p_header) break; /* No frame available */
+
+        i_samples = p_header->nFilledLen / p_sys->out.p_fmt->audio.i_channels / 2;
+        if(i_samples)
+        {
+            p_buffer = decoder_NewAudioBuffer( p_dec, i_samples );
+            if( !p_buffer ) break; /* No audio buffer available */
+
+            memcpy( p_buffer->p_buffer, p_header->pBuffer, p_buffer->i_buffer );
+            p_header->nFilledLen = 0;
+
+            if( p_header->nTimeStamp != 0 &&
+                p_header->nTimeStamp != date_Get( &p_sys->end_date ) )
+                date_Set( &p_sys->end_date, p_header->nTimeStamp );
+
+            p_buffer->i_pts = date_Get( &p_sys->end_date );
+            p_buffer->i_length = date_Increment( &p_sys->end_date, i_samples ) -
+                p_buffer->i_pts;
+        }
+
+#ifdef OMXIL_EXTRA_DEBUG
+        msg_Dbg( p_dec, "FillThisBuffer %p, %p", p_header, p_header->pBuffer );
+#endif
+        OMX_FIFO_GET(&p_sys->out.fifo, p_header);
+        OMX_FillThisBuffer(p_sys->omx_handle, p_header);
+    }
+
+
+    /* Send the input buffer to the component */
+    OMX_FIFO_GET(&p_sys->in.fifo, p_header);
+    if(p_header)
+    {
+        /* In direct mode we pass the input pointer as is.
+         * Otherwise we memcopy the data */
+        if(p_sys->in.b_direct)
+        {
+            p_header->pOutputPortPrivate = p_header->pBuffer;
+            p_header->pBuffer = p_block->p_buffer;
+            p_header->pAppPrivate = p_block;
+        }
+        else
+        {
+            if(p_block->i_buffer > p_header->nAllocLen)
+            {
+                msg_Dbg(p_dec, "buffer too small (%i,%i)", p_block->i_buffer,
+                        (int)p_header->nAllocLen);
+                p_block->i_buffer = p_header->nAllocLen;
+            }
+            memcpy(p_header->pBuffer, p_block->p_buffer, p_block->i_buffer );
+            block_Release(p_block);
+        }
+
+        p_header->nFilledLen = p_block->i_buffer;
+        p_header->nOffset = 0;
+        p_header->nFlags = OMX_BUFFERFLAG_ENDOFFRAME;
+        p_header->nTimeStamp = p_block->i_dts;
+#ifdef OMXIL_EXTRA_DEBUG
+        msg_Dbg( p_dec, "EmptyThisBuffer %p, %p, %i", p_header, p_header->pBuffer,
+                 (int)p_header->nFilledLen );
+#endif
+        OMX_EmptyThisBuffer(p_sys->omx_handle, p_header);
+        p_sys->in.b_flushed = false;
+        *pp_block = NULL; /* Avoid being fed the same packet again */
+    }
+
+    /* Handle the PortSettingsChanged events */
+    for(i = 0; i < p_sys->ports; i++)
+    {
+        OmxPort *p_port = &p_sys->p_ports[i];
+        if(!p_port->b_reconfigure) continue;
+        p_port->b_reconfigure = 0;
+        omx_error = PortReconfigure(p_dec, p_port);
+    }
+
+    return p_buffer;
+}
+
+/*****************************************************************************
+ * EncodeVideo: Called to encode one frame
+ *****************************************************************************/
+static block_t *EncodeVideo( encoder_t *p_enc, picture_t *p_pic )
+{
+    decoder_t *p_dec = ( decoder_t *)p_enc;
+    decoder_sys_t *p_sys = p_dec->p_sys;
+    OMX_ERRORTYPE omx_error;
+    unsigned int i;
+
+    OMX_BUFFERHEADERTYPE *p_header;
+    block_t *p_block = 0;
+
+    /* Check for errors from codec */
+    if(p_sys->b_error)
+    {
+        msg_Dbg(p_dec, "error during encoding");
+        return 0;
+    }
+
+    /* Send the input buffer to the component */
+    OMX_FIFO_GET(&p_sys->in.fifo, p_header);
+    if(p_header)
+    {
+        /* In direct mode we pass the input pointer as is.
+         * Otherwise we memcopy the data */
+        if(p_sys->in.b_direct)
+        {
+            p_header->pOutputPortPrivate = p_header->pBuffer;
+            p_header->pBuffer = p_pic->p[0].p_pixels;
+        }
+        else
+        {
+            CopyVlcPicture(p_dec, p_header, p_pic);
+        }
+
+        p_header->nFilledLen = p_sys->in.i_frame_size;
+        p_header->nOffset = 0;
+        p_header->nFlags = OMX_BUFFERFLAG_ENDOFFRAME;
+        p_header->nTimeStamp = p_pic->date;
+#ifdef OMXIL_EXTRA_DEBUG
+        msg_Dbg( p_dec, "EmptyThisBuffer %p, %p, %i", p_header, p_header->pBuffer,
+                 (int)p_header->nFilledLen );
+#endif
+        OMX_EmptyThisBuffer(p_sys->omx_handle, p_header);
+        p_sys->in.b_flushed = false;
+    }
+
+    /* Handle the PortSettingsChanged events */
+    for(i = 0; i < p_sys->ports; i++)
+    {
+        OmxPort *p_port = &p_sys->p_ports[i];
+        if(!p_port->b_reconfigure) continue;
+        p_port->b_reconfigure = 0;
+        omx_error = PortReconfigure(p_dec, p_port);
+    }
+
+    /* Wait for the decoded frame */
+    while(!p_block)
+    {
+        OMX_FIFO_GET(&p_sys->out.fifo, p_header);
+
+        if(p_header->nFilledLen)
+        {
+            if(p_header->nFlags & OMX_BUFFERFLAG_CODECCONFIG)
+            {
+                /* TODO: need to store codec config */
+                msg_Dbg(p_dec, "received codec config %i", (int)p_header->nFilledLen);
+            }
+
+            p_block = p_header->pAppPrivate;
+            if(!p_block)
+            {
+                /* We're not in direct rendering mode.
+                 * Get a new block and copy the content */
+                p_block = block_New( p_dec, p_header->nFilledLen );
+                memcpy(p_block->p_buffer, p_header->pBuffer, p_header->nFilledLen );
+            }
+
+            p_block->i_buffer = p_header->nFilledLen;
+            p_block->i_pts = p_block->i_dts = p_header->nTimeStamp;
+            p_header->nFilledLen = 0;
+            p_header->pAppPrivate = 0;
+        }
+
+#ifdef OMXIL_EXTRA_DEBUG
+        msg_Dbg( p_dec, "FillThisBuffer %p, %p", p_header, p_header->pBuffer );
+#endif
+        OMX_FillThisBuffer(p_sys->omx_handle, p_header);
+    }
+
+    msg_Dbg(p_dec, "done");
+    return p_block;
+}
+
+/*****************************************************************************
+ * CloseGeneric: omxil decoder destruction
+ *****************************************************************************/
+static void CloseGeneric( vlc_object_t *p_this )
+{
+    decoder_t *p_dec = (decoder_t *)p_this;
+    decoder_sys_t *p_sys = p_dec->p_sys;
+
+    if(p_sys->omx_handle) DeinitialiseComponent(p_dec, p_sys->omx_handle);
+    if(p_sys->b_init) p_sys->pf_deinit();
+    dll_close( p_sys->dll_handle );
+
+    vlc_mutex_destroy (&p_sys->mutex);
+    vlc_cond_destroy (&p_sys->cond);
+    vlc_mutex_destroy (&p_sys->in.fifo.lock);
+    vlc_cond_destroy (&p_sys->in.fifo.wait);
+    vlc_mutex_destroy (&p_sys->out.fifo.lock);
+    vlc_cond_destroy (&p_sys->out.fifo.wait);
+
+    free( p_sys );
+}
+
+/*****************************************************************************
+ * OmxEventHandler: 
+ *****************************************************************************/
+static OMX_ERRORTYPE OmxEventHandler( OMX_HANDLETYPE omx_handle,
+    OMX_PTR app_data, OMX_EVENTTYPE event, OMX_U32 data_1,
+    OMX_U32 data_2, OMX_PTR event_data )
+{
+    decoder_t *p_dec = (decoder_t *)app_data;
+    decoder_sys_t *p_sys = p_dec->p_sys;
+    unsigned int i;
+    (void)omx_handle;
+
+    switch (event)
+    {
+    case OMX_EventCmdComplete:
+        switch ((OMX_STATETYPE)data_1)
+        {
+        case OMX_CommandStateSet:
+            msg_Dbg( p_dec, "OmxEventHandler (%s, %s, %s)", EventToString(event),
+                     CommandToString(data_1), StateToString(data_2) );
+            break;
+
+        default:
+            msg_Dbg( p_dec, "OmxEventHandler (%s, %s, %u)", EventToString(event),
+                     CommandToString(data_1), (unsigned int)data_2 );
+            break;
+        }
+        break;
+
+    case OMX_EventError:
+        msg_Dbg( p_dec, "OmxEventHandler (%s, %s, %u, %s)", EventToString(event),
+                 ErrorToString((OMX_ERRORTYPE)data_1), (unsigned int)data_2,
+                 (const char *)event_data);
+        //p_sys->b_error = true;
+        break;
+
+    case OMX_EventPortSettingsChanged:
+        msg_Dbg( p_dec, "OmxEventHandler (%s, %u, %u)", EventToString(event),
+                 (unsigned int)data_1, (unsigned int)data_2 );
+        for(i = 0; i < p_sys->ports; i++)
+            if(p_sys->p_ports[i].definition.eDir == OMX_DirOutput)
+                p_sys->p_ports[i].b_reconfigure = true;
+        break;
+
+    default:
+        msg_Dbg( p_dec, "OmxEventHandler (%s, %u, %u)", EventToString(event),
+                 (unsigned int)data_1, (unsigned int)data_2 );
+        break;
+    }
+
+    PostOmxEvent(p_dec, event, data_1, data_2, event_data);
+    return OMX_ErrorNone;
+}
+
+static OMX_ERRORTYPE OmxEmptyBufferDone( OMX_HANDLETYPE omx_handle,
+    OMX_PTR app_data, OMX_BUFFERHEADERTYPE *omx_header )
+{
+    decoder_t *p_dec = (decoder_t *)app_data;
+    decoder_sys_t *p_sys = p_dec->p_sys;
+    (void)omx_handle;
+
+#ifdef OMXIL_EXTRA_DEBUG
+    msg_Dbg( p_dec, "OmxEmptyBufferDone %p, %p", omx_header, omx_header->pBuffer );
+#endif
+
+    if(omx_header->pAppPrivate || omx_header->pOutputPortPrivate)
+    {
+        block_t *p_block = (block_t *)omx_header->pAppPrivate;
+        omx_header->pBuffer = omx_header->pOutputPortPrivate;
+        if(p_block) block_Release(p_block);
+        omx_header->pAppPrivate = 0;
+    }
+    OMX_FIFO_PUT(&p_sys->in.fifo, omx_header);
+
+    return OMX_ErrorNone;
+}
+
+static OMX_ERRORTYPE OmxFillBufferDone( OMX_HANDLETYPE omx_handle,
+    OMX_PTR app_data, OMX_BUFFERHEADERTYPE *omx_header )
+{
+    decoder_t *p_dec = (decoder_t *)app_data;
+    decoder_sys_t *p_sys = p_dec->p_sys;
+    (void)omx_handle;
+
+#ifdef OMXIL_EXTRA_DEBUG
+    msg_Dbg( p_dec, "OmxFillBufferDone %p, %p, %i", omx_header, omx_header->pBuffer,
+             (int)omx_header->nFilledLen );
+#endif
+
+    if(omx_header->pInputPortPrivate)
+    {
+        omx_header->pBuffer = omx_header->pInputPortPrivate;
+    }
+    OMX_FIFO_PUT(&p_sys->out.fifo, omx_header);
+
+    return OMX_ErrorNone;
+}
diff --git a/modules/codec/omxil/omxil.h b/modules/codec/omxil/omxil.h
new file mode 100644 (file)
index 0000000..7b8f848
--- /dev/null
@@ -0,0 +1,111 @@
+/*****************************************************************************
+ * omxil_utils.h: helper functions
+ *****************************************************************************
+ * Copyright (C) 2010 the VideoLAN team
+ * $Id$
+ *
+ * Authors: Gildas Bazin <gbazin@videolan.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+
+/*****************************************************************************
+ * Includes
+ *****************************************************************************/
+#include "OMX_Core.h"
+#include "OMX_Index.h"
+#include "OMX_Component.h"
+#include "OMX_Video.h"
+
+#include "omxil_utils.h"
+
+/*****************************************************************************
+ * defines
+ *****************************************************************************/
+#define MAX_COMPONENTS_LIST_SIZE 32
+
+/*****************************************************************************
+ * decoder_sys_t : omxil decoder descriptor
+ *****************************************************************************/
+typedef struct OmxPort
+{
+    bool b_valid;
+    OMX_U32 i_port_index;
+    OMX_HANDLETYPE omx_handle;
+    OMX_PARAM_PORTDEFINITIONTYPE definition;
+    es_format_t *p_fmt;
+
+    unsigned int i_frame_size;
+    unsigned int i_frame_stride;
+    unsigned int i_frame_stride_chroma_div;
+
+    unsigned int i_buffers;
+    OMX_BUFFERHEADERTYPE **pp_buffers;
+
+    struct fifo_t
+    {
+      vlc_mutex_t         lock;
+      vlc_cond_t          wait;
+
+      OMX_BUFFERHEADERTYPE *p_first;
+      OMX_BUFFERHEADERTYPE **pp_last;
+
+      int offset;
+
+    } fifo;
+
+    OmxFormatParam format_param;
+
+    OMX_BOOL b_reconfigure;
+    OMX_BOOL b_direct;
+    OMX_BOOL b_flushed;
+
+} OmxPort;
+
+struct decoder_sys_t
+{
+    void *dll_handle;
+    OMX_HANDLETYPE omx_handle;
+
+    OMX_ERRORTYPE (*pf_init) (void);
+    OMX_ERRORTYPE (*pf_deinit) (void);
+    OMX_ERRORTYPE (*pf_get_handle) (OMX_HANDLETYPE *, OMX_STRING,
+                                    OMX_PTR, OMX_CALLBACKTYPE *);
+    OMX_ERRORTYPE (*pf_free_handle) (OMX_HANDLETYPE);
+    OMX_ERRORTYPE (*pf_component_enum)(OMX_STRING, OMX_U32, OMX_U32);
+    OMX_ERRORTYPE (*pf_get_roles_of_component)(OMX_STRING, OMX_U32 *, OMX_U8 **);
+
+    bool b_enc;
+    bool b_init;
+    vlc_mutex_t lock;
+
+    char ppsz_components[MAX_COMPONENTS_LIST_SIZE][OMX_MAX_STRINGNAME_SIZE];
+    unsigned int components;
+
+    struct OmxEvent *p_events;
+    struct OmxEvent **pp_last_event;
+
+    vlc_mutex_t mutex;
+    vlc_cond_t cond;
+
+    OmxPort *p_ports;
+    unsigned int ports;
+    OmxPort in;
+    OmxPort out;
+
+    bool b_error;
+
+    date_t end_date;
+};
diff --git a/modules/codec/omxil/omxil_utils.h b/modules/codec/omxil/omxil_utils.h
new file mode 100644 (file)
index 0000000..959f934
--- /dev/null
@@ -0,0 +1,169 @@
+/*****************************************************************************
+ * omxil_utils.h: helper functions
+ *****************************************************************************
+ * Copyright (C) 2010 the VideoLAN team
+ * $Id$
+ *
+ * Authors: Gildas Bazin <gbazin@videolan.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+
+/*****************************************************************************
+ * OMX macros
+ *****************************************************************************/
+#define OMX_INIT_COMMON(a) \
+  (a).nSize = sizeof(a); \
+  (a).nVersion.s.nVersionMajor = 1; \
+  (a).nVersion.s.nVersionMinor = 1; \
+  (a).nVersion.s.nRevision = 1; \
+  (a).nVersion.s.nStep = 0
+
+#define OMX_INIT_STRUCTURE(a) \
+  memset(&(a), 0, sizeof(a)); \
+  OMX_INIT_COMMON(a)
+
+#define OMX_ComponentRoleEnum(hComponent, cRole, nIndex) \
+    ((OMX_COMPONENTTYPE*)hComponent)->ComponentRoleEnum ? \
+    ((OMX_COMPONENTTYPE*)hComponent)->ComponentRoleEnum(  \
+        hComponent, cRole, nIndex ) : OMX_ErrorNotImplemented
+
+#define CHECK_ERROR(a, ...) \
+    if(a != OMX_ErrorNone) {msg_Dbg( p_dec, __VA_ARGS__ ); goto error;}
+
+/*****************************************************************************
+ * OMX buffer FIFO macros
+ *****************************************************************************/
+#define OMX_FIFO_PEEK(p_fifo, p_buffer) \
+         p_buffer = (p_fifo)->p_first;
+
+#define OMX_FIFO_GET(p_fifo, p_buffer) \
+    do { vlc_mutex_lock( &(p_fifo)->lock ); \
+         while( !(p_fifo)->p_first ) \
+             vlc_cond_wait( &(p_fifo)->wait, &(p_fifo)->lock ); \
+         p_buffer = (p_fifo)->p_first; \
+         OMX_BUFFERHEADERTYPE **pp_next = (OMX_BUFFERHEADERTYPE **) \
+             ((void **)p_buffer + (p_fifo)->offset); \
+         (p_fifo)->p_first = *pp_next; *pp_next = 0; \
+         if( !(p_fifo)->p_first ) (p_fifo)->pp_last = &(p_fifo)->p_first; \
+         vlc_mutex_unlock( &(p_fifo)->lock ); } while(0)
+
+#define OMX_FIFO_PUT(p_fifo, p_buffer) \
+    do { vlc_mutex_lock (&(p_fifo)->lock);              \
+         OMX_BUFFERHEADERTYPE **pp_next = (OMX_BUFFERHEADERTYPE **) \
+             ((void **)p_buffer + (p_fifo)->offset); \
+         *(p_fifo)->pp_last = p_buffer; \
+         (p_fifo)->pp_last = pp_next; *pp_next = 0; \
+         vlc_cond_signal( &(p_fifo)->wait ); \
+         vlc_mutex_unlock( &(p_fifo)->lock ); } while(0)
+
+/*****************************************************************************
+ * OMX format parameters
+ *****************************************************************************/
+typedef union {
+    OMX_PARAM_U32TYPE common;
+    OMX_AUDIO_PARAM_PCMMODETYPE pcm;
+    OMX_AUDIO_PARAM_MP3TYPE mp3;
+    OMX_AUDIO_PARAM_AACPROFILETYPE aac;
+    OMX_AUDIO_PARAM_VORBISTYPE vorbis;
+    OMX_AUDIO_PARAM_WMATYPE wma;
+    OMX_AUDIO_PARAM_RATYPE ra;
+    OMX_AUDIO_PARAM_ADPCMTYPE adpcm;
+    OMX_AUDIO_PARAM_G723TYPE g723;
+    OMX_AUDIO_PARAM_G726TYPE g726;
+    OMX_AUDIO_PARAM_G729TYPE g729;
+    OMX_AUDIO_PARAM_AMRTYPE amr;
+
+    OMX_VIDEO_PARAM_H263TYPE h263;
+    OMX_VIDEO_PARAM_MPEG2TYPE mpeg2;
+    OMX_VIDEO_PARAM_MPEG4TYPE mpeg4;
+    OMX_VIDEO_PARAM_WMVTYPE wmv;
+    OMX_VIDEO_PARAM_RVTYPE rv;
+    OMX_VIDEO_PARAM_AVCTYPE avc;
+
+} OmxFormatParam;
+
+/*****************************************************************************
+ * Events utility functions
+ *****************************************************************************/
+typedef struct OmxEvent
+{
+    OMX_EVENTTYPE event;
+    OMX_U32 data_1;
+    OMX_U32 data_2;
+    OMX_PTR event_data;
+
+    struct OmxEvent *next;
+} OmxEvent;
+
+OMX_ERRORTYPE PostOmxEvent(decoder_t *p_dec, OMX_EVENTTYPE event,
+    OMX_U32 data_1, OMX_U32 data_2, OMX_PTR event_data);
+OMX_ERRORTYPE WaitForOmxEvent(decoder_t *p_dec, OMX_EVENTTYPE *event,
+    OMX_U32 *data_1, OMX_U32 *data_2, OMX_PTR *event_data);
+OMX_ERRORTYPE WaitForSpecificOmxEvent(decoder_t *p_dec,
+    OMX_EVENTTYPE specific_event, OMX_U32 *data_1, OMX_U32 *data_2,
+    OMX_PTR *event_data);
+
+/*****************************************************************************
+ * Picture utility functions
+ *****************************************************************************/
+void CopyOmxPicture( decoder_t *, picture_t *, OMX_BUFFERHEADERTYPE * );
+void CopyVlcPicture( decoder_t *, OMX_BUFFERHEADERTYPE *, picture_t * );
+
+/*****************************************************************************
+ * Logging utility functions
+ *****************************************************************************/
+const char *StateToString(OMX_STATETYPE state);
+const char *CommandToString(OMX_COMMANDTYPE command);
+const char *EventToString(OMX_EVENTTYPE event);
+const char *ErrorToString(OMX_ERRORTYPE error);
+
+void PrintOmx(decoder_t *p_dec, OMX_HANDLETYPE omx_handle, OMX_U32 i_port);
+
+/*****************************************************************************
+ * fourcc -> omx id mapping
+ *****************************************************************************/
+int GetOmxVideoFormat( vlc_fourcc_t i_fourcc,
+                       OMX_VIDEO_CODINGTYPE *pi_omx_codec,
+                       const char **ppsz_name );
+int GetVlcVideoFormat( OMX_VIDEO_CODINGTYPE i_omx_codec,
+                       vlc_fourcc_t *pi_fourcc, const char **ppsz_name );
+int GetOmxAudioFormat( vlc_fourcc_t i_fourcc,
+                       OMX_AUDIO_CODINGTYPE *pi_omx_codec,
+                       const char **ppsz_name );
+int GetVlcAudioFormat( OMX_AUDIO_CODINGTYPE i_omx_codec,
+                       vlc_fourcc_t *pi_fourcc, const char **ppsz_name );
+const char *GetOmxRole( vlc_fourcc_t i_fourcc, int i_cat, bool b_enc );
+int GetOmxChromaFormat( vlc_fourcc_t i_fourcc,
+                        OMX_COLOR_FORMATTYPE *pi_omx_codec,
+                        const char **ppsz_name );
+int GetVlcChromaFormat( OMX_COLOR_FORMATTYPE i_omx_codec,
+                        vlc_fourcc_t *pi_fourcc, const char **ppsz_name );
+int GetVlcChromaSizes( vlc_fourcc_t i_fourcc,
+                       unsigned int width, unsigned int height,
+                       unsigned int *size, unsigned int *pitch,
+                       unsigned int *chroma_pitch_div );
+
+/*****************************************************************************
+ * Functions to deal with audio format parameters
+ *****************************************************************************/
+OMX_ERRORTYPE SetAudioParameters(OMX_HANDLETYPE handle,
+    OmxFormatParam *param, OMX_U32 i_port, OMX_AUDIO_CODINGTYPE encoding,
+    uint8_t i_channels, unsigned int i_samplerate, unsigned int i_bitrate,
+    unsigned int i_bps, unsigned int i_blocksize);
+OMX_ERRORTYPE GetAudioParameters(OMX_HANDLETYPE handle,
+    OmxFormatParam *param, OMX_U32 i_port, OMX_AUDIO_CODINGTYPE encoding,
+    uint8_t *pi_channels, unsigned int *pi_samplerate,
+    unsigned int *pi_bitrate, unsigned int *pi_bps, unsigned int *pi_blocksize);
diff --git a/modules/codec/omxil/utils.c b/modules/codec/omxil/utils.c
new file mode 100644 (file)
index 0000000..df1c076
--- /dev/null
@@ -0,0 +1,892 @@
+/*****************************************************************************
+ * utils.c: helper functions
+ *****************************************************************************
+ * Copyright (C) 2010 the VideoLAN team
+ * $Id$
+ *
+ * Authors: Gildas Bazin <gbazin@videolan.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+
+/*****************************************************************************
+ * Preamble
+ *****************************************************************************/
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#if defined(HAVE_DL_DLOPEN)
+# include <dlfcn.h>
+#endif
+
+#include <vlc_common.h>
+#include <vlc_plugin.h>
+#include <vlc_codec.h>
+#include <vlc_block_helper.h>
+#include <vlc_cpu.h>
+
+#include "omxil.h"
+
+/*****************************************************************************
+ * Events utility functions
+ *****************************************************************************/
+OMX_ERRORTYPE PostOmxEvent(decoder_t *p_dec, OMX_EVENTTYPE event,
+    OMX_U32 data_1, OMX_U32 data_2, OMX_PTR event_data)
+{
+    decoder_sys_t *p_sys = p_dec->p_sys;
+    OmxEvent *p_event;
+
+    p_event = malloc(sizeof(OmxEvent));
+    if(!p_event) return OMX_ErrorInsufficientResources;
+
+    p_event->event = event;
+    p_event->data_1 = data_1;
+    p_event->data_2 = data_2;
+    p_event->event_data = event_data;
+    p_event->next = 0;
+
+    vlc_mutex_lock(&p_sys->mutex);
+    *p_sys->pp_last_event = p_event;
+    p_sys->pp_last_event = &p_event->next;
+    vlc_cond_signal(&p_sys->cond);
+    vlc_mutex_unlock(&p_sys->mutex);
+    return OMX_ErrorNone;
+}
+
+OMX_ERRORTYPE WaitForOmxEvent(decoder_t *p_dec, OMX_EVENTTYPE *event,
+    OMX_U32 *data_1, OMX_U32 *data_2, OMX_PTR *event_data)
+{
+    decoder_sys_t *p_sys = p_dec->p_sys;
+    OmxEvent *p_event;
+
+    vlc_mutex_lock(&p_sys->mutex);
+
+    if(!p_sys->p_events)
+        vlc_cond_timedwait(&p_sys->cond, &p_sys->mutex, mdate()+CLOCK_FREQ);
+
+    p_event = p_sys->p_events;
+    if(p_event)
+    {
+        p_sys->p_events = p_event->next;
+        if(!p_sys->p_events) p_sys->pp_last_event = &p_sys->p_events;
+    }
+
+    vlc_mutex_unlock(&p_sys->mutex);
+
+    if(p_event)
+    {
+        if(event) *event = p_event->event;
+        if(data_1) *data_1 = p_event->data_1;
+        if(data_2) *data_2 = p_event->data_2;
+        if(event_data) *event_data = p_event->event_data;
+        free(p_event);
+        return OMX_ErrorNone;
+    }
+
+    return OMX_ErrorTimeout;
+}
+
+OMX_ERRORTYPE WaitForSpecificOmxEvent(decoder_t *p_dec,
+    OMX_EVENTTYPE specific_event, OMX_U32 *data_1, OMX_U32 *data_2,
+    OMX_PTR *event_data)
+{
+    OMX_ERRORTYPE status;
+    OMX_EVENTTYPE event;
+    mtime_t before =  mdate();
+
+    while(1)
+    {
+        status = WaitForOmxEvent(p_dec, &event, data_1, data_2, event_data);
+        if(status != OMX_ErrorNone) return status;
+
+        if(event == specific_event) break;
+        if(mdate() - before > CLOCK_FREQ) return OMX_ErrorTimeout;
+    }
+
+    return OMX_ErrorNone;
+}
+
+/*****************************************************************************
+ * Picture utility functions
+ *****************************************************************************/
+void CopyOmxPicture( decoder_t *p_dec, picture_t *p_pic,
+                     OMX_BUFFERHEADERTYPE *p_header )
+{
+    decoder_sys_t *p_sys = p_dec->p_sys;
+    int i_src_stride, i_dst_stride;
+    int i_plane, i_width, i_line;
+    uint8_t *p_dst, *p_src;
+
+    i_src_stride  = p_sys->out.i_frame_stride;
+    p_src = p_header->pBuffer + p_header->nOffset;
+
+    for( i_plane = 0; i_plane < p_pic->i_planes; i_plane++ )
+    {
+        if(i_plane == 1) i_src_stride /= p_sys->out.i_frame_stride_chroma_div;
+        p_dst = p_pic->p[i_plane].p_pixels;
+        i_dst_stride = p_pic->p[i_plane].i_pitch;
+        i_width = p_pic->p[i_plane].i_visible_pitch;
+
+        for( i_line = 0; i_line < p_pic->p[i_plane].i_visible_lines; i_line++ )
+        {
+            vlc_memcpy( p_dst, p_src, i_width );
+            p_src += i_src_stride;
+            p_dst += i_dst_stride;
+        }
+    }
+}
+
+void CopyVlcPicture( decoder_t *p_dec, OMX_BUFFERHEADERTYPE *p_header,
+                     picture_t *p_pic)
+{
+    decoder_sys_t *p_sys = p_dec->p_sys;
+    int i_src_stride, i_dst_stride;
+    int i_plane, i_width, i_line;
+    uint8_t *p_dst, *p_src;
+
+    i_dst_stride  = p_sys->out.i_frame_stride;
+    p_dst = p_header->pBuffer + p_header->nOffset;
+
+    for( i_plane = 0; i_plane < p_pic->i_planes; i_plane++ )
+    {
+        if(i_plane == 1) i_dst_stride /= p_sys->in.i_frame_stride_chroma_div;
+        p_src = p_pic->p[i_plane].p_pixels;
+        i_src_stride = p_pic->p[i_plane].i_pitch;
+        i_width = p_pic->p[i_plane].i_visible_pitch;
+
+        for( i_line = 0; i_line < p_pic->p[i_plane].i_visible_lines; i_line++ )
+        {
+            vlc_memcpy( p_dst, p_src, i_width );
+            p_src += i_src_stride;
+            p_dst += i_dst_stride;
+        }
+    }
+}
+
+/*****************************************************************************
+ * Logging utility functions
+ *****************************************************************************/
+const char *StateToString(OMX_STATETYPE state)
+{
+    static const char *psz_names[] = {
+        "OMX_StateInvalid", "OMX_StateLoaded", "OMX_StateIdle",
+        "OMX_StateExecuting", "OMX_StatePause", "OMX_StateWaitForResources",
+        "OMX_State unknown"
+    };
+
+    if((unsigned int)state > sizeof(psz_names)/sizeof(char*)-1)
+        state = (OMX_STATETYPE)(sizeof(psz_names)/sizeof(char*)-1);
+    return psz_names[state];
+}
+
+const char *CommandToString(OMX_COMMANDTYPE command)
+{
+    static const char *psz_names[] = {
+        "OMX_CommandStateSet", "OMX_CommandFlush", "OMX_CommandPortDisable",
+        "OMX_CommandPortEnable", "OMX_CommandMarkBuffer",
+        "OMX_Command unknown"
+    };
+
+    if((unsigned int)command > sizeof(psz_names)/sizeof(char*)-1)
+        command = (OMX_COMMANDTYPE)(sizeof(psz_names)/sizeof(char*)-1);
+    return psz_names[command];
+}
+
+const char *EventToString(OMX_EVENTTYPE event)
+{
+    static const char *psz_names[] = {
+        "OMX_EventCmdComplete", "OMX_EventError", "OMX_EventMark",
+        "OMX_EventPortSettingsChanged", "OMX_EventBufferFlag",
+        "OMX_EventResourcesAcquired", "OMX_EventComponentResumed",
+        "OMX_EventDynamicResourcesAvailable", "OMX_EventPortFormatDetected",
+        "OMX_Event unknown"
+    };
+
+    if((unsigned int)event > sizeof(psz_names)/sizeof(char*)-1)
+        event = (OMX_EVENTTYPE)(sizeof(psz_names)/sizeof(char*)-1);
+    return psz_names[event];
+}
+
+const char *ErrorToString(OMX_ERRORTYPE error)
+{
+    static const char *psz_names[] = {
+        "OMX_ErrorInsufficientResources", "OMX_ErrorUndefined",
+        "OMX_ErrorInvalidComponentName", "OMX_ErrorComponentNotFound",
+        "OMX_ErrorInvalidComponent", "OMX_ErrorBadParameter",
+        "OMX_ErrorNotImplemented", "OMX_ErrorUnderflow",
+        "OMX_ErrorOverflow", "OMX_ErrorHardware", "OMX_ErrorInvalidState",
+        "OMX_ErrorStreamCorrupt", "OMX_ErrorPortsNotCompatible",
+        "OMX_ErrorResourcesLost", "OMX_ErrorNoMore", "OMX_ErrorVersionMismatch",
+        "OMX_ErrorNotReady", "OMX_ErrorTimeout", "OMX_ErrorSameState",
+        "OMX_ErrorResourcesPreempted", "OMX_ErrorPortUnresponsiveDuringAllocation",
+        "OMX_ErrorPortUnresponsiveDuringDeallocation",
+        "OMX_ErrorPortUnresponsiveDuringStop", "OMX_ErrorIncorrectStateTransition",
+        "OMX_ErrorIncorrectStateOperation", "OMX_ErrorUnsupportedSetting",
+        "OMX_ErrorUnsupportedIndex", "OMX_ErrorBadPortIndex",
+        "OMX_ErrorPortUnpopulated", "OMX_ErrorComponentSuspended",
+        "OMX_ErrorDynamicResourcesUnavailable", "OMX_ErrorMbErrorsInFrame",
+        "OMX_ErrorFormatNotDetected", "OMX_ErrorContentPipeOpenFailed",
+        "OMX_ErrorContentPipeCreationFailed", "OMX_ErrorSeperateTablesUsed",
+        "OMX_ErrorTunnelingUnsupported",
+        "OMX_Error unkown"
+    };
+
+    if(error == OMX_ErrorNone) return "OMX_ErrorNone";
+
+    error -= OMX_ErrorInsufficientResources;
+
+    if((unsigned int)error > sizeof(psz_names)/sizeof(char*)-1)
+        error = (OMX_STATETYPE)(sizeof(psz_names)/sizeof(char*)-1);
+    return psz_names[error];
+}
+
+/*****************************************************************************
+ * fourcc -> omx id mapping
+ *****************************************************************************/
+static const struct
+{
+    vlc_fourcc_t i_fourcc;
+    OMX_VIDEO_CODINGTYPE i_codec;
+    const char *psz_role;
+
+} video_format_table[] =
+{
+    { VLC_CODEC_MPGV, OMX_VIDEO_CodingMPEG2, "video_decoder.mpeg2" },
+    { VLC_CODEC_MP4V, OMX_VIDEO_CodingMPEG4, "video_decoder.mpeg4" },
+    { VLC_CODEC_H264, OMX_VIDEO_CodingAVC,   "video_decoder.avc"   },
+    { VLC_CODEC_H263, OMX_VIDEO_CodingH263,  "video_decoder.h263"  },
+    { VLC_CODEC_WMV1, OMX_VIDEO_CodingWMV,   "video_decoder.wmv"   },
+    { VLC_CODEC_WMV2, OMX_VIDEO_CodingWMV,   "video_decoder.wmv"   },
+    { VLC_CODEC_WMV3, OMX_VIDEO_CodingWMV,   "video_decoder.wmv"   },
+    { VLC_CODEC_MJPG, OMX_VIDEO_CodingMJPEG, "video_decoder.jpeg"  },
+    { VLC_CODEC_RV10, OMX_VIDEO_CodingRV,    "video_decoder.rv"    },
+    { VLC_CODEC_RV20, OMX_VIDEO_CodingRV,    "video_decoder.rv"    },
+    { VLC_CODEC_RV30, OMX_VIDEO_CodingRV,    "video_decoder.rv"    },
+    { VLC_CODEC_RV40, OMX_VIDEO_CodingRV,    "video_decoder.rv"    },
+    { 0, 0, 0 }
+};
+
+static const struct
+{
+    vlc_fourcc_t i_fourcc;
+    OMX_AUDIO_CODINGTYPE i_codec;
+    const char *psz_role;
+
+} audio_format_table[] =
+{
+    { VLC_CODEC_AMR_NB, OMX_AUDIO_CodingAMR, "audio_decoder.amr" },
+    { VLC_CODEC_AMR_WB, OMX_AUDIO_CodingAMR, "audio_decoder.amr" },
+    { VLC_CODEC_MP4A,   OMX_AUDIO_CodingAAC, "audio_decoder.aac" },
+    { VLC_CODEC_S16N,   OMX_AUDIO_CodingPCM, "audio_decoder.pcm" },
+    { 0, 0, 0 }
+};
+
+static const struct
+{
+    vlc_fourcc_t i_fourcc;
+    OMX_VIDEO_CODINGTYPE i_codec;
+    const char *psz_role;
+
+} video_enc_format_table[] =
+{
+    { VLC_CODEC_MPGV, OMX_VIDEO_CodingMPEG2, "video_encoder.mpeg2" },
+    { VLC_CODEC_MP4V, OMX_VIDEO_CodingMPEG4, "video_encoder.mpeg4" },
+    { VLC_CODEC_H264, OMX_VIDEO_CodingAVC,   "video_encoder.avc"   },
+    { VLC_CODEC_H263, OMX_VIDEO_CodingH263,  "video_encoder.h263"  },
+    { VLC_CODEC_WMV1, OMX_VIDEO_CodingWMV,   "video_encoder.wmv"   },
+    { VLC_CODEC_WMV2, OMX_VIDEO_CodingWMV,   "video_encoder.wmv"   },
+    { VLC_CODEC_WMV3, OMX_VIDEO_CodingWMV,   "video_encoder.wmv"   },
+    { VLC_CODEC_MJPG, OMX_VIDEO_CodingMJPEG, "video_encoder.jpeg"  },
+    { VLC_CODEC_RV10, OMX_VIDEO_CodingRV,    "video_encoder.rv"    },
+    { VLC_CODEC_RV20, OMX_VIDEO_CodingRV,    "video_encoder.rv"    },
+    { VLC_CODEC_RV30, OMX_VIDEO_CodingRV,    "video_encoder.rv"    },
+    { VLC_CODEC_RV40, OMX_VIDEO_CodingRV,    "video_encoder.rv"    },
+    { 0, 0, 0 }
+};
+
+static const struct
+{
+    vlc_fourcc_t i_fourcc;
+    OMX_AUDIO_CODINGTYPE i_codec;
+    const char *psz_role;
+
+} audio_enc_format_table[] =
+{
+    { VLC_CODEC_AMR_NB, OMX_AUDIO_CodingAMR, "audio_encoder.amr" },
+    { VLC_CODEC_AMR_WB, OMX_AUDIO_CodingAMR, "audio_encoder.amr" },
+    { VLC_CODEC_MP4A,   OMX_AUDIO_CodingAAC, "audio_encoder.aac" },
+    { VLC_CODEC_S16N,   OMX_AUDIO_CodingPCM, "audio_encoder.pcm" },
+    { 0, 0, 0 }
+};
+
+static const struct
+{
+    vlc_fourcc_t i_fourcc;
+    OMX_COLOR_FORMATTYPE i_codec;
+    unsigned int i_size_mul;
+    unsigned int i_line_mul;
+    unsigned int i_line_chroma_div;
+
+} chroma_format_table[] =
+{
+    { VLC_CODEC_I420, OMX_COLOR_FormatYUV420Planar, 3, 1, 2 },
+    { VLC_CODEC_I420, OMX_COLOR_FormatYUV420PackedPlanar, 3, 1, 2 },
+    { VLC_CODEC_YUYV, OMX_COLOR_FormatYCbYCr, 4, 2, 0 },
+    { VLC_CODEC_YVYU, OMX_COLOR_FormatYCrYCb, 4, 2, 0 },
+    { VLC_CODEC_UYVY, OMX_COLOR_FormatCbYCrY, 4, 2, 0 },
+    { VLC_CODEC_VYUY, OMX_COLOR_FormatCrYCbY, 4, 2, 0 },
+    { 0, 0, 0, 0, 0 }
+};
+
+int GetOmxVideoFormat( vlc_fourcc_t i_fourcc,
+                       OMX_VIDEO_CODINGTYPE *pi_omx_codec,
+                       const char **ppsz_name )
+{
+    unsigned int i;
+
+    i_fourcc = vlc_fourcc_GetCodec( VIDEO_ES, i_fourcc );
+
+    for( i = 0; video_format_table[i].i_codec != 0; i++ )
+        if( video_format_table[i].i_fourcc == i_fourcc ) break;
+
+    if( pi_omx_codec ) *pi_omx_codec = video_format_table[i].i_codec;
+    if( ppsz_name ) *ppsz_name = vlc_fourcc_GetDescription( VIDEO_ES, i_fourcc );
+    return !!video_format_table[i].i_codec;
+}
+
+int GetVlcVideoFormat( OMX_VIDEO_CODINGTYPE i_omx_codec,
+                       vlc_fourcc_t *pi_fourcc, const char **ppsz_name )
+{
+    unsigned int i;
+
+    for( i = 0; video_format_table[i].i_codec != 0; i++ )
+        if( video_format_table[i].i_codec == i_omx_codec ) break;
+
+    if( pi_fourcc ) *pi_fourcc = video_format_table[i].i_fourcc;
+    if( ppsz_name ) *ppsz_name = vlc_fourcc_GetDescription( VIDEO_ES,
+                                     video_format_table[i].i_fourcc );
+    return !!video_format_table[i].i_fourcc;
+}
+
+static const char *GetOmxVideoRole( vlc_fourcc_t i_fourcc )
+{
+    unsigned int i;
+
+    i_fourcc = vlc_fourcc_GetCodec( VIDEO_ES, i_fourcc );
+
+    for( i = 0; video_format_table[i].i_codec != 0; i++ )
+        if( video_format_table[i].i_fourcc == i_fourcc ) break;
+
+    return video_format_table[i].psz_role;
+}
+
+static const char *GetOmxVideoEncRole( vlc_fourcc_t i_fourcc )
+{
+    unsigned int i;
+
+    i_fourcc = vlc_fourcc_GetCodec( VIDEO_ES, i_fourcc );
+
+    for( i = 0; video_enc_format_table[i].i_codec != 0; i++ )
+        if( video_enc_format_table[i].i_fourcc == i_fourcc ) break;
+
+    return video_enc_format_table[i].psz_role;
+}
+
+int GetOmxAudioFormat( vlc_fourcc_t i_fourcc,
+                       OMX_AUDIO_CODINGTYPE *pi_omx_codec,
+                       const char **ppsz_name )
+{
+    unsigned int i;
+
+    i_fourcc = vlc_fourcc_GetCodec( AUDIO_ES, i_fourcc );
+
+    for( i = 0; audio_format_table[i].i_codec != 0; i++ )
+        if( audio_format_table[i].i_fourcc == i_fourcc ) break;
+
+    if( pi_omx_codec ) *pi_omx_codec = audio_format_table[i].i_codec;
+    if( ppsz_name ) *ppsz_name = vlc_fourcc_GetDescription( AUDIO_ES, i_fourcc );
+    return !!audio_format_table[i].i_codec;
+}
+
+int GetVlcAudioFormat( OMX_AUDIO_CODINGTYPE i_omx_codec,
+                       vlc_fourcc_t *pi_fourcc, const char **ppsz_name )
+{
+    unsigned int i;
+
+    for( i = 0; audio_format_table[i].i_codec != 0; i++ )
+        if( audio_format_table[i].i_codec == i_omx_codec ) break;
+
+    if( pi_fourcc ) *pi_fourcc = audio_format_table[i].i_fourcc;
+    if( ppsz_name ) *ppsz_name = vlc_fourcc_GetDescription( AUDIO_ES,
+                                     audio_format_table[i].i_fourcc );
+    return !!audio_format_table[i].i_fourcc;
+}
+
+static const char *GetOmxAudioRole( vlc_fourcc_t i_fourcc )
+{
+    unsigned int i;
+
+    i_fourcc = vlc_fourcc_GetCodec( AUDIO_ES, i_fourcc );
+
+    for( i = 0; audio_format_table[i].i_codec != 0; i++ )
+        if( audio_format_table[i].i_fourcc == i_fourcc ) break;
+
+    return audio_format_table[i].psz_role;
+}
+
+static const char *GetOmxAudioEncRole( vlc_fourcc_t i_fourcc )
+{
+    unsigned int i;
+
+    i_fourcc = vlc_fourcc_GetCodec( AUDIO_ES, i_fourcc );
+
+    for( i = 0; audio_enc_format_table[i].i_codec != 0; i++ )
+        if( audio_enc_format_table[i].i_fourcc == i_fourcc ) break;
+
+    return audio_enc_format_table[i].psz_role;
+}
+
+const char *GetOmxRole( vlc_fourcc_t i_fourcc, int i_cat, bool b_enc )
+{
+    if(b_enc)
+        return i_cat == VIDEO_ES ?
+            GetOmxVideoEncRole( i_fourcc ) : GetOmxAudioEncRole( i_fourcc );
+    else
+        return i_cat == VIDEO_ES ?
+            GetOmxVideoRole( i_fourcc ) : GetOmxAudioRole( i_fourcc );
+}
+
+int GetOmxChromaFormat( vlc_fourcc_t i_fourcc,
+                        OMX_COLOR_FORMATTYPE *pi_omx_codec,
+                        const char **ppsz_name )
+{
+    unsigned int i;
+
+    i_fourcc = vlc_fourcc_GetCodec( VIDEO_ES, i_fourcc );
+
+    for( i = 0; chroma_format_table[i].i_codec != 0; i++ )
+        if( chroma_format_table[i].i_fourcc == i_fourcc ) break;
+
+    if( pi_omx_codec ) *pi_omx_codec = chroma_format_table[i].i_codec;
+    if( ppsz_name ) *ppsz_name = vlc_fourcc_GetDescription( VIDEO_ES, i_fourcc );
+    return !!chroma_format_table[i].i_codec;
+}
+
+int GetVlcChromaFormat( OMX_COLOR_FORMATTYPE i_omx_codec,
+                        vlc_fourcc_t *pi_fourcc, const char **ppsz_name )
+{
+    unsigned int i;
+
+    for( i = 0; chroma_format_table[i].i_codec != 0; i++ )
+        if( chroma_format_table[i].i_codec == i_omx_codec ) break;
+
+    if( pi_fourcc ) *pi_fourcc = chroma_format_table[i].i_fourcc;
+    if( ppsz_name ) *ppsz_name = vlc_fourcc_GetDescription( VIDEO_ES,
+                                     chroma_format_table[i].i_fourcc );
+    return !!chroma_format_table[i].i_fourcc;
+}
+
+int GetVlcChromaSizes( vlc_fourcc_t i_fourcc,
+                       unsigned int width, unsigned int height,
+                       unsigned int *size, unsigned int *pitch,
+                       unsigned int *chroma_pitch_div )
+{
+    unsigned int i;
+
+    i_fourcc = vlc_fourcc_GetCodec( VIDEO_ES, i_fourcc );
+
+    for( i = 0; chroma_format_table[i].i_codec != 0; i++ )
+        if( chroma_format_table[i].i_fourcc == i_fourcc ) break;
+
+    /* Align on macroblock boundary */
+    width = (width + 15) & ~0xF;
+    height = (height + 15) & ~0xF;
+
+    if( size ) *size = width * height * chroma_format_table[i].i_size_mul / 2;
+    if( pitch ) *pitch = width * chroma_format_table[i].i_line_mul;
+    if( chroma_pitch_div )
+        *chroma_pitch_div = chroma_format_table[i].i_line_chroma_div;
+    return !!chroma_format_table[i].i_codec;
+}
+
+/*****************************************************************************
+ * Functions to deal with audio format parameters
+ *****************************************************************************/
+static const struct {
+    OMX_AUDIO_CODINGTYPE encoding;
+    OMX_INDEXTYPE index;
+    int size;
+} audio_encoding_param[] =
+{   { OMX_AUDIO_CodingPCM, OMX_IndexParamAudioPcm,
+      sizeof(OMX_AUDIO_PARAM_PCMMODETYPE) },
+    { OMX_AUDIO_CodingADPCM, OMX_IndexParamAudioAdpcm,
+      sizeof(OMX_AUDIO_PARAM_ADPCMTYPE) },
+    { OMX_AUDIO_CodingAMR, OMX_IndexParamAudioAmr,
+      sizeof(OMX_AUDIO_PARAM_AMRTYPE) },
+    { OMX_AUDIO_CodingG711, OMX_IndexParamAudioPcm,
+      sizeof(OMX_AUDIO_PARAM_PCMMODETYPE) },
+    { OMX_AUDIO_CodingG723, OMX_IndexParamAudioG723,
+      sizeof(OMX_AUDIO_PARAM_G723TYPE) },
+    { OMX_AUDIO_CodingG726, OMX_IndexParamAudioG726,
+      sizeof(OMX_AUDIO_PARAM_G726TYPE) },
+    { OMX_AUDIO_CodingG729, OMX_IndexParamAudioG729,
+      sizeof(OMX_AUDIO_PARAM_G729TYPE) },
+    { OMX_AUDIO_CodingAAC, OMX_IndexParamAudioAac,
+      sizeof(OMX_AUDIO_PARAM_AACPROFILETYPE) },
+    { OMX_AUDIO_CodingMP3, OMX_IndexParamAudioMp3,
+      sizeof(OMX_AUDIO_PARAM_MP3TYPE) },
+    { OMX_AUDIO_CodingSBC, OMX_IndexParamAudioSbc,
+      sizeof(OMX_AUDIO_PARAM_SBCTYPE) },
+    { OMX_AUDIO_CodingVORBIS, OMX_IndexParamAudioVorbis,
+      sizeof(OMX_AUDIO_PARAM_VORBISTYPE) },
+    { OMX_AUDIO_CodingWMA, OMX_IndexParamAudioWma,
+      sizeof(OMX_AUDIO_PARAM_WMATYPE) },
+    { OMX_AUDIO_CodingRA, OMX_IndexParamAudioRa,
+      sizeof(OMX_AUDIO_PARAM_RATYPE) },
+    { OMX_AUDIO_CodingUnused, 0, 0 }
+};
+
+static OMX_INDEXTYPE GetAudioParamFormatIndex(OMX_AUDIO_CODINGTYPE encoding)
+{
+  int i;
+
+  for(i = 0; audio_encoding_param[i].encoding != OMX_AUDIO_CodingUnused &&
+      audio_encoding_param[i].encoding != encoding; i++);
+
+  return audio_encoding_param[i].index;
+}
+
+static unsigned int GetAudioParamSize(OMX_INDEXTYPE index)
+{
+  int i;
+
+  for(i = 0; audio_encoding_param[i].encoding != OMX_AUDIO_CodingUnused &&
+      audio_encoding_param[i].index != index; i++);
+
+  return audio_encoding_param[i].size;
+}
+
+OMX_ERRORTYPE SetAudioParameters(OMX_HANDLETYPE handle,
+    OmxFormatParam *param, OMX_U32 i_port, OMX_AUDIO_CODINGTYPE encoding,
+    uint8_t i_channels, unsigned int i_samplerate, unsigned int i_bitrate,
+    unsigned int i_bps, unsigned int i_blocksize)
+{
+    OMX_INDEXTYPE index;
+
+    switch(encoding)
+    {
+    case OMX_AUDIO_CodingPCM:
+    case OMX_AUDIO_CodingG711:
+        OMX_INIT_STRUCTURE(param->pcm);
+        param->pcm.nChannels = i_channels;
+        param->pcm.nSamplingRate = i_samplerate;
+        param->pcm.eNumData = OMX_NumericalDataSigned;
+        param->pcm.ePCMMode = OMX_AUDIO_PCMModeLinear;
+        param->pcm.eEndian = OMX_EndianLittle;
+        param->pcm.bInterleaved = OMX_TRUE;
+        param->pcm.nBitPerSample = i_bps;
+        param->pcm.eChannelMapping[0] = OMX_AUDIO_ChannelCF;
+        if(i_channels == 2)
+        {
+            param->pcm.eChannelMapping[0] = OMX_AUDIO_ChannelLF;
+            param->pcm.eChannelMapping[1] = OMX_AUDIO_ChannelRF;
+        }
+        break;
+    case OMX_AUDIO_CodingADPCM:
+        OMX_INIT_STRUCTURE(param->adpcm);
+        param->adpcm.nChannels = i_channels;
+        param->adpcm.nSampleRate = i_samplerate;
+        param->adpcm.nBitsPerSample = i_bps;
+        break;
+    case OMX_AUDIO_CodingAMR:
+        OMX_INIT_STRUCTURE(param->amr);
+        param->amr.nChannels = i_channels;
+        param->amr.nBitRate = i_bitrate;
+        param->amr.eAMRBandMode = OMX_AUDIO_AMRBandModeUnused;
+        param->amr.eAMRDTXMode = OMX_AUDIO_AMRDTXModeOff;
+        param->amr.eAMRFrameFormat = OMX_AUDIO_AMRFrameFormatConformance;
+        break;
+    case OMX_AUDIO_CodingG723:
+        OMX_INIT_STRUCTURE(param->g723);
+        param->g723.nChannels = i_channels;
+        param->g723.bDTX = OMX_FALSE;
+        param->g723.eBitRate = OMX_AUDIO_G723ModeUnused;
+        param->g723.bHiPassFilter = OMX_TRUE;
+        param->g723.bPostFilter = OMX_TRUE;
+        break;
+    case OMX_AUDIO_CodingG726:
+        OMX_INIT_STRUCTURE(param->g726);
+        param->g726.nChannels = i_channels;
+        param->g726.eG726Mode = OMX_AUDIO_G726ModeUnused;
+        break;
+    case OMX_AUDIO_CodingG729:
+        OMX_INIT_STRUCTURE(param->g729);
+        param->g729.nChannels = i_channels;
+        param->g729.bDTX = OMX_FALSE;
+        param->g729.eBitType = OMX_AUDIO_G729;
+        break;
+    case OMX_AUDIO_CodingAAC:
+        OMX_INIT_STRUCTURE(param->aac);
+        param->aac.nChannels = i_channels;
+        param->aac.nSampleRate = i_samplerate;
+        param->aac.nBitRate = i_bitrate;
+        param->aac.nAudioBandWidth = 0;
+        param->aac.nFrameLength = 1024;
+        param->aac.nAACtools = OMX_AUDIO_AACToolAll;
+        param->aac.nAACERtools = OMX_AUDIO_AACERAll;
+        param->aac.eAACProfile = OMX_AUDIO_AACObjectLC;
+        param->aac.eAACStreamFormat = OMX_AUDIO_AACStreamFormatRAW;
+        param->aac.eChannelMode = i_channels ?
+            OMX_AUDIO_ChannelModeStereo : OMX_AUDIO_ChannelModeMono;
+        break;
+    case OMX_AUDIO_CodingMP3:
+        OMX_INIT_STRUCTURE(param->mp3);
+        param->mp3.nChannels = i_channels;
+        param->mp3.nSampleRate = i_samplerate;
+        param->mp3.nBitRate = i_bitrate;
+        param->mp3.eChannelMode = i_channels ?
+            OMX_AUDIO_ChannelModeStereo : OMX_AUDIO_ChannelModeMono;
+        param->mp3.eFormat = OMX_AUDIO_MP3StreamFormatMP1Layer3;
+        break;
+    case OMX_AUDIO_CodingWMA:
+        OMX_INIT_STRUCTURE(param->wma);
+        param->wma.nChannels = i_channels;
+        param->wma.nBitRate = i_bitrate;
+        param->wma.eFormat = OMX_AUDIO_WMAFormatUnused;
+        param->wma.eProfile = OMX_AUDIO_WMAProfileUnused;
+        param->wma.nSamplingRate = i_samplerate;
+        param->wma.nBlockAlign = i_blocksize;
+        param->wma.nEncodeOptions = 0;
+        param->wma.nSuperBlockAlign = 0;
+        break;
+    case OMX_AUDIO_CodingRA:
+        OMX_INIT_STRUCTURE(param->ra);
+        param->ra.nChannels = i_channels;
+        param->ra.nSamplingRate = i_samplerate;
+        param->ra.nBitsPerFrame = i_bps;
+        param->ra.nSamplePerFrame = 0;
+        param->ra.nCouplingQuantBits = 0;
+        param->ra.nCouplingStartRegion = 0;
+        param->ra.nNumRegions = 0;
+        param->ra.eFormat = OMX_AUDIO_RAFormatUnused;
+        break;
+    case OMX_AUDIO_CodingVORBIS:
+        OMX_INIT_STRUCTURE(param->vorbis);
+        param->vorbis.nChannels = i_channels;
+        param->vorbis.nBitRate = i_bitrate;
+        param->vorbis.nMinBitRate = 0;
+        param->vorbis.nMaxBitRate = i_bitrate;
+        param->vorbis.nSampleRate = i_samplerate;
+        param->vorbis.nAudioBandWidth = 0;
+        param->vorbis.nQuality = 3;
+        param->vorbis.bManaged = OMX_FALSE;
+        param->vorbis.bDownmix = OMX_FALSE;
+        break;
+    default:
+        return OMX_ErrorBadParameter;
+    }
+
+    param->common.nPortIndex = i_port;
+
+    index = GetAudioParamFormatIndex(encoding);
+    return OMX_SetParameter(handle, index, param);
+}
+
+OMX_ERRORTYPE GetAudioParameters(OMX_HANDLETYPE handle,
+    OmxFormatParam *param, OMX_U32 i_port, OMX_AUDIO_CODINGTYPE encoding,
+    uint8_t *pi_channels, unsigned int *pi_samplerate,
+    unsigned int *pi_bitrate, unsigned int *pi_bps, unsigned int *pi_blocksize)
+{
+    int i_channels = 0, i_samplerate = 0, i_bitrate = 0;
+    int i_bps = 0, i_blocksize = 0;
+    OMX_ERRORTYPE omx_error;
+    OMX_INDEXTYPE index;
+
+    OMX_INIT_COMMON(param->common);
+    param->common.nPortIndex = i_port;
+    index = GetAudioParamFormatIndex(encoding);
+    if(!index) return OMX_ErrorNotImplemented;
+
+    param->common.nSize = GetAudioParamSize(index);
+    omx_error = OMX_GetParameter(handle, index, param);
+    if(omx_error != OMX_ErrorNone) return omx_error;
+
+    switch(encoding)
+    {
+    case OMX_AUDIO_CodingPCM:
+    case OMX_AUDIO_CodingG711:
+        i_channels = param->pcm.nChannels;
+        i_samplerate = param->pcm.nSamplingRate;
+        i_bps = param->pcm.nBitPerSample;
+        break;
+    case OMX_AUDIO_CodingADPCM:
+        i_channels = param->adpcm.nChannels;
+        i_samplerate = param->adpcm.nSampleRate;
+        i_bps = param->adpcm.nBitsPerSample;
+        break;
+    case OMX_AUDIO_CodingAMR:
+        i_channels = param->amr.nChannels;
+        i_bitrate = param->amr.nBitRate;
+        i_samplerate = 8000;
+        break;
+    case OMX_AUDIO_CodingG723:
+        i_channels = param->g723.nChannels;
+        break;
+    case OMX_AUDIO_CodingG726:
+        i_channels = param->g726.nChannels;
+        break;
+    case OMX_AUDIO_CodingG729:
+        i_channels = param->g729.nChannels;
+        break;
+    case OMX_AUDIO_CodingAAC:
+        i_channels = param->aac.nChannels;
+        i_samplerate = param->aac.nSampleRate;
+        i_bitrate = param->aac.nBitRate;
+        i_channels = param->aac.eChannelMode == OMX_AUDIO_ChannelModeStereo ? 2 : 1;
+        break;
+    case OMX_AUDIO_CodingMP3:
+        i_channels = param->mp3.nChannels;
+        i_samplerate = param->mp3.nSampleRate;
+        i_bitrate = param->mp3.nBitRate;
+        i_channels = param->mp3.eChannelMode == OMX_AUDIO_ChannelModeStereo ? 2 : 1;
+        break;
+    case OMX_AUDIO_CodingVORBIS:
+        i_channels = param->vorbis.nChannels;
+        i_bitrate = param->vorbis.nBitRate;
+        i_samplerate = param->vorbis.nSampleRate;
+        break;
+    case OMX_AUDIO_CodingWMA:
+        i_channels = param->wma.nChannels;
+        i_bitrate = param->wma.nBitRate;
+        i_samplerate = param->wma.nSamplingRate;
+        i_blocksize = param->wma.nBlockAlign;
+        break;
+    case OMX_AUDIO_CodingRA:
+        i_channels = param->ra.nChannels;
+        i_samplerate = param->ra.nSamplingRate;
+        i_bps = param->ra.nBitsPerFrame;
+        break;
+    default:
+        return OMX_ErrorBadParameter;
+    }
+
+    if(pi_channels) *pi_channels = i_channels;
+    if(pi_samplerate) *pi_samplerate = i_samplerate;
+    if(pi_bitrate) *pi_bitrate = i_bitrate;
+    if(pi_bps) *pi_bps = i_bps;
+    if(pi_blocksize) *pi_blocksize = i_blocksize;
+    return OMX_ErrorNone;
+}
+
+/*****************************************************************************
+ * PrintOmx: print component summary 
+ *****************************************************************************/
+void PrintOmx(decoder_t *p_dec, OMX_HANDLETYPE omx_handle, OMX_U32 i_port)
+{
+    OMX_PARAM_PORTDEFINITIONTYPE definition;
+    OMX_PORT_PARAM_TYPE param;
+    OMX_ERRORTYPE omx_error;
+    unsigned int i, j;
+
+    /* Find the input / output ports */
+    OMX_INIT_STRUCTURE(param);
+    OMX_INIT_STRUCTURE(definition);
+
+    for(i = 0; i < 3; i++)
+    {
+        omx_error = OMX_GetParameter(omx_handle, OMX_IndexParamAudioInit + i, &param);
+        if(omx_error != OMX_ErrorNone) continue;
+
+        if(i_port == OMX_ALL)
+            msg_Dbg( p_dec, "found %i %s ports", (int)param.nPorts,
+                     i == 0 ? "audio" : i == 1 ? "image" : "video" );
+
+        for(j = 0; j < param.nPorts; j++)
+        {
+            unsigned int i_samplerate, i_bitrate;
+            unsigned int i_bitspersample, i_blockalign;
+            uint8_t i_channels;
+            OmxFormatParam format_param;
+            vlc_fourcc_t i_fourcc;
+            const char *psz_name;
+
+            if(i_port != OMX_ALL && i_port != param.nStartPortNumber + j)
+                continue;
+
+            /* Get port definition */
+            definition.nPortIndex = param.nStartPortNumber + j;
+            omx_error = OMX_GetParameter(omx_handle, OMX_IndexParamPortDefinition,
+                                      &definition);
+            if(omx_error != OMX_ErrorNone) continue;
+
+            OMX_PARAM_U32TYPE u32param;
+            OMX_INIT_STRUCTURE(u32param);
+            u32param.nPortIndex = param.nStartPortNumber + j;
+            omx_error = OMX_GetParameter(omx_handle, OMX_IndexParamNumAvailableStreams,
+                                         (OMX_PTR)&u32param);
+
+            msg_Dbg( p_dec, "-> %s %i (%i streams) (%i:%i:%i buffers) (%i,%i) %s",
+                     definition.eDir == OMX_DirOutput ? "output" : "input",
+                     (int)definition.nPortIndex, (int)u32param.nU32,
+                     (int)definition.nBufferCountActual,
+                     (int)definition.nBufferCountMin, (int)definition.nBufferSize,
+                     (int)definition.bBuffersContiguous,
+                     (int)definition.nBufferAlignment,
+                     definition.bEnabled ? "enabled" : "disabled" );
+
+            switch(definition.eDomain)
+            {
+            case OMX_PortDomainVideo:
+
+                if(definition.format.video.eCompressionFormat)
+                    GetVlcVideoFormat( definition.format.video.eCompressionFormat,
+                                       &i_fourcc, &psz_name );
+                else
+                    GetVlcChromaFormat( definition.format.video.eColorFormat,
+                                        &i_fourcc, &psz_name );
+
+                msg_Dbg( p_dec, "  -> video %s %ix%i@%.2f (%i,%i) (%i,%i)", psz_name,
+                         (int)definition.format.video.nFrameWidth,
+                         (int)definition.format.video.nFrameHeight,
+                         (float)definition.format.video.xFramerate/(float)(1<<16),
+                         (int)definition.format.video.eCompressionFormat,
+                         (int)definition.format.video.eColorFormat,
+                         (int)definition.format.video.nStride,
+                         (int)definition.format.video.nSliceHeight);
+                break;
+
+            case OMX_PortDomainAudio:
+
+                GetVlcAudioFormat( definition.format.audio.eEncoding,
+                                   &i_fourcc, &psz_name );
+
+                GetAudioParameters(omx_handle, &format_param,
+                                   definition.nPortIndex,
+                                   definition.format.audio.eEncoding,
+                                   &i_channels, &i_samplerate, &i_bitrate,
+                                   &i_bitspersample, &i_blockalign);
+
+                msg_Dbg( p_dec, "  -> audio %s (%i) %i,%i,%i,%i,%i", psz_name,
+                         (int)definition.format.audio.eEncoding,
+                         i_channels, i_samplerate, i_bitrate, i_bitspersample,
+                         i_blockalign);
+                break;
+
+            default: break;
+            }
+        }
+    }
+}