1 /*******************************************************************************
2 * config.h: limits and configuration
4 *******************************************************************************
5 * Defines all compilation-time configuration constants and size limits
6 *******************************************************************************/
8 /* Conventions regarding names of symbols and variables
9 * ----------------------------------------------------
11 * - Symbols should begin with a prefix indicating in which module they are
12 * used, such as INTF_, VOUT_ or ADEC_.
14 * - Regarding environment variables, which are used as initialization parameters
16 * + variable names should end with '_VAR'
17 * + environment variable default value should end with '_DEFAULT'
18 * + values having a special meaning with '_VAL'
22 /*******************************************************************************
24 *******************************************************************************/
26 /* Program options - this part will produce a copyright message with compilation
27 * options informations, based on some definines set in the Makefile - do not
29 #if defined(VIDEO_X11)
30 #define VIDEO_OPTIONS "X11"
31 #elif defined(VIDEO_FB)
32 #define VIDEO_OPTIONS "Framebuffer"
33 #elif defined(VIDEO_GGI)
34 #define VIDEO_OPTIONS "GGI"
36 #define VIDEO_OPTIONS ""
39 #define ARCH_OPTIONS "MMX"
41 #define ARCH_OPTIONS ""
43 #define PROGRAM_OPTIONS VIDEO_OPTIONS " " ARCH_OPTIONS
45 /* Program version and copyright message */
46 #define PROGRAM_VERSION "1.0-dev"
47 #define COPYRIGHT_MESSAGE "VideoLAN Client v" PROGRAM_VERSION " (" __DATE__ ") - " \
48 PROGRAM_OPTIONS " - (c)1999-2000 VideoLAN"
50 /*******************************************************************************
51 * General compilation options
52 *******************************************************************************/
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
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
64 /* Define for profiling and statistics support - such informations, like FPS
65 * or pictures count won't be available if it not set */
68 /* Define for unthreaded version of the program - ?? not yet implemented */
71 /*******************************************************************************
72 * Debugging options - define or undefine symbols
73 *******************************************************************************/
75 /* General debugging support */
78 /* Modules specific debugging - this will produce a lot of output, but can be
79 * usefull to track a bug */
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
91 /*******************************************************************************
92 * General configuration
93 *******************************************************************************/
95 /* Automagically spawn input, audio and video threads ? */
99 /* When creating or destroying threads in blocking mode, delay to poll thread
101 #define THREAD_SLEEP 10000
104 * Decoders FIFO configuration
107 /* Size of the FIFO. FIFO_SIZE+1 must be a multiple of 2 */
108 #define FIFO_SIZE 1023
111 /*******************************************************************************
112 * Interface configuration
113 *******************************************************************************/
115 /* Environment variable used to store startup script name and default value */
116 #define INTF_INIT_SCRIPT_VAR "vlc_init"
117 #define INTF_INIT_SCRIPT_DEFAULT "vlc.init"
119 /* Base delay in micro second for interface sleeps */
120 #define INTF_IDLE_SLEEP 100000
122 /* Step for changing gamma, and minimum and maximum values */
123 #define INTF_GAMMA_STEP .1
124 #define INTF_GAMMA_LIMIT 3
130 /* Title of the X11 window */
131 #define VOUT_TITLE "VideoLAN Client"
133 /*******************************************************************************
134 * Input thread configuration
135 *******************************************************************************/
138 #define INPUT_IDLE_SLEEP 100000
141 * General limitations
144 /* Broadcast address, in case of a broadcasted stream */
145 #define INPUT_BCAST_ADDR "138.195.143.255"
147 /* Maximum number of input threads - this value is used exclusively by
148 * interface, and is in fact an interface limitation */
149 #define INPUT_MAX_THREADS 10
151 /* Maximum number of programs definitions in a TS stream */
152 #define INPUT_MAX_PGRM 10
154 /* Maximum number of ES definitions in a TS stream */
155 #define INPUT_MAX_ES 10
157 /* Maximum number of ES in a single program */
158 #define INPUT_MAX_PROGRAM_ES 10
160 /* Maximum number of selected ES in an input thread */
161 #define INPUT_MAX_SELECTED_ES 10
163 /* Maximum number of TS packets in the client at any time
164 * INPUT_MAX_TS + 1 must be a power of 2, to optimize the %(INPUT_MAX_TS+1)
165 * operation with a &INPUT_MAX_TS in the case of a fifo netlist.
166 * It should be > number of fifos * FIFO_SIZE to avoid input deadlock. */
167 #define INPUT_MAX_TS 32767 /* INPUT_MAX_TS + 1 = 2^15 */
169 /* Same thing with PES packets */
170 #define INPUT_MAX_PES 16383
172 /* Maximum number of TS packets we read from the socket in one readv().
173 * Since you can't put more than 7 TS packets in an Ethernet frame,
174 * the maximum value is 7. This number should also limit the stream server,
175 * otherwise any supplementary packet is lost. */
176 #define INPUT_TS_READ_ONCE 7
178 /* Use a LIFO or FIFO for TS netlist ? */
179 #undef INPUT_LIFO_TS_NETLIST
181 /* Use a LIFO or FIFO for PES netlist ? */
182 #undef INPUT_LIFO_PES_NETLIST
184 /* Maximum length of a hostname or source name */
185 #define INPUT_MAX_SOURCE_LENGTH 100
187 /* Default remote server */
188 #define INPUT_SERVER_VAR "vlc_server"
189 #define INPUT_SERVER_DEFAULT "138.195.143.220"
191 /* Default input port */
192 #define INPUT_PORT_VAR "vlc_server_port"
193 #define INPUT_PORT_DEFAULT 1234
199 /* Default network interface and environment variable */
200 #define INPUT_IFACE_VAR "vlc_iface"
201 #define INPUT_IFACE_DEFAULT "eth0"
203 /* Default server and port */
204 #define INPUT_VLAN_SERVER_VAR "vlc_vlan_server"
205 #define INPUT_VLAN_SERVER_DEFAULT "138.195.140.31"
206 #define INPUT_VLAN_PORT_VAR "vlc_vlan_port"
207 #define INPUT_VLAN_PORT_DEFAULT 6010
209 /* Delay between vlan changes - this is required to avoid flooding the VLAN
211 #define INPUT_VLAN_CHANGE_DELAY 5000000
213 /*******************************************************************************
214 * Audio configuration
215 *******************************************************************************/
217 /* Environment variable used to store dsp device name, and default value */
218 #define AOUT_DSP_VAR "vlc_dsp"
219 #define AOUT_DSP_DEFAULT "/dev/dsp"
221 /* Environment variable for stereo, and default value */
222 #define AOUT_STEREO_VAR "vlc_stereo"
223 #define AOUT_STEREO_DEFAULT 1
225 /* Environment variable for output rate, and default value */
226 #define AOUT_RATE_VAR "vlc_audio_rate"
227 #define AOUT_RATE_DEFAULT 44100
229 /*******************************************************************************
230 * Video configuration
231 *******************************************************************************/
234 * Default settings for video output threads
237 /* Environment variable used in place of DISPLAY if available */
238 #define VOUT_DISPLAY_VAR "vlc_display"
240 /* Default dimensions for display window - these dimensions are enough for the
241 * standard width and height broadcasted MPEG-2 streams */
242 #define VOUT_WIDTH_VAR "vlc_width"
243 #define VOUT_HEIGHT_VAR "vlc_height"
244 #define VOUT_WIDTH_DEFAULT 640
245 #define VOUT_HEIGHT_DEFAULT 480
247 /* Default video heap size - remember that a decompressed picture is big
248 * (~1 Mbyte) before using huge values */
249 #define VOUT_MAX_PICTURES 10
251 /* Environment variable for grayscale output mode, and default value */
252 #define VOUT_GRAYSCALE_VAR "vlc_grayscale"
253 #define VOUT_GRAYSCALE_DEFAULT 0
256 #define VOUT_GAMMA 0.
262 /* Time during which the thread will sleep if it has nothing to
263 * display (in micro-seconds) */
264 /* ?? this constant will probably evolve to a calculated value */
265 #define VOUT_IDLE_SLEEP 20000
267 /* Maximum lap of time allowed between the beginning of rendering and
268 * display. If, compared to the current date, the next image is too
269 * late, the thread will perform an idle loop. This time should be
270 * at least VOUT_IDLE_SLEEP plus the time required to render a few
271 * images, to avoid trashing of decoded images */
272 /* ?? this constant will probably evolve to a calculated value */
273 #define VOUT_DISPLAY_DELAY 100000
275 /* Delay (in microseconds) between increments in idle levels */
276 #define VOUT_IDLE_DELAY 5000000
278 /* Number of pictures required to computes the FPS rate */
279 #define VOUT_FPS_SAMPLES 20
282 * Framebuffer settings
285 /* Environment variable for framebuffer device, and default value */
286 #define VOUT_FB_DEV_VAR "vlc_fb_dev"
287 #define VOUT_FB_DEV_DEFAULT "/dev/fb0"
293 /* Font maximum and minimum characters - characters outside this range are not
294 * printed - maximum range is 1-256 */
295 #define VOUT_MIN_CHAR 1
296 #define VOUT_MAX_CHAR 128
298 /*******************************************************************************
299 * Video parser configuration
300 *******************************************************************************/
302 #define VPAR_IDLE_SLEEP 100000
304 /* Number of macroblock buffers available. It should be always greater than
305 * twice the number of macroblocks in a picture. VFIFO_SIZE + 1 should also
306 * be a power of two. */
307 #define VFIFO_SIZE 8191
309 /* Maximum number of macroblocks in a picture. */
312 /*******************************************************************************
313 * Video decoder configuration
314 *******************************************************************************/
316 #define VDEC_IDLE_SLEEP 100000
318 /* Number of video_decoder threads to launch on startup of the video_parser.
319 * It should always be less than half the number of macroblocks of a
323 /* Maximum range of values out of the IDCT + motion compensation. Only
324 * used if you define MPEG2_COMPLIANT above. */
325 #define VDEC_CROPRANGE 2048
327 /*******************************************************************************
328 * Generic decoder configuration
329 *******************************************************************************/
331 #define GDEC_IDLE_SLEEP 100000
333 /*******************************************************************************
334 * Messages and console interfaces configuration
335 *******************************************************************************/
337 /* Maximal size of the message queue - in case of overflow, all messages in the
338 * queue are printed by the calling thread */
339 #define INTF_MSG_QSIZE 64
341 /* Define to enable messages queues - disabling messages queue can be usefull
342 * when debugging, since it allows messages which would not otherwise be printed,
343 * due to a crash, to be printed anyway */
344 #define INTF_MSG_QUEUE
346 /* Format of the header for debug messages. The arguments following this header
347 * are the file (char *), the function (char *) and the line (int) in which the
348 * message function was called */
349 #define INTF_MSG_DBG_FORMAT "## %s:%s(),%i: "
351 /* Maximal number of arguments on a command line, including the function name */
352 #define INTF_MAX_ARGS 20
354 /* Maximal size of a command line in a script */
355 #define INTF_MAX_CMD_SIZE 240
357 /* Number of memorized lines in console window text zone */
358 #define INTF_CONSOLE_MAX_TEXT 100
360 /* Maximal number of commands which can be saved in history list */
361 #define INTF_CONSOLE_MAX_HISTORY 20