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