]> git.sesse.net Git - vlc/blob - include/config.h
* Ajout d'un flag VDEC_SMP � commenter si on n'a qu'un seul
[vlc] / include / config.h
1 /*******************************************************************************
2  * config.h: limits and configuration
3  * (c)1999 VideoLAN
4  *******************************************************************************
5  * Defines all compilation-time configuration constants and size limits
6  *******************************************************************************/
7
8 /* Conventions regarding names of symbols and variables
9  * ----------------------------------------------------
10  *
11  * - Symbols should begin with a prefix indicating in which module they are
12  *   used, such as INTF_, VOUT_ or ADEC_.
13  *
14  * - Regarding environment variables, which are used as initialization parameters 
15  *   for threads :
16  *   + variable names should end with '_VAR'
17  *   + environment variable default value should end with '_DEFAULT'
18  *   + values having a special meaning with '_VAL' 
19  *   
20  */
21
22 /*******************************************************************************
23  * Program information
24  *******************************************************************************/
25
26 /* Program version and copyright message */
27 #define COPYRIGHT_MESSAGE               "VideoLAN Client v" PROGRAM_VERSION " - (c)1999-2000 VideoLAN"
28 #define VERSION_MESSAGE                 "VideoLAN Client - (c)1999-2000 VideoLAN\n" \
29                                         "version " PROGRAM_VERSION " ( " PROGRAM_BUILD " )\n" \
30                                         "compilation options: " PROGRAM_OPTIONS
31
32 /*******************************************************************************
33  * General compilation options
34  *******************************************************************************/
35
36 /* Define for DVB support - Note that some extensions or restrictions may be
37  * incompatible with native MPEG2 streams */
38 //#define DVB_EXTENSIONS
39 //#define DVB_RESTRICTIONS
40
41 /* Define to disable some obscure heuristics behind the video_parser and the
42  * video_decoder that improve performance but are not fully MPEG2 compliant
43  * and might cause problems with some very weird streams. */
44 //#define MPEG2_COMPLIANT
45
46 /* Define for profiling and statistics support - such informations, like FPS
47  * or pictures count won't be available if it not set */
48 #define STATS
49
50 /* Define for unthreaded version of the program - ?? not yet implemented */
51 //#define NO_THREAD
52
53 /*******************************************************************************
54  * Debugging options - define or undefine symbols
55  *******************************************************************************/
56 #ifdef DEBUG
57 /* General debugging support, which depends of the DEBUG define, is determined
58  * in the Makefile */
59
60 /* Modules specific debugging - this will produce a lot of output, but can be
61  * usefull to track a bug */
62 #define DEBUG_INTF
63 #define DEBUG_INPUT
64 #define DEBUG_AUDIO
65 //#define DEBUG_VIDEO
66
67 /* Debugging log file - if defined, a file can be used to store all messages. If
68  * DEBUG_LOG_ONLY is defined, debug messages will only be printed to the log and
69  * will not appear on the screen */
70 #define DEBUG_LOG                       "vlc-debug.log"
71 #define DEBUG_LOG_ONLY
72
73 #endif
74
75 /*******************************************************************************
76  * General configuration
77  *******************************************************************************/
78
79 /* Automagically spawn input, audio and video threads ? */
80 // ?? used ?
81 #define AUTO_SPAWN
82
83 /* When creating or destroying threads in blocking mode, delay to poll thread
84  * status */
85 #define THREAD_SLEEP                    10000
86
87 /*
88  * Decoders FIFO configuration
89  */
90
91 /* Size of the FIFO. FIFO_SIZE+1 must be a multiple of 2 */
92 #define FIFO_SIZE                       1023
93
94
95 /*******************************************************************************
96  * Interface configuration
97  *******************************************************************************/
98
99 /* Environment variable used to store startup script name and default value */
100 #define INTF_INIT_SCRIPT_VAR            "vlc_init"
101 #define INTF_INIT_SCRIPT_DEFAULT        "vlc.init"
102
103 /* Base delay in micro second for interface sleeps */
104 #define INTF_IDLE_SLEEP                 100000
105
106 /* Step for changing gamma, and minimum and maximum values */
107 #define INTF_GAMMA_STEP                 .1
108 #define INTF_GAMMA_LIMIT                3
109
110 /*
111  * X11 settings
112  */
113
114 /* Title of the X11 window */
115 #define VOUT_TITLE                      "VideoLAN Client"
116
117 /*******************************************************************************
118  * Input thread configuration
119  *******************************************************************************/
120
121 /* ?? */
122 #define INPUT_IDLE_SLEEP                100000
123
124 /*
125  * General limitations
126  */
127
128 /* Broadcast address, in case of a broadcasted stream */
129 #define INPUT_BCAST_ADDR                "138.195.143.255"
130
131 /* Maximum number of input threads - this value is used exclusively by
132  * interface, and is in fact an interface limitation */
133 #define INPUT_MAX_THREADS               10
134
135 /* Maximum number of programs definitions in a TS stream */
136 #define INPUT_MAX_PGRM                  10
137
138 /* Maximum number of ES definitions in a TS stream */
139 #define INPUT_MAX_ES                    10
140
141 /* Maximum number of ES in a single program */
142 #define INPUT_MAX_PROGRAM_ES            10
143
144 /* Maximum number of selected ES in an input thread */
145 #define INPUT_MAX_SELECTED_ES           10
146
147 /* Maximum number of TS packets in the client at any time
148  * INPUT_MAX_TS + 1 must be a power of 2, to optimize the %(INPUT_MAX_TS+1)
149  * operation with a &INPUT_MAX_TS in the case of a fifo netlist.
150  * It should be > number of fifos * FIFO_SIZE to avoid input deadlock. */
151 #define INPUT_MAX_TS                    32767      /* INPUT_MAX_TS + 1 = 2^15 */
152
153 /* Same thing with PES packets */
154 #define INPUT_MAX_PES                   16383
155
156 /* Maximum number of TS packets we read from the socket in one readv().
157  * Since you can't put more than 7 TS packets in an Ethernet frame,
158  * the maximum value is 7. This number should also limit the stream server,
159  * otherwise any supplementary packet is lost. */
160 #define INPUT_TS_READ_ONCE              7
161
162 /* Use a LIFO or FIFO for TS netlist ? */
163 #undef INPUT_LIFO_TS_NETLIST
164
165 /* Use a LIFO or FIFO for PES netlist ? */
166 #undef INPUT_LIFO_PES_NETLIST
167
168 /* Maximum length of a hostname or source name */
169 #define INPUT_MAX_SOURCE_LENGTH         100
170
171 /* Default remote server */
172 #define INPUT_SERVER_VAR                "vlc_server"
173 #define INPUT_SERVER_DEFAULT            "138.195.143.220"
174
175 /* Default input port */
176 #define INPUT_PORT_VAR                  "vlc_server_port"
177 #define INPUT_PORT_DEFAULT              1234
178
179 /*
180  * Vlan method 
181  */ 
182
183 /* Default network interface and environment variable */
184 #define INPUT_IFACE_VAR                 "vlc_iface"
185 #define INPUT_IFACE_DEFAULT             "eth0"
186
187 /* Default server and port */
188 #define INPUT_VLAN_SERVER_VAR           "vlc_vlan_server"
189 #define INPUT_VLAN_SERVER_DEFAULT       "138.195.140.31"
190 #define INPUT_VLAN_PORT_VAR             "vlc_vlan_port"
191 #define INPUT_VLAN_PORT_DEFAULT         6010
192
193 /* Delay between vlan changes - this is required to avoid flooding the VLAN 
194  * server */
195 #define INPUT_VLAN_CHANGE_DELAY         5000000
196
197 /*******************************************************************************
198  * Audio configuration
199  *******************************************************************************/
200
201 /* Environment variable used to store dsp device name, and default value */
202 #define AOUT_DSP_VAR                    "vlc_dsp"
203 #define AOUT_DSP_DEFAULT                "/dev/dsp"
204
205 /* Environment variable for stereo, and default value */
206 #define AOUT_STEREO_VAR                 "vlc_stereo"
207 #define AOUT_STEREO_DEFAULT             1
208
209 /* Environment variable for output rate, and default value */
210 #define AOUT_RATE_VAR                   "vlc_audio_rate"
211 #define AOUT_RATE_DEFAULT               44100 
212
213 /*******************************************************************************
214  * Video configuration
215  *******************************************************************************/
216
217 /*
218  * Default settings for video output threads
219  */
220
221 /* Environment variable used in place of DISPLAY if available */
222 #define VOUT_DISPLAY_VAR                "vlc_display"
223
224 /* Default dimensions for display window - these dimensions are enough for the 
225  * standard width and height broadcasted MPEG-2 streams */
226 #define VOUT_WIDTH_VAR                  "vlc_width"
227 #define VOUT_HEIGHT_VAR                 "vlc_height"
228 #define VOUT_WIDTH_DEFAULT              640
229 #define VOUT_HEIGHT_DEFAULT             480
230
231 /* Default video heap size - remember that a decompressed picture is big 
232  * (~1 Mbyte) before using huge values */
233 #define VOUT_MAX_PICTURES               10
234
235 /* Environment variable for grayscale output mode, and default value */
236 #define VOUT_GRAYSCALE_VAR              "vlc_grayscale"
237 #define VOUT_GRAYSCALE_DEFAULT          0
238
239 /* Default gamma */
240 #define VOUT_GAMMA                      0.
241
242 /*
243  * Time settings
244  */
245
246 /* Time during which the thread will sleep if it has nothing to 
247  * display (in micro-seconds) */
248 /* ?? this constant will probably evolve to a calculated value */
249 #define VOUT_IDLE_SLEEP                 20000
250
251 /* Maximum lap of time allowed between the beginning of rendering and
252  * display. If, compared to the current date, the next image is too
253  * late, the thread will perform an idle loop. This time should be
254  * at least VOUT_IDLE_SLEEP plus the time required to render a few
255  * images, to avoid trashing of decoded images */
256 /* ?? this constant will probably evolve to a calculated value */
257 #define VOUT_DISPLAY_DELAY              500000
258
259 /* Delay (in microseconds) between increments in idle levels */
260 #define VOUT_IDLE_DELAY                 5000000000000
261
262 /* Number of pictures required to computes the FPS rate */
263 #define VOUT_FPS_SAMPLES                20
264
265 /*
266  * Framebuffer settings
267  */
268
269 /* Environment variable for framebuffer device, and default value */
270 #define VOUT_FB_DEV_VAR                 "vlc_fb_dev"
271 #define VOUT_FB_DEV_DEFAULT             "/dev/fb0"
272
273 /*
274  * X11 settings 
275  */
276
277 /* Font maximum and minimum characters - characters outside this range are not
278  * printed - maximum range is 1-256 */
279 #define VOUT_MIN_CHAR                   1
280 #define VOUT_MAX_CHAR                   128
281
282 /*******************************************************************************
283  * Video parser configuration
284  *******************************************************************************/
285
286 #define VPAR_IDLE_SLEEP                 100000
287
288 /* Time to sleep when waiting for a buffer (from vout or the video fifo). */
289 #define VPAR_OUTMEM_SLEEP               50000
290
291 /* The following directives only apply if you define VDEC_SMP below. */
292
293 /* Number of macroblock buffers available. It should be always greater than
294  * twice the number of macroblocks in a picture. VFIFO_SIZE + 1 should also
295  * be a power of two. */
296 #define VFIFO_SIZE                      8191
297
298 /* Maximum number of macroblocks in a picture. */
299 #define MAX_MB                          2048
300
301 /*******************************************************************************
302  * Video decoder configuration
303  *******************************************************************************/
304
305 //#define VDEC_SMP
306
307 #define VDEC_IDLE_SLEEP                 100000
308
309 /* Number of video_decoder threads to launch on startup of the video_parser.
310  * It should always be less than half the number of macroblocks of a
311  * picture. Only available if you defined VDEC_SMP above. */
312 #define NB_VDEC                         1
313
314 /* Maximum range of values out of the IDCT + motion compensation. */
315 #define VDEC_CROPRANGE                  2048
316
317 /*******************************************************************************
318  * Generic decoder configuration
319  *******************************************************************************/
320
321 #define GDEC_IDLE_SLEEP                 100000
322
323 /*******************************************************************************
324  * Messages and console interfaces configuration
325  *******************************************************************************/
326
327 /* Maximal size of the message queue - in case of overflow, all messages in the
328  * queue are printed by the calling thread */
329 #define INTF_MSG_QSIZE                  64
330
331 /* Define to enable messages queues - disabling messages queue can be usefull
332  * when debugging, since it allows messages which would not otherwise be printed,
333  * due to a crash, to be printed anyway */
334 #ifndef DEBUG
335 #define INTF_MSG_QUEUE
336 #endif
337
338 /* Format of the header for debug messages. The arguments following this header
339  * are the file (char *), the function (char *) and the line (int) in which the
340  * message function was called */
341 #define INTF_MSG_DBG_FORMAT             "## %s:%s(),%i: "
342
343 /* Maximal number of arguments on a command line, including the function name */
344 #define INTF_MAX_ARGS                   20
345
346 /* Maximal size of a command line in a script */
347 #define INTF_MAX_CMD_SIZE               240
348
349 /* Number of memorized lines in console window text zone */
350 #define INTF_CONSOLE_MAX_TEXT           100
351
352 /* Maximal number of commands which can be saved in history list */
353 #define INTF_CONSOLE_MAX_HISTORY        20