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