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