Home | History | Annotate | Download | only in include
      1 /*
      2  ** Copyright 2003-2010, VisualOn, Inc.
      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 express or implied.
     13  ** See the License for the specific language governing permissions and
     14  ** limitations under the License.
     15  */
     16 /*******************************************************************************
     17 	File:		voType.h
     18 
     19 	Content:	data type definition
     20 
     21 *******************************************************************************/
     22 #ifndef __voType_H__
     23 #define __voType_H__
     24 
     25 #ifdef __cplusplus
     26 extern "C" {
     27 #endif /* __cplusplus */
     28 
     29 #ifdef _WIN32
     30 #	define VO_API __cdecl
     31 #	define VO_CBI __stdcall
     32 #else
     33 #	define VO_API
     34 #	define VO_CBI
     35 #endif //_WIN32
     36 
     37 /** VO_IN is used to identify inputs to an VO function.  This designation
     38     will also be used in the case of a pointer that points to a parameter
     39     that is used as an output. */
     40 #ifndef VO_IN
     41 #define VO_IN
     42 #endif
     43 
     44 /** VO_OUT is used to identify outputs from an VO function.  This
     45     designation will also be used in the case of a pointer that points
     46     to a parameter that is used as an input. */
     47 #ifndef VO_OUT
     48 #define VO_OUT
     49 #endif
     50 
     51 /** VO_INOUT is used to identify parameters that may be either inputs or
     52     outputs from an VO function at the same time.  This designation will
     53     also be used in the case of a pointer that  points to a parameter that
     54     is used both as an input and an output. */
     55 #ifndef VO_INOUT
     56 #define VO_INOUT
     57 #endif
     58 
     59 #define VO_MAX_ENUM_VALUE	0X7FFFFFFF
     60 
     61 /** VO_VOID */
     62 typedef void VO_VOID;
     63 
     64 /** VO_U8 is an 8 bit unsigned quantity that is byte aligned */
     65 typedef unsigned char VO_U8;
     66 
     67 /** VO_BYTE is an 8 bit unsigned quantity that is byte aligned */
     68 typedef unsigned char VO_BYTE;
     69 
     70 /** VO_S8 is an 8 bit signed quantity that is byte aligned */
     71 typedef signed char VO_S8;
     72 
     73 /** VO_CHAR is an 8 bit signed quantity that is byte aligned */
     74 typedef char VO_CHAR;
     75 
     76 /** VO_U16 is a 16 bit unsigned quantity that is 16 bit word aligned */
     77 typedef unsigned short VO_U16;
     78 
     79 /** VO_WCHAR is a 16 bit unsigned quantity that is 16 bit word aligned */
     80 #if defined _WIN32
     81 typedef unsigned short VO_WCHAR;
     82 typedef unsigned short* VO_PWCHAR;
     83 #elif defined LINUX
     84 typedef unsigned char VO_WCHAR;
     85 typedef unsigned char* VO_PWCHAR;
     86 #endif
     87 
     88 /** VO_S16 is a 16 bit signed quantity that is 16 bit word aligned */
     89 typedef signed short VO_S16;
     90 
     91 /** VO_U32 is a 32 bit unsigned quantity that is 32 bit word aligned */
     92 typedef unsigned long VO_U32;
     93 
     94 /** VO_S32 is a 32 bit signed quantity that is 32 bit word aligned */
     95 typedef signed long VO_S32;
     96 
     97 /* Users with compilers that cannot accept the "long long" designation should
     98    define the VO_SKIP64BIT macro.  It should be noted that this may cause
     99    some components to fail to compile if the component was written to require
    100    64 bit integral types.  However, these components would NOT compile anyway
    101    since the compiler does not support the way the component was written.
    102 */
    103 #ifndef VO_SKIP64BIT
    104 #ifdef _MSC_VER
    105 /** VO_U64 is a 64 bit unsigned quantity that is 64 bit word aligned */
    106 typedef unsigned __int64  VO_U64;
    107 /** VO_S64 is a 64 bit signed quantity that is 64 bit word aligned */
    108 typedef signed   __int64  VO_S64;
    109 #else // WIN32
    110 /** VO_U64 is a 64 bit unsigned quantity that is 64 bit word aligned */
    111 typedef unsigned long long VO_U64;
    112 /** VO_S64 is a 64 bit signed quantity that is 64 bit word aligned */
    113 typedef signed long long VO_S64;
    114 #endif // WIN32
    115 #endif // VO_SKIP64BIT
    116 
    117 /** The VO_BOOL type is intended to be used to represent a true or a false
    118     value when passing parameters to and from the VO core and components.  The
    119     VO_BOOL is a 32 bit quantity and is aligned on a 32 bit word boundary.
    120  */
    121 typedef enum VO_BOOL {
    122     VO_FALSE = 0,
    123     VO_TRUE = !VO_FALSE,
    124 	VO_BOOL_MAX = VO_MAX_ENUM_VALUE
    125 } VO_BOOL;
    126 
    127 /** The VO_PTR type is intended to be used to pass pointers between the VO
    128     applications and the VO Core and components.  This is a 32 bit pointer and
    129     is aligned on a 32 bit boundary.
    130  */
    131 typedef void* VO_PTR;
    132 
    133 /** The VO_HANDLE type is intended to be used to pass pointers between the VO
    134     applications and the VO Core and components.  This is a 32 bit pointer and
    135     is aligned on a 32 bit boundary.
    136  */
    137 typedef void* VO_HANDLE;
    138 
    139 /** The VO_STRING type is intended to be used to pass "C" type strings between
    140     the application and the core and component.  The VO_STRING type is a 32
    141     bit pointer to a zero terminated string.  The  pointer is word aligned and
    142     the string is byte aligned.
    143  */
    144 typedef char* VO_PCHAR;
    145 
    146 /** The VO_PBYTE type is intended to be used to pass arrays of bytes such as
    147     buffers between the application and the component and core.  The VO_PBYTE
    148     type is a 32 bit pointer to a zero terminated string.  The  pointer is word
    149     aligned and the string is byte aligned.
    150  */
    151 typedef unsigned char* VO_PBYTE;
    152 
    153 /** The VO_PTCHAR type is intended to be used to pass arrays of wchar such as
    154     unicode char between the application and the component and core.  The VO_PTCHAR
    155     type is a 32 bit pointer to a zero terminated string.  The  pointer is word
    156     aligned and the string is byte aligned.
    157  */
    158 /*
    159 #if !defined LINUX
    160 typedef unsigned short* VO_PTCHAR;
    161 typedef unsigned short* VO_TCHAR;
    162 #else
    163 typedef char* VO_PTCHAR;
    164 typedef char VO_TCHAR;
    165 #endif
    166 */
    167 
    168 #ifndef NULL
    169 #ifdef __cplusplus
    170 #define NULL    0
    171 #else
    172 #define NULL    ((void *)0)
    173 #endif
    174 #endif
    175 
    176 /**
    177  * Input stream format, Frame or Stream..
    178  */
    179 typedef enum {
    180     VO_INPUT_FRAME	= 1,	/*!< Input contains completely frame(s) data. */
    181     VO_INPUT_STREAM,		/*!< Input is stream data. */
    182 	VO_INPUT_STREAM_MAX = VO_MAX_ENUM_VALUE
    183 } VO_INPUT_TYPE;
    184 
    185 
    186 /**
    187  * General data buffer, used as input or output.
    188  */
    189 typedef struct {
    190 	VO_PBYTE	Buffer;		/*!< Buffer pointer */
    191 	VO_U32		Length;		/*!< Buffer size in byte */
    192 	VO_S64		Time;		/*!< The time of the buffer */
    193 } VO_CODECBUFFER;
    194 
    195 
    196 /**
    197  * The init memdata flag.
    198  */
    199 typedef enum{
    200 	VO_IMF_USERMEMOPERATOR		=0,	/*!< memData is  the pointer of memoperator function*/
    201 	VO_IMF_PREALLOCATEDBUFFER	=1,	/*!< memData is  preallocated memory*/
    202 	VO_IMF_MAX = VO_MAX_ENUM_VALUE
    203 }VO_INIT_MEM_FlAG;
    204 
    205 
    206 /**
    207  * The init memory structure..
    208  */
    209 typedef struct{
    210 	VO_INIT_MEM_FlAG			memflag;	/*!<memory flag  */
    211 	VO_PTR						memData;	/*!<a pointer to VO_MEM_OPERATOR or a preallocated buffer  */
    212 	VO_U32						reserved1;	/*!<reserved  */
    213 	VO_U32						reserved2;	/*!<reserved */
    214 }VO_CODEC_INIT_USERDATA;
    215 
    216 
    217 #ifdef __cplusplus
    218 }
    219 #endif /* __cplusplus */
    220 
    221 #endif // __voType_H__
    222