2 Copyright 2004-2022 Chris Tallon
4 This file is part of VOMP.
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.
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.
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/>.
23 typedef unsigned char UCHAR;
24 typedef unsigned short USHORT;
25 typedef unsigned int UINT;
39 #define toi4(arg) static_cast<i4>(arg)
40 #define tou4(arg) static_cast<u4>(arg)
44 #define OPTIONTYPE_TEXT 1
45 #define OPTIONTYPE_INT 2
50 // Global useful functions
52 long long getTimeMS();
54 int getClockRealTime(struct timespec *tp);
56 //#define WINDOWS_LEGACY
60 #define Led_TYPE LedWin
61 #define Video_TYPE VideoWin
63 #define Thread_TYPE ThreadWin
64 #define ThreadID_TYPE unsigned int
65 #define VectorHandle void*
66 #define VECTOR_HANDLE_INIT NULL
67 #ifndef WINDOWS_LEGACY
68 #define Osd_TYPE OsdWinVector
69 #define Surface_TYPE SurfaceVector
70 #define GRADIENT_DRAWING
71 #define ADVANCED_MENUES // This is for special HD versions of our menus
73 #define Osd_TYPE OsdWinPixel
74 #define Surface_TYPE SurfaceWin
77 #define RemoteStartDev ""//No devices passed
79 // FIXME - check C++ - I think some of these are in std:: now ?
80 // FIXME - Not on Windows. Obviously. Also _snprintf doesn't guarantee null termination.
81 // FIXME When the Windows code is upped to VS2015 use snprintf instead of _snprintf.
82 #define SNPRINTF _snprintf
83 #define VSNPRINTF _vsnprintf
84 #define STRCASECMP _stricmp
85 #define STRCASESTR StrStrI
86 /* #define STRTOULL _strtoui64 */
87 #define STRTOUL strtoul
88 #define STRTOKR strtok_s
89 #define LOCALTIME_R(time, tm) (localtime_s(tm,time))
91 #define CLOSESOCKET closesocket
92 #define DEFAULT_TCP_WINDOWSIZE 2048
93 #define DEFAULT_TCP_WINDOWSIZENR 2 /*=2048*/
94 #define PLAYER_MAX_STREAMING_BUFFERS 120 // for video in uints of 50000 KB
104 #define Surface_TYPE SurfaceDirectFB
109 #define Thread_TYPE ThreadPAndroid
112 #define Thread_TYPE ThreadP
116 #define ThreadID_TYPE pthread_t
118 #define SNPRINTF snprintf
119 #define VSNPRINTF vsnprintf
120 #define STRCASECMP strcasecmp
121 #define STRCASESTR strcasestr
122 #define STRTOUL strtoul
123 #define STRTOKR strtok_r
124 #define LOCALTIME_R(time, tm) (localtime_r(time, tm))
127 #define CLOSESOCKET close
129 // add here defines for plattform specific objects
130 #ifdef VOMP_PLATFORM_RASPBERRY
131 #define Remote_TYPE InputLinux // Generic Remote under Linux (Konsole!, not X) will support in the end:
132 #define RemoteStartDev ""//No devices passed
135 // remotes under /dev/event
138 #define Led_TYPE LedRaspberry //this is device dependent
139 #define Osd_TYPE OsdOpenVG // This OpenGL ES 2.0, in the moment only for raspberry, but might be splitted for other devices
140 #define Audio_TYPE AudioOMX // This is Audio based on OpenMax and libav for decoding
141 #define Video_TYPE VideoOMX // This is Video based on OpenMax
145 #define VPE_OMX_SUPPORT // Activate support for hardware codec using openmax il
146 #define VPE_OMX_H264_DECODER "OMX.broadcom.video_decode"
147 #define VPE_OMX_MPEG2_DECODER "OMX.broadcom.video_decode"
148 #define VPE_OMX_VIDEO_SCHED "OMX.broadcom.video_scheduler"
149 #define VPE_OMX_VIDEO_REND "OMX.broadcom.video_render"
150 #define VPE_OMX_VIDEO_DEINTERLACE "OMX.broadcom.image_fx"
151 #define VPE_OMX_CLOCK "OMX.broadcom.clock"
152 #define VPE_OMX_AUDIO_DECODER "OMX.broadcom.audio_decode"
153 #define VPE_OMX_AUDIO_REND "OMX.broadcom.audio_render"
154 #define VPE_OMX_IMAGE_DECODER "OMX.broadcom.image_decode"
155 #define VPE_OMX_EGL_REND "OMX.broadcom.egl_render"
157 //#define VPE_LIBAV_SUPPORT
158 // #define VPE_LIBAV_MPEG2_TRANSCODING
160 #define DEFAULT_TCP_WINDOWSIZE 0
161 #define DEFAULT_TCP_WINDOWSIZENR 0 /*=2048*/
162 #define PLAYER_MAX_STREAMING_BUFFERS 120 // for video in uints of 50000 KB
163 #define TV_NORM_SWITCHABLE
164 #define HANDLE_VT_SWITCHING
165 #define GRADIENT_DRAWING
166 #define ADVANCED_MENUES // This is for special HD versions of our menus
167 #define VectorHandle unsigned int
168 #define VECTOR_HANDLE_INIT 0
171 #define PICTURE_DECODER_MAGICK
172 #define PICTURE_DECODER_OMX
174 #define VOMP_LINUX_CLOCK CLOCK_MONOTONIC
176 #define FALLTHROUGH [[fallthrough]];
179 #ifdef VOMP_PLATTFORM_MVP // FIXME OBSOLETE
180 #define Remote_TYPE RemoteMVP
181 #define RemoteStartDev "/dev/rawir"
187 #define DEFAULT_TCP_WINDOWSIZE 2048 /*=2048*/
188 #define DEFAULT_TCP_WINDOWSIZENR 2 /*=2048*/
189 #define PLAYER_MAX_STREAMING_BUFFERS 11 // for video in uints of 50000 KB
192 #define VOMP_MEDIAPLAYER
193 #define VOMP_LINUX_CLOCK CLOCK_REALTIME
195 #define VectorHandle void*
196 #define VECTOR_HANDLE_INIT NULL
200 #ifdef VOMP_PLATTFORM_NMT // This was the attempt to port vomp to nmt, it failed but maybe the code is useful at some time
201 #define Remote_TYPE RemoteLirc
202 #define RemoteStartDev "/dev/lircd"
203 #define Led_TYPE LedMVP
204 #define Osd_TYPE OsdDirectFB
205 #define Audio_TYPE AudioNMT
206 #define Video_TYPE VideoNMT
207 #define Surface_TYPE SurfaceDirectFB //deprecated
208 #define DEFAULT_TCP_WINDOWSIZE 2048
209 #define DEFAULT_TCP_WINDOWSIZENR 2 /*=2048*/
210 #define PLAYER_MAX_STREAMING_BUFFERS 11 // for video in uints of 50000 KB
212 #define VOMP_LINUX_CLOCK CLOCK_REALTIME
221 UINT id; // Used for working out what has changed at the end
222 char *title; // Name of the option
223 char *configSection; // Which section of the config file
224 char *configParam; // Parameter name in the config file
225 UINT optionType; // 1 for text, 2 for int
226 UINT optionCount; // How many choices?
227 UINT defaultOption; // Serial of the default choice (base 0), or actual option in int mode
228 int startInt; // Starting int for int mode
229 const char * const * options; // Text for the options (null for int mode)