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
7 * Authors: Vincent Seguin <seguin@via.ecp.fr>
8 * Samuel Hocevar <sam@via.ecp.fr>
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.
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.
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 *****************************************************************************/
25 /* Conventions regarding names of symbols and variables
26 * ----------------------------------------------------
28 * - Symbols should begin with a prefix indicating in which module they are
29 * used, such as INTF_, VOUT_ or ADEC_.
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'
39 /*****************************************************************************
40 * General configuration
41 *****************************************************************************/
43 #define CLOCK_FREQ 1000000
46 /* Automagically spawn audio and video decoder threads */
49 /* When creating or destroying threads in blocking mode, delay to poll thread
51 #define THREAD_SLEEP ((int)(0.010*CLOCK_FREQ))
53 /* When a thread waits on a condition in debug mode, delay to wait before
54 * outputting an error message (in second) */
55 #define THREAD_COND_TIMEOUT 5
57 /* Environment variable containing the memcpy method */
58 #define MEMCPY_METHOD_VAR "vlc_memcpy"
64 #define MAX_PLUGIN_COUNT 32
66 /*****************************************************************************
67 * Interface configuration
68 *****************************************************************************/
70 /* Environment variable containing the display method */
71 #define INTF_METHOD_VAR "vlc_intf"
72 #define INTF_METHOD_DEFAULT "gtk"
74 /* Environment variable used to store startup script name and default value */
75 #define INTF_INIT_SCRIPT_VAR "vlcrc"
76 #define INTF_INIT_SCRIPT_DEFAULT ".vlcrc"
78 /* Environment variable used to store channels file and default value */
79 #define INTF_CHANNELS_VAR "vlc_channels"
80 #define INTF_CHANNELS_DEFAULT "vlc.channels"
82 /* Base delay in micro second for interface sleeps */
83 #define INTF_IDLE_SLEEP ((int)(0.050*CLOCK_FREQ))
85 /* Step for changing gamma, and minimum and maximum values */
86 #define INTF_GAMMA_STEP .1
87 #define INTF_GAMMA_LIMIT 3
89 /* Maximum number of channels */
90 #define INTF_MAX_CHANNELS 10
92 /* Default search path for interface file browser */
93 #define INTF_PATH_VAR "vlc_search_path"
94 #define INTF_PATH_DEFAULT ""
96 /*****************************************************************************
97 * Input thread configuration
98 *****************************************************************************/
100 /* Environment variable containing the input method */
101 #define INPUT_METHOD_VAR "vlc_input"
102 #define INPUT_METHOD_DEFAULT "ps"
105 #define INPUT_IDLE_SLEEP ((int)(0.100*CLOCK_FREQ))
108 * General limitations
111 /* Maximum number of input threads - this value is used exclusively by
112 * interface, and is in fact an interface limitation */
113 #define INPUT_MAX_THREADS 10
115 /* Maximum size of a data packet (128 kB) */
116 #define INPUT_MAX_PACKET_SIZE 131072
118 /* Maximum length of a pre-parsed chunk (4 MB) */
119 #define INPUT_PREPARSE_LENGTH 4194304
121 /* Maximum length of a hostname or source name */
122 #define INPUT_MAX_SOURCE_LENGTH 100
124 /* Maximum memory the input is allowed to use (20 MB) */
125 #define INPUT_MAX_ALLOCATION 20971520
127 /* Default network protocol */
128 #define INPUT_NETWORK_PROTOCOL_VAR "vlc_network_protocol"
129 #define INPUT_NETWORK_PROTOCOL_DEFAULT "ts"
131 /* Default input port */
132 #define INPUT_PORT_VAR "vlc_server_port"
133 #define INPUT_PORT_DEFAULT 1234
135 /* FIXME : Delete those ! */
136 /* Default remote server */
137 #define INPUT_SERVER_VAR "vlc_server"
138 #define INPUT_SERVER_DEFAULT "138.195.143.220"
141 #define INPUT_BROADCAST_VAR "vlc_broadcast"
142 #define INPUT_BROADCAST_DEFAULT 0
144 /* Default broadcast address */
145 #define INPUT_BCAST_ADDR_VAR "vlc_broadcast_addr"
146 #define INPUT_BCAST_ADDR_DEFAULT "138.195.143.255"
149 #define INPUT_NETWORK_CHANNEL_VAR "vlc_channel"
150 #define INPUT_NETWORK_CHANNEL_DEFAULT 0
156 /* Default network interface and environment variable */
157 #define INPUT_IFACE_VAR "vlc_iface"
158 #define INPUT_IFACE_DEFAULT "eth0"
160 /* Default server and port */
161 #define INPUT_CHANNEL_SERVER_VAR "vlc_channel_server"
162 #define INPUT_CHANNEL_SERVER_DEFAULT "138.195.143.120"
163 #define INPUT_CHANNEL_PORT_VAR "vlc_channel_port"
164 #define INPUT_CHANNEL_PORT_DEFAULT 6010
166 /* Delay between channel changes - this is required to avoid flooding the
168 #define INPUT_CHANNEL_CHANGE_DELAY (mtime_t)(5*CLOCK_FREQ)
170 /* Duration between the time we receive the data packet, and the time we will
171 * mark it to be presented */
172 #define DEFAULT_PTS_DELAY (mtime_t)(.2*CLOCK_FREQ)
175 #define INPUT_DVD_DEVICE_VAR "vlc_dvd_device"
177 #define INPUT_TITLE_VAR "vlc_input_title"
178 #define INPUT_CHAPTER_VAR "vlc_input_chapter"
179 #define INPUT_ANGLE_VAR "vlc_input_angle"
180 #define INPUT_AUDIO_VAR "vlc_input_audio"
181 #define INPUT_CHANNEL_VAR "vlc_input_channel"
182 #define INPUT_SUBTITLE_VAR "vlc_input_subtitle"
185 #define INPUT_VCD_DEVICE_VAR "vlc_vcd_device"
187 /*****************************************************************************
188 * Audio configuration
189 *****************************************************************************/
191 /* Maximum number of audio output threads */
192 #define AOUT_MAX_THREADS 10
194 /* Environment variable containing the audio output method */
195 #define AOUT_METHOD_VAR "vlc_aout"
196 #define AOUT_METHOD_DEFAULT "dsp"
198 /* Environment variable used to store dsp device name, and default value */
199 #define AOUT_DSP_VAR "vlc_dsp"
200 #define AOUT_DSP_DEFAULT "/dev/dsp"
202 /* Default audio output format (AOUT_FMT_S16_NE = Native Endianess) */
203 #define AOUT_FORMAT_DEFAULT AOUT_FMT_S16_NE
204 /* #define AOUT_FORMAT_DEFAULT AOUT_FMT_S8 */
205 /* #define AOUT_FORMAT_DEFAULT AOUT_FMT_U8 */
206 /* #define AOUT_FORMAT_DEFAULT AOUT_FMT_S16_BE */
207 /* #define AOUT_FORMAT_DEFAULT AOUT_FMT_S16_LE */
208 /* #define AOUT_FORMAT_DEFAULT AOUT_FMT_U16_BE */
209 /* #define AOUT_FORMAT_DEFAULT AOUT_FMT_U16_LE */
211 /* Environment variable for stereo, and default value */
212 #define AOUT_STEREO_VAR "vlc_stereo"
213 #define AOUT_STEREO_DEFAULT 1
215 /* Environment variable for spdif mode */
216 #define AOUT_SPDIF_VAR "vlc_spdif"
217 #define AOUT_SPDIF_DEFAULT 0
219 /* Environment variable containing the AC3 downmix method */
220 #define DOWNMIX_METHOD_VAR "vlc_downmix"
222 /* Environment variable containing the AC3 IMDCT method */
223 #define IMDCT_METHOD_VAR "vlc_imdct"
226 #define VOLUME_DEFAULT 512
227 #define VOLUME_STEP 128
228 #define VOLUME_MAX 1024
230 /* Environment variable for volume */
231 #define AOUT_VOLUME_VAR "vlc_volume"
233 /* Environment variable for output rate, and default value */
234 #define AOUT_RATE_VAR "vlc_audio_rate"
235 #define AOUT_RATE_DEFAULT 44100
237 /* Number of audio output frames contained in an audio output fifo.
238 * (AOUT_FIFO_SIZE + 1) must be a power of 2, in order to optimise the
239 * %(AOUT_FIFO_SIZE + 1) operation with an &AOUT_FIFO_SIZE.
240 * With 511 we have at least 511*384/2/48000=2 seconds of sound */
241 #define AOUT_FIFO_SIZE 511
243 /* Maximum number of audio fifos. The value of AOUT_MAX_FIFOS should be a power
244 * of two, in order to optimize the '/AOUT_MAX_FIFOS' and '*AOUT_MAX_FIFOS'
245 * operations with '>>' and '<<' (gcc changes this at compilation-time) */
246 #define AOUT_MAX_FIFOS 2
248 /* Duration (in microseconds) of an audio output buffer should be :
249 * - short, in order to be able to play a new song very quickly (especially a
250 * song from the interface)
251 * - long, in order to perform the buffer calculations as few as possible */
252 #define AOUT_BUFFER_DURATION 100000
254 /* Environment variable for audio decoders */
255 #define ADEC_MPEG_VAR "vlc_mpeg_adec"
256 #define ADEC_AC3_VAR "vlc_ac3_adec"
258 /*****************************************************************************
259 * Video configuration
260 *****************************************************************************/
262 /* Maximum number of video output threads */
263 #define VOUT_MAX_THREADS 256
266 * Default settings for video output threads
269 /* Environment variable containing the display method */
270 #define VOUT_METHOD_VAR "vlc_vout"
271 #define VOUT_METHOD_DEFAULT "x11"
273 /* Environment variable containing the display method */
274 #define VOUT_FILTER_VAR "vlc_filter"
275 #define VOUT_FILTER_DEFAULT "x11"
277 /* Environment variable containing the motion compensation method */
278 #define MOTION_METHOD_VAR "vlc_motion"
280 /* Environment variable containing the IDCT method */
281 #define IDCT_METHOD_VAR "vlc_idct"
283 /* Environment variable containing the YUV method */
284 #define YUV_METHOD_VAR "vlc_yuv"
286 /* Environment variable used in place of DISPLAY if available */
287 #define VOUT_DISPLAY_VAR "vlc_display"
289 /* Default dimensions for display window - these dimensions are enough for the
290 * standard width and height broadcasted MPEG-2 streams or DVDs */
291 #define VOUT_WIDTH_VAR "vlc_width"
292 #define VOUT_WIDTH_DEFAULT 720
293 #define VOUT_HEIGHT_VAR "vlc_height"
294 #define VOUT_HEIGHT_DEFAULT 576
295 #define VOUT_DEPTH_VAR "vlc_depth"
296 #define VOUT_DEPTH_DEFAULT 15
298 /* Default SPU margin is -1, which means we don't force their position */
299 #define VOUT_SPUMARGIN_VAR "vlc_spumargin"
300 #define VOUT_SPUMARGIN_DEFAULT -1
302 /* Multiplier value for aspect ratio calculation (2^7 * 3^3 * 5^3) */
303 #define VOUT_ASPECT_FACTOR 432000
305 /* Maximum width of a scaled source picture - this should be relatively high,
306 * since higher stream values will result in no display at all. */
307 #define VOUT_MAX_WIDTH 4096
309 /* Number of planes in a picture */
310 #define VOUT_MAX_PLANES 5
312 /* Video heap size - remember that a decompressed picture is big
313 * (~1 Mbyte) before using huge values */
314 #define VOUT_MAX_PICTURES 8
316 /* Number of simultaneous subpictures */
317 #define VOUT_MAX_SUBPICTURES 8
319 /* Maximum number of active areas in a rendering buffer. Active areas are areas
320 * of the picture which need to be cleared before re-using the buffer. If a
321 * picture, including its many additions such as subtitles, additionnal user
322 * informations and interface, has too many active areas, some of them are
324 #define VOUT_MAX_AREAS 5
326 /* Environment variable for grayscale output mode, and default value */
327 #define VOUT_GRAYSCALE_VAR "vlc_grayscale"
328 #define VOUT_GRAYSCALE_DEFAULT 0
330 /* Environment variable for fullscreen mode, and default value */
331 #define VOUT_FULLSCREEN_VAR "vlc_fullscreen"
332 #define VOUT_FULLSCREEN_DEFAULT 0
334 /* Environment variable for overlay mode, and default value */
335 #define VOUT_NOOVERLAY_VAR "vlc_nooverlay"
336 #define VOUT_NOOVERLAY_DEFAULT 0
339 #define VOUT_GAMMA_VAR "vlc_gamma"
340 #define VOUT_GAMMA_DEFAULT 0.
343 #define VOUT_DEFAULT_FONT "default8x9.psf"
344 #define VOUT_LARGE_FONT "default8x16.psf"
346 /* Statistics are displayed every n loops (=~ pictures) */
347 #define VOUT_STATS_NB_LOOPS 100
353 /* Time during which the thread will sleep if it has nothing to
354 * display (in micro-seconds) */
355 #define VOUT_IDLE_SLEEP ((int)(0.020*CLOCK_FREQ))
357 /* Maximum lap of time allowed between the beginning of rendering and
358 * display. If, compared to the current date, the next image is too
359 * late, the thread will perform an idle loop. This time should be
360 * at least VOUT_IDLE_SLEEP plus the time required to render a few
361 * images, to avoid trashing of decoded images */
362 #define VOUT_DISPLAY_DELAY ((int)(0.500*CLOCK_FREQ))
364 /* Delay (in microseconds) before an idle screen is displayed */
365 #define VOUT_IDLE_DELAY (5*CLOCK_FREQ)
367 /* Number of pictures required to computes the FPS rate */
368 #define VOUT_FPS_SAMPLES 20
370 /* Better be in advance when awakening than late... */
371 #define VOUT_MWAIT_TOLERANCE ((int)(0.020*CLOCK_FREQ))
373 /* Time to sleep when waiting for a buffer (from vout or the video fifo).
374 * It should be approximately the time needed to perform a complete picture
375 * loop. Since it only happens when the video heap is full, it does not need
376 * to be too low, even if it blocks the decoder. */
377 #define VOUT_OUTMEM_SLEEP ((int)(0.020*CLOCK_FREQ))
379 /* The default video output window title */
380 #define VOUT_TITLE "VideoLAN Client " VERSION
382 /* Environment variable for framebuffer device, and default value */
383 #define VOUT_FB_DEV_VAR "vlc_fb_dev"
384 #define VOUT_FB_DEV_DEFAULT "/dev/fb0"
386 /* Environment variable for XVideo adaptor, and default value */
387 #define VOUT_XVADAPTOR_VAR "vlc_xv_adaptor"
389 /*****************************************************************************
390 * Video parser configuration
391 *****************************************************************************/
393 #define VPAR_IDLE_SLEEP ((int)(0.010*CLOCK_FREQ))
395 /* Optimization level, from 0 to 2 - 1 is generally a good compromise. Remember
396 * that raising this level dramatically lengthens the compilation time. */
397 #if defined( HAVE_RELEASE ) || defined( __pentiumpro__ )
398 # define VPAR_OPTIM_LEVEL 2
400 # define VPAR_OPTIM_LEVEL 1
403 /* Maximum number of macroblocks in a picture. */
406 /* The synchro variable name */
407 #define VPAR_SYNCHRO_VAR "vlc_synchro"
409 /*****************************************************************************
410 * Video decoder configuration
411 *****************************************************************************/
413 #define VDEC_IDLE_SLEEP ((int)(0.100*CLOCK_FREQ))
415 /* Maximum range of values out of the IDCT + motion compensation. */
416 #define VDEC_CROPRANGE 2048
418 /* Environment variable containing the SMP value. */
419 #define VDEC_SMP_VAR "vlc_smp"
421 /* No SMP by default, since it slows down things on non-smp machines. */
422 #define VDEC_SMP_DEFAULT 0
424 /* Nice increments for decoders -- necessary for x11 scheduling */
427 /*****************************************************************************
428 * Messages and console interfaces configuration
429 *****************************************************************************/
431 /* Maximal size of a message to be stored in the mesage queue,
432 * it is needed when vasprintf is not avalaible */
433 #define INTF_MAX_MSG_SIZE 512
435 /* Maximal size of the message queue - in case of overflow, all messages in the
436 * queue are printed, but not sent to the threads */
437 #define INTF_MSG_QSIZE 256
439 /* Interface warnig message level */
440 #define INTF_WARNING_VAR "vlc_warning_level"
441 #define INTF_WARNING_DEFAULT 0
443 /****************************************************************************
445 ****************************************************************************/
447 /* Launch on start-up */
448 #define PLAYLIST_STARTUP_VAR "vlc_playlist_on_start_up"
449 #define PLAYLIST_STARTUP_DEFAULT 0
451 /* Enqueue drag'n dropped item */
452 #define PLAYLIST_ENQUEUE_VAR "vlc_playlist_enqueue"
453 #define PLAYLIST_ENQUEUE_DEFAULT 0
455 /* Loop on playlist end */
456 #define PLAYLIST_LOOP_VAR "vlc_playlist_loop"
457 #define PLAYLIST_LOOP_DEFAULT 0