141050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard/* 241050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard ** Copyright 2003-2010, VisualOn, Inc. 341050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard ** 441050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard ** Licensed under the Apache License, Version 2.0 (the "License"); 541050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard ** you may not use this file except in compliance with the License. 641050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard ** You may obtain a copy of the License at 741050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard ** 841050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard ** http://www.apache.org/licenses/LICENSE-2.0 941050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard ** 1041050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard ** Unless required by applicable law or agreed to in writing, software 1141050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard ** distributed under the License is distributed on an "AS IS" BASIS, 1241050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1341050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard ** See the License for the specific language governing permissions and 1441050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard ** limitations under the License. 1541050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard */ 1641050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard/******************************************************************************* 1741050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard File: voType.h 1841050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard 1941050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard Content: data type definition 2041050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard 2141050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard*******************************************************************************/ 2241050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard#ifndef __voType_H__ 2341050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard#define __voType_H__ 2441050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard 2541050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard#ifdef __cplusplus 2641050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgardextern "C" { 2741050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard#endif /* __cplusplus */ 2841050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard 2941050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard#ifdef _WIN32 3041050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard# define VO_API __cdecl 3141050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard# define VO_CBI __stdcall 3241050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard#else 3341050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard# define VO_API 3441050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard# define VO_CBI 3541050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard#endif //_WIN32 3641050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard 3741050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard/** VO_IN is used to identify inputs to an VO function. This designation 3841050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard will also be used in the case of a pointer that points to a parameter 3941050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard that is used as an output. */ 4041050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard#ifndef VO_IN 4141050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard#define VO_IN 4241050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard#endif 4341050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard 4441050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard/** VO_OUT is used to identify outputs from an VO function. This 4541050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard designation will also be used in the case of a pointer that points 4641050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard to a parameter that is used as an input. */ 4741050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard#ifndef VO_OUT 4841050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard#define VO_OUT 4941050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard#endif 5041050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard 5141050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard/** VO_INOUT is used to identify parameters that may be either inputs or 5241050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard outputs from an VO function at the same time. This designation will 5341050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard also be used in the case of a pointer that points to a parameter that 5441050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard is used both as an input and an output. */ 5541050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard#ifndef VO_INOUT 5641050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard#define VO_INOUT 5741050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard#endif 5841050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard 5941050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard#define VO_MAX_ENUM_VALUE 0X7FFFFFFF 6041050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard 6141050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard/** VO_VOID */ 6241050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgardtypedef void VO_VOID; 6341050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard 6441050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard/** VO_U8 is an 8 bit unsigned quantity that is byte aligned */ 6541050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgardtypedef unsigned char VO_U8; 6641050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard 6741050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard/** VO_BYTE is an 8 bit unsigned quantity that is byte aligned */ 6841050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgardtypedef unsigned char VO_BYTE; 6941050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard 7041050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard/** VO_S8 is an 8 bit signed quantity that is byte aligned */ 7141050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgardtypedef signed char VO_S8; 7241050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard 7341050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard/** VO_CHAR is an 8 bit signed quantity that is byte aligned */ 7441050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgardtypedef char VO_CHAR; 7541050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard 7641050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard/** VO_U16 is a 16 bit unsigned quantity that is 16 bit word aligned */ 7741050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgardtypedef unsigned short VO_U16; 7841050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard 7941050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard/** VO_S16 is a 16 bit signed quantity that is 16 bit word aligned */ 8041050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgardtypedef signed short VO_S16; 8141050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard 8241050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard/** VO_U32 is a 32 bit unsigned quantity that is 32 bit word aligned */ 8341050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgardtypedef unsigned long VO_U32; 8441050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard 8541050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard/** VO_S32 is a 32 bit signed quantity that is 32 bit word aligned */ 8641050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgardtypedef signed long VO_S32; 8741050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard 8841050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard/* Users with compilers that cannot accept the "long long" designation should 8941050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard define the VO_SKIP64BIT macro. It should be noted that this may cause 9041050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard some components to fail to compile if the component was written to require 9141050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard 64 bit integral types. However, these components would NOT compile anyway 9241050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard since the compiler does not support the way the component was written. 9341050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard*/ 9441050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard#ifndef VO_SKIP64BIT 952a4592119fe1d303fff2f268fffe7a84f38f8027Martin Storsjo#ifdef _MSC_VER 9641050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard/** VO_U64 is a 64 bit unsigned quantity that is 64 bit word aligned */ 9741050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgardtypedef unsigned __int64 VO_U64; 9841050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard/** VO_S64 is a 64 bit signed quantity that is 64 bit word aligned */ 9941050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgardtypedef signed __int64 VO_S64; 10041050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard#else // WIN32 10141050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard/** VO_U64 is a 64 bit unsigned quantity that is 64 bit word aligned */ 10241050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgardtypedef unsigned long long VO_U64; 10341050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard/** VO_S64 is a 64 bit signed quantity that is 64 bit word aligned */ 10441050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgardtypedef signed long long VO_S64; 10541050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard#endif // WIN32 10641050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard#endif // VO_SKIP64BIT 10741050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard 10841050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard/** The VO_BOOL type is intended to be used to represent a true or a false 10941050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard value when passing parameters to and from the VO core and components. The 11041050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard VO_BOOL is a 32 bit quantity and is aligned on a 32 bit word boundary. 11141050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard */ 11241050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgardtypedef enum VO_BOOL { 11341050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard VO_FALSE = 0, 11441050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard VO_TRUE = !VO_FALSE, 11541050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard VO_BOOL_MAX = VO_MAX_ENUM_VALUE 11641050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard} VO_BOOL; 11741050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard 11841050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard/** The VO_PTR type is intended to be used to pass pointers between the VO 11941050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard applications and the VO Core and components. This is a 32 bit pointer and 12041050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard is aligned on a 32 bit boundary. 12141050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard */ 12241050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgardtypedef void* VO_PTR; 12341050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard 12441050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard/** The VO_HANDLE type is intended to be used to pass pointers between the VO 12541050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard applications and the VO Core and components. This is a 32 bit pointer and 12641050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard is aligned on a 32 bit boundary. 12741050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard */ 12841050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgardtypedef void* VO_HANDLE; 12941050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard 13041050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard/** The VO_STRING type is intended to be used to pass "C" type strings between 13141050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard the application and the core and component. The VO_STRING type is a 32 13241050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard bit pointer to a zero terminated string. The pointer is word aligned and 13341050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard the string is byte aligned. 13441050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard */ 13541050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgardtypedef char* VO_PCHAR; 13641050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard 13741050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard/** The VO_PBYTE type is intended to be used to pass arrays of bytes such as 13841050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard buffers between the application and the component and core. The VO_PBYTE 13941050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard type is a 32 bit pointer to a zero terminated string. The pointer is word 14041050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard aligned and the string is byte aligned. 14141050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard */ 14241050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgardtypedef unsigned char* VO_PBYTE; 14341050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard 14441050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard#ifndef NULL 14541050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard#ifdef __cplusplus 14641050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard#define NULL 0 14741050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard#else 14841050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard#define NULL ((void *)0) 14941050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard#endif 15041050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard#endif 15141050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard 15241050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard/** 15341050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard * Input stream format, Frame or Stream.. 15441050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard */ 15541050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgardtypedef enum { 15641050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard VO_INPUT_FRAME = 1, /*!< Input contains completely frame(s) data. */ 15741050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard VO_INPUT_STREAM, /*!< Input is stream data. */ 15841050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard VO_INPUT_STREAM_MAX = VO_MAX_ENUM_VALUE 15941050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard} VO_INPUT_TYPE; 16041050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard 16141050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard 16241050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard/** 16341050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard * General data buffer, used as input or output. 16441050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard */ 16541050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgardtypedef struct { 16641050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard VO_PBYTE Buffer; /*!< Buffer pointer */ 16741050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard VO_U32 Length; /*!< Buffer size in byte */ 16841050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard VO_S64 Time; /*!< The time of the buffer */ 16941050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard} VO_CODECBUFFER; 17041050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard 17141050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard 17241050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard/** 17341050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard * The init memdata flag. 17441050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard */ 17541050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgardtypedef enum{ 17641050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard VO_IMF_USERMEMOPERATOR =0, /*!< memData is the pointer of memoperator function*/ 17741050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard VO_IMF_PREALLOCATEDBUFFER =1, /*!< memData is preallocated memory*/ 17841050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard VO_IMF_MAX = VO_MAX_ENUM_VALUE 17941050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard}VO_INIT_MEM_FlAG; 18041050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard 18141050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard 18241050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard/** 18341050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard * The init memory structure.. 18441050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard */ 18541050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgardtypedef struct{ 18641050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard VO_INIT_MEM_FlAG memflag; /*!<memory flag */ 18741050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard VO_PTR memData; /*!<a pointer to VO_MEM_OPERATOR or a preallocated buffer */ 18841050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard VO_U32 reserved1; /*!<reserved */ 18941050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard VO_U32 reserved2; /*!<reserved */ 19041050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard}VO_CODEC_INIT_USERDATA; 19141050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard 19241050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard 19341050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard#ifdef __cplusplus 19441050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard} 19541050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard#endif /* __cplusplus */ 19641050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard 19741050cdb033641ddf26831d9272c0930f7b40a2dMans Rullgard#endif // __voType_H__ 198