]> git.vomp.tv Git - vompclient.git/blob - defines.h
Preparations for dynamic mode switching
[vompclient.git] / defines.h
1 /*\r
2     Copyright 2004-2005 Chris Tallon\r
3 \r
4     This file is part of VOMP.\r
5 \r
6     VOMP is free software; you can redistribute it and/or modify\r
7     it under the terms of the GNU General Public License as published by\r
8     the Free Software Foundation; either version 2 of the License, or\r
9     (at your option) any later version.\r
10 \r
11     VOMP is distributed in the hope that it will be useful,\r
12     but WITHOUT ANY WARRANTY; without even the implied warranty of\r
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
14     GNU General Public License for more details.\r
15 \r
16     You should have received a copy of the GNU General Public License\r
17     along with VOMP; if not, write to the Free Software\r
18     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.\r
19 */\r
20 \r
21 #ifndef DEFINES_H\r
22 #define DEFINES_H\r
23 \r
24 typedef unsigned char UCHAR;\r
25 typedef unsigned short USHORT;\r
26 typedef unsigned int UINT;\r
27 typedef unsigned long ULONG;\r
28 typedef unsigned long long ULLONG;\r
29 \r
30 #define OPTIONTYPE_TEXT 1\r
31 #define OPTIONTYPE_INT 2\r
32 \r
33 #define BENCHMARK_FPS\r
34 \r
35 //ULLONG htonll(ULLONG a);\r
36 //ULLONG ntohll(ULLONG a);\r
37 void MILLISLEEP(ULONG a);\r
38 long long getTimeMS();\r
39 \r
40 #ifdef WIN32\r
41 \r
42   #define Surface_TYPE SurfaceWin\r
43   #define Thread_TYPE ThreadWin\r
44   #define ThreadID_TYPE unsigned int\r
45 \r
46   #define SNPRINTF _snprintf\r
47   #define VSNPRINTF _vsnprintf\r
48   #define STRCASECMP _stricmp\r
49   #define STRCASESTR StrStrI\r
50 /*  #define STRTOULL _strtoui64 */\r
51   #define STRTOUL strtoul\r
52   #define CLOSESOCKET closesocket\r
53   #define DEFAULT_TCP_WINDOWSIZENR 1  /*=2048*/\r
54   #define PLAYER_MAX_STREAMING_BUFFERS 120 // for video in uints of 50000 KB\r
55 \r
56   #define VOMP_HAS_EXIT\r
57 \r
58 #else\r
59 \r
60   int max(int, int);\r
61   int min(UINT, int);\r
62 /*#ifdef _MIPS_ARCH\r
63   #define Surface_TYPE SurfaceDirectFB\r
64 #else\r
65   #define Surface_TYPE SurfaceMVP\r
66 #endif*/\r
67 #ifdef __ANDROID__\r
68   #define Thread_TYPE ThreadPAndroid\r
69 \r
70 #else\r
71   #define Thread_TYPE ThreadP\r
72 \r
73 #endif\r
74   #include <pthread.h>\r
75   #define ThreadID_TYPE pthread_t\r
76 \r
77   #define SNPRINTF snprintf\r
78   #define VSNPRINTF vsnprintf\r
79   #define STRCASECMP strcasecmp\r
80   #define STRCASESTR strcasestr\r
81   #define STRTOUL strtoul\r
82   #define CLOSESOCKET close\r
83 \r
84 // add here defines for plattform specific objects\r
85 #ifdef VOMP_PLATTFORM_RASPBERRY\r
86    #define Remote_TYPE RemoteLinux  // Generic Remote under Linux (Konsole!, not X) will support in the end:\r
87    #define RemoteStartDev ""//No devices passed\r
88 \r
89   // Keyboard\r
90   // remotes under /dev/event\r
91   // HDMI CEC\r
92   //lirc?\r
93    #define Mtd_TYPE MtdRaspberry  //this is device dependent\r
94    #define Led_TYPE LedRaspberry  //this is device dependent\r
95    #define Osd_TYPE OsdOpenVG   // This OpenGL ES 2.0, in the moment only for raspberry, but might be splitted for other devices\r
96    #define OsdStartDev ""\r
97    #define Audio_TYPE AudioOMX   // This is Audio based on OpenMax and libav for decoding\r
98    #define Video_TYPE VideoOMX   // This is Video based on OpenMax\r
99 \r
100 \r
101 \r
102    #define VPE_OMX_SUPPORT // Activate support for hardware codec using openmax il\r
103    #define VPE_OMX_H264_DECODER "OMX.broadcom.video_decode"\r
104    #define VPE_OMX_MPEG2_DECODER "OMX.broadcom.video_decode"\r
105    #define VPE_OMX_VIDEO_SCHED "OMX.broadcom.video_scheduler"\r
106    #define VPE_OMX_VIDEO_REND "OMX.broadcom.video_render"\r
107    #define VPE_OMX_VIDEO_DEINTERLACE "OMX.broadcom.image_fx"\r
108    #define VPE_OMX_CLOCK "OMX.broadcom.clock"\r
109    #define VPE_OMX_AUDIO_DECODER "OMX.broadcom.audio_decode"\r
110    #define VPE_OMX_AUDIO_REND "OMX.broadcom.audio_render"\r
111 \r
112    //#define  VPE_LIBAV_SUPPORT\r
113   // #define  VPE_LIBAV_MPEG2_TRANSCODING\r
114 \r
115   #define DEFAULT_TCP_WINDOWSIZENR 6  /*=2048*/\r
116   #define PLAYER_MAX_STREAMING_BUFFERS 120 // for video in uints of 50000 KB\r
117   #define TV_NORM_SWITCHABLE\r
118   #define HANDLE_VT_SWITCHING\r
119 \r
120   #define VOMP_LINUX_CLOCK  CLOCK_MONOTONIC\r
121 \r
122 #endif\r
123 #ifdef VOMP_PLATTFORM_MVP\r
124   #define Remote_TYPE RemoteMVP\r
125   #define RemoteStartDev "/dev/rawir"\r
126   #define Mtd_TYPE MtdMVP\r
127   #define Led_TYPE LedMVP\r
128   #define Osd_TYPE OsdMVP\r
129   #define OsdStartDev "/dev/stbgfx"\r
130   #define Audio_TYPE AudioMVP\r
131   #define Video_TYPE VideoMVP\r
132   #define Surface_TYPE SurfaceMVP //deprecated\r
133   #define DEFAULT_TCP_WINDOWSIZENR 1  /*=2048*/\r
134   #define PLAYER_MAX_STREAMING_BUFFERS 11 // for video in uints of 50000 KB\r
135   #define PAL_WSS\r
136   #define MVP_REMOTE_TYPES\r
137 \r
138   #define VOMP_MEDIAPLAYER\r
139   #define VOMP_LINUX_CLOCK  CLOCK_REALTIME\r
140 #endif\r
141 \r
142 #ifdef VOMP_PLATTFORM_NMT // This was the attempt to port vomp to nmt, it failed but maybe the code is useful at some time\r
143   #define Remote_TYPE RemoteLirc\r
144   #define RemoteStartDev "/dev/lircd"\r
145   #define Mtd_TYPE MtdNMT\r
146   #define Led_TYPE LedMVP\r
147   #define Osd_TYPE OsdDirectFB\r
148   #define OsdStartDev ""\r
149   #define Audio_TYPE AudioNMT\r
150   #define Video_TYPE VideoNMT\r
151   #define Surface_TYPE SurfaceDirectFB //deprecated\r
152   #define DEFAULT_TCP_WINDOWSIZENR 1  /*=2048*/\r
153   #define PLAYER_MAX_STREAMING_BUFFERS 11 // for video in uints of 50000 KB\r
154 \r
155   #define VOMP_LINUX_CLOCK  CLOCK_REALTIME\r
156 \r
157 #endif\r
158 \r
159 #endif\r
160 \r
161 /*\r
162 typedef struct\r
163 {\r
164   UINT id;               // Used for working out what has changed at the end\r
165   char *title;           // Name of the option\r
166   char *configSection;   // Which section of the config file\r
167   char *configParam;     // Parameter name in the config file\r
168   UINT optionType;       // 1 for text, 2 for int\r
169   UINT optionCount;      // How many choices?\r
170   UINT defaultOption;    // Serial of the default choice (base 0), or actual option in int mode\r
171   int startInt;          // Starting int for int mode\r
172   const char * const * options;  // Text for the options (null for int mode)\r
173 } OPTIONDATA;\r
174 */\r
175 \r
176 #endif\r