Home | History | Annotate | Download | only in inc
      1 /* ------------------------------------------------------------------
      2  * Copyright (C) 1998-2009 PacketVideo
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
     13  * express or implied.
     14  * See the License for the specific language governing permissions
     15  * and limitations under the License.
     16  * -------------------------------------------------------------------
     17  */
     18 /*
     19  * Copyright (c) 2008 The Khronos Group Inc.
     20  *
     21  * Permission is hereby granted, free of charge, to any person obtaining
     22  * a copy of this software and associated documentation files (the
     23  * "Software"), to deal in the Software without restriction, including
     24  * without limitation the rights to use, copy, modify, merge, publish,
     25  * distribute, sublicense, and/or sell copies of the Software, and to
     26  * permit persons to whom the Software is furnished to do so, subject
     27  * to the following conditions:
     28  * The above copyright notice and this permission notice shall be included
     29  * in all copies or substantial portions of the Software.
     30  *
     31  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
     32  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
     33  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
     34  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
     35  * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
     36  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
     37  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
     38  *
     39  */
     40 
     41 /** OMX_Types.h - OpenMax IL version 1.1.2
     42  *  The OMX_Types header file contains the primitive type definitions used by
     43  *  the core, the application and the component.  This file may need to be
     44  *  modified to be used on systems that do not have "char" set to 8 bits,
     45  *  "short" set to 16 bits and "long" set to 32 bits.
     46  */
     47 
     48 #ifndef OMX_Types_h
     49 #define OMX_Types_h
     50 
     51 #ifdef __cplusplus
     52 extern "C" {
     53 #endif /* __cplusplus */
     54 
     55 /** The OMX_API and OMX_APIENTRY are platform specific definitions used
     56  *  to declare OMX function prototypes.  They are modified to meet the
     57  *  requirements for a particular platform */
     58 #ifdef __SYMBIAN32__
     59 #   ifdef __OMX_EXPORTS
     60 #       define OMX_API __declspec(dllexport)
     61 #   else
     62 #       ifdef _WIN32
     63 #           define OMX_API __declspec(dllexport)
     64 #       else
     65 #           define OMX_API __declspec(dllimport)
     66 #       endif
     67 #   endif
     68 #else
     69 #   ifdef _WIN32
     70 #      ifdef __OMX_EXPORTS
     71 #          define OMX_API __declspec(dllexport)
     72 #      else
     73 #          define OMX_API __declspec(dllimport)
     74 #      endif
     75 #   else
     76 #      ifdef __OMX_EXPORTS
     77 #          define OMX_API
     78 #      else
     79 #          define OMX_API extern
     80 #      endif
     81 #   endif
     82 #endif
     83 
     84 #ifndef OMX_APIENTRY
     85 #define OMX_APIENTRY
     86 #endif
     87 
     88 /** OMX_IN is used to identify inputs to an OMX function.  This designation
     89     will also be used in the case of a pointer that points to a parameter
     90     that is used as an output. */
     91 #ifndef OMX_IN
     92 #define OMX_IN
     93 #endif
     94 
     95 /** OMX_OUT is used to identify outputs from an OMX function.  This
     96     designation will also be used in the case of a pointer that points
     97     to a parameter that is used as an input. */
     98 #ifndef OMX_OUT
     99 #define OMX_OUT
    100 #endif
    101 
    102 
    103 /** OMX_INOUT is used to identify parameters that may be either inputs or
    104     outputs from an OMX function at the same time.  This designation will
    105     also be used in the case of a pointer that  points to a parameter that
    106     is used both as an input and an output. */
    107 #ifndef OMX_INOUT
    108 #define OMX_INOUT
    109 #endif
    110 
    111 /** OMX_ALL is used to as a wildcard to select all entities of the same type
    112  *  when specifying the index, or referring to a object by an index.  (i.e.
    113  *  use OMX_ALL to indicate all N channels). When used as a port index
    114  *  for a config or parameter this OMX_ALL denotes that the config or
    115  *  parameter applies to the entire component not just one port. */
    116 #define OMX_ALL 0xFFFFFFFF
    117 
    118 /** In the following we define groups that help building doxygen documentation */
    119 
    120 /** @defgroup core OpenMAX IL core
    121  * Functions and structure related to the OMX IL core
    122  */
    123 
    124  /** @defgroup comp OpenMAX IL component
    125  * Functions and structure related to the OMX IL component
    126  */
    127 
    128 /** @defgroup rpm Resource and Policy Management
    129  * Structures for resource and policy management of components
    130  */
    131 
    132 /** @defgroup buf Buffer Management
    133  * Buffer handling functions and structures
    134  */
    135 
    136 /** @defgroup tun Tunneling
    137  * @ingroup core comp
    138  * Structures and functions to manage tunnels among component ports
    139  */
    140 
    141 /** @defgroup cp Content Pipes
    142  *  @ingroup core
    143  */
    144 
    145  /** @defgroup metadata Metadata handling
    146   *
    147   */
    148 
    149 /** OMX_U8 is an 8 bit unsigned quantity that is byte aligned */
    150 typedef unsigned char OMX_U8;
    151 
    152 /** OMX_S8 is an 8 bit signed quantity that is byte aligned */
    153 typedef signed char OMX_S8;
    154 
    155 /** OMX_U16 is a 16 bit unsigned quantity that is 16 bit word aligned */
    156 typedef unsigned short OMX_U16;
    157 
    158 /** OMX_S16 is a 16 bit signed quantity that is 16 bit word aligned */
    159 typedef signed short OMX_S16;
    160 
    161 /** OMX_U32 is a 32 bit unsigned quantity that is 32 bit word aligned */
    162 typedef unsigned long OMX_U32;
    163 
    164 /** OMX_S32 is a 32 bit signed quantity that is 32 bit word aligned */
    165 typedef signed long OMX_S32;
    166 
    167 
    168 /* Users with compilers that cannot accept the "long long" designation should
    169    define the OMX_SKIP64BIT macro.  It should be noted that this may cause
    170    some components to fail to compile if the component was written to require
    171    64 bit integral types.  However, these components would NOT compile anyway
    172    since the compiler does not support the way the component was written.
    173 */
    174 #ifndef OMX_SKIP64BIT
    175 #ifdef __SYMBIAN32__
    176 /** OMX_U64 is a 64 bit unsigned quantity that is 64 bit word aligned */
    177 typedef unsigned long long OMX_U64;
    178 
    179 /** OMX_S64 is a 64 bit signed quantity that is 64 bit word aligned */
    180 typedef signed long long OMX_S64;
    181 
    182 #elif defined(WIN32)
    183 
    184 /** OMX_U64 is a 64 bit unsigned quantity that is 64 bit word aligned */
    185 typedef unsigned __int64  OMX_U64;
    186 
    187 /** OMX_S64 is a 64 bit signed quantity that is 64 bit word aligned */
    188 typedef signed   __int64  OMX_S64;
    189 
    190 #else /* WIN32 */
    191 
    192 /** OMX_U64 is a 64 bit unsigned quantity that is 64 bit word aligned */
    193 typedef unsigned long long OMX_U64;
    194 
    195 /** OMX_S64 is a 64 bit signed quantity that is 64 bit word aligned */
    196 typedef signed long long OMX_S64;
    197 
    198 #endif /* WIN32 */
    199 #endif
    200 
    201 
    202 /** The OMX_BOOL type is intended to be used to represent a true or a false
    203     value when passing parameters to and from the OMX core and components.  The
    204     OMX_BOOL is a 32 bit quantity and is aligned on a 32 bit word boundary.
    205  */
    206 typedef enum OMX_BOOL {
    207     OMX_FALSE = 0,
    208     OMX_TRUE = !OMX_FALSE,
    209     OMX_BOOL_MAX = 0x7FFFFFFF
    210 } OMX_BOOL;
    211 
    212 /** The OMX_PTR type is intended to be used to pass pointers between the OMX
    213     applications and the OMX Core and components.  This is a 32 bit pointer and
    214     is aligned on a 32 bit boundary.
    215  */
    216 typedef void* OMX_PTR;
    217 
    218 /** The OMX_STRING type is intended to be used to pass "C" type strings between
    219     the application and the core and component.  The OMX_STRING type is a 32
    220     bit pointer to a zero terminated string.  The  pointer is word aligned and
    221     the string is byte aligned.
    222  */
    223 typedef char* OMX_STRING;
    224 
    225 /** The OMX_BYTE type is intended to be used to pass arrays of bytes such as
    226     buffers between the application and the component and core.  The OMX_BYTE
    227     type is a 32 bit pointer to a zero terminated string.  The  pointer is word
    228     aligned and the string is byte aligned.
    229  */
    230 typedef unsigned char* OMX_BYTE;
    231 
    232 /** OMX_UUIDTYPE is a very long unique identifier to uniquely identify
    233     at runtime.  This identifier should be generated by a component in a way
    234     that guarantees that every instance of the identifier running on the system
    235     is unique. */
    236 typedef unsigned char OMX_UUIDTYPE[128];
    237 
    238 /** The OMX_DIRTYPE enumeration is used to indicate if a port is an input or
    239     an output port.  This enumeration is common across all component types.
    240  */
    241 typedef enum OMX_DIRTYPE
    242 {
    243     OMX_DirInput,              /**< Port is an input port */
    244     OMX_DirOutput,             /**< Port is an output port */
    245     OMX_DirMax = 0x7FFFFFFF
    246 } OMX_DIRTYPE;
    247 
    248 /** The OMX_ENDIANTYPE enumeration is used to indicate the bit ordering
    249     for numerical data (i.e. big endian, or little endian).
    250  */
    251 typedef enum OMX_ENDIANTYPE
    252 {
    253     OMX_EndianBig, /**< big endian */
    254     OMX_EndianLittle, /**< little endian */
    255     OMX_EndianMax = 0x7FFFFFFF
    256 } OMX_ENDIANTYPE;
    257 
    258 
    259 /** The OMX_NUMERICALDATATYPE enumeration is used to indicate if data
    260     is signed or unsigned
    261  */
    262 typedef enum OMX_NUMERICALDATATYPE
    263 {
    264     OMX_NumericalDataSigned, /**< signed data */
    265     OMX_NumericalDataUnsigned, /**< unsigned data */
    266     OMX_NumercialDataMax = 0x7FFFFFFF
    267 } OMX_NUMERICALDATATYPE;
    268 
    269 
    270 /** Unsigned bounded value type */
    271 typedef struct OMX_BU32 {
    272     OMX_U32 nValue; /**< actual value */
    273     OMX_U32 nMin;   /**< minimum for value (i.e. nValue >= nMin) */
    274     OMX_U32 nMax;   /**< maximum for value (i.e. nValue <= nMax) */
    275 } OMX_BU32;
    276 
    277 
    278 /** Signed bounded value type */
    279 typedef struct OMX_BS32 {
    280     OMX_S32 nValue; /**< actual value */
    281     OMX_S32 nMin;   /**< minimum for value (i.e. nValue >= nMin) */
    282     OMX_S32 nMax;   /**< maximum for value (i.e. nValue <= nMax) */
    283 } OMX_BS32;
    284 
    285 
    286 /** Structure representing some time or duration in microseconds. This structure
    287   *  must be interpreted as a signed 64 bit value. The quantity is signed to accommodate
    288   *  negative deltas and preroll scenarios. The quantity is represented in microseconds
    289   *  to accomodate high resolution timestamps (e.g. DVD presentation timestamps based
    290   *  on a 90kHz clock) and to allow more accurate and synchronized delivery (e.g.
    291   *  individual audio samples delivered at 192 kHz). The quantity is 64 bit to
    292   *  accommodate a large dynamic range (signed 32 bit values would allow only for plus
    293   *  or minus 35 minutes).
    294   *
    295   *  Implementations with limited precision may convert the signed 64 bit value to
    296   *  a signed 32 bit value internally but risk loss of precision.
    297   */
    298 #ifndef OMX_SKIP64BIT
    299 typedef OMX_S64 OMX_TICKS;
    300 #else
    301 typedef struct OMX_TICKS
    302 {
    303     OMX_U32 nLowPart;    /** low bits of the signed 64 bit tick value */
    304     OMX_U32 nHighPart;   /** high bits of the signed 64 bit tick value */
    305 } OMX_TICKS;
    306 #endif
    307 #define OMX_TICKS_PER_SECOND 1000000
    308 
    309 /** Define the public interface for the OMX Handle.  The core will not use
    310     this value internally, but the application should only use this value.
    311  */
    312 typedef void* OMX_HANDLETYPE;
    313 
    314 typedef struct OMX_MARKTYPE
    315 {
    316     OMX_HANDLETYPE hMarkTargetComponent;   /**< The component that will
    317                                                 generate a mark event upon
    318                                                 processing the mark. */
    319     OMX_PTR pMarkData;   /**< Application specific data associated with
    320                               the mark sent on a mark event to disambiguate
    321                               this mark from others. */
    322 } OMX_MARKTYPE;
    323 
    324 
    325 /** OMX_NATIVE_DEVICETYPE is used to map a OMX video port to the
    326  *  platform & operating specific object used to reference the display
    327  *  or can be used by a audio port for native audio rendering */
    328 typedef void* OMX_NATIVE_DEVICETYPE;
    329 
    330 /** OMX_NATIVE_WINDOWTYPE is used to map a OMX video port to the
    331  *  platform & operating specific object used to reference the window */
    332 typedef void* OMX_NATIVE_WINDOWTYPE;
    333 
    334 /** The OMX_VERSIONTYPE union is used to specify the version for
    335     a structure or component.  For a component, the version is entirely
    336     specified by the component vendor.  Components doing the same function
    337     from different vendors may or may not have the same version.  For
    338     structures, the version shall be set by the entity that allocates the
    339     structure.  For structures specified in the OMX 1.1 specification, the
    340     value of the version shall be set to 1.1.0.0 in all cases.  Access to the
    341     OMX_VERSIONTYPE can be by a single 32 bit access (e.g. by nVersion) or
    342     by accessing one of the structure elements to, for example, check only
    343     the Major revision.
    344  */
    345 typedef union OMX_VERSIONTYPE
    346 {
    347     struct
    348     {
    349         OMX_U8 nVersionMajor;   /**< Major version accessor element */
    350         OMX_U8 nVersionMinor;   /**< Minor version accessor element */
    351         OMX_U8 nRevision;       /**< Revision version accessor element */
    352         OMX_U8 nStep;           /**< Step version accessor element */
    353     } s;
    354     OMX_U32 nVersion;           /**< 32 bit value to make accessing the
    355                                     version easily done in a single word
    356                                     size copy/compare operation */
    357 } OMX_VERSIONTYPE;
    358 
    359 #ifdef __cplusplus
    360 }
    361 #endif /* __cplusplus */
    362 
    363 #endif
    364 /* File EOF */
    365