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 - version " PROGRAM_VERSION \
45 " " PROGRAM_CODENAME " - (c)1996-2000 VideoLAN"
47 /*****************************************************************************
48 * General compilation options
49 *****************************************************************************/
51 /* Define for DVB support - Note that some extensions or restrictions may be
52 * incompatible with native MPEG2 streams */
53 //#define DVB_EXTENSIONS
54 //#define DVB_RESTRICTIONS
56 /* Define to disable some obscure heuristics behind the video_parser and the
57 * video_decoder that improve performance but are not fully MPEG2 compliant
58 * and might cause problems with some very weird streams. */
59 //#define MPEG2_COMPLIANT
61 /* Define for profiling and statistics support - such informations, like FPS
62 * or pictures count won't be available if it not set */
65 /* Define for unthreaded version of the program FIXME: not yet implemented ??*/
68 /*****************************************************************************
69 * Debugging options - define or undefine symbols
70 *****************************************************************************/
72 /* General debugging support, which depends of the DEBUG define, is determined
75 /* Modules specific debugging - this will produce a lot of output, but can be
76 * usefull to track a bug */
82 /* Debugging log file - if defined, a file can be used to store all messages. If
83 * DEBUG_LOG_ONLY is defined, debug messages will only be printed to the log and
84 * will not appear on the screen */
85 #define DEBUG_LOG "vlc-debug.log"
86 #define DEBUG_LOG_ONLY
90 /*****************************************************************************
91 * General configuration
92 *****************************************************************************/
94 #define CLOCK_FREQ 1000000
97 /* Automagically spawn input, audio and video threads ? */
101 /* When creating or destroying threads in blocking mode, delay to poll thread
103 #define THREAD_SLEEP ((int)(0.010*CLOCK_FREQ))
106 * Decoders FIFO configuration
109 /* Size of the FIFO. FIFO_SIZE+1 must be a multiple of 2 */
110 #define FIFO_SIZE 1023
113 /*****************************************************************************
114 * Interface configuration
115 *****************************************************************************/
117 /* Environment variable used to store startup script name and default value */
118 #define INTF_INIT_SCRIPT_VAR "vlc_init"
119 #define INTF_INIT_SCRIPT_DEFAULT "vlc.init"
121 /* Environment variable used to store channels file and default value */
122 #define INTF_CHANNELS_VAR "vlc_channels"
123 #define INTF_CHANNELS_DEFAULT "vlc.channels"
125 /* Base delay in micro second for interface sleeps */
126 #define INTF_IDLE_SLEEP ((int)(0.100*CLOCK_FREQ))
128 /* Step for changing gamma, and minimum and maximum values */
129 #define INTF_GAMMA_STEP .1
130 #define INTF_GAMMA_LIMIT 3
136 /* Title of the X11 window */
137 #define VOUT_TITLE "VideoLAN Client"
139 /*****************************************************************************
140 * Input thread configuration
141 *****************************************************************************/
144 #define INPUT_IDLE_SLEEP ((int)(0.100*CLOCK_FREQ))
147 * General limitations
150 /* Broadcast address, in case of a broadcasted stream */
151 #define INPUT_BCAST_ADDR "138.195.143.255"
153 /* Maximum number of input threads - this value is used exclusively by
154 * interface, and is in fact an interface limitation */
155 #define INPUT_MAX_THREADS 10
157 /* Maximum number of programs definitions in a TS stream */
158 #define INPUT_MAX_PGRM 10
160 /* Maximum number of ES definitions in a TS stream */
161 #define INPUT_MAX_ES 10
163 /* Maximum number of ES in a single program */
164 #define INPUT_MAX_PROGRAM_ES 10
166 /* Maximum number of selected ES in an input thread */
167 #define INPUT_MAX_SELECTED_ES 10
169 /* Maximum number of TS packets in the client at any time
170 * INPUT_MAX_TS + 1 must be a power of 2, to optimize the %(INPUT_MAX_TS+1)
171 * operation with a &INPUT_MAX_TS in the case of a fifo netlist.
172 * It should be > number of fifos * FIFO_SIZE to avoid input deadlock. */
173 #define INPUT_MAX_TS 32767 /* INPUT_MAX_TS + 1 = 2^15 */
175 /* Same thing with PES packets */
176 #define INPUT_MAX_PES 16383
178 /* Maximum number of TS packets we read from the socket in one readv().
179 * Since you can't put more than 7 TS packets in an Ethernet frame,
180 * the maximum value is 7. This number should also limit the stream server,
181 * otherwise any supplementary packet is lost. */
182 #define INPUT_TS_READ_ONCE 7
184 /* Use a LIFO or FIFO for TS netlist ? */
185 #undef INPUT_LIFO_TS_NETLIST
187 /* Use a LIFO or FIFO for PES netlist ? */
188 #undef INPUT_LIFO_PES_NETLIST
190 /* Maximum length of a hostname or source name */
191 #define INPUT_MAX_SOURCE_LENGTH 100
193 /* Default remote server */
194 #define INPUT_SERVER_VAR "vlc_server"
195 #define INPUT_SERVER_DEFAULT "138.195.143.220"
197 /* Default input port */
198 #define INPUT_PORT_VAR "vlc_server_port"
199 #define INPUT_PORT_DEFAULT 1234
205 /* Default network interface and environment variable */
206 #define INPUT_IFACE_VAR "vlc_iface"
207 #define INPUT_IFACE_DEFAULT "eth0"
209 /* Default server and port */
210 #define INPUT_VLAN_SERVER_VAR "vlc_vlan_server"
211 #define INPUT_VLAN_SERVER_DEFAULT "138.195.140.31"
212 #define INPUT_VLAN_PORT_VAR "vlc_vlan_port"
213 #define INPUT_VLAN_PORT_DEFAULT 6010
215 /* Delay between vlan changes - this is required to avoid flooding the VLAN
217 #define INPUT_VLAN_CHANGE_DELAY (5*CLOCK_FREQ)
219 /* Duration between the time we receive the TS packet, and the time we will
220 * mark it to be presented */
221 #define INPUT_PTS_DELAY (2*CLOCK_FREQ)
223 /*****************************************************************************
224 * Audio configuration
225 *****************************************************************************/
227 /* Environment variable containing the audio output method */
228 #define AOUT_METHOD_VAR "vlc_aout"
230 /* The fallback method */
231 #define AOUT_DEFAULT_METHOD "dsp"
233 /* Environment variable used to store dsp device name, and default value */
234 #define AOUT_DSP_VAR "vlc_dsp"
235 #define AOUT_DSP_DEFAULT "/dev/dsp"
237 /* Environment variable for stereo, and default value */
238 #define AOUT_STEREO_VAR "vlc_stereo"
239 #define AOUT_STEREO_DEFAULT 1
241 /* Environment variable for output rate, and default value */
242 #define AOUT_RATE_VAR "vlc_audio_rate"
243 #define AOUT_RATE_DEFAULT 44100
245 /*****************************************************************************
246 * Video configuration
247 *****************************************************************************/
250 * Default settings for video output threads
253 /* Environment variable containing the display method */
254 #define VOUT_METHOD_VAR "vlc_vout"
256 /* The fallback method */
257 #define VOUT_DEFAULT_METHOD "x11"
259 /* Environment variable used in place of DISPLAY if available */
260 #define VOUT_DISPLAY_VAR "vlc_display"
262 /* Default dimensions for display window - these dimensions are enough for the
263 * standard width and height broadcasted MPEG-2 streams */
264 #define VOUT_WIDTH_VAR "vlc_width"
265 #define VOUT_HEIGHT_VAR "vlc_height"
266 #define VOUT_WIDTH_DEFAULT 640
267 #define VOUT_HEIGHT_DEFAULT 480
269 /* Maximum width of a scaled source picture - this should be relatively high,
270 * since higher stream values will result in no display at all. */
271 #define VOUT_MAX_WIDTH 4096
273 /* Video heap size - remember that a decompressed picture is big
274 * (~1 Mbyte) before using huge values */
275 #define VOUT_MAX_PICTURES 10
277 /* Maximum number of active areas in a rendering buffer. Active areas are areas
278 * of the picture which need to be cleared before re-using the buffer. If a
279 * picture, including its many additions such as subtitles, additionnal user
280 * informations and interface, has too many active areas, some of them are
282 #define VOUT_MAX_AREAS 5
284 /* Environment variable for grayscale output mode, and default value */
285 #define VOUT_GRAYSCALE_VAR "vlc_grayscale"
286 #define VOUT_GRAYSCALE_DEFAULT 0
289 #define VOUT_GAMMA 0.
292 #define VOUT_DEFAULT_FONT "Resources/default8x9.psf"
293 #define VOUT_LARGE_FONT "Resources/default8x16.psf"
299 /* Time during which the thread will sleep if it has nothing to
300 * display (in micro-seconds) */
301 #define VOUT_IDLE_SLEEP ((int)(0.020*CLOCK_FREQ))
303 /* Maximum lap of time allowed between the beginning of rendering and
304 * display. If, compared to the current date, the next image is too
305 * late, the thread will perform an idle loop. This time should be
306 * at least VOUT_IDLE_SLEEP plus the time required to render a few
307 * images, to avoid trashing of decoded images */
308 #define VOUT_DISPLAY_DELAY ((int)(0.500*CLOCK_FREQ))
310 /* Delay (in microseconds) before an idle screen is displayed */
311 #define VOUT_IDLE_DELAY (5*CLOCK_FREQ)
313 /* Number of pictures required to computes the FPS rate */
314 #define VOUT_FPS_SAMPLES 20
317 * Framebuffer settings
320 /* Environment variable for framebuffer device, and default value */
321 #define VOUT_FB_DEV_VAR "vlc_fb_dev"
322 #define VOUT_FB_DEV_DEFAULT "/dev/fb0"
324 /*****************************************************************************
325 * Video parser configuration
326 *****************************************************************************/
328 #define VPAR_IDLE_SLEEP ((int)(0.010*CLOCK_FREQ))
330 /* Time to sleep when waiting for a buffer (from vout or the video fifo).
331 * It should be approximately the time needed to perform a complete picture
332 * loop. Since it only happens when the video heap is full, it does not need
333 * to be too low, even if it blocks the decoder. */
334 #define VPAR_OUTMEM_SLEEP ((int)(0.050*CLOCK_FREQ))
336 /* Optimization level, from 0 to 2 - 1 is generally a good compromise. Remember
337 * that raising this level dramatically lengthens the compilation time. */
338 #define VPAR_OPTIM_LEVEL 1
340 /* The following directives only apply if you define VDEC_SMP below. */
342 /* Number of macroblock buffers available. It should be always greater than
343 * twice the number of macroblocks in a picture. VFIFO_SIZE + 1 should also
344 * be a power of two. */
345 #define VFIFO_SIZE 8191
347 /* Maximum number of macroblocks in a picture. */
350 /*****************************************************************************
351 * Video decoder configuration
352 *****************************************************************************/
356 #define VDEC_IDLE_SLEEP ((int)(0.100*CLOCK_FREQ))
358 /* Number of video_decoder threads to launch on startup of the video_parser.
359 * It should always be less than half the number of macroblocks of a
360 * picture. Only available if you defined VDEC_SMP above. */
363 /* Maximum range of values out of the IDCT + motion compensation. */
364 #define VDEC_CROPRANGE 2048
366 /*****************************************************************************
367 * Generic decoder configuration
368 *****************************************************************************/
370 #define GDEC_IDLE_SLEEP ((int)(0.100*CLOCK_FREQ))
372 /*****************************************************************************
373 * Messages and console interfaces configuration
374 *****************************************************************************/
376 /* Maximal size of the message queue - in case of overflow, all messages in the
377 * queue are printed by the calling thread */
378 #define INTF_MSG_QSIZE 64
380 /* Define to enable messages queues - disabling messages queue can be usefull
381 * when debugging, since it allows messages which would not otherwise be printed,
382 * due to a crash, to be printed anyway */
384 #define INTF_MSG_QUEUE
387 /* Format of the header for debug messages. The arguments following this header
388 * are the file (char *), the function (char *) and the line (int) in which the
389 * message function was called */
390 #define INTF_MSG_DBG_FORMAT "## %s:%s(),%i: "
392 /* Maximal number of arguments on a command line, including the function name */
393 #define INTF_MAX_ARGS 20
395 /* Maximal size of a command line in a script */
396 #define INTF_MAX_CMD_SIZE 240
398 /* Number of memorized lines in console window text zone */
399 #define INTF_CONSOLE_MAX_TEXT 100
401 /* Maximal number of commands which can be saved in history list */
402 #define INTF_CONSOLE_MAX_HISTORY 20
404 /*****************************************************************************
405 * Synchro configuration
406 *****************************************************************************/
408 #define VOUT_SYNCHRO_LEVEL_START 5
409 #define VOUT_SYNCHRO_LEVEL_MAX 15
410 #define VOUT_SYNCHRO_HEAP_IDEAL_SIZE 5