]> git.sesse.net Git - vlc/blob - include/config.h.in
* Filter plugins. Not very polished (please don't look at how the dates are
[vlc] / include / config.h.in
1 /*****************************************************************************
2  * config.h: limits and configuration
3  * Defines all compilation-time configuration constants and size limits
4  *****************************************************************************
5  * Copyright (C) 1999, 2000, 2001 VideoLAN
6  *
7  * Authors: Vincent Seguin <seguin@via.ecp.fr>
8  *          Samuel Hocevar <sam@via.ecp.fr>
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  * 
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
23  *****************************************************************************/
24
25 /* Conventions regarding names of symbols and variables
26  * ----------------------------------------------------
27  *
28  * - Symbols should begin with a prefix indicating in which module they are
29  *   used, such as INTF_, VOUT_ or ADEC_.
30  *
31  * - Regarding environment variables, which are used as initialization
32  *  parameters for threads :
33  *   + variable names should end with '_VAR'
34  *   + environment variable default value should end with '_DEFAULT'
35  *   + values having a special meaning with '_VAL'
36  *
37  */
38
39 #ifdef HAVE_CONFIG_H
40 #else
41 #define HAVE_CONFIG_H
42
43 /*****************************************************************************
44  * Program information
45  *****************************************************************************/
46
47 /* Program version and copyright message */
48 #define VERSION_MESSAGE     "vlc @VLC_VERSION@ @VLC_CODENAME@ " \
49                           /* "(" PROGRAM_BUILD ") (" PROGRAM_OPTIONS ")\n" */ \
50                             "Copyright 1996-2001 VideoLAN\n"
51 #define COPYRIGHT_MESSAGE   "VideoLAN Client - version @VLC_VERSION@" \
52                             " @VLC_CODENAME@ - (C)1996-2001 VideoLAN"
53
54 #define VLC_VERSION         "@VLC_VERSION@"
55
56 /*****************************************************************************
57  * Debugging options - define or undefine symbols
58  *****************************************************************************/
59 #ifdef TRACE
60 /* General trace support, which depends of the TRACE define, is determined
61  * in the Makefile */
62
63 /* Modules specific debugging - this will produce a lot of output, but can be
64  * useful to track a bug */
65 //#define TRACE_INTF
66 //#define TRACE_INPUT
67 //#define TRACE_AUDIO
68 #define TRACE_VOUT
69 #define TRACE_VPAR
70
71 /* Trace log file - if defined, a file can be used to store all messages. If
72  * TRACE_LOG_ONLY is defined, debug messages will only be printed to the log and
73  * will not appear on the screen */
74 #define TRACE_LOG                       "vlc-trace.log"
75 #define TRACE_LOG_ONLY
76
77 #endif
78
79 /*****************************************************************************
80  * General configuration
81  *****************************************************************************/
82
83 #define CLOCK_FREQ 1000000
84
85
86 /* Automagically spawn audio and video decoder threads */
87 #define AUTO_SPAWN
88
89 /* When creating or destroying threads in blocking mode, delay to poll thread
90  * status */
91 #define THREAD_SLEEP                    ((int)(0.010*CLOCK_FREQ))
92
93 /* When a thread waits on a condition in debug mode, delay to wait before
94  * outputting an error message (in second) */
95 #define THREAD_COND_TIMEOUT                             5
96
97 /* Environment variable containing the memcpy method */
98 #define MEMCPY_METHOD_VAR               "vlc_memcpy"
99
100 /*
101  * Decoders FIFO configuration
102  */
103
104 /* Size of the FIFO. FIFO_SIZE+1 must be a power of 2 */
105 #define FIFO_SIZE                       1023
106
107 /*
108  * Paths
109  */
110
111 #define DATA_PATH                       "@prefix@/share/videolan"
112 #define PLUGIN_PATH                     "@prefix@/lib/videolan/vlc"
113
114 #define MAX_PLUGIN_COUNT                32
115
116 /*****************************************************************************
117  * Interface configuration
118  *****************************************************************************/
119
120 /* Environment variable containing the display method */
121 #define INTF_METHOD_VAR                 "vlc_intf"
122 #define INTF_METHOD_DEFAULT             "gtk"
123
124 /* Environment variable used to store startup script name and default value */
125 #define INTF_INIT_SCRIPT_VAR            "vlcrc"
126 #define INTF_INIT_SCRIPT_DEFAULT        ".vlcrc"
127
128 /* Environment variable used to store channels file and default value */
129 #define INTF_CHANNELS_VAR               "vlc_channels"
130 #define INTF_CHANNELS_DEFAULT           "vlc.channels"
131
132 /* Base delay in micro second for interface sleeps */
133 #define INTF_IDLE_SLEEP                 ((int)(0.050*CLOCK_FREQ))
134
135 /* Step for changing gamma, and minimum and maximum values */
136 #define INTF_GAMMA_STEP                 .1
137 #define INTF_GAMMA_LIMIT                3
138
139 /* Maximum number of channels */
140 #define INTF_MAX_CHANNELS               10
141
142 /* Default search path for interface file browser */
143 #define INTF_PATH_VAR                   "vlc_search_path"
144 #define INTF_PATH_DEFAULT               ""
145
146 /* Environment variable containing the standard output method */
147 #define INTF_STDOUT_VAR                 "vlc_stdout"
148 #define INTF_STDOUT_DEFAULT             ""
149
150 /*****************************************************************************
151  * Input thread configuration
152  *****************************************************************************/
153
154 /* Environment variable containing the input method */
155 #define INPUT_METHOD_VAR                "vlc_input"
156 #define INPUT_METHOD_DEFAULT            "ps"
157
158 /* XXX?? */
159 #define INPUT_IDLE_SLEEP                ((int)(0.100*CLOCK_FREQ))
160
161 /*
162  * General limitations
163  */
164
165 /* Maximum number of input threads - this value is used exclusively by
166  * interface, and is in fact an interface limitation */
167 #define INPUT_MAX_THREADS               10
168
169 /* Maximum size of a data packet (128 kB) */
170 #define INPUT_MAX_PACKET_SIZE           131072
171
172 /* Maximum length of a pre-parsed chunk (4 MB) */
173 #define INPUT_PREPARSE_LENGTH           4194304
174
175 /* Maximum length of a hostname or source name */
176 #define INPUT_MAX_SOURCE_LENGTH         100
177
178 /* Maximum memory the input is allowed to use (20 MB) */
179 #define INPUT_MAX_ALLOCATION                    20971520
180
181 /* Default network protocol */
182 #define INPUT_NETWORK_PROTOCOL_VAR      "vlc_network_protocol"
183 #define INPUT_NETWORK_PROTOCOL_DEFAULT  "ts"
184
185 /* Default input port */
186 #define INPUT_PORT_VAR                  "vlc_server_port"
187 #define INPUT_PORT_DEFAULT              1234
188
189 /* FIXME : Delete those ! */
190 /* Default remote server */
191 #define INPUT_SERVER_VAR                "vlc_server"
192 #define INPUT_SERVER_DEFAULT            "138.195.143.220"
193
194 /* Broadcast mode */
195 #define INPUT_BROADCAST_VAR             "vlc_broadcast"
196 #define INPUT_BROADCAST_DEFAULT         0
197
198 /* Default broadcast address */
199 #define INPUT_BCAST_ADDR_VAR            "vlc_broadcast_addr"
200 #define INPUT_BCAST_ADDR_DEFAULT        "138.195.143.255"
201
202 /* Channels mode */
203 #define INPUT_NETWORK_CHANNEL_VAR       "vlc_channel"
204 #define INPUT_NETWORK_CHANNEL_DEFAULT   0
205
206 /*
207  * Channel method
208  */
209
210 /* Default network interface and environment variable */
211 #define INPUT_IFACE_VAR                 "vlc_iface"
212 #define INPUT_IFACE_DEFAULT             "eth0"
213
214 /* Default server and port */
215 #define INPUT_CHANNEL_SERVER_VAR           "vlc_channel_server"
216 #define INPUT_CHANNEL_SERVER_DEFAULT       "138.195.143.120"
217 #define INPUT_CHANNEL_PORT_VAR             "vlc_channel_port"
218 #define INPUT_CHANNEL_PORT_DEFAULT         6010
219
220 /* Delay between channel changes - this is required to avoid flooding the 
221  * channel server */
222 #define INPUT_CHANNEL_CHANGE_DELAY         (mtime_t)(5*CLOCK_FREQ)
223
224 /* Duration between the time we receive the data packet, and the time we will
225  * mark it to be presented */
226 #define DEFAULT_PTS_DELAY               (mtime_t)(.2*CLOCK_FREQ)
227
228 /* DVD defaults */
229 #define INPUT_DVD_DEVICE_VAR            "vlc_dvd_device"
230 #define INPUT_DVD_DEVICE_DEFAULT        "/dev/dvd"
231
232 #define INPUT_TITLE_VAR                 "vlc_input_title"
233 #define INPUT_CHAPTER_VAR               "vlc_input_chapter"
234 #define INPUT_ANGLE_VAR                 "vlc_input_angle"
235 #define INPUT_AUDIO_VAR                 "vlc_input_audio"
236 #define INPUT_CHANNEL_VAR               "vlc_input_channel"
237 #define INPUT_SUBTITLE_VAR              "vlc_input_subtitle"
238
239 /* VCD defaults */
240 #define INPUT_VCD_DEVICE_VAR            "vlc_vcd_device"
241 #define INPUT_VCD_DEVICE_DEFAULT        "/dev/cdrom"
242
243 /*****************************************************************************
244  * Audio configuration
245  *****************************************************************************/
246
247 /* Maximum number of audio output threads */
248 #define AOUT_MAX_THREADS                10
249
250 /* Environment variable containing the audio output method */
251 #define AOUT_METHOD_VAR                 "vlc_aout"
252 #define AOUT_METHOD_DEFAULT             "dsp"
253
254 /* Environment variable used to store dsp device name, and default value */
255 #define AOUT_DSP_VAR                    "vlc_dsp"
256 #define AOUT_DSP_DEFAULT                "/dev/dsp"
257
258 /* Default audio output format (AOUT_FMT_S16_NE = Native Endianess) */
259 #define AOUT_FORMAT_DEFAULT             AOUT_FMT_S16_NE
260 /* #define AOUT_FORMAT_DEFAULT          AOUT_FMT_S8 */
261 /* #define AOUT_FORMAT_DEFAULT          AOUT_FMT_U8 */
262 /* #define AOUT_FORMAT_DEFAULT          AOUT_FMT_S16_BE */
263 /* #define AOUT_FORMAT_DEFAULT          AOUT_FMT_S16_LE */
264 /* #define AOUT_FORMAT_DEFAULT          AOUT_FMT_U16_BE */
265 /* #define AOUT_FORMAT_DEFAULT          AOUT_FMT_U16_LE */
266
267 /* Environment variable for stereo, and default value */
268 #define AOUT_STEREO_VAR                 "vlc_stereo"
269 #define AOUT_STEREO_DEFAULT             1
270
271 /* Environment variable for spdif mode */
272 #define AOUT_SPDIF_VAR                  "vlc_spdif"
273 #define AOUT_SPDIF_DEFAULT              0
274
275 /* Environment variable containing the AC3 downmix method */
276 #define DOWNMIX_METHOD_VAR              "vlc_downmix"
277
278 /* Environment variable containing the AC3 IMDCT method */
279 #define IMDCT_METHOD_VAR                "vlc_imdct"
280
281 /* Volume */
282 #define VOLUME_DEFAULT                  512
283 #define VOLUME_STEP                     128
284 #define VOLUME_MAX                      1024
285
286 /* Environment variable for volume */
287 #define AOUT_VOLUME_VAR                 "vlc_volume"
288
289 /* Environment variable for output rate, and default value */
290 #define AOUT_RATE_VAR                   "vlc_audio_rate"
291 #define AOUT_RATE_DEFAULT               44100
292
293 /* Number of audio output frames contained in an audio output fifo.
294  * (AOUT_FIFO_SIZE + 1) must be a power of 2, in order to optimise the
295  * %(AOUT_FIFO_SIZE + 1) operation with an &AOUT_FIFO_SIZE.
296  * With 511 we have at least 511*384/2/48000=2 seconds of sound */
297 #define AOUT_FIFO_SIZE                  511
298
299 /* Maximum number of audio fifos. The value of AOUT_MAX_FIFOS should be a power
300  * of two, in order to optimize the '/AOUT_MAX_FIFOS' and '*AOUT_MAX_FIFOS'
301  * operations with '>>' and '<<' (gcc changes this at compilation-time) */
302 #define AOUT_MAX_FIFOS                  2
303
304 /* Duration (in microseconds) of an audio output buffer should be :
305  * - short, in order to be able to play a new song very quickly (especially a
306  *   song from the interface)
307  * - long, in order to perform the buffer calculations as few as possible */
308 #define AOUT_BUFFER_DURATION            100000
309
310 /* Environment variable for MPEG audio decoder */
311 #define ADEC_MPEG_VAR                   "vlc_mpeg_adec"
312
313 /*****************************************************************************
314  * Video configuration
315  *****************************************************************************/
316
317 /* Maximum number of video output threads */
318 #define VOUT_MAX_THREADS                10
319
320 /*
321  * Default settings for video output threads
322  */
323
324 /* Environment variable containing the display method */
325 #define VOUT_METHOD_VAR                 "vlc_vout"
326 #define VOUT_METHOD_DEFAULT             "x11"
327
328 /* Environment variable containing the display method */
329 #define VOUT_FILTER_VAR                 "vlc_filter"
330 #define VOUT_FILTER_DEFAULT             "x11"
331
332 /* Environment variable containing the motion compensation method */
333 #define MOTION_METHOD_VAR               "vlc_motion"
334
335 /* Environment variable containing the IDCT method */
336 #define IDCT_METHOD_VAR                 "vlc_idct"
337
338 /* Environment variable containing the YUV method */
339 #define YUV_METHOD_VAR                  "vlc_yuv"
340
341 /* Environment variable used in place of DISPLAY if available */
342 #define VOUT_DISPLAY_VAR                "vlc_display"
343
344 /* Default dimensions for display window - these dimensions are enough for the
345  * standard width and height broadcasted MPEG-2 streams or DVDs */
346 #define VOUT_WIDTH_VAR                  "vlc_width"
347 #define VOUT_WIDTH_DEFAULT              720
348 #define VOUT_HEIGHT_VAR                 "vlc_height"
349 #define VOUT_HEIGHT_DEFAULT             576
350 #define VOUT_DEPTH_VAR                  "vlc_depth"
351 #define VOUT_DEPTH_DEFAULT              15
352
353 /* Multiplier value for aspect ratio calculation */
354 #define VOUT_ASPECT_FACTOR              (2*2*2*2*2*2*2*3*3*3*5*5*5)
355
356 /* Maximum width of a scaled source picture - this should be relatively high,
357  * since higher stream values will result in no display at all. */
358 #define VOUT_MAX_WIDTH                  4096
359
360 /* Number of planes in a picture */
361 #define VOUT_MAX_PLANES                 5
362
363 /* Video heap size - remember that a decompressed picture is big
364  * (~1 Mbyte) before using huge values */
365 #define VOUT_MAX_PICTURES               8
366
367 /* Number of simultaneous subpictures */
368 #define VOUT_MAX_SUBPICTURES            8
369
370 /* Maximum number of active areas in a rendering buffer. Active areas are areas
371  * of the picture which need to be cleared before re-using the buffer. If a
372  * picture, including its many additions such as subtitles, additionnal user
373  * informations and interface, has too many active areas, some of them are
374  * joined. */
375 #define VOUT_MAX_AREAS                  5
376
377 /* Environment variable for grayscale output mode, and default value */
378 #define VOUT_GRAYSCALE_VAR              "vlc_grayscale"
379 #define VOUT_GRAYSCALE_DEFAULT          0
380
381 /* Environment variable for fullscreen mode, and default value */
382 #define VOUT_FULLSCREEN_VAR             "vlc_fullscreen"
383 #define VOUT_FULLSCREEN_DEFAULT         0
384
385 /* Environment variable for overlay mode, and default value */
386 #define VOUT_OVERLAY_VAR                "vlc_overlay"
387 #define VOUT_OVERLAY_DEFAULT            0
388
389 /* Default gamma */
390 #define VOUT_GAMMA_VAR                  "vlc_gamma"
391 #define VOUT_GAMMA_DEFAULT              0.
392
393 /* Default fonts */
394 #define VOUT_DEFAULT_FONT               "default8x9.psf"
395 #define VOUT_LARGE_FONT                 "default8x16.psf"
396
397 /* Statistics are displayed every n loops (=~ pictures) */
398 #define VOUT_STATS_NB_LOOPS             100
399
400 /*
401  * Time settings
402  */
403
404 /* Time during which the thread will sleep if it has nothing to
405  * display (in micro-seconds) */
406 #define VOUT_IDLE_SLEEP                 ((int)(0.020*CLOCK_FREQ))
407
408 /* Maximum lap of time allowed between the beginning of rendering and
409  * display. If, compared to the current date, the next image is too
410  * late, the thread will perform an idle loop. This time should be
411  * at least VOUT_IDLE_SLEEP plus the time required to render a few
412  * images, to avoid trashing of decoded images */
413 #define VOUT_DISPLAY_DELAY              ((int)(0.500*CLOCK_FREQ))
414
415 /* Delay (in microseconds) before an idle screen is displayed */
416 #define VOUT_IDLE_DELAY                 (5*CLOCK_FREQ)
417
418 /* Number of pictures required to computes the FPS rate */
419 #define VOUT_FPS_SAMPLES                20
420
421 /* Better be in advance when awakening than late... */
422 #define VOUT_MWAIT_TOLERANCE            ((int)(0.020*CLOCK_FREQ))
423
424 /* Time to sleep when waiting for a buffer (from vout or the video fifo).
425  * It should be approximately the time needed to perform a complete picture
426  * loop. Since it only happens when the video heap is full, it does not need
427  * to be too low, even if it blocks the decoder. */
428 #define VOUT_OUTMEM_SLEEP               ((int)(0.020*CLOCK_FREQ))
429
430 /* The default video output window title */
431 #define VOUT_TITLE                      "VideoLAN Client @VLC_VERSION@"
432
433 /* Environment variable for framebuffer device, and default value */
434 #define VOUT_FB_DEV_VAR                 "vlc_fb_dev"
435 #define VOUT_FB_DEV_DEFAULT             "/dev/fb0"
436
437 /* Environment variable for XVideo adaptor, and default value */
438 #define VOUT_XVADAPTOR_VAR              "vlc_xv_adaptor"
439
440 /*****************************************************************************
441  * Video parser configuration
442  *****************************************************************************/
443
444 #define VPAR_IDLE_SLEEP                 ((int)(0.010*CLOCK_FREQ))
445
446 /* Optimization level, from 0 to 2 - 1 is generally a good compromise. Remember
447  * that raising this level dramatically lengthens the compilation time. */
448 #ifdef RELEASE
449 #   define VPAR_OPTIM_LEVEL             2
450 #else
451 #   define VPAR_OPTIM_LEVEL             1
452 #endif
453
454 /* Maximum number of macroblocks in a picture. */
455 #define MAX_MB                          2048
456
457 /* The synchro variable name */
458 #define VPAR_SYNCHRO_VAR                "vlc_synchro"
459
460 /*****************************************************************************
461  * Video decoder configuration
462  *****************************************************************************/
463
464 #define VDEC_IDLE_SLEEP                 ((int)(0.100*CLOCK_FREQ))
465
466 /* Maximum range of values out of the IDCT + motion compensation. */
467 #define VDEC_CROPRANGE                  2048
468
469 /* Environment variable containing the SMP value. */
470 #define VDEC_SMP_VAR                   "vlc_smp"
471
472 /* No SMP by default, since it slows down things on non-smp machines. */
473 #define VDEC_SMP_DEFAULT                0
474
475 /* Nice increments for decoders -- necessary for x11 scheduling */
476 #define VDEC_NICE                       3
477
478 /*****************************************************************************
479  * Messages and console interfaces configuration
480  *****************************************************************************/
481
482 /* Maximal size of a message to be stored in the mesage queue,
483  * it is needed when vasprintf is not avalaible */
484 #define INTF_MAX_MSG_SIZE              512
485
486 /* Maximal size of the message queue - in case of overflow, all messages in the
487  * queue are printed by the calling thread */
488 #define INTF_MSG_QSIZE                  64
489
490 /* Interface warnig message level */
491 #define INTF_WARNING_VAR                "vlc_warning_level"
492 #define INTF_WARNING_DEFAULT            0
493
494 /* Define to enable messages queues - disabling messages queue can be useful
495  * when debugging, since it allows messages which would not be printed
496  * due to a crash to be printed anyway */
497 #ifndef DEBUG
498 #define INTF_MSG_QUEUE
499 #endif
500
501 /* Format of the header for debug messages. The arguments following this header
502  * are the file (char *), the function (char *) and the line (int) in which the
503  * message function was called */
504 #define INTF_MSG_DBG_FORMAT             "## %s:%s(),%i: "
505
506 /* Max number of arguments on a command line, including the function name */
507 #define INTF_MAX_ARGS                   20
508
509 /* Maximal size of a command line in a script */
510 #define INTF_MAX_CMD_SIZE               240
511
512 /* Number of memorized lines in console window text zone */
513 #define INTF_CONSOLE_MAX_TEXT           100
514
515 /* Maximal number of commands which can be saved in history list */
516 #define INTF_CONSOLE_MAX_HISTORY        20
517
518 /****************************************************************************
519  * Playlist defaults
520  ****************************************************************************/
521
522 /* Launch on start-up */
523 #define PLAYLIST_STARTUP_VAR            "vlc_playlist_on_start_up"
524 #define PLAYLIST_STARTUP_DEFAULT        0
525
526 /* Enqueue drag'n dropped item */
527 #define PLAYLIST_ENQUEUE_VAR            "vlc_playlist_enqueue"
528 #define PLAYLIST_ENQUEUE_DEFAULT        0
529
530 /* Loop on playlist end */
531 #define PLAYLIST_LOOP_VAR               "vlc_playlist_loop"
532 #define PLAYLIST_LOOP_DEFAULT           0
533
534 #endif