]> git.vomp.tv Git - vompclient.git/blob - defines.h
Clean up screenShot() - all params, return types, function names
[vompclient.git] / defines.h
1 /*
2     Copyright 2004-2020 Chris Tallon
3
4     This file is part of VOMP.
5
6     VOMP is free software; you can redistribute it and/or modify
7     it under the terms of the GNU General Public License as published by
8     the Free Software Foundation; either version 2 of the License, or
9     (at your option) any later version.
10
11     VOMP is distributed in the hope that it will be useful,
12     but WITHOUT ANY WARRANTY; without even the implied warranty of
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14     GNU General Public License for more details.
15
16     You should have received a copy of the GNU General Public License
17     along with VOMP.  If not, see <https://www.gnu.org/licenses/>.
18 */
19
20 #ifndef DEFINES_H
21 #define DEFINES_H
22
23 typedef unsigned char UCHAR;
24 typedef unsigned short USHORT;
25 typedef unsigned int UINT;
26 typedef unsigned long ULONG;
27 typedef unsigned long long ULLONG;
28
29 #define OPTIONTYPE_TEXT 1
30 #define OPTIONTYPE_INT 2
31
32 #define BENCHMARK_FPS
33
34
35 // Global useful functions
36
37 long long getTimeMS();
38
39 #include <string>
40
41
42 int getClockRealTime(struct timespec *tp);
43
44 const std::string& getCommandLineServer();
45
46 //#define WINDOWS_LEGACY
47
48 #ifdef WIN32
49
50   #define Led_TYPE LedWin
51   #define Video_TYPE VideoWin
52
53   #define Thread_TYPE ThreadWin
54   #define ThreadID_TYPE unsigned int
55   #define VectorHandle void* 
56   #define VECTOR_HANDLE_INIT NULL
57 #ifndef WINDOWS_LEGACY
58   #define Osd_TYPE OsdWinVector
59   #define Surface_TYPE SurfaceVector
60   #define GRADIENT_DRAWING
61   #define ADVANCED_MENUES // This is for special HD versions of our menus
62 #else
63   #define Osd_TYPE OsdWinPixel
64   #define Surface_TYPE SurfaceWin
65 #endif
66
67   #define RemoteStartDev ""//No devices passed
68
69 // FIXME - check C++ - I think some of these are in std:: now ?
70 // FIXME - Not on Windows. Obviously. Also _snprintf doesn't guarantee null termination.
71 // FIXME When the Windows code is upped to VS2015 use snprintf instead of _snprintf.
72   #define SNPRINTF _snprintf
73   #define VSNPRINTF _vsnprintf
74   #define STRCASECMP _stricmp
75   #define STRCASESTR StrStrI
76 /*  #define STRTOULL _strtoui64 */
77   #define STRTOUL strtoul
78   #define STRTOKR strtok_s
79   #define LOCALTIME_R(time, tm) (localtime_s(tm,time)) 
80
81   #define CLOSESOCKET closesocket
82   #define DEFAULT_TCP_WINDOWSIZE 2048
83   #define DEFAULT_TCP_WINDOWSIZENR 2  /*=2048*/
84   #define PLAYER_MAX_STREAMING_BUFFERS 120 // for video in uints of 50000 KB
85
86   #define VOMP_HAS_EXIT
87
88   #define FALLTHROUGH
89
90 #else
91
92   int max(int, int);
93   int min(UINT, int);
94 /*#ifdef _MIPS_ARCH
95   #define Surface_TYPE SurfaceDirectFB
96 #else
97   #define Surface_TYPE
98 #endif*/
99 #ifdef __ANDROID__
100   #define Thread_TYPE ThreadPAndroid
101
102 #else
103   #define Thread_TYPE ThreadP
104
105 #endif
106   #include <pthread.h>
107   #define ThreadID_TYPE pthread_t
108
109   #define SNPRINTF snprintf
110   #define VSNPRINTF vsnprintf
111   #define STRCASECMP strcasecmp
112   #define STRCASESTR strcasestr
113   #define STRTOUL strtoul
114   #define STRTOKR strtok_r
115   #define LOCALTIME_R(time, tm) (localtime_r(time, tm)) 
116
117
118   #define CLOSESOCKET close
119
120 // add here defines for plattform specific objects
121 #ifdef VOMP_PLATFORM_RASPBERRY
122   #define Remote_TYPE InputLinux  // Generic Remote under Linux (Konsole!, not X) will support in the end:
123   #define RemoteStartDev ""//No devices passed
124
125   // Keyboard
126   // remotes under /dev/event
127   // HDMI CEC
128   //lirc?
129   #define Led_TYPE LedRaspberry  //this is device dependent
130   #define Osd_TYPE OsdOpenVG   // This OpenGL ES 2.0, in the moment only for raspberry, but might be splitted for other devices
131   #define Audio_TYPE AudioOMX   // This is Audio based on OpenMax and libav for decoding
132   #define Video_TYPE VideoOMX   // This is Video based on OpenMax
133
134
135
136   #define VPE_OMX_SUPPORT // Activate support for hardware codec using openmax il
137   #define VPE_OMX_H264_DECODER "OMX.broadcom.video_decode"
138   #define VPE_OMX_MPEG2_DECODER "OMX.broadcom.video_decode"
139   #define VPE_OMX_VIDEO_SCHED "OMX.broadcom.video_scheduler"
140   #define VPE_OMX_VIDEO_REND "OMX.broadcom.video_render"
141   #define VPE_OMX_VIDEO_DEINTERLACE "OMX.broadcom.image_fx"
142   #define VPE_OMX_CLOCK "OMX.broadcom.clock"
143   #define VPE_OMX_AUDIO_DECODER "OMX.broadcom.audio_decode"
144   #define VPE_OMX_AUDIO_REND "OMX.broadcom.audio_render"
145   #define VPE_OMX_IMAGE_DECODER "OMX.broadcom.image_decode"
146   #define VPE_OMX_EGL_REND "OMX.broadcom.egl_render"
147
148    //#define  VPE_LIBAV_SUPPORT
149   // #define  VPE_LIBAV_MPEG2_TRANSCODING
150
151   #define DEFAULT_TCP_WINDOWSIZE 0
152   #define DEFAULT_TCP_WINDOWSIZENR 0  /*=2048*/
153   #define PLAYER_MAX_STREAMING_BUFFERS 120 // for video in uints of 50000 KB
154   #define TV_NORM_SWITCHABLE
155   #define HANDLE_VT_SWITCHING
156   #define GRADIENT_DRAWING
157   #define ADVANCED_MENUES // This is for special HD versions of our menus
158   #define VectorHandle unsigned int 
159   #define VECTOR_HANDLE_INIT 0
160
161
162   #define PICTURE_DECODER_MAGICK
163   #define PICTURE_DECODER_OMX
164
165   #define VOMP_LINUX_CLOCK  CLOCK_MONOTONIC
166
167 #define FALLTHROUGH [[fallthrough]];
168
169 #endif
170 #ifdef VOMP_PLATTFORM_MVP                   // FIXME OBSOLETE
171   #define Remote_TYPE RemoteMVP
172   #define RemoteStartDev "/dev/rawir"
173   #define Led_TYPE
174   #define Osd_TYPE
175   #define Audio_TYPE
176   #define Video_TYPE
177   #define Surface_TYPE
178   #define DEFAULT_TCP_WINDOWSIZE 2048  /*=2048*/
179   #define DEFAULT_TCP_WINDOWSIZENR 2  /*=2048*/
180   #define PLAYER_MAX_STREAMING_BUFFERS 11 // for video in uints of 50000 KB
181   #define PAL_WSS
182
183   #define VOMP_MEDIAPLAYER
184   #define VOMP_LINUX_CLOCK  CLOCK_REALTIME
185
186   #define VectorHandle void*
187   #define VECTOR_HANDLE_INIT NULL
188
189 #endif
190
191 #ifdef VOMP_PLATTFORM_NMT // This was the attempt to port vomp to nmt, it failed but maybe the code is useful at some time
192   #define Remote_TYPE RemoteLirc
193   #define RemoteStartDev "/dev/lircd"
194   #define Led_TYPE LedMVP
195   #define Osd_TYPE OsdDirectFB
196   #define Audio_TYPE AudioNMT
197   #define Video_TYPE VideoNMT
198   #define Surface_TYPE SurfaceDirectFB //deprecated
199   #define DEFAULT_TCP_WINDOWSIZE 2048
200   #define DEFAULT_TCP_WINDOWSIZENR 2  /*=2048*/
201   #define PLAYER_MAX_STREAMING_BUFFERS 11 // for video in uints of 50000 KB
202
203   #define VOMP_LINUX_CLOCK  CLOCK_REALTIME
204
205 #endif
206
207 #endif
208
209 /*
210 typedef struct
211 {
212   UINT id;               // Used for working out what has changed at the end
213   char *title;           // Name of the option
214   char *configSection;   // Which section of the config file
215   char *configParam;     // Parameter name in the config file
216   UINT optionType;       // 1 for text, 2 for int
217   UINT optionCount;      // How many choices?
218   UINT defaultOption;    // Serial of the default choice (base 0), or actual option in int mode
219   int startInt;          // Starting int for int mode
220   const char * const * options;  // Text for the options (null for int mode)
221 } OPTIONDATA;
222 */
223
224 #endif