1 /*****************************************************************************
2 * config.h: limits and configuration
3 * Defines all compilation-time configuration constants and size limits
4 *****************************************************************************
5 * Copyright (C) 1999, 2000 VideoLAN
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
19 * You should have received a copy of the GNU General Public
20 * License along with this program; if not, write to the
21 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22 * Boston, MA 02111-1307, 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 parameters
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 /*****************************************************************************
41 *****************************************************************************/
43 /* Program version and copyright message */
44 #define COPYRIGHT_MESSAGE "VideoLAN Client v" PROGRAM_VERSION " - (c)1999-2000 VideoLAN"
45 #define VERSION_MESSAGE "VideoLAN Client - (c)1999-2000 VideoLAN\n" \
46 "version " PROGRAM_VERSION " ( " PROGRAM_BUILD " )\n" \
47 "compilation options: " PROGRAM_OPTIONS
49 /*****************************************************************************
50 * General compilation options
51 *****************************************************************************/
53 /* Define for DVB support - Note that some extensions or restrictions may be
54 * incompatible with native MPEG2 streams */
55 //#define DVB_EXTENSIONS
56 //#define DVB_RESTRICTIONS
58 /* Define to disable some obscure heuristics behind the video_parser and the
59 * video_decoder that improve performance but are not fully MPEG2 compliant
60 * and might cause problems with some very weird streams. */
61 //#define MPEG2_COMPLIANT
63 /* Define for profiling and statistics support - such informations, like FPS
64 * or pictures count won't be available if it not set */
67 /* Define for unthreaded version of the program FIXME: not yet implemented ??*/
70 /*****************************************************************************
71 * Debugging options - define or undefine symbols
72 *****************************************************************************/
74 /* General debugging support, which depends of the DEBUG define, is determined
77 /* Modules specific debugging - this will produce a lot of output, but can be
78 * usefull to track a bug */
84 /* Debugging log file - if defined, a file can be used to store all messages. If
85 * DEBUG_LOG_ONLY is defined, debug messages will only be printed to the log and
86 * will not appear on the screen */
87 #define DEBUG_LOG "vlc-debug.log"
88 #define DEBUG_LOG_ONLY
92 /*****************************************************************************
93 * General configuration
94 *****************************************************************************/
96 #define CLOCK_FREQ 1000000
99 /* Automagically spawn input, audio and video threads ? */
103 /* When creating or destroying threads in blocking mode, delay to poll thread
105 #define THREAD_SLEEP ((int)(0.010*CLOCK_FREQ))
108 * Decoders FIFO configuration
111 /* Size of the FIFO. FIFO_SIZE+1 must be a multiple of 2 */
112 #define FIFO_SIZE 1023
115 /*****************************************************************************
116 * Interface configuration
117 *****************************************************************************/
119 /* Environment variable used to store startup script name and default value */
120 #define INTF_INIT_SCRIPT_VAR "vlc_init"
121 #define INTF_INIT_SCRIPT_DEFAULT "vlc.init"
123 /* Environment variable used to store channels file and default value */
124 #define INTF_CHANNELS_VAR "vlc_channels"
125 #define INTF_CHANNELS_DEFAULT "vlc.channels"
127 /* Base delay in micro second for interface sleeps */
128 #define INTF_IDLE_SLEEP ((int)(0.100*CLOCK_FREQ))
130 /* Step for changing gamma, and minimum and maximum values */
131 #define INTF_GAMMA_STEP .1
132 #define INTF_GAMMA_LIMIT 3
138 /* Title of the X11 window */
139 #define VOUT_TITLE "VideoLAN Client"
141 /*****************************************************************************
142 * Input thread configuration
143 *****************************************************************************/
146 #define INPUT_IDLE_SLEEP ((int)(0.100*CLOCK_FREQ))
149 * General limitations
152 /* Broadcast address, in case of a broadcasted stream */
153 #define INPUT_BCAST_ADDR "138.195.143.255"
155 /* Maximum number of input threads - this value is used exclusively by
156 * interface, and is in fact an interface limitation */
157 #define INPUT_MAX_THREADS 10
159 /* Maximum number of programs definitions in a TS stream */
160 #define INPUT_MAX_PGRM 10
162 /* Maximum number of ES definitions in a TS stream */
163 #define INPUT_MAX_ES 10
165 /* Maximum number of ES in a single program */
166 #define INPUT_MAX_PROGRAM_ES 10
168 /* Maximum number of selected ES in an input thread */
169 #define INPUT_MAX_SELECTED_ES 10
171 /* Maximum number of TS packets in the client at any time
172 * INPUT_MAX_TS + 1 must be a power of 2, to optimize the %(INPUT_MAX_TS+1)
173 * operation with a &INPUT_MAX_TS in the case of a fifo netlist.
174 * It should be > number of fifos * FIFO_SIZE to avoid input deadlock. */
175 #define INPUT_MAX_TS 32767 /* INPUT_MAX_TS + 1 = 2^15 */
177 /* Same thing with PES packets */
178 #define INPUT_MAX_PES 16383
180 /* Maximum number of TS packets we read from the socket in one readv().
181 * Since you can't put more than 7 TS packets in an Ethernet frame,
182 * the maximum value is 7. This number should also limit the stream server,
183 * otherwise any supplementary packet is lost. */
184 #define INPUT_TS_READ_ONCE 7
186 /* Use a LIFO or FIFO for TS netlist ? */
187 #undef INPUT_LIFO_TS_NETLIST
189 /* Use a LIFO or FIFO for PES netlist ? */
190 #undef INPUT_LIFO_PES_NETLIST
192 /* Maximum length of a hostname or source name */
193 #define INPUT_MAX_SOURCE_LENGTH 100
195 /* Default remote server */
196 #define INPUT_SERVER_VAR "vlc_server"
197 #define INPUT_SERVER_DEFAULT "138.195.143.220"
199 /* Default input port */
200 #define INPUT_PORT_VAR "vlc_server_port"
201 #define INPUT_PORT_DEFAULT 1234
207 /* Default network interface and environment variable */
208 #define INPUT_IFACE_VAR "vlc_iface"
209 #define INPUT_IFACE_DEFAULT "eth0"
211 /* Default server and port */
212 #define INPUT_VLAN_SERVER_VAR "vlc_vlan_server"
213 #define INPUT_VLAN_SERVER_DEFAULT "138.195.140.31"
214 #define INPUT_VLAN_PORT_VAR "vlc_vlan_port"
215 #define INPUT_VLAN_PORT_DEFAULT 6010
217 /* Delay between vlan changes - this is required to avoid flooding the VLAN
219 #define INPUT_VLAN_CHANGE_DELAY (5*CLOCK_FREQ)
221 /* Duration between the time we receive the TS packet, and the time we will
222 * mark it to be presented */
223 #define INPUT_PTS_DELAY (2*CLOCK_FREQ)
225 /*****************************************************************************
226 * Audio configuration
227 *****************************************************************************/
229 /* Environment variable containing the audio output method */
230 #define AOUT_METHOD_VAR "vlc_aout"
232 /* The fallback method */
233 #define AOUT_DEFAULT_METHOD "dsp"
235 /* Environment variable used to store dsp device name, and default value */
236 #define AOUT_DSP_VAR "vlc_dsp"
237 #define AOUT_DSP_DEFAULT "/dev/dsp"
239 /* Environment variable for stereo, and default value */
240 #define AOUT_STEREO_VAR "vlc_stereo"
241 #define AOUT_STEREO_DEFAULT 1
243 /* Environment variable for output rate, and default value */
244 #define AOUT_RATE_VAR "vlc_audio_rate"
245 #define AOUT_RATE_DEFAULT 44100
247 /*****************************************************************************
248 * Video configuration
249 *****************************************************************************/
252 * Default settings for video output threads
255 /* Environment variable containing the display method */
256 #define VOUT_METHOD_VAR "vlc_vout"
258 /* The fallback method */
259 #define VOUT_DEFAULT_METHOD "x11"
261 /* Environment variable used in place of DISPLAY if available */
262 #define VOUT_DISPLAY_VAR "vlc_display"
264 /* Default dimensions for display window - these dimensions are enough for the
265 * standard width and height broadcasted MPEG-2 streams */
266 #define VOUT_WIDTH_VAR "vlc_width"
267 #define VOUT_HEIGHT_VAR "vlc_height"
268 #define VOUT_WIDTH_DEFAULT 640
269 #define VOUT_HEIGHT_DEFAULT 480
271 /* Maximum width of a scaled source picture - this should be relatively high,
272 * since higher stream values will result in no display at all. */
273 #define VOUT_MAX_WIDTH 4096
275 /* Video heap size - remember that a decompressed picture is big
276 * (~1 Mbyte) before using huge values */
277 #define VOUT_MAX_PICTURES 10
279 /* Maximum number of active areas in a rendering buffer. Active areas are areas
280 * of the picture which need to be cleared before re-using the buffer. If a
281 * picture, including its many additions such as subtitles, additionnal user
282 * informations and interface, has too many active areas, some of them are
284 #define VOUT_MAX_AREAS 5
286 /* Environment variable for grayscale output mode, and default value */
287 #define VOUT_GRAYSCALE_VAR "vlc_grayscale"
288 #define VOUT_GRAYSCALE_DEFAULT 0
291 #define VOUT_GAMMA 0.
294 #define VOUT_DEFAULT_FONT "Resources/default8x9.psf"
295 #define VOUT_LARGE_FONT "Resources/default8x16.psf"
301 /* Time during which the thread will sleep if it has nothing to
302 * display (in micro-seconds) */
303 #define VOUT_IDLE_SLEEP ((int)(0.020*CLOCK_FREQ))
305 /* Maximum lap of time allowed between the beginning of rendering and
306 * display. If, compared to the current date, the next image is too
307 * late, the thread will perform an idle loop. This time should be
308 * at least VOUT_IDLE_SLEEP plus the time required to render a few
309 * images, to avoid trashing of decoded images */
310 #define VOUT_DISPLAY_DELAY ((int)(0.500*CLOCK_FREQ))
312 /* Delay (in microseconds) before an idle screen is displayed */
313 #define VOUT_IDLE_DELAY (5*CLOCK_FREQ)
315 /* Number of pictures required to computes the FPS rate */
316 #define VOUT_FPS_SAMPLES 20
319 * Framebuffer settings
322 /* Environment variable for framebuffer device, and default value */
323 #define VOUT_FB_DEV_VAR "vlc_fb_dev"
324 #define VOUT_FB_DEV_DEFAULT "/dev/fb0"
326 /*****************************************************************************
327 * Video parser configuration
328 *****************************************************************************/
330 #define VPAR_IDLE_SLEEP ((int)(0.010*CLOCK_FREQ))
332 /* Time to sleep when waiting for a buffer (from vout or the video fifo).
333 * It should be approximately the time needed to perform a complete picture
334 * loop. Since it only happens when the video heap is full, it does not need
335 * to be too low, even if it blocks the decoder. */
336 #define VPAR_OUTMEM_SLEEP ((int)(0.050*CLOCK_FREQ))
338 /* Optimization level, from 0 to 2 - 1 is generally a good compromise. Remember
339 * that raising this level dramatically lengthens the compilation time. */
340 #define VPAR_OPTIM_LEVEL 1
342 /* The following directives only apply if you define VDEC_SMP below. */
344 /* Number of macroblock buffers available. It should be always greater than
345 * twice the number of macroblocks in a picture. VFIFO_SIZE + 1 should also
346 * be a power of two. */
347 #define VFIFO_SIZE 8191
349 /* Maximum number of macroblocks in a picture. */
352 /*****************************************************************************
353 * Video decoder configuration
354 *****************************************************************************/
358 #define VDEC_IDLE_SLEEP ((int)(0.100*CLOCK_FREQ))
360 /* Number of video_decoder threads to launch on startup of the video_parser.
361 * It should always be less than half the number of macroblocks of a
362 * picture. Only available if you defined VDEC_SMP above. */
365 /* Maximum range of values out of the IDCT + motion compensation. */
366 #define VDEC_CROPRANGE 2048
368 /*****************************************************************************
369 * Generic decoder configuration
370 *****************************************************************************/
372 #define GDEC_IDLE_SLEEP ((int)(0.100*CLOCK_FREQ))
374 /*****************************************************************************
375 * Messages and console interfaces configuration
376 *****************************************************************************/
378 /* Maximal size of the message queue - in case of overflow, all messages in the
379 * queue are printed by the calling thread */
380 #define INTF_MSG_QSIZE 64
382 /* Define to enable messages queues - disabling messages queue can be usefull
383 * when debugging, since it allows messages which would not otherwise be printed,
384 * due to a crash, to be printed anyway */
386 #define INTF_MSG_QUEUE
389 /* Format of the header for debug messages. The arguments following this header
390 * are the file (char *), the function (char *) and the line (int) in which the
391 * message function was called */
392 #define INTF_MSG_DBG_FORMAT "## %s:%s(),%i: "
394 /* Maximal number of arguments on a command line, including the function name */
395 #define INTF_MAX_ARGS 20
397 /* Maximal size of a command line in a script */
398 #define INTF_MAX_CMD_SIZE 240
400 /* Number of memorized lines in console window text zone */
401 #define INTF_CONSOLE_MAX_TEXT 100
403 /* Maximal number of commands which can be saved in history list */
404 #define INTF_CONSOLE_MAX_HISTORY 20
406 /*****************************************************************************
407 * Synchro configuration
408 *****************************************************************************/
410 #define VOUT_SYNCHRO_LEVEL_START 5
411 #define VOUT_SYNCHRO_LEVEL_MAX 15
412 #define VOUT_SYNCHRO_HEAP_IDEAL_SIZE 5