config.h 14 KB
Newer Older
1
/*****************************************************************************
Michel Kaempf's avatar
Michel Kaempf committed
2 3
 * config.h: limits and configuration
 * (c)1999 VideoLAN
4
 *****************************************************************************
Michel Kaempf's avatar
Michel Kaempf committed
5
 * Defines all compilation-time configuration constants and size limits
6
 *****************************************************************************/
Michel Kaempf's avatar
Michel Kaempf committed
7

Vincent Seguin's avatar
Vincent Seguin committed
8 9 10 11 12 13
/* Conventions regarding names of symbols and variables
 * ----------------------------------------------------
 *
 * - Symbols should begin with a prefix indicating in which module they are
 *   used, such as INTF_, VOUT_ or ADEC_.
 *
14
 * - Regarding environment variables, which are used as initialization parameters
Vincent Seguin's avatar
Vincent Seguin committed
15 16 17
 *   for threads :
 *   + variable names should end with '_VAR'
 *   + environment variable default value should end with '_DEFAULT'
18 19
 *   + values having a special meaning with '_VAL'
 *
Vincent Seguin's avatar
Vincent Seguin committed
20 21
 */

22
/*****************************************************************************
Michel Kaempf's avatar
Michel Kaempf committed
23
 * Program information
24
 *****************************************************************************/
Michel Kaempf's avatar
Michel Kaempf committed
25 26

/* Program version and copyright message */
Vincent Seguin's avatar
Vincent Seguin committed
27 28 29 30
#define COPYRIGHT_MESSAGE	        "VideoLAN Client v" PROGRAM_VERSION " - (c)1999-2000 VideoLAN"
#define VERSION_MESSAGE                 "VideoLAN Client - (c)1999-2000 VideoLAN\n" \
                                        "version " PROGRAM_VERSION " ( " PROGRAM_BUILD " )\n" \
                                        "compilation options: " PROGRAM_OPTIONS
Michel Kaempf's avatar
Michel Kaempf committed
31

32
/*****************************************************************************
Michel Kaempf's avatar
Michel Kaempf committed
33
 * General compilation options
34
 *****************************************************************************/
Michel Kaempf's avatar
Michel Kaempf committed
35 36 37 38 39 40

/* Define for DVB support - Note that some extensions or restrictions may be
 * incompatible with native MPEG2 streams */
//#define DVB_EXTENSIONS
//#define DVB_RESTRICTIONS

41 42 43 44 45
/* Define to disable some obscure heuristics behind the video_parser and the
 * video_decoder that improve performance but are not fully MPEG2 compliant
 * and might cause problems with some very weird streams. */
//#define MPEG2_COMPLIANT

46 47
/* Define for profiling and statistics support - such informations, like FPS
 * or pictures count won't be available if it not set */
48
#define STATS
Michel Kaempf's avatar
Michel Kaempf committed
49 50 51 52

/* Define for unthreaded version of the program - ?? not yet implemented */
//#define NO_THREAD

53
/*****************************************************************************
Michel Kaempf's avatar
Michel Kaempf committed
54
 * Debugging options - define or undefine symbols
55
 *****************************************************************************/
Vincent Seguin's avatar
Vincent Seguin committed
56 57 58
#ifdef DEBUG
/* General debugging support, which depends of the DEBUG define, is determined
 * in the Makefile */
Michel Kaempf's avatar
Michel Kaempf committed
59

60 61
/* Modules specific debugging - this will produce a lot of output, but can be
 * usefull to track a bug */
Vincent Seguin's avatar
Vincent Seguin committed
62
#define DEBUG_INTF
Michel Kaempf's avatar
Michel Kaempf committed
63 64
#define DEBUG_INPUT
#define DEBUG_AUDIO
65
//#define DEBUG_VIDEO
Michel Kaempf's avatar
Michel Kaempf committed
66 67 68 69

/* Debugging log file - if defined, a file can be used to store all messages. If
 * DEBUG_LOG_ONLY is defined, debug messages will only be printed to the log and
 * will not appear on the screen */
Vincent Seguin's avatar
Vincent Seguin committed
70 71 72 73
#define DEBUG_LOG                       "vlc-debug.log"
#define DEBUG_LOG_ONLY

#endif
Michel Kaempf's avatar
Michel Kaempf committed
74

75
/*****************************************************************************
76
 * General configuration
77
 *****************************************************************************/
Michel Kaempf's avatar
Michel Kaempf committed
78

Christophe Massiot's avatar
Christophe Massiot committed
79
/* Automagically spawn input, audio and video threads ? */
80
// ?? used ?
81
#define AUTO_SPAWN
Christophe Massiot's avatar
Christophe Massiot committed
82

83 84 85
/* When creating or destroying threads in blocking mode, delay to poll thread
 * status */
#define THREAD_SLEEP                    10000
Michel Kaempf's avatar
Michel Kaempf committed
86 87

/*
88
 * Decoders FIFO configuration
Michel Kaempf's avatar
Michel Kaempf committed
89 90
 */

91 92 93 94
/* Size of the FIFO. FIFO_SIZE+1 must be a multiple of 2 */
#define FIFO_SIZE                       1023


95
/*****************************************************************************
96
 * Interface configuration
97
 *****************************************************************************/
98 99 100 101 102

/* Environment variable used to store startup script name and default value */
#define INTF_INIT_SCRIPT_VAR	        "vlc_init"
#define INTF_INIT_SCRIPT_DEFAULT        "vlc.init"

103 104 105 106
/* Environment variable used to store channels file and default value */
#define INTF_CHANNELS_VAR               "vlc_channels"
#define INTF_CHANNELS_DEFAULT           "vlc.channels"

107 108
/* Base delay in micro second for interface sleeps */
#define INTF_IDLE_SLEEP                 100000
Michel Kaempf's avatar
Michel Kaempf committed
109

Vincent Seguin's avatar
Vincent Seguin committed
110 111
/* Step for changing gamma, and minimum and maximum values */
#define INTF_GAMMA_STEP                 .1
112
#define INTF_GAMMA_LIMIT                3
113

Michel Kaempf's avatar
Michel Kaempf committed
114
/*
115
 * X11 settings
Michel Kaempf's avatar
Michel Kaempf committed
116 117
 */

118 119 120
/* Title of the X11 window */
#define VOUT_TITLE                      "VideoLAN Client"

121
/*****************************************************************************
Michel Kaempf's avatar
Michel Kaempf committed
122
 * Input thread configuration
123
 *****************************************************************************/
Michel Kaempf's avatar
Michel Kaempf committed
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154

/* ?? */
#define INPUT_IDLE_SLEEP                100000

/*
 * General limitations
 */

/* Broadcast address, in case of a broadcasted stream */
#define INPUT_BCAST_ADDR                "138.195.143.255"

/* Maximum number of input threads - this value is used exclusively by
 * interface, and is in fact an interface limitation */
#define INPUT_MAX_THREADS               10

/* Maximum number of programs definitions in a TS stream */
#define INPUT_MAX_PGRM                  10

/* Maximum number of ES definitions in a TS stream */
#define INPUT_MAX_ES                    10

/* Maximum number of ES in a single program */
#define INPUT_MAX_PROGRAM_ES            10

/* Maximum number of selected ES in an input thread */
#define INPUT_MAX_SELECTED_ES           10

/* Maximum number of TS packets in the client at any time
 * INPUT_MAX_TS + 1 must be a power of 2, to optimize the %(INPUT_MAX_TS+1)
 * operation with a &INPUT_MAX_TS in the case of a fifo netlist.
 * It should be > number of fifos * FIFO_SIZE to avoid input deadlock. */
155
#define INPUT_MAX_TS                    32767     /* INPUT_MAX_TS + 1 = 2^15 */
Michel Kaempf's avatar
Michel Kaempf committed
156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171

/* Same thing with PES packets */
#define INPUT_MAX_PES                   16383

/* Maximum number of TS packets we read from the socket in one readv().
 * Since you can't put more than 7 TS packets in an Ethernet frame,
 * the maximum value is 7. This number should also limit the stream server,
 * otherwise any supplementary packet is lost. */
#define INPUT_TS_READ_ONCE              7

/* Use a LIFO or FIFO for TS netlist ? */
#undef INPUT_LIFO_TS_NETLIST

/* Use a LIFO or FIFO for PES netlist ? */
#undef INPUT_LIFO_PES_NETLIST

172
/* Maximum length of a hostname or source name */
173
#define INPUT_MAX_SOURCE_LENGTH         100
Michel Kaempf's avatar
Michel Kaempf committed
174 175

/* Default remote server */
176 177
#define INPUT_SERVER_VAR                "vlc_server"
#define INPUT_SERVER_DEFAULT            "138.195.143.220"
Michel Kaempf's avatar
Michel Kaempf committed
178

179
/* Default input port */
180 181
#define INPUT_PORT_VAR                  "vlc_server_port"
#define INPUT_PORT_DEFAULT              1234
Michel Kaempf's avatar
Michel Kaempf committed
182 183

/*
184 185
 * Vlan method
 */
Michel Kaempf's avatar
Michel Kaempf committed
186

187 188 189 190 191 192 193 194 195
/* Default network interface and environment variable */
#define INPUT_IFACE_VAR                 "vlc_iface"
#define INPUT_IFACE_DEFAULT             "eth0"

/* Default server and port */
#define INPUT_VLAN_SERVER_VAR           "vlc_vlan_server"
#define INPUT_VLAN_SERVER_DEFAULT       "138.195.140.31"
#define INPUT_VLAN_PORT_VAR             "vlc_vlan_port"
#define INPUT_VLAN_PORT_DEFAULT         6010
Michel Kaempf's avatar
Michel Kaempf committed
196

197
/* Delay between vlan changes - this is required to avoid flooding the VLAN
198 199 200
 * server */
#define INPUT_VLAN_CHANGE_DELAY         5000000

201 202 203 204
/* Duration between the time we receive the TS packet, and the time we will
 * mark it to be presented */
#define INPUT_PTS_DELAY                 2000000

205
/*****************************************************************************
Vincent Seguin's avatar
Vincent Seguin committed
206
 * Audio configuration
207
 *****************************************************************************/
Michel Kaempf's avatar
Michel Kaempf committed
208

Vincent Seguin's avatar
Vincent Seguin committed
209 210 211 212 213 214 215 216 217 218
/* Environment variable used to store dsp device name, and default value */
#define AOUT_DSP_VAR                    "vlc_dsp"
#define AOUT_DSP_DEFAULT                "/dev/dsp"

/* Environment variable for stereo, and default value */
#define AOUT_STEREO_VAR                 "vlc_stereo"
#define AOUT_STEREO_DEFAULT             1

/* Environment variable for output rate, and default value */
#define AOUT_RATE_VAR                   "vlc_audio_rate"
219
#define AOUT_RATE_DEFAULT               44100
Vincent Seguin's avatar
Vincent Seguin committed
220

221
/*****************************************************************************
Vincent Seguin's avatar
Vincent Seguin committed
222
 * Video configuration
223
 *****************************************************************************/
Michel Kaempf's avatar
Michel Kaempf committed
224 225 226 227 228

/*
 * Default settings for video output threads
 */

229
/* Environment variable used in place of DISPLAY if available */
230
#define VOUT_DISPLAY_VAR                "vlc_display"
231

232
/* Default dimensions for display window - these dimensions are enough for the
233 234 235 236 237
 * standard width and height broadcasted MPEG-2 streams */
#define VOUT_WIDTH_VAR                  "vlc_width"
#define VOUT_HEIGHT_VAR                 "vlc_height"
#define VOUT_WIDTH_DEFAULT              640
#define VOUT_HEIGHT_DEFAULT             480
Michel Kaempf's avatar
Michel Kaempf committed
238

239
/* Maximum width of a scaled source picture - this should be relatively high,
240 241 242
 * since higher stream values will result in no display at all. */
#define VOUT_MAX_WIDTH                  4096

243
/* Video heap size - remember that a decompressed picture is big
Vincent Seguin's avatar
Vincent Seguin committed
244
 * (~1 Mbyte) before using huge values */
Michel Kaempf's avatar
Michel Kaempf committed
245 246
#define VOUT_MAX_PICTURES               10

247
/* Maximum number of active areas in a rendering buffer. Active areas are areas
248
 * of the picture which need to be cleared before re-using the buffer. If a
249
 * picture, including its many additions such as subtitles, additionnal user
250
 * informations and interface, has too many active areas, some of them are
251 252 253
 * joined. */
#define VOUT_MAX_AREAS                  5

254 255 256 257
/* Environment variable for grayscale output mode, and default value */
#define VOUT_GRAYSCALE_VAR              "vlc_grayscale"
#define VOUT_GRAYSCALE_DEFAULT          0

258
/* Default gamma */
Vincent Seguin's avatar
Vincent Seguin committed
259
#define VOUT_GAMMA                      0.
260

Vincent Seguin's avatar
Vincent Seguin committed
261 262 263 264
/* Default fonts */
#define VOUT_DEFAULT_FONT               "Resources/default8x9.psf"
#define VOUT_LARGE_FONT                 "Resources/default8x16.psf"

Michel Kaempf's avatar
Michel Kaempf committed
265
/*
Vincent Seguin's avatar
Vincent Seguin committed
266
 * Time settings
Michel Kaempf's avatar
Michel Kaempf committed
267 268
 */

269
/* Time during which the thread will sleep if it has nothing to
Michel Kaempf's avatar
Michel Kaempf committed
270
 * display (in micro-seconds) */
271
#define VOUT_IDLE_SLEEP                 20000
Michel Kaempf's avatar
Michel Kaempf committed
272 273 274 275 276 277

/* Maximum lap of time allowed between the beginning of rendering and
 * display. If, compared to the current date, the next image is too
 * late, the thread will perform an idle loop. This time should be
 * at least VOUT_IDLE_SLEEP plus the time required to render a few
 * images, to avoid trashing of decoded images */
278
#define VOUT_DISPLAY_DELAY              500000
Michel Kaempf's avatar
Michel Kaempf committed
279

280 281
/* Delay (in microseconds) before an idle screen is displayed */
#define VOUT_IDLE_DELAY                 5000000
282 283

/* Number of pictures required to computes the FPS rate */
284
#define VOUT_FPS_SAMPLES                20
285

Vincent Seguin's avatar
Vincent Seguin committed
286
/*
287 288 289 290 291 292 293
 * Framebuffer settings
 */

/* Environment variable for framebuffer device, and default value */
#define VOUT_FB_DEV_VAR                 "vlc_fb_dev"
#define VOUT_FB_DEV_DEFAULT             "/dev/fb0"

294
/*****************************************************************************
295
 * Video parser configuration
296
 *****************************************************************************/
297 298 299

#define VPAR_IDLE_SLEEP                 100000

300
/* Time to sleep when waiting for a buffer (from vout or the video fifo).
Vincent Seguin's avatar
Vincent Seguin committed
301 302 303 304
 * It should be approximately the time needed to perform a complete picture
 * loop. Since it only happens when the video heap is full, it does not need
 * to be too low, even if it blocks the decoder. */
#define VPAR_OUTMEM_SLEEP               50000
305

306 307 308 309
/* Optimization level, from 0 to 2 - 1 is generally a good compromise. Remember
 * that raising this level dramatically lengthens the compilation time. */
#define VPAR_OPTIM_LEVEL                1

310 311
/* The following directives only apply if you define VDEC_SMP below. */

312 313 314
/* Number of macroblock buffers available. It should be always greater than
 * twice the number of macroblocks in a picture. VFIFO_SIZE + 1 should also
 * be a power of two. */
Christophe Massiot's avatar
Christophe Massiot committed
315
#define VFIFO_SIZE                      8191
316 317

/* Maximum number of macroblocks in a picture. */
Christophe Massiot's avatar
Christophe Massiot committed
318
#define MAX_MB                          2048
319

320
/*****************************************************************************
Michel Kaempf's avatar
Michel Kaempf committed
321
 * Video decoder configuration
322
 *****************************************************************************/
Michel Kaempf's avatar
Michel Kaempf committed
323

324 325
//#define VDEC_SMP

Michel Kaempf's avatar
Michel Kaempf committed
326 327
#define VDEC_IDLE_SLEEP                 100000

328 329
/* Number of video_decoder threads to launch on startup of the video_parser.
 * It should always be less than half the number of macroblocks of a
330
 * picture. Only available if you defined VDEC_SMP above. */
331 332
#define NB_VDEC                         1

333
/* Maximum range of values out of the IDCT + motion compensation. */
334 335
#define VDEC_CROPRANGE                  2048

336
/*****************************************************************************
Michel Kaempf's avatar
Michel Kaempf committed
337
 * Generic decoder configuration
338
 *****************************************************************************/
Michel Kaempf's avatar
Michel Kaempf committed
339 340 341

#define GDEC_IDLE_SLEEP                 100000

342
/*****************************************************************************
343
 * Messages and console interfaces configuration
344
 *****************************************************************************/
Vincent Seguin's avatar
Vincent Seguin committed
345 346 347

/* Maximal size of the message queue - in case of overflow, all messages in the
 * queue are printed by the calling thread */
348
#define INTF_MSG_QSIZE                  64
Vincent Seguin's avatar
Vincent Seguin committed
349 350 351 352

/* Define to enable messages queues - disabling messages queue can be usefull
 * when debugging, since it allows messages which would not otherwise be printed,
 * due to a crash, to be printed anyway */
Vincent Seguin's avatar
Vincent Seguin committed
353
#ifndef DEBUG
354
#define INTF_MSG_QUEUE
Vincent Seguin's avatar
Vincent Seguin committed
355
#endif
Vincent Seguin's avatar
Vincent Seguin committed
356 357 358 359

/* Format of the header for debug messages. The arguments following this header
 * are the file (char *), the function (char *) and the line (int) in which the
 * message function was called */
360 361 362 363 364 365 366 367 368 369 370 371 372
#define INTF_MSG_DBG_FORMAT             "## %s:%s(),%i: "

/* Maximal number of arguments on a command line, including the function name */
#define INTF_MAX_ARGS                   20

/* Maximal size of a command line in a script */
#define INTF_MAX_CMD_SIZE               240

/* Number of memorized lines in console window text zone */
#define INTF_CONSOLE_MAX_TEXT           100

/* Maximal number of commands which can be saved in history list */
#define INTF_CONSOLE_MAX_HISTORY        20