]> git.sesse.net Git - vlc/blob - include/config.h.in
. suppression d'un warning pour les machines n'ayant pas usleep()
[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 VideoLAN
6  *
7  * Authors:
8  *
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.
13  *
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.
18  *
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  *****************************************************************************/
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 parameters
32  *   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 /*****************************************************************************
40  * Program information
41  *****************************************************************************/
42
43 /* Program version and copyright message */
44 #define VERSION_MESSAGE     "vlc @VLC_VERSION@ @VLC_CODENAME@" \
45                             /* " (" PROGRAM_BUILD ") (" PROGRAM_OPTIONS ")\n" */ \
46                             "Copyright 1996-2000 VideoLAN\n"
47 #define COPYRIGHT_MESSAGE   "VideoLAN Client - version @VLC_VERSION@" \
48                             " @VLC_CODENAME@ - (c)1996-2000 VideoLAN"
49
50 /*****************************************************************************
51  * General compilation options
52  *****************************************************************************/
53
54 /* Define for DVB support - Note that some extensions or restrictions may be
55  * incompatible with native MPEG2 streams */
56 //#define DVB_EXTENSIONS
57 //#define DVB_RESTRICTIONS
58
59 /* Define to disable some obscure heuristics behind the video_parser and the
60  * video_decoder that improve performance but are not fully MPEG2 compliant
61  * and might cause problems with some very weird streams. */
62 //#define MPEG2_COMPLIANT
63
64 /* Define for profiling and statistics support - such informations, like FPS
65  * or pictures count won't be available if it not set */
66 #define STATS
67
68 /* Define for unthreaded version of the program FIXME: not yet implemented ??*/
69 //#define NO_THREAD
70
71 /*****************************************************************************
72  * Debugging options - define or undefine symbols
73  *****************************************************************************/
74 #if DEBUG == 1
75 /* General debugging support, which depends of the DEBUG define, is determined
76  * in the Makefile */
77
78 /* Modules specific debugging - this will produce a lot of output, but can be
79  * usefull to track a bug */
80 #define DEBUG_INTF
81 #define DEBUG_INPUT
82 #define DEBUG_AUDIO
83 //#define DEBUG_VIDEO
84
85 /* Debugging log file - if defined, a file can be used to store all messages. If
86  * DEBUG_LOG_ONLY is defined, debug messages will only be printed to the log and
87  * will not appear on the screen */
88 #define DEBUG_LOG                       "vlc-debug.log"
89 #define DEBUG_LOG_ONLY
90
91 #endif
92
93 /*****************************************************************************
94  * General configuration
95  *****************************************************************************/
96
97 #define CLOCK_FREQ 1000000
98
99
100 /* Automagically spawn input, audio and video threads ? */
101 /* XXX?? used ? */
102 #define AUTO_SPAWN
103
104 /* When creating or destroying threads in blocking mode, delay to poll thread
105  * status */
106 #define THREAD_SLEEP                    ((int)(0.010*CLOCK_FREQ))
107
108 /*
109  * Decoders FIFO configuration
110  */
111
112 /* Size of the FIFO. FIFO_SIZE+1 must be a multiple of 2 */
113 #define FIFO_SIZE                       1023
114
115
116 /*****************************************************************************
117  * Interface configuration
118  *****************************************************************************/
119
120 /* Environment variable used to store startup script name and default value */
121 #define INTF_INIT_SCRIPT_VAR            "vlc_init"
122 #define INTF_INIT_SCRIPT_DEFAULT        "vlc.init"
123
124 /* Environment variable used to store channels file and default value */
125 #define INTF_CHANNELS_VAR               "vlc_channels"
126 #define INTF_CHANNELS_DEFAULT           "vlc.channels"
127
128 /* Base delay in micro second for interface sleeps */
129 #define INTF_IDLE_SLEEP                 ((int)(0.100*CLOCK_FREQ))
130
131 /* Step for changing gamma, and minimum and maximum values */
132 #define INTF_GAMMA_STEP                 .1
133 #define INTF_GAMMA_LIMIT                3
134
135 /*
136  * X11 settings
137  */
138
139 /* Title of the X11 window */
140 #define VOUT_TITLE                      "VideoLAN Client"
141
142 /*****************************************************************************
143  * Input thread configuration
144  *****************************************************************************/
145
146 /* XXX?? */
147 #define INPUT_IDLE_SLEEP                ((int)(0.100*CLOCK_FREQ))
148
149 /*
150  * General limitations
151  */
152
153 /* Broadcast address, in case of a broadcasted stream */
154 #define INPUT_BCAST_ADDR                "138.195.143.255"
155
156 /* Maximum number of input threads - this value is used exclusively by
157  * interface, and is in fact an interface limitation */
158 #define INPUT_MAX_THREADS               10
159
160 /* Maximum number of programs definitions in a TS stream */
161 #define INPUT_MAX_PGRM                  10
162
163 /* Maximum number of ES definitions in a TS stream */
164 #define INPUT_MAX_ES                    10
165
166 /* Maximum number of ES in a single program */
167 #define INPUT_MAX_PROGRAM_ES            10
168
169 /* Maximum number of selected ES in an input thread */
170 #define INPUT_MAX_SELECTED_ES           10
171
172 /* Maximum number of TS packets in the client at any time
173  * INPUT_MAX_TS + 1 must be a power of 2, to optimize the %(INPUT_MAX_TS+1)
174  * operation with a &INPUT_MAX_TS in the case of a fifo netlist.
175  * It should be > number of fifos * FIFO_SIZE to avoid input deadlock. */
176 #define INPUT_MAX_TS                    32767     /* INPUT_MAX_TS + 1 = 2^15 */
177
178 /* Same thing with PES packets */
179 #define INPUT_MAX_PES                   16383
180
181 /* Maximum number of TS packets we read from the socket in one readv().
182  * Since you can't put more than 7 TS packets in an Ethernet frame,
183  * the maximum value is 7. This number should also limit the stream server,
184  * otherwise any supplementary packet is lost. */
185 #define INPUT_TS_READ_ONCE              7
186
187 /* Use a LIFO or FIFO for TS netlist ? */
188 #undef INPUT_LIFO_TS_NETLIST
189
190 /* Use a LIFO or FIFO for PES netlist ? */
191 #undef INPUT_LIFO_PES_NETLIST
192
193 /* Maximum length of a hostname or source name */
194 #define INPUT_MAX_SOURCE_LENGTH         100
195
196 /* Default remote server */
197 #define INPUT_SERVER_VAR                "vlc_server"
198 #define INPUT_SERVER_DEFAULT            "138.195.143.220"
199
200 /* Default input port */
201 #define INPUT_PORT_VAR                  "vlc_server_port"
202 #define INPUT_PORT_DEFAULT              1234
203
204 /*
205  * Vlan method
206  */
207
208 /* Default network interface and environment variable */
209 #define INPUT_IFACE_VAR                 "vlc_iface"
210 #define INPUT_IFACE_DEFAULT             "eth0"
211
212 /* Default server and port */
213 #define INPUT_VLAN_SERVER_VAR           "vlc_vlan_server"
214 #define INPUT_VLAN_SERVER_DEFAULT       "138.195.140.31"
215 #define INPUT_VLAN_PORT_VAR             "vlc_vlan_port"
216 #define INPUT_VLAN_PORT_DEFAULT         6010
217
218 /* Delay between vlan changes - this is required to avoid flooding the VLAN
219  * server */
220 #define INPUT_VLAN_CHANGE_DELAY         (5*CLOCK_FREQ)
221
222 /* Duration between the time we receive the TS packet, and the time we will
223  * mark it to be presented */
224 #define INPUT_PTS_DELAY                 (2*CLOCK_FREQ)
225
226 /*****************************************************************************
227  * Audio configuration
228  *****************************************************************************/
229
230 /* Environment variable containing the audio output method */
231 #define AOUT_METHOD_VAR                 "vlc_aout"
232
233 /* The fallback method */
234 #define AOUT_DEFAULT_METHOD "dsp"
235
236 /* Environment variable used to store dsp device name, and default value */
237 #define AOUT_DSP_VAR                    "vlc_dsp"
238 #define AOUT_DSP_DEFAULT                "/dev/dsp"
239
240 /* Environment variable for stereo, and default value */
241 #define AOUT_STEREO_VAR                 "vlc_stereo"
242 #define AOUT_STEREO_DEFAULT             1
243
244 /* Environment variable for output rate, and default value */
245 #define AOUT_RATE_VAR                   "vlc_audio_rate"
246 #define AOUT_RATE_DEFAULT               44100
247
248 /*****************************************************************************
249  * Video configuration
250  *****************************************************************************/
251
252 /*
253  * Default settings for video output threads
254  */
255
256 /* Environment variable containing the display method */
257 #define VOUT_METHOD_VAR                 "vlc_vout"
258
259 /* The fallback method */
260 #define VOUT_DEFAULT_METHOD             "x11"
261
262 /* Environment variable used in place of DISPLAY if available */
263 #define VOUT_DISPLAY_VAR                "vlc_display"
264
265 /* Default dimensions for display window - these dimensions are enough for the
266  * standard width and height broadcasted MPEG-2 streams */
267 #define VOUT_WIDTH_VAR                  "vlc_width"
268 #define VOUT_HEIGHT_VAR                 "vlc_height"
269 #define VOUT_WIDTH_DEFAULT              640
270 #define VOUT_HEIGHT_DEFAULT             480
271
272 /* Maximum width of a scaled source picture - this should be relatively high,
273  * since higher stream values will result in no display at all. */
274 #define VOUT_MAX_WIDTH                  4096
275
276 /* Video heap size - remember that a decompressed picture is big
277  * (~1 Mbyte) before using huge values */
278 #define VOUT_MAX_PICTURES               10
279
280 /* Maximum number of active areas in a rendering buffer. Active areas are areas
281  * of the picture which need to be cleared before re-using the buffer. If a
282  * picture, including its many additions such as subtitles, additionnal user
283  * informations and interface, has too many active areas, some of them are
284  * joined. */
285 #define VOUT_MAX_AREAS                  5
286
287 /* Environment variable for grayscale output mode, and default value */
288 #define VOUT_GRAYSCALE_VAR              "vlc_grayscale"
289 #define VOUT_GRAYSCALE_DEFAULT          0
290
291 /* Default gamma */
292 #define VOUT_GAMMA                      0.
293
294 /* Default fonts */
295 #define VOUT_DEFAULT_FONT               "lib/default8x9.psf"
296 #define VOUT_LARGE_FONT                 "lib/default8x16.psf"
297
298 /*
299  * Time settings
300  */
301
302 /* Time during which the thread will sleep if it has nothing to
303  * display (in micro-seconds) */
304 #define VOUT_IDLE_SLEEP                 ((int)(0.020*CLOCK_FREQ))
305
306 /* Maximum lap of time allowed between the beginning of rendering and
307  * display. If, compared to the current date, the next image is too
308  * late, the thread will perform an idle loop. This time should be
309  * at least VOUT_IDLE_SLEEP plus the time required to render a few
310  * images, to avoid trashing of decoded images */
311 #define VOUT_DISPLAY_DELAY              ((int)(0.500*CLOCK_FREQ))
312
313 /* Delay (in microseconds) before an idle screen is displayed */
314 #define VOUT_IDLE_DELAY                 (5*CLOCK_FREQ)
315
316 /* Number of pictures required to computes the FPS rate */
317 #define VOUT_FPS_SAMPLES                20
318
319 /*
320  * Framebuffer settings
321  */
322
323 /* Environment variable for framebuffer device, and default value */
324 #define VOUT_FB_DEV_VAR                 "vlc_fb_dev"
325 #define VOUT_FB_DEV_DEFAULT             "/dev/fb0"
326
327 /*****************************************************************************
328  * Video parser configuration
329  *****************************************************************************/
330
331 #define VPAR_IDLE_SLEEP                 ((int)(0.010*CLOCK_FREQ))
332
333 /* Time to sleep when waiting for a buffer (from vout or the video fifo).
334  * It should be approximately the time needed to perform a complete picture
335  * loop. Since it only happens when the video heap is full, it does not need
336  * to be too low, even if it blocks the decoder. */
337 #define VPAR_OUTMEM_SLEEP               ((int)(0.050*CLOCK_FREQ))
338
339 /* Optimization level, from 0 to 2 - 1 is generally a good compromise. Remember
340  * that raising this level dramatically lengthens the compilation time. */
341 #define VPAR_OPTIM_LEVEL                1
342
343 /* The following directives only apply if you define VDEC_SMP below. */
344
345 /* Number of macroblock buffers available. It should be always greater than
346  * twice the number of macroblocks in a picture. VFIFO_SIZE + 1 should also
347  * be a power of two. */
348 #define VFIFO_SIZE                      8191
349
350 /* Maximum number of macroblocks in a picture. */
351 #define MAX_MB                          2048
352
353 /*****************************************************************************
354  * Video decoder configuration
355  *****************************************************************************/
356
357 //#define VDEC_SMP
358
359 #define VDEC_IDLE_SLEEP                 ((int)(0.100*CLOCK_FREQ))
360
361 /* Number of video_decoder threads to launch on startup of the video_parser.
362  * It should always be less than half the number of macroblocks of a
363  * picture. Only available if you defined VDEC_SMP above. */
364 #define NB_VDEC                         1
365
366 /* Maximum range of values out of the IDCT + motion compensation. */
367 #define VDEC_CROPRANGE                  2048
368
369 /*****************************************************************************
370  * Generic decoder configuration
371  *****************************************************************************/
372
373 #define GDEC_IDLE_SLEEP                 ((int)(0.100*CLOCK_FREQ))
374
375 /*****************************************************************************
376  * Messages and console interfaces configuration
377  *****************************************************************************/
378
379 /* Maximal size of a message to be stored in the mesage queue,
380  * it is needed when vasprintf is not avalaible */
381 #define INTF_MAX_MSG_SIZE              512
382
383 /* Maximal size of the message queue - in case of overflow, all messages in the
384  * queue are printed by the calling thread */
385 #define INTF_MSG_QSIZE                  64
386
387 /* Define to enable messages queues - disabling messages queue can be usefull
388  * when debugging, since it allows messages which would not otherwise be printed,
389  * due to a crash, to be printed anyway */
390 #ifndef DEBUG
391 #define INTF_MSG_QUEUE
392 #endif
393
394 /* Format of the header for debug messages. The arguments following this header
395  * are the file (char *), the function (char *) and the line (int) in which the
396  * message function was called */
397 #define INTF_MSG_DBG_FORMAT             "## %s:%s(),%i: "
398
399 /* Maximal number of arguments on a command line, including the function name */
400 #define INTF_MAX_ARGS                   20
401
402 /* Maximal size of a command line in a script */
403 #define INTF_MAX_CMD_SIZE               240
404
405 /* Number of memorized lines in console window text zone */
406 #define INTF_CONSOLE_MAX_TEXT           100
407
408 /* Maximal number of commands which can be saved in history list */
409 #define INTF_CONSOLE_MAX_HISTORY        20
410
411 /*****************************************************************************
412  * Synchro configuration
413  *****************************************************************************/
414
415 #define VOUT_SYNCHRO_LEVEL_START        5
416 #define VOUT_SYNCHRO_LEVEL_MAX          15
417 #define VOUT_SYNCHRO_HEAP_IDEAL_SIZE    5