mirror of
https://github.com/videolan/vlc.git
synced 2025-01-10 09:48:21 +08:00
This is the first part of the new configuration architecture for vlc.
Two other parts will follow soon: - config file implementation - gtk configuration interface. This part won't change much for end-users as these changes are mostly internal, you will however notice that the command line interface has changed. It will maybe be less user-friendly as I almost removed the short options but it shouldn't a big problem when the config file is implemented. What as changed is that it is really easy now to add configuration options to vlc. Plugins can also implement configuration options. All you have to do is to declare a MODULE_CONFIG section in your plugin. If you want to know more about this look at configuration.h and for some example: main.c, dsp.c or xvideo.c It would be nice if every developper could now start using configuration options in there plugins and also enhance old plugins. That's it, now let's hope I didn't break too many things ;-)
This commit is contained in:
parent
d9d659fc3e
commit
c40571df60
2
Makefile
2
Makefile
@ -137,7 +137,7 @@ INTERFACE := main interface intf_msg intf_playlist intf_eject
|
||||
INPUT := input input_ext-dec input_ext-intf input_dec input_programs input_clock mpeg_system
|
||||
VIDEO_OUTPUT := video_output video_text vout_pictures vout_subpictures
|
||||
AUDIO_OUTPUT := audio_output aout_common aout_ext-dec aout_spdif
|
||||
MISC := mtime modules netutils iso_lang
|
||||
MISC := mtime modules configuration netutils iso_lang
|
||||
|
||||
C_OBJ := $(INTERFACE:%=src/interface/%.o) \
|
||||
$(INPUT:%=src/input/%.o) \
|
||||
|
@ -2,7 +2,7 @@
|
||||
* audio_output.h : audio output thread interface
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1999, 2000 VideoLAN
|
||||
* $Id: audio_output.h,v 1.41 2002/01/14 12:15:10 asmax Exp $
|
||||
* $Id: audio_output.h,v 1.42 2002/02/24 20:51:09 gbazin Exp $
|
||||
*
|
||||
* Authors: Michel Kaempf <maxx@via.ecp.fr>
|
||||
* Cyril Deguet <asmax@via.ecp.fr>
|
||||
@ -158,10 +158,6 @@ typedef struct aout_thread_s
|
||||
* will be played */
|
||||
mtime_t date;
|
||||
|
||||
/* Path to the audio output device (default is set to "/dev/dsp") */
|
||||
char * psz_device;
|
||||
int i_fd;
|
||||
|
||||
/* The current volume */
|
||||
int i_volume;
|
||||
int i_savedvolume;
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Collection of useful common types and macros definitions
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1998, 1999, 2000 VideoLAN
|
||||
* $Id: common.h,v 1.75 2002/02/20 23:23:53 sam Exp $
|
||||
* $Id: common.h,v 1.76 2002/02/24 20:51:09 gbazin Exp $
|
||||
*
|
||||
* Authors: Samuel Hocevar <sam@via.ecp.fr>
|
||||
* Vincent Seguin <seguin@via.ecp.fr>
|
||||
@ -98,9 +98,12 @@ typedef struct plugin_info_s * p_plugin_info_t;
|
||||
struct playlist_s;
|
||||
struct playlist_item_s;
|
||||
struct module_s;
|
||||
struct module_config_s;
|
||||
|
||||
typedef struct playlist_s * p_playlist_t;
|
||||
typedef struct playlist_item_s * p_playlist_item_t;
|
||||
typedef struct module_s * p_module_t;
|
||||
typedef struct module_config_s * p_module_config_t;
|
||||
|
||||
/* Interface */
|
||||
struct intf_thread_s;
|
||||
@ -441,10 +444,13 @@ typedef struct module_symbols_s
|
||||
struct aout_bank_s* p_aout_bank;
|
||||
struct vout_bank_s* p_vout_bank;
|
||||
|
||||
int ( * main_GetIntVariable ) ( char *, int );
|
||||
char * ( * main_GetPszVariable ) ( char *, char * );
|
||||
void ( * main_PutIntVariable ) ( char *, int );
|
||||
void ( * main_PutPszVariable ) ( char *, char * );
|
||||
int ( * config_GetIntVariable ) ( const char * );
|
||||
char * ( * config_GetPszVariable ) ( const char * );
|
||||
void ( * config_PutIntVariable ) ( const char *, int );
|
||||
void ( * config_PutPszVariable ) ( const char *, char * );
|
||||
struct module_config_s * ( * config_FindConfig ) ( const char * );
|
||||
struct module_config_s * ( * config_Duplicate ) ( struct module_config_s *,
|
||||
int );
|
||||
|
||||
struct intf_subscription_s * ( * intf_MsgSub ) ( void );
|
||||
void ( * intf_MsgUnsub ) ( struct intf_subscription_s * );
|
||||
@ -463,9 +469,9 @@ typedef struct module_symbols_s
|
||||
void ( * intf_UrlDecode ) ( char * );
|
||||
int ( * intf_Eject ) ( const char * );
|
||||
|
||||
void ( * msleep ) ( mtime_t );
|
||||
mtime_t ( * mdate ) ( void );
|
||||
char * ( * mstrtime ) ( char *, mtime_t );
|
||||
void ( * msleep ) ( mtime_t );
|
||||
mtime_t ( * mdate ) ( void );
|
||||
char * ( * mstrtime ) ( char *, mtime_t );
|
||||
|
||||
int ( * network_ChannelCreate )( void );
|
||||
int ( * network_ChannelJoin ) ( int );
|
||||
@ -574,8 +580,8 @@ typedef struct module_symbols_s
|
||||
|
||||
char * ( * DecodeLanguage ) ( u16 );
|
||||
|
||||
struct module_s * ( * module_Need ) ( int, char *, void * );
|
||||
void ( * module_Unneed ) ( struct module_s * );
|
||||
struct module_s * ( * module_Need ) ( int, char *, void * );
|
||||
void ( * module_Unneed ) ( struct module_s * );
|
||||
|
||||
} module_symbols_t;
|
||||
|
||||
|
320
include/config.h
320
include/config.h
@ -27,13 +27,6 @@
|
||||
*
|
||||
* - Symbols should begin with a prefix indicating in which module they are
|
||||
* used, such as INTF_, VOUT_ or ADEC_.
|
||||
*
|
||||
* - Regarding environment variables, which are used as initialization
|
||||
* parameters for threads :
|
||||
* + variable names should end with '_VAR'
|
||||
* + environment variable default value should end with '_DEFAULT'
|
||||
* + values having a special meaning with '_VAL'
|
||||
*
|
||||
*/
|
||||
|
||||
/*****************************************************************************
|
||||
@ -54,31 +47,10 @@
|
||||
* outputting an error message (in second) */
|
||||
#define THREAD_COND_TIMEOUT 5
|
||||
|
||||
/* Environment variable containing the memcpy method */
|
||||
#define MEMCPY_METHOD_VAR "vlc_memcpy"
|
||||
|
||||
/*
|
||||
* Paths
|
||||
*/
|
||||
|
||||
#define MAX_PLUGIN_COUNT 32
|
||||
|
||||
/*****************************************************************************
|
||||
* Interface configuration
|
||||
*****************************************************************************/
|
||||
|
||||
/* Environment variable containing the display method */
|
||||
#define INTF_METHOD_VAR "vlc_intf"
|
||||
#define INTF_METHOD_DEFAULT "gtk"
|
||||
|
||||
/* Environment variable used to store startup script name and default value */
|
||||
#define INTF_INIT_SCRIPT_VAR "vlcrc"
|
||||
#define INTF_INIT_SCRIPT_DEFAULT ".vlcrc"
|
||||
|
||||
/* Environment variable used to store channels file and default value */
|
||||
#define INTF_CHANNELS_VAR "vlc_channels"
|
||||
#define INTF_CHANNELS_DEFAULT "vlc.channels"
|
||||
|
||||
/* Base delay in micro second for interface sleeps */
|
||||
#define INTF_IDLE_SLEEP ((int)(0.050*CLOCK_FREQ))
|
||||
|
||||
@ -86,21 +58,10 @@
|
||||
#define INTF_GAMMA_STEP .1
|
||||
#define INTF_GAMMA_LIMIT 3
|
||||
|
||||
/* Maximum number of channels */
|
||||
#define INTF_MAX_CHANNELS 10
|
||||
|
||||
/* Default search path for interface file browser */
|
||||
#define INTF_PATH_VAR "vlc_search_path"
|
||||
#define INTF_PATH_DEFAULT ""
|
||||
|
||||
/*****************************************************************************
|
||||
* Input thread configuration
|
||||
*****************************************************************************/
|
||||
|
||||
/* Environment variable containing the input method */
|
||||
#define INPUT_METHOD_VAR "vlc_input"
|
||||
#define INPUT_METHOD_DEFAULT "ps"
|
||||
|
||||
/* XXX?? */
|
||||
#define INPUT_IDLE_SLEEP ((int)(0.100*CLOCK_FREQ))
|
||||
|
||||
@ -124,45 +85,10 @@
|
||||
/* Maximum memory the input is allowed to use (20 MB) */
|
||||
#define INPUT_MAX_ALLOCATION 20971520
|
||||
|
||||
/* Default network protocol */
|
||||
#define INPUT_NETWORK_PROTOCOL_VAR "vlc_network_protocol"
|
||||
#define INPUT_NETWORK_PROTOCOL_DEFAULT "ts"
|
||||
|
||||
/* Default input port */
|
||||
#define INPUT_PORT_VAR "vlc_server_port"
|
||||
#define INPUT_PORT_DEFAULT 1234
|
||||
|
||||
/* FIXME : Delete those ! */
|
||||
/* Default remote server */
|
||||
#define INPUT_SERVER_VAR "vlc_server"
|
||||
#define INPUT_SERVER_DEFAULT "138.195.143.220"
|
||||
|
||||
/* Broadcast mode */
|
||||
#define INPUT_BROADCAST_VAR "vlc_broadcast"
|
||||
#define INPUT_BROADCAST_DEFAULT 0
|
||||
|
||||
/* Default broadcast address */
|
||||
#define INPUT_BCAST_ADDR_VAR "vlc_broadcast_addr"
|
||||
#define INPUT_BCAST_ADDR_DEFAULT "138.195.143.255"
|
||||
|
||||
/* Channels mode */
|
||||
#define INPUT_NETWORK_CHANNEL_VAR "vlc_channel"
|
||||
#define INPUT_NETWORK_CHANNEL_DEFAULT 0
|
||||
|
||||
/*
|
||||
* Channel method
|
||||
*/
|
||||
|
||||
/* Default network interface and environment variable */
|
||||
#define INPUT_IFACE_VAR "vlc_iface"
|
||||
#define INPUT_IFACE_DEFAULT "eth0"
|
||||
|
||||
/* Default server and port */
|
||||
#define INPUT_CHANNEL_SERVER_VAR "vlc_channel_server"
|
||||
#define INPUT_CHANNEL_SERVER_DEFAULT "138.195.143.120"
|
||||
#define INPUT_CHANNEL_PORT_VAR "vlc_channel_port"
|
||||
#define INPUT_CHANNEL_PORT_DEFAULT 6010
|
||||
|
||||
/* Delay between channel changes - this is required to avoid flooding the
|
||||
* channel server */
|
||||
#define INPUT_CHANNEL_CHANGE_DELAY (mtime_t)(5*CLOCK_FREQ)
|
||||
@ -171,19 +97,6 @@
|
||||
* mark it to be presented */
|
||||
#define DEFAULT_PTS_DELAY (mtime_t)(.2*CLOCK_FREQ)
|
||||
|
||||
/* DVD defaults */
|
||||
#define INPUT_DVD_DEVICE_VAR "vlc_dvd_device"
|
||||
|
||||
#define INPUT_TITLE_VAR "vlc_input_title"
|
||||
#define INPUT_CHAPTER_VAR "vlc_input_chapter"
|
||||
#define INPUT_ANGLE_VAR "vlc_input_angle"
|
||||
#define INPUT_AUDIO_VAR "vlc_input_audio"
|
||||
#define INPUT_CHANNEL_VAR "vlc_input_channel"
|
||||
#define INPUT_SUBTITLE_VAR "vlc_input_subtitle"
|
||||
|
||||
/* VCD defaults */
|
||||
#define INPUT_VCD_DEVICE_VAR "vlc_vcd_device"
|
||||
|
||||
/*****************************************************************************
|
||||
* Audio configuration
|
||||
*****************************************************************************/
|
||||
@ -191,14 +104,6 @@
|
||||
/* Maximum number of audio output threads */
|
||||
#define AOUT_MAX_THREADS 10
|
||||
|
||||
/* Environment variable containing the audio output method */
|
||||
#define AOUT_METHOD_VAR "vlc_aout"
|
||||
#define AOUT_METHOD_DEFAULT "dsp"
|
||||
|
||||
/* Environment variable used to store dsp device name, and default value */
|
||||
#define AOUT_DSP_VAR "vlc_dsp"
|
||||
#define AOUT_DSP_DEFAULT "/dev/dsp"
|
||||
|
||||
/* Default audio output format (AOUT_FMT_S16_NE = Native Endianess) */
|
||||
#define AOUT_FORMAT_DEFAULT AOUT_FMT_S16_NE
|
||||
/* #define AOUT_FORMAT_DEFAULT AOUT_FMT_S8 */
|
||||
@ -208,32 +113,11 @@
|
||||
/* #define AOUT_FORMAT_DEFAULT AOUT_FMT_U16_BE */
|
||||
/* #define AOUT_FORMAT_DEFAULT AOUT_FMT_U16_LE */
|
||||
|
||||
/* Environment variable for stereo, and default value */
|
||||
#define AOUT_STEREO_VAR "vlc_stereo"
|
||||
#define AOUT_STEREO_DEFAULT 1
|
||||
|
||||
/* Environment variable for spdif mode */
|
||||
#define AOUT_SPDIF_VAR "vlc_spdif"
|
||||
#define AOUT_SPDIF_DEFAULT 0
|
||||
|
||||
/* Environment variable containing the AC3 downmix method */
|
||||
#define DOWNMIX_METHOD_VAR "vlc_downmix"
|
||||
|
||||
/* Environment variable containing the AC3 IMDCT method */
|
||||
#define IMDCT_METHOD_VAR "vlc_imdct"
|
||||
|
||||
/* Volume */
|
||||
#define VOLUME_DEFAULT 512
|
||||
#define VOLUME_STEP 128
|
||||
#define VOLUME_MAX 1024
|
||||
|
||||
/* Environment variable for volume */
|
||||
#define AOUT_VOLUME_VAR "vlc_volume"
|
||||
|
||||
/* Environment variable for output rate, and default value */
|
||||
#define AOUT_RATE_VAR "vlc_audio_rate"
|
||||
#define AOUT_RATE_DEFAULT 44100
|
||||
|
||||
/* Number of audio output frames contained in an audio output fifo.
|
||||
* (AOUT_FIFO_SIZE + 1) must be a power of 2, in order to optimise the
|
||||
* %(AOUT_FIFO_SIZE + 1) operation with an &AOUT_FIFO_SIZE.
|
||||
@ -251,10 +135,6 @@
|
||||
* - long, in order to perform the buffer calculations as few as possible */
|
||||
#define AOUT_BUFFER_DURATION 100000
|
||||
|
||||
/* Environment variable for audio decoders */
|
||||
#define ADEC_MPEG_VAR "vlc_mpeg_adec"
|
||||
#define ADEC_AC3_VAR "vlc_ac3_adec"
|
||||
|
||||
/*****************************************************************************
|
||||
* Video configuration
|
||||
*****************************************************************************/
|
||||
@ -266,39 +146,6 @@
|
||||
* Default settings for video output threads
|
||||
*/
|
||||
|
||||
/* Environment variable containing the display method */
|
||||
#define VOUT_METHOD_VAR "vlc_vout"
|
||||
#define VOUT_METHOD_DEFAULT "x11"
|
||||
|
||||
/* Environment variable containing the display method */
|
||||
#define VOUT_FILTER_VAR "vlc_filter"
|
||||
#define VOUT_FILTER_DEFAULT "x11"
|
||||
|
||||
/* Environment variable containing the motion compensation method */
|
||||
#define MOTION_METHOD_VAR "vlc_motion"
|
||||
|
||||
/* Environment variable containing the IDCT method */
|
||||
#define IDCT_METHOD_VAR "vlc_idct"
|
||||
|
||||
/* Environment variable containing the YUV method */
|
||||
#define YUV_METHOD_VAR "vlc_yuv"
|
||||
|
||||
/* Environment variable used in place of DISPLAY if available */
|
||||
#define VOUT_DISPLAY_VAR "vlc_display"
|
||||
|
||||
/* Default dimensions for display window - these dimensions are enough for the
|
||||
* standard width and height broadcasted MPEG-2 streams or DVDs */
|
||||
#define VOUT_WIDTH_VAR "vlc_width"
|
||||
#define VOUT_WIDTH_DEFAULT 720
|
||||
#define VOUT_HEIGHT_VAR "vlc_height"
|
||||
#define VOUT_HEIGHT_DEFAULT 576
|
||||
#define VOUT_DEPTH_VAR "vlc_depth"
|
||||
#define VOUT_DEPTH_DEFAULT 15
|
||||
|
||||
/* Default SPU margin is -1, which means we don't force their position */
|
||||
#define VOUT_SPUMARGIN_VAR "vlc_spumargin"
|
||||
#define VOUT_SPUMARGIN_DEFAULT -1
|
||||
|
||||
/* Multiplier value for aspect ratio calculation (2^7 * 3^3 * 5^3) */
|
||||
#define VOUT_ASPECT_FACTOR 432000
|
||||
|
||||
@ -323,22 +170,6 @@
|
||||
* joined. */
|
||||
#define VOUT_MAX_AREAS 5
|
||||
|
||||
/* Environment variable for grayscale output mode, and default value */
|
||||
#define VOUT_GRAYSCALE_VAR "vlc_grayscale"
|
||||
#define VOUT_GRAYSCALE_DEFAULT 0
|
||||
|
||||
/* Environment variable for fullscreen mode, and default value */
|
||||
#define VOUT_FULLSCREEN_VAR "vlc_fullscreen"
|
||||
#define VOUT_FULLSCREEN_DEFAULT 0
|
||||
|
||||
/* Environment variable for overlay mode, and default value */
|
||||
#define VOUT_NOOVERLAY_VAR "vlc_nooverlay"
|
||||
#define VOUT_NOOVERLAY_DEFAULT 0
|
||||
|
||||
/* Default gamma */
|
||||
#define VOUT_GAMMA_VAR "vlc_gamma"
|
||||
#define VOUT_GAMMA_DEFAULT 0.
|
||||
|
||||
/* Default fonts */
|
||||
#define VOUT_DEFAULT_FONT "default8x9.psf"
|
||||
#define VOUT_LARGE_FONT "default8x16.psf"
|
||||
@ -379,13 +210,6 @@
|
||||
/* The default video output window title */
|
||||
#define VOUT_TITLE "VideoLAN Client " VERSION
|
||||
|
||||
/* Environment variable for framebuffer device, and default value */
|
||||
#define VOUT_FB_DEV_VAR "vlc_fb_dev"
|
||||
#define VOUT_FB_DEV_DEFAULT "/dev/fb0"
|
||||
|
||||
/* Environment variable for XVideo adaptor, and default value */
|
||||
#define VOUT_XVADAPTOR_VAR "vlc_xv_adaptor"
|
||||
|
||||
/*****************************************************************************
|
||||
* Video parser configuration
|
||||
*****************************************************************************/
|
||||
@ -403,9 +227,6 @@
|
||||
/* Maximum number of macroblocks in a picture. */
|
||||
#define MAX_MB 2048
|
||||
|
||||
/* The synchro variable name */
|
||||
#define VPAR_SYNCHRO_VAR "vlc_synchro"
|
||||
|
||||
/*****************************************************************************
|
||||
* Video decoder configuration
|
||||
*****************************************************************************/
|
||||
@ -415,9 +236,6 @@
|
||||
/* Maximum range of values out of the IDCT + motion compensation. */
|
||||
#define VDEC_CROPRANGE 2048
|
||||
|
||||
/* Environment variable containing the SMP value. */
|
||||
#define VDEC_SMP_VAR "vlc_smp"
|
||||
|
||||
/* No SMP by default, since it slows down things on non-smp machines. */
|
||||
#define VDEC_SMP_DEFAULT 0
|
||||
|
||||
@ -436,23 +254,137 @@
|
||||
* queue are printed, but not sent to the threads */
|
||||
#define INTF_MSG_QSIZE 256
|
||||
|
||||
/* Interface warnig message level */
|
||||
#define INTF_WARNING_VAR "vlc_warning_level"
|
||||
#define INTF_WARNING_DEFAULT 0
|
||||
|
||||
/****************************************************************************
|
||||
* Playlist defaults
|
||||
* Macros for the names of the main options
|
||||
* Instead of directly manipulating the option names, we define macros for
|
||||
* them. This makes sense only for the main options (ie. only the ones defined
|
||||
* in main.c) because they are widely used.
|
||||
* We won't bother doing this for plugins as plugin specific options should
|
||||
* by definition be restricted in useage to the plugin that defines them.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* Interface option names
|
||||
*/
|
||||
|
||||
/* Variable containing the display method */
|
||||
#define INTF_METHOD_VAR "intf"
|
||||
/* Variable used to store startup script */
|
||||
#define INTF_INIT_SCRIPT_VAR "vlcrc"
|
||||
/* Default search path for interface file browser */
|
||||
#define INTF_PATH_VAR "search_path"
|
||||
/* Interface warnig message level */
|
||||
#define INTF_WARNING_VAR "warning"
|
||||
/* Variable to enable stats mode */
|
||||
#define INTF_STATS_VAR "stats"
|
||||
|
||||
/*
|
||||
* Audio output option names
|
||||
*/
|
||||
|
||||
/* Variable to disable the audio output */
|
||||
#define AOUT_NOAUDIO_VAR "noaudio"
|
||||
/* Variable containing the audio output method */
|
||||
#define AOUT_METHOD_VAR "aout"
|
||||
/* Variable for spdif mode */
|
||||
#define AOUT_SPDIF_VAR "spdif"
|
||||
/* Variable for volume */
|
||||
#define AOUT_VOLUME_VAR "volume"
|
||||
/* Variable for mono */
|
||||
#define AOUT_MONO_VAR "audio_mono"
|
||||
/* Variable for output rate */
|
||||
#define AOUT_RATE_VAR "audio_rate"
|
||||
/* Variable for output rate */
|
||||
#define AOUT_DESYNC_VAR "audio_desync"
|
||||
|
||||
/*
|
||||
* Video output option names
|
||||
*/
|
||||
|
||||
/* Variable to disable the video output */
|
||||
#define VOUT_NOVIDEO_VAR "novideo"
|
||||
/* Variable containing the display method */
|
||||
#define VOUT_METHOD_VAR "vout"
|
||||
/* Variable used in place of DISPLAY if available */
|
||||
#define VOUT_DISPLAY_VAR "display"
|
||||
/* Dimensions for display window */
|
||||
#define VOUT_WIDTH_VAR "width"
|
||||
#define VOUT_HEIGHT_VAR "height"
|
||||
/* Variable for grayscale output mode */
|
||||
#define VOUT_GRAYSCALE_VAR "grayscale"
|
||||
/* Variable for fullscreen mode */
|
||||
#define VOUT_FULLSCREEN_VAR "fullscreen"
|
||||
/* Variable for overlay mode */
|
||||
#define VOUT_NOOVERLAY_VAR "nooverlay"
|
||||
/* Variable containing the filter method */
|
||||
#define VOUT_FILTER_VAR "filter"
|
||||
/* Variable containing the SPU margin */
|
||||
#define VOUT_SPUMARGIN_VAR "spumargin"
|
||||
|
||||
/*
|
||||
* Input option names
|
||||
*/
|
||||
|
||||
/* Variable containing the input method */
|
||||
#define INPUT_METHOD_VAR "input"
|
||||
/* Input port */
|
||||
#define INPUT_PORT_VAR "server_port"
|
||||
/* Channels mode */
|
||||
#define INPUT_NETWORK_CHANNEL_VAR "network_channel"
|
||||
/* Variable containing channel server and port */
|
||||
#define INPUT_CHANNEL_SERVER_VAR "channel_server"
|
||||
#define INPUT_CHANNEL_PORT_VAR "channel_port"
|
||||
/* Variable containing network interface */
|
||||
#define INPUT_IFACE_VAR "iface"
|
||||
|
||||
#define INPUT_TITLE_VAR "input_title"
|
||||
#define INPUT_CHAPTER_VAR "input_chapter"
|
||||
#define INPUT_ANGLE_VAR "input_angle"
|
||||
#define INPUT_AUDIO_VAR "input_audio"
|
||||
#define INPUT_CHANNEL_VAR "input_channel"
|
||||
#define INPUT_SUBTITLE_VAR "input_subtitle"
|
||||
/* DVD defaults */
|
||||
#define INPUT_DVD_DEVICE_VAR "dvd_device"
|
||||
/* VCD defaults */
|
||||
#define INPUT_VCD_DEVICE_VAR "vcd_device"
|
||||
|
||||
/*
|
||||
* Decoders option names
|
||||
*/
|
||||
|
||||
/* Variables for audio decoders */
|
||||
#define ADEC_MPEG_VAR "mpeg_adec"
|
||||
#define ADEC_AC3_VAR "ac3_adec"
|
||||
/* The synchro variable name */
|
||||
#define VPAR_SYNCHRO_VAR "vpar_synchro"
|
||||
/* Variable containing the SMP value */
|
||||
#define VDEC_SMP_VAR "vdec_smp"
|
||||
|
||||
/*
|
||||
* Playlist option names
|
||||
*/
|
||||
|
||||
/* Launch on start-up */
|
||||
#define PLAYLIST_STARTUP_VAR "vlc_playlist_on_start_up"
|
||||
#define PLAYLIST_STARTUP_DEFAULT 0
|
||||
|
||||
#define PLAYLIST_STARTUP_VAR "playlist_on_startup"
|
||||
/* Enqueue drag'n dropped item */
|
||||
#define PLAYLIST_ENQUEUE_VAR "vlc_playlist_enqueue"
|
||||
#define PLAYLIST_ENQUEUE_DEFAULT 0
|
||||
|
||||
#define PLAYLIST_ENQUEUE_VAR "playlist_enqueue"
|
||||
/* Loop on playlist end */
|
||||
#define PLAYLIST_LOOP_VAR "vlc_playlist_loop"
|
||||
#define PLAYLIST_LOOP_DEFAULT 0
|
||||
#define PLAYLIST_LOOP_VAR "playlist_loop"
|
||||
|
||||
/*
|
||||
* CPU options
|
||||
*/
|
||||
#define NOMMX_VAR "nommx"
|
||||
#define NO3DN_VAR "no3dn"
|
||||
#define NOMMXEXT_VAR "nommxext"
|
||||
#define NOSSE_VAR "nosse"
|
||||
#define NOALTIVEC_VAR "noaltivec"
|
||||
|
||||
/*
|
||||
* Misc option names
|
||||
*/
|
||||
|
||||
/* Variable containing the memcpy method */
|
||||
#define MEMCPY_METHOD_VAR "memcpy"
|
||||
|
116
include/configuration.h
Normal file
116
include/configuration.h
Normal file
@ -0,0 +1,116 @@
|
||||
/*****************************************************************************
|
||||
* configuration.h : configuration management module
|
||||
* This file describes the programming interface for the configuration module.
|
||||
* It includes functions allowing to declare, get or set configuration options.
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1999, 2000 VideoLAN
|
||||
* $Id: configuration.h,v 1.1 2002/02/24 20:51:09 gbazin Exp $
|
||||
*
|
||||
* Authors: Gildas Bazin <gbazin@netcourrier.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
|
||||
*****************************************************************************/
|
||||
|
||||
/*****************************************************************************
|
||||
* Macros used to build the configuration structure.
|
||||
*****************************************************************************/
|
||||
|
||||
/* Mandatory last part of the structure */
|
||||
#define MODULE_CONFIG_ITEM_END 0x000 /* End of config */
|
||||
|
||||
/* Configuration widgets */
|
||||
#define MODULE_CONFIG_ITEM_CATEGORY 0x0001 /* Start of new category */
|
||||
#define MODULE_CONFIG_ITEM_SUBCATEGORY 0x0002 /* Start of sub-category */
|
||||
#define MODULE_CONFIG_ITEM_SUBCATEGORY_END 0x0003 /* End of sub-category */
|
||||
#define MODULE_CONFIG_ITEM_STRING 0x0004 /* String option */
|
||||
#define MODULE_CONFIG_ITEM_FILE 0x0005 /* File option */
|
||||
#define MODULE_CONFIG_ITEM_PLUGIN 0x0006 /* Plugin option */
|
||||
#define MODULE_CONFIG_ITEM_INTEGER 0x0007 /* Integer option */
|
||||
#define MODULE_CONFIG_ITEM_BOOL 0x0008 /* Bool option */
|
||||
#define MODULE_CONFIG_ITEM_ALIAS 0x0009 /* Alias option */
|
||||
|
||||
typedef struct module_config_s
|
||||
{
|
||||
int i_type; /* Configuration type */
|
||||
char * psz_name; /* Option name */
|
||||
char * psz_text; /* Short comment on the configuration option */
|
||||
char * psz_longtext; /* Long comment on the configuration option */
|
||||
char * psz_value; /* Option value */
|
||||
int i_value; /* Option value */
|
||||
void * p_callback; /* Function to call when commiting a change */
|
||||
boolean_t b_dirty; /* Dirty flag to indicate a config change */
|
||||
|
||||
} module_config_t;
|
||||
|
||||
/*****************************************************************************
|
||||
* Prototypes - these methods are used to get, set or manipulate configuration
|
||||
* data.
|
||||
*****************************************************************************/
|
||||
#ifndef PLUGIN
|
||||
int config_GetIntVariable( const char *psz_name );
|
||||
char * config_GetPszVariable( const char *psz_name );
|
||||
void config_PutIntVariable( const char *psz_name, int i_value );
|
||||
void config_PutPszVariable( const char *psz_name, char *psz_value );
|
||||
|
||||
module_config_t *config_FindConfig( const char *psz_name );
|
||||
module_config_t *config_Duplicate ( module_config_t *p_config_orig,
|
||||
int i_config_options );
|
||||
#else
|
||||
# define config_GetIntVariable p_symbols->config_GetIntVariable
|
||||
# define config_PutIntVariable p_symbols->config_PutIntVariable
|
||||
# define config_GetPszVariable p_symbols->config_GetPszVariable
|
||||
# define config_PutPszVariable p_symbols->config_PutPszVariable
|
||||
# define config_Duplicate p_symbols->config_Duplicate
|
||||
# define config_FindConfig p_symbols->config_FindConfig
|
||||
#endif
|
||||
|
||||
/*****************************************************************************
|
||||
* Macros used to build the configuration structure.
|
||||
*
|
||||
* Note that internally we support only 2 types of config data: int and string.
|
||||
* The other types declared here just map to one of these 2 basic types but
|
||||
* have the advantage of also providing very good hints to a configuration
|
||||
* interface so as to make it more user friendly.
|
||||
* The configuration structure also includes category hints. These hints can
|
||||
* provide a configuration inteface with some very useful data and also allow
|
||||
* for a more user friendly interface.
|
||||
*****************************************************************************/
|
||||
|
||||
#define MODULE_CONFIG_START \
|
||||
static module_config_t p_config[] = {
|
||||
|
||||
#define MODULE_CONFIG_STOP \
|
||||
{ MODULE_CONFIG_ITEM_END, NULL, NULL, NULL, NULL, 0, NULL, 0 } };
|
||||
|
||||
#define ADD_CATEGORY_HINT( text, longtext ) \
|
||||
{ MODULE_CONFIG_ITEM_CATEGORY, NULL, text, longtext, NULL, 0, NULL, 0 },
|
||||
#define ADD_SUBCATEGORY_HINT( text, longtext ) \
|
||||
{ MODULE_CONFIG_ITEM_SUBCATEGORY, NULL, text, longtext, NULL, 0, NULL, 0 },
|
||||
#define END_SUBCATEGORY_HINT \
|
||||
{ MODULE_CONFIG_ITEM_SUBCATEGORY_END, NULL, NULL, NULL, NULL, 0, NULL, 0 },
|
||||
#define ADD_STRING( name, value, p_callback, text, longtext ) \
|
||||
{ MODULE_CONFIG_ITEM_STRING, name, text, longtext, value, 0, \
|
||||
p_callback, 0 },
|
||||
#define ADD_FILE( name, psz_value, p_callback, text, longtext ) \
|
||||
{ MODULE_CONFIG_ITEM_FILE, name, text, longtext, psz_value, 0, \
|
||||
p_callback, 0 },
|
||||
#define ADD_PLUGIN( name, i_capability, psz_value, p_callback, text, longtext)\
|
||||
{ MODULE_CONFIG_ITEM_PLUGIN, name, text, longtext, psz_value, \
|
||||
i_capability, p_callback, 0 },
|
||||
#define ADD_INTEGER( name, i_value, p_callback, text, longtext ) \
|
||||
{ MODULE_CONFIG_ITEM_INTEGER, name, text, longtext, NULL, i_value, \
|
||||
p_callback, 0 },
|
||||
#define ADD_BOOL( name, p_callback, text, longtext ) \
|
||||
{ MODULE_CONFIG_ITEM_BOOL, name, text, longtext, NULL, 0, p_callback, 0 },
|
@ -3,7 +3,7 @@
|
||||
* Declaration and extern access to global program object.
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1999, 2000 VideoLAN
|
||||
* $Id: main.h,v 1.29 2002/02/15 13:32:52 sam Exp $
|
||||
* $Id: main.h,v 1.30 2002/02/24 20:51:09 gbazin Exp $
|
||||
*
|
||||
* Authors: Vincent Seguin <seguin@via.ecp.fr>
|
||||
*
|
||||
@ -38,7 +38,6 @@ typedef struct main_s
|
||||
/* Global properties */
|
||||
int i_argc; /* command line arguments count */
|
||||
char ** ppsz_argv; /* command line arguments */
|
||||
char ** ppsz_env; /* environment variables */
|
||||
char * psz_arg0; /* program name (whithout path) */
|
||||
|
||||
u32 i_cpu_capabilities; /* CPU extensions */
|
||||
@ -49,6 +48,7 @@ typedef struct main_s
|
||||
boolean_t b_audio; /* is audio output allowed ? */
|
||||
boolean_t b_video; /* is video output allowed ? */
|
||||
boolean_t b_ac3;
|
||||
boolean_t b_stereo;
|
||||
mtime_t i_desync; /* relative desync of the audio ouput */
|
||||
|
||||
/* Fast memcpy plugin used */
|
||||
@ -77,20 +77,3 @@ extern main_t *p_main;
|
||||
*****************************************************************************/
|
||||
#define FAST_MEMCPY p_main->pf_memcpy
|
||||
#define FAST_MEMSET p_main->pf_memset
|
||||
|
||||
/*****************************************************************************
|
||||
* Prototypes - these methods are used to get default values for some threads
|
||||
* and modules.
|
||||
*****************************************************************************/
|
||||
#ifndef PLUGIN
|
||||
int main_GetIntVariable( char *psz_name, int i_default );
|
||||
char * main_GetPszVariable( char *psz_name, char *psz_default );
|
||||
void main_PutIntVariable( char *psz_name, int i_value );
|
||||
void main_PutPszVariable( char *psz_name, char *psz_value );
|
||||
#else
|
||||
# define main_GetIntVariable p_symbols->main_GetIntVariable
|
||||
# define main_PutIntVariable p_symbols->main_PutIntVariable
|
||||
# define main_GetPszVariable p_symbols->main_GetPszVariable
|
||||
# define main_PutPszVariable p_symbols->main_PutPszVariable
|
||||
#endif
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
* modules.h : Module management functions.
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2001 VideoLAN
|
||||
* $Id: modules.h,v 1.41 2002/02/15 13:32:52 sam Exp $
|
||||
* $Id: modules.h,v 1.42 2002/02/24 20:51:09 gbazin Exp $
|
||||
*
|
||||
* Authors: Samuel Hocevar <sam@zoy.org>
|
||||
*
|
||||
@ -46,34 +46,36 @@ static __inline__ char *GetCapabilityName( unsigned int i_capa )
|
||||
* new capability. */
|
||||
static char *pp_capa[] =
|
||||
{
|
||||
"main",
|
||||
#define MODULE_CAPABILITY_MAIN 0 /* Main */
|
||||
"interface",
|
||||
#define MODULE_CAPABILITY_INTF 0 /* Interface */
|
||||
#define MODULE_CAPABILITY_INTF 1 /* Interface */
|
||||
"access",
|
||||
#define MODULE_CAPABILITY_ACCESS 1 /* Input */
|
||||
#define MODULE_CAPABILITY_ACCESS 2 /* Input */
|
||||
"input",
|
||||
#define MODULE_CAPABILITY_INPUT 2 /* Input */
|
||||
#define MODULE_CAPABILITY_INPUT 3 /* Input */
|
||||
"decaps",
|
||||
#define MODULE_CAPABILITY_DECAPS 3 /* Decaps */
|
||||
#define MODULE_CAPABILITY_DECAPS 4 /* Decaps */
|
||||
"decoder",
|
||||
#define MODULE_CAPABILITY_DECODER 4 /* Audio or video decoder */
|
||||
#define MODULE_CAPABILITY_DECODER 5 /* Audio or video decoder */
|
||||
"motion",
|
||||
#define MODULE_CAPABILITY_MOTION 5 /* Motion compensation */
|
||||
#define MODULE_CAPABILITY_MOTION 6 /* Motion compensation */
|
||||
"iDCT",
|
||||
#define MODULE_CAPABILITY_IDCT 6 /* IDCT transformation */
|
||||
#define MODULE_CAPABILITY_IDCT 7 /* IDCT transformation */
|
||||
"audio output",
|
||||
#define MODULE_CAPABILITY_AOUT 7 /* Audio output */
|
||||
#define MODULE_CAPABILITY_AOUT 8 /* Audio output */
|
||||
"video output",
|
||||
#define MODULE_CAPABILITY_VOUT 8 /* Video output */
|
||||
#define MODULE_CAPABILITY_VOUT 9 /* Video output */
|
||||
"chroma transformation",
|
||||
#define MODULE_CAPABILITY_CHROMA 9 /* colorspace conversion */
|
||||
#define MODULE_CAPABILITY_CHROMA 10 /* colorspace conversion */
|
||||
"iMDCT",
|
||||
#define MODULE_CAPABILITY_IMDCT 10 /* IMDCT transformation */
|
||||
#define MODULE_CAPABILITY_IMDCT 11 /* IMDCT transformation */
|
||||
"downmix",
|
||||
#define MODULE_CAPABILITY_DOWNMIX 11 /* AC3 downmix */
|
||||
#define MODULE_CAPABILITY_DOWNMIX 12 /* AC3 downmix */
|
||||
"memcpy",
|
||||
#define MODULE_CAPABILITY_MEMCPY 12 /* memcpy */
|
||||
#define MODULE_CAPABILITY_MEMCPY 13 /* memcpy */
|
||||
"unknown"
|
||||
#define MODULE_CAPABILITY_MAX 13 /* Total number of capabilities */
|
||||
#define MODULE_CAPABILITY_MAX 14 /* Total number of capabilities */
|
||||
};
|
||||
|
||||
return pp_capa[ (i_capa) > MODULE_CAPABILITY_MAX ? MODULE_CAPABILITY_MAX :
|
||||
@ -120,6 +122,7 @@ typedef struct module_s
|
||||
|
||||
struct module_functions_s *p_functions; /* Capability functions */
|
||||
struct module_config_s *p_config; /* Module configuration structure */
|
||||
int i_config_options; /* number of configuration options */
|
||||
|
||||
/*
|
||||
* Variables used internally by the module manager
|
||||
@ -325,41 +328,14 @@ typedef struct module_functions_s
|
||||
|
||||
typedef struct module_functions_s * p_module_functions_t;
|
||||
|
||||
/*****************************************************************************
|
||||
* Macros used to build the configuration structure.
|
||||
*****************************************************************************/
|
||||
|
||||
/* Mandatory first and last parts of the structure */
|
||||
#define MODULE_CONFIG_ITEM_START 0xdead /* The main window */
|
||||
#define MODULE_CONFIG_ITEM_END 0xbeef /* End of the window */
|
||||
|
||||
/* Configuration widgets */
|
||||
#define MODULE_CONFIG_ITEM_WINDOW 0x0001 /* The main window */
|
||||
#define MODULE_CONFIG_ITEM_PANE 0x0002 /* A notebook pane */
|
||||
#define MODULE_CONFIG_ITEM_FRAME 0x0003 /* A frame */
|
||||
#define MODULE_CONFIG_ITEM_COMMENT 0x0004 /* A comment text */
|
||||
#define MODULE_CONFIG_ITEM_STRING 0x0005 /* A string */
|
||||
#define MODULE_CONFIG_ITEM_FILE 0x0006 /* A file selector */
|
||||
#define MODULE_CONFIG_ITEM_CHECK 0x0007 /* A checkbox */
|
||||
#define MODULE_CONFIG_ITEM_CHOOSE 0x0008 /* A choose box */
|
||||
#define MODULE_CONFIG_ITEM_RADIO 0x0009 /* A radio box */
|
||||
#define MODULE_CONFIG_ITEM_SCALE 0x000a /* A horizontal ruler */
|
||||
#define MODULE_CONFIG_ITEM_SPIN 0x000b /* A numerical selector */
|
||||
|
||||
typedef struct module_config_s
|
||||
{
|
||||
int i_type; /* Configuration widget type */
|
||||
char * psz_text; /* Text commenting or describing the widget */
|
||||
char * psz_name; /* Variable name */
|
||||
void * p_getlist; /* Function to call to get a choice list */
|
||||
void * p_change; /* Function to call when commiting a change */
|
||||
} module_config_t;
|
||||
|
||||
/*****************************************************************************
|
||||
* Exported functions.
|
||||
*****************************************************************************/
|
||||
#ifndef PLUGIN
|
||||
void module_InitBank ( void );
|
||||
void module_LoadMain ( void );
|
||||
void module_LoadBuiltins ( void );
|
||||
void module_LoadPlugins ( void );
|
||||
void module_EndBank ( void );
|
||||
void module_ResetBank ( void );
|
||||
void module_ManageBank ( void );
|
||||
@ -370,4 +346,3 @@ void module_Unneed ( module_t * p_module );
|
||||
# define module_Need p_symbols->module_Need
|
||||
# define module_Unneed p_symbols->module_Unneed
|
||||
#endif
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
* modules_inner.h : Macros used from within a module.
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2001 VideoLAN
|
||||
* $Id: modules_inner.h,v 1.11 2002/01/09 02:01:14 sam Exp $
|
||||
* $Id: modules_inner.h,v 1.12 2002/02/24 20:51:09 gbazin Exp $
|
||||
*
|
||||
* Authors: Samuel Hocevar <sam@zoy.org>
|
||||
*
|
||||
@ -72,9 +72,12 @@
|
||||
/*
|
||||
* InitModule: this function is called once and only once, when the module
|
||||
* is looked at for the first time. We get the useful data from it, for
|
||||
* instance the module name, its shortcuts, its capabilities...
|
||||
* instance the module name, its shortcuts, its capabilities... we also create
|
||||
* a copy of its config because the module can be unloaded at any time.
|
||||
*/
|
||||
#define MODULE_INIT_START \
|
||||
DECLARE_SYMBOLS; \
|
||||
\
|
||||
int __VLC_SYMBOL( InitModule ) ( module_t *p_module ) \
|
||||
{ \
|
||||
int i_shortcut = 0; \
|
||||
@ -85,7 +88,17 @@
|
||||
p_module->i_cpu_capabilities = 0;
|
||||
|
||||
#define MODULE_INIT_STOP \
|
||||
STORE_SYMBOLS; \
|
||||
p_module->pp_shortcuts[ i_shortcut ] = NULL; \
|
||||
p_module->i_config_options = sizeof(p_config)/sizeof(module_config_t);\
|
||||
p_module->p_config = config_Duplicate( p_config, \
|
||||
p_module->i_config_options ); \
|
||||
if( p_module->p_config == NULL ) \
|
||||
{ \
|
||||
intf_ErrMsg( MODULE_STRING \
|
||||
" InitModule error: can't duplicate p_config" ); \
|
||||
return( -1 ); \
|
||||
} \
|
||||
return( 0 ); \
|
||||
}
|
||||
|
||||
@ -113,8 +126,6 @@
|
||||
* module will be used.
|
||||
*/
|
||||
#define MODULE_ACTIVATE_START \
|
||||
DECLARE_SYMBOLS; \
|
||||
\
|
||||
int __VLC_SYMBOL( ActivateModule ) ( module_t *p_module ) \
|
||||
{ \
|
||||
p_module->p_functions = \
|
||||
@ -123,7 +134,6 @@
|
||||
{ \
|
||||
return( -1 ); \
|
||||
} \
|
||||
p_module->p_config = p_config; \
|
||||
STORE_SYMBOLS;
|
||||
|
||||
#define MODULE_ACTIVATE_STOP \
|
||||
@ -143,38 +153,3 @@
|
||||
#define MODULE_DEACTIVATE_STOP \
|
||||
return( 0 ); \
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* Macros used to build the configuration structure.
|
||||
*****************************************************************************/
|
||||
|
||||
#define MODULE_CONFIG_START \
|
||||
static module_config_t p_config[] = { \
|
||||
{ MODULE_CONFIG_ITEM_START, NULL, NULL, NULL, NULL },
|
||||
|
||||
#define MODULE_CONFIG_STOP \
|
||||
{ MODULE_CONFIG_ITEM_END, NULL, NULL, NULL, NULL } };
|
||||
|
||||
#define ADD_WINDOW( text ) \
|
||||
{ MODULE_CONFIG_ITEM_WINDOW, text, NULL, NULL, NULL },
|
||||
#define ADD_FRAME( text ) \
|
||||
{ MODULE_CONFIG_ITEM_FRAME, text, NULL, NULL, NULL },
|
||||
#define ADD_PANE( text ) \
|
||||
{ MODULE_CONFIG_ITEM_PANE, text, NULL, NULL, NULL },
|
||||
#define ADD_COMMENT( text ) \
|
||||
{ MODULE_CONFIG_ITEM_COMMENT, text, NULL, NULL, NULL },
|
||||
#define ADD_STRING( text, name, p_update ) \
|
||||
{ MODULE_CONFIG_ITEM_STRING, text, name, NULL, p_update },
|
||||
#define ADD_FILE( text, name, p_update ) \
|
||||
{ MODULE_CONFIG_ITEM_FILE, text, name, NULL, p_update },
|
||||
#define ADD_CHECK( text, name, p_update ) \
|
||||
{ MODULE_CONFIG_ITEM_CHECK, text, name, NULL, p_update },
|
||||
#define ADD_CHOOSE( text, name, p_getlist, p_update ) \
|
||||
{ MODULE_CONFIG_ITEM_CHOOSE, text, name, p_getlist, p_update },
|
||||
#define ADD_RADIO( text, name, p_getlist, p_update ) \
|
||||
{ MODULE_CONFIG_ITEM_RADIO, text, name, p_getlist, p_update },
|
||||
#define ADD_SCALE( text, name, p_getlist, p_update ) \
|
||||
{ MODULE_CONFIG_ITEM_SCALE, text, name, p_getlist, p_update },
|
||||
#define ADD_SPIN( text, name, p_getlist, p_update ) \
|
||||
{ MODULE_CONFIG_ITEM_SPIN, text, name, p_getlist, p_update },
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
* vlc.h: global header for vlc
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1998, 1999, 2000 VideoLAN
|
||||
* $Id: vlc.h,v 1.3 2002/01/04 14:01:34 sam Exp $
|
||||
* $Id: vlc.h,v 1.4 2002/02/24 20:51:09 gbazin Exp $
|
||||
*
|
||||
* Authors: Samuel Hocevar <sam@via.ecp.fr>
|
||||
* Vincent Seguin <seguin@via.ecp.fr>
|
||||
@ -52,4 +52,4 @@
|
||||
#include "modules.h"
|
||||
|
||||
#include "main.h"
|
||||
|
||||
#include "configuration.h"
|
||||
|
@ -4,7 +4,7 @@
|
||||
* (http://liba52.sf.net/).
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2001 VideoLAN
|
||||
* $Id: a52.c,v 1.3 2002/02/15 13:32:52 sam Exp $
|
||||
* $Id: a52.c,v 1.4 2002/02/24 20:51:09 gbazin Exp $
|
||||
*
|
||||
* Authors: Gildas Bazin <gbazin@netcourrier.com>
|
||||
*
|
||||
@ -28,7 +28,7 @@
|
||||
*****************************************************************************/
|
||||
#include <stdlib.h> /* malloc(), free() */
|
||||
#include <string.h> /* strdup() */
|
||||
#include <stdint.h>
|
||||
#include <stdint.h> /* int16_t .. */
|
||||
|
||||
#include <videolan/vlc.h>
|
||||
|
||||
@ -67,7 +67,7 @@ void _M( adec_getfunctions )( function_list_t * p_function_list )
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* Build configuration tree.
|
||||
* Build configuration structure.
|
||||
*****************************************************************************/
|
||||
MODULE_CONFIG_START
|
||||
MODULE_CONFIG_STOP
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ac3_adec.c: ac3 decoder module main file
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1999-2001 VideoLAN
|
||||
* $Id: ac3_adec.c,v 1.20 2002/02/19 00:50:19 sam Exp $
|
||||
* $Id: ac3_adec.c,v 1.21 2002/02/24 20:51:09 gbazin Exp $
|
||||
*
|
||||
* Authors: Michel Lespinasse <walken@zoy.org>
|
||||
*
|
||||
@ -68,7 +68,17 @@ void _M( adec_getfunctions )( function_list_t * p_function_list )
|
||||
/*****************************************************************************
|
||||
* Build configuration tree.
|
||||
*****************************************************************************/
|
||||
/* Variable containing the AC3 downmix method */
|
||||
#define DOWNMIX_METHOD_VAR "ac3_downmix"
|
||||
/* Variable containing the AC3 IMDCT method */
|
||||
#define IMDCT_METHOD_VAR "ac3_imdct"
|
||||
|
||||
MODULE_CONFIG_START
|
||||
ADD_CATEGORY_HINT( "Misc Options", NULL)
|
||||
ADD_PLUGIN ( DOWNMIX_METHOD_VAR, MODULE_CAPABILITY_DOWNMIX, NULL, NULL,
|
||||
"AC3 downmix method", NULL )
|
||||
ADD_PLUGIN ( IMDCT_METHOD_VAR, MODULE_CAPABILITY_IMDCT, NULL, NULL,
|
||||
"AC3 IMDCT method", NULL )
|
||||
MODULE_CONFIG_STOP
|
||||
|
||||
MODULE_INIT_START
|
||||
@ -101,6 +111,8 @@ static int decoder_Probe( u8 *pi_type )
|
||||
*****************************************************************************/
|
||||
static int InitThread( ac3dec_thread_t * p_ac3thread )
|
||||
{
|
||||
char *psz_name;
|
||||
|
||||
/*
|
||||
* Thread properties
|
||||
*/
|
||||
@ -111,9 +123,10 @@ static int InitThread( ac3dec_thread_t * p_ac3thread )
|
||||
* Choose the best downmix module
|
||||
*/
|
||||
#define DOWNMIX p_ac3thread->ac3_decoder->downmix
|
||||
DOWNMIX.p_module = module_Need( MODULE_CAPABILITY_DOWNMIX,
|
||||
main_GetPszVariable( DOWNMIX_METHOD_VAR, NULL ),
|
||||
NULL );
|
||||
psz_name = config_GetPszVariable( DOWNMIX_METHOD_VAR );
|
||||
DOWNMIX.p_module = module_Need( MODULE_CAPABILITY_DOWNMIX, psz_name,
|
||||
NULL );
|
||||
if( psz_name ) free( psz_name );
|
||||
|
||||
if( DOWNMIX.p_module == NULL )
|
||||
{
|
||||
@ -139,9 +152,10 @@ static int InitThread( ac3dec_thread_t * p_ac3thread )
|
||||
p_ac3thread->ac3_decoder->imdct = memalign(16, sizeof(imdct_t));
|
||||
|
||||
#define IMDCT p_ac3thread->ac3_decoder->imdct
|
||||
IMDCT->p_module = module_Need( MODULE_CAPABILITY_IMDCT,
|
||||
main_GetPszVariable( IMDCT_METHOD_VAR, NULL ),
|
||||
NULL );
|
||||
psz_name = config_GetPszVariable( IMDCT_METHOD_VAR );
|
||||
IMDCT->p_module = module_Need( MODULE_CAPABILITY_IMDCT, psz_name,
|
||||
NULL );
|
||||
if( psz_name ) free( psz_name );
|
||||
|
||||
if( IMDCT->p_module == NULL )
|
||||
{
|
||||
@ -161,15 +175,7 @@ static int InitThread( ac3dec_thread_t * p_ac3thread )
|
||||
#undef F
|
||||
|
||||
/* Initialize the ac3 decoder structures */
|
||||
#define p_dec p_ac3thread->ac3_decoder
|
||||
#if defined( __MINGW32__ )
|
||||
p_dec->samples_back = memalign( 16, 6 * 256 * sizeof(float) + 15 );
|
||||
p_dec->samples = (float *)
|
||||
(((unsigned long) p_dec->samples_back + 15 ) & ~0xFUL);
|
||||
#else
|
||||
p_dec->samples = memalign( 16, 6 * 256 * sizeof(float) );
|
||||
#endif
|
||||
#undef p_dec
|
||||
p_ac3thread->ac3_decoder->samples = memalign( 16, 6 * 256 * sizeof(float) );
|
||||
|
||||
IMDCT->buf = memalign( 16, N/4 * sizeof(complex_t) );
|
||||
IMDCT->delay = memalign( 16, 6 * 256 * sizeof(float) );
|
||||
@ -222,7 +228,7 @@ static int decoder_Run ( decoder_config_t * p_config )
|
||||
DecoderError( p_config->p_decoder_fifo );
|
||||
return( -1 );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Initialize the thread properties
|
||||
*/
|
||||
@ -264,7 +270,7 @@ static int decoder_Run ( decoder_config_t * p_config )
|
||||
AlignWord( p_bit_stream );
|
||||
b_sync = 1;
|
||||
#undef p_bit_stream
|
||||
}
|
||||
}
|
||||
|
||||
if (ac3_sync_frame (p_ac3thread->ac3_decoder, &sync_info))
|
||||
{
|
||||
@ -275,16 +281,15 @@ static int decoder_Run ( decoder_config_t * p_config )
|
||||
if( ( p_ac3thread->p_aout_fifo != NULL ) &&
|
||||
( p_ac3thread->p_aout_fifo->l_rate != sync_info.sample_rate ) )
|
||||
{
|
||||
aout_DestroyFifo (p_ac3thread->p_aout_fifo);
|
||||
|
||||
/* Make sure the output thread leaves the NextFrame() function */
|
||||
vlc_mutex_lock (&(p_ac3thread->p_aout_fifo->data_lock));
|
||||
aout_DestroyFifo (p_ac3thread->p_aout_fifo);
|
||||
vlc_cond_signal (&(p_ac3thread->p_aout_fifo->data_wait));
|
||||
vlc_mutex_unlock (&(p_ac3thread->p_aout_fifo->data_lock));
|
||||
|
||||
p_ac3thread->p_aout_fifo = NULL;
|
||||
}
|
||||
|
||||
|
||||
/* Creating the audio output fifo if not created yet */
|
||||
if (p_ac3thread->p_aout_fifo == NULL ) {
|
||||
p_ac3thread->p_aout_fifo = aout_CreateFifo( AOUT_ADEC_STEREO_FIFO,
|
||||
@ -307,12 +312,8 @@ static int decoder_Run ( decoder_config_t * p_config )
|
||||
free( IMDCT->delay );
|
||||
free( IMDCT->buf );
|
||||
#undef IMDCT
|
||||
|
||||
#if defined( __MINGW32__ )
|
||||
free( p_ac3thread->ac3_decoder->samples_back );
|
||||
#else
|
||||
|
||||
free( p_ac3thread->ac3_decoder->samples );
|
||||
#endif
|
||||
|
||||
module_Unneed( p_ac3thread->ac3_decoder->imdct->p_module );
|
||||
module_Unneed( p_ac3thread->ac3_decoder->downmix.p_module );
|
||||
@ -402,11 +403,7 @@ static void EndThread (ac3dec_thread_t * p_ac3thread)
|
||||
free( IMDCT->buf );
|
||||
#undef IMDCT
|
||||
|
||||
#if defined( __MINGW32__ )
|
||||
free( p_ac3thread->ac3_decoder->samples_back );
|
||||
#else
|
||||
free( p_ac3thread->ac3_decoder->samples );
|
||||
#endif
|
||||
|
||||
/* Unlock the modules */
|
||||
module_Unneed( p_ac3thread->ac3_decoder->downmix.p_module );
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ac3_decoder.h : ac3 decoder interface
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1999, 2000 VideoLAN
|
||||
* $Id: ac3_decoder.h,v 1.1 2001/11/13 12:09:17 henri Exp $
|
||||
* $Id: ac3_decoder.h,v 1.2 2002/02/24 20:51:09 gbazin Exp $
|
||||
*
|
||||
* Authors: Michel Kaempf <maxx@via.ecp.fr>
|
||||
* Renaud Dartus <reno@videolan.org>
|
||||
@ -355,9 +355,6 @@ typedef struct mantissa_s
|
||||
struct ac3dec_s
|
||||
{
|
||||
float * samples;
|
||||
#if defined( __MINGW32__ )
|
||||
float * samples_back;
|
||||
#endif
|
||||
imdct_t * imdct;
|
||||
|
||||
/*
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ac3_spdif.c: ac3 pass-through to external decoder with enabled soundcard
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2001 VideoLAN
|
||||
* $Id: ac3_spdif.c,v 1.14 2002/02/19 00:50:19 sam Exp $
|
||||
* $Id: ac3_spdif.c,v 1.15 2002/02/24 20:51:09 gbazin Exp $
|
||||
*
|
||||
* Authors: Stéphane Borel <stef@via.ecp.fr>
|
||||
* Juha Yrjola <jyrjola@cc.hut.fi>
|
||||
@ -91,7 +91,7 @@ MODULE_DEACTIVATE_STOP
|
||||
*****************************************************************************/
|
||||
static int decoder_Probe( u8 *pi_type )
|
||||
{
|
||||
return( ( main_GetIntVariable( AOUT_SPDIF_VAR, 0 )
|
||||
return( ( config_GetIntVariable( AOUT_SPDIF_VAR )
|
||||
&& *pi_type == AC3_AUDIO_ES ) ? 0 : -1 );
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
* alsa.c : alsa plugin for vlc
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2000-2001 VideoLAN
|
||||
* $Id: alsa.c,v 1.13 2001/12/30 07:09:54 sam Exp $
|
||||
* $Id: alsa.c,v 1.14 2002/02/24 20:51:09 gbazin Exp $
|
||||
*
|
||||
* Authors: Henri Fallon <henri@videolan.org>
|
||||
*
|
||||
@ -38,7 +38,7 @@ void _M( aout_getfunctions )( function_list_t * p_function_list );
|
||||
* Build configuration tree.
|
||||
*****************************************************************************/
|
||||
MODULE_CONFIG_START
|
||||
ADD_COMMENT( "Yeah, alsa rocks !" )
|
||||
|
||||
MODULE_CONFIG_STOP
|
||||
|
||||
MODULE_INIT_START
|
||||
|
@ -77,9 +77,6 @@ void _M( aout_getfunctions )( function_list_t * p_function_list )
|
||||
static int aout_Open( aout_thread_t *p_aout )
|
||||
{
|
||||
int i_err = 0;
|
||||
p_aout->i_format = AOUT_FORMAT_DEFAULT;
|
||||
p_aout->i_channels = 1 + main_GetIntVariable( AOUT_STEREO_VAR, AOUT_STEREO_DEFAULT );
|
||||
p_aout->l_rate = AOUT_RATE_DEFAULT;
|
||||
|
||||
/* Allocate structure */
|
||||
p_aout->p_sys = malloc( sizeof( aout_sys_t ) );
|
||||
|
@ -37,9 +37,6 @@ void _M( aout_getfunctions )( function_list_t * p_function_list );
|
||||
* Build configuration tree.
|
||||
*****************************************************************************/
|
||||
MODULE_CONFIG_START
|
||||
ADD_WINDOW( "Configuration for arts module" )
|
||||
ADD_FRAME( "aRts" )
|
||||
ADD_COMMENT( "This module does not need configuration" )
|
||||
MODULE_CONFIG_STOP
|
||||
|
||||
MODULE_INIT_START
|
||||
|
@ -2,7 +2,7 @@
|
||||
* aout_beos.cpp: BeOS audio output
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1999, 2000, 2001 VideoLAN
|
||||
* $Id: aout_beos.cpp,v 1.21 2002/02/15 13:32:52 sam Exp $
|
||||
* $Id: aout_beos.cpp,v 1.22 2002/02/24 20:51:09 gbazin Exp $
|
||||
*
|
||||
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
|
||||
* Samuel Hocevar <sam@zoy.org>
|
||||
@ -109,11 +109,6 @@ static int aout_Open( aout_thread_t *p_aout )
|
||||
}
|
||||
|
||||
/* Initialize some variables */
|
||||
p_aout->i_format = AOUT_FORMAT_DEFAULT;
|
||||
p_aout->i_channels = 1 + main_GetIntVariable( AOUT_STEREO_VAR,
|
||||
AOUT_STEREO_DEFAULT );
|
||||
p_aout->l_rate = main_GetIntVariable( AOUT_RATE_VAR, AOUT_RATE_DEFAULT );
|
||||
|
||||
p_aout->p_sys->p_format->frame_rate = 44100.0;
|
||||
p_aout->p_sys->p_format->channel_count = p_aout->i_channels;
|
||||
p_aout->p_sys->p_format->format = gs_audio_format::B_GS_S16;
|
||||
|
@ -2,7 +2,7 @@
|
||||
* beos.cpp : BeOS plugin for vlc
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2000, 2001 VideoLAN
|
||||
* $Id: beos.cpp,v 1.16 2002/01/05 18:25:48 sam Exp $
|
||||
* $Id: beos.cpp,v 1.17 2002/02/24 20:51:09 gbazin Exp $
|
||||
*
|
||||
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
|
||||
* Samuel Hocevar <sam@zoy.org>
|
||||
@ -43,8 +43,6 @@ void _M( intf_getfunctions )( function_list_t * p_function_list );
|
||||
* Build configuration tree.
|
||||
*****************************************************************************/
|
||||
MODULE_CONFIG_START
|
||||
ADD_WINDOW( "Configuration for BeOS module" )
|
||||
ADD_COMMENT( "Ha, ha -- nothing to configure yet" )
|
||||
MODULE_CONFIG_STOP
|
||||
|
||||
MODULE_INIT_START
|
||||
|
@ -2,7 +2,7 @@
|
||||
* vout_beos.cpp: beos video output display method
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2000, 2001 VideoLAN
|
||||
* $Id: vout_beos.cpp,v 1.41 2002/02/15 13:32:52 sam Exp $
|
||||
* $Id: vout_beos.cpp,v 1.42 2002/02/24 20:51:09 gbazin Exp $
|
||||
*
|
||||
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
|
||||
* Samuel Hocevar <sam@zoy.org>
|
||||
@ -576,8 +576,8 @@ void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
|
||||
static int BeosOpenDisplay( vout_thread_t *p_vout )
|
||||
{
|
||||
p_vout->p_sys->p_window = new VideoWindow(
|
||||
main_GetIntVariable( VOUT_WIDTH_VAR, VOUT_WIDTH_DEFAULT ) - 1,
|
||||
main_GetIntVariable( VOUT_HEIGHT_VAR, VOUT_HEIGHT_DEFAULT ) - 1,
|
||||
config_GetIntVariable( VOUT_WIDTH_VAR ) - 1,
|
||||
config_GetIntVariable( VOUT_HEIGHT_VAR ) - 1,
|
||||
p_vout );
|
||||
|
||||
if( p_vout->p_sys->p_window == NULL )
|
||||
|
@ -2,7 +2,7 @@
|
||||
* aout_directx.c: Windows DirectX audio output method
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2001 VideoLAN
|
||||
* $Id: aout_directx.c,v 1.18 2002/02/15 20:02:21 gbazin Exp $
|
||||
* $Id: aout_directx.c,v 1.19 2002/02/24 20:51:09 gbazin Exp $
|
||||
*
|
||||
* Authors: Gildas Bazin <gbazin@netcourrier.com>
|
||||
*
|
||||
@ -146,8 +146,6 @@ static int aout_Open( aout_thread_t *p_aout )
|
||||
vlc_mutex_init( &p_aout->p_sys->buffer_lock );
|
||||
|
||||
|
||||
p_aout->psz_device = 0;
|
||||
|
||||
/* Initialise DirectSound */
|
||||
if( DirectxInitDSound( p_aout ) )
|
||||
{
|
||||
|
@ -2,7 +2,7 @@
|
||||
* directx.c : Windows DirectX plugin for vlc
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2001 VideoLAN
|
||||
* $Id: directx.c,v 1.5 2002/01/17 23:02:45 gbazin Exp $
|
||||
* $Id: directx.c,v 1.6 2002/02/24 20:51:09 gbazin Exp $
|
||||
*
|
||||
* Authors: Gildas Bazin <gbazin@netcourrier.com>
|
||||
*
|
||||
@ -44,8 +44,6 @@ void _M( vout_getfunctions )( function_list_t * p_function_list );
|
||||
* Building configuration tree
|
||||
*****************************************************************************/
|
||||
MODULE_CONFIG_START
|
||||
ADD_WINDOW( "Configuration for Windows DirectX module" )
|
||||
ADD_COMMENT( "For now, the Windows DirectX module cannot be configured" )
|
||||
MODULE_CONFIG_STOP
|
||||
|
||||
MODULE_INIT_START
|
||||
|
@ -2,7 +2,7 @@
|
||||
* vout_directx.c: Windows DirectX video output display method
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2001 VideoLAN
|
||||
* $Id: vout_directx.c,v 1.22 2002/02/15 20:02:21 gbazin Exp $
|
||||
* $Id: vout_directx.c,v 1.23 2002/02/24 20:51:09 gbazin Exp $
|
||||
*
|
||||
* Authors: Gildas Bazin <gbazin@netcourrier.com>
|
||||
*
|
||||
@ -134,7 +134,7 @@ static int vout_Create( vout_thread_t *p_vout )
|
||||
p_vout->p_sys->b_caps_overlay_clipping = 0;
|
||||
SetRectEmpty( &p_vout->p_sys->rect_display );
|
||||
p_vout->p_sys->b_using_overlay =
|
||||
!main_GetIntVariable( VOUT_NOOVERLAY_VAR, VOUT_NOOVERLAY_DEFAULT );
|
||||
!config_GetIntVariable( VOUT_NOOVERLAY_VAR );
|
||||
|
||||
p_vout->p_sys->b_cursor = 1;
|
||||
|
||||
@ -157,10 +157,8 @@ static int vout_Create( vout_thread_t *p_vout )
|
||||
}
|
||||
|
||||
#if 0
|
||||
p_vout->p_sys->i_window_width = main_GetIntVariable( VOUT_WIDTH_VAR,
|
||||
VOUT_WIDTH_DEFAULT );
|
||||
p_vout->p_sys->i_window_height = main_GetIntVariable( VOUT_HEIGHT_VAR,
|
||||
VOUT_HEIGHT_DEFAULT );
|
||||
p_vout->p_sys->i_window_width = config_GetIntVariable( VOUT_WIDTH_VAR );
|
||||
p_vout->p_sys->i_window_height = config_GetIntVariable( VOUT_HEIGHT_VAR );
|
||||
#endif
|
||||
|
||||
/* Set locks and condition variables */
|
||||
|
@ -2,7 +2,7 @@
|
||||
* aout_dsp.c : dsp functions library
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1999-2001 VideoLAN
|
||||
* $Id: aout_dsp.c,v 1.21 2002/02/15 13:32:53 sam Exp $
|
||||
* $Id: aout_dsp.c,v 1.22 2002/02/24 20:51:09 gbazin Exp $
|
||||
*
|
||||
* Authors: Michel Kaempf <maxx@via.ecp.fr>
|
||||
* Samuel Hocevar <sam@zoy.org>
|
||||
@ -53,6 +53,7 @@
|
||||
|
||||
#include "audio_output.h" /* aout_thread_t */
|
||||
|
||||
#define DSP_DEV_VAR "dsp_dev"
|
||||
/*****************************************************************************
|
||||
* aout_sys_t: dsp audio output method descriptor
|
||||
*****************************************************************************
|
||||
@ -63,6 +64,10 @@ typedef struct aout_sys_s
|
||||
{
|
||||
audio_buf_info audio_buf;
|
||||
|
||||
/* Path to the audio output device */
|
||||
char * psz_device;
|
||||
int i_fd;
|
||||
|
||||
} aout_sys_t;
|
||||
|
||||
/*****************************************************************************
|
||||
@ -92,7 +97,7 @@ void _M( aout_getfunctions )( function_list_t * p_function_list )
|
||||
* aout_Open: opens the audio device (the digital sound processor)
|
||||
*****************************************************************************
|
||||
* This function opens the dsp as a usual non-blocking write-only file, and
|
||||
* modifies the p_aout->i_fd with the file's descriptor.
|
||||
* modifies the p_aout->p_sys->i_fd with the file's descriptor.
|
||||
*****************************************************************************/
|
||||
static int aout_Open( aout_thread_t *p_aout )
|
||||
{
|
||||
@ -105,13 +110,21 @@ static int aout_Open( aout_thread_t *p_aout )
|
||||
}
|
||||
|
||||
/* Initialize some variables */
|
||||
p_aout->psz_device = main_GetPszVariable( AOUT_DSP_VAR, AOUT_DSP_DEFAULT );
|
||||
if( !(p_aout->p_sys->psz_device = config_GetPszVariable( DSP_DEV_VAR )) )
|
||||
{
|
||||
intf_ErrMsg( "aout error: don't know which audio device to open" );
|
||||
free( p_aout->p_sys );
|
||||
return( -1 );
|
||||
}
|
||||
|
||||
/* Open the sound device */
|
||||
if( (p_aout->i_fd = open( p_aout->psz_device, O_WRONLY )) < 0 )
|
||||
if( (p_aout->p_sys->i_fd = open( p_aout->p_sys->psz_device, O_WRONLY ))
|
||||
< 0 )
|
||||
{
|
||||
intf_ErrMsg( "aout error: can't open audio device (%s)",
|
||||
p_aout->psz_device );
|
||||
p_aout->p_sys->psz_device );
|
||||
free( p_aout->p_sys->psz_device );
|
||||
free( p_aout->p_sys );
|
||||
return( -1 );
|
||||
}
|
||||
|
||||
@ -133,16 +146,16 @@ static int aout_SetFormat( aout_thread_t *p_aout )
|
||||
boolean_t b_stereo = p_aout->b_stereo;
|
||||
|
||||
/* Reset the DSP device */
|
||||
if( ioctl( p_aout->i_fd, SNDCTL_DSP_RESET, NULL ) < 0 )
|
||||
if( ioctl( p_aout->p_sys->i_fd, SNDCTL_DSP_RESET, NULL ) < 0 )
|
||||
{
|
||||
intf_ErrMsg( "aout error: can't reset audio device (%s)",
|
||||
p_aout->psz_device );
|
||||
p_aout->p_sys->psz_device );
|
||||
return( -1 );
|
||||
}
|
||||
|
||||
/* Set the output format */
|
||||
i_format = p_aout->i_format;
|
||||
if( ioctl( p_aout->i_fd, SNDCTL_DSP_SETFMT, &i_format ) < 0 )
|
||||
if( ioctl( p_aout->p_sys->i_fd, SNDCTL_DSP_SETFMT, &i_format ) < 0 )
|
||||
{
|
||||
intf_ErrMsg( "aout error: can't set audio output format (%i)",
|
||||
p_aout->i_format );
|
||||
@ -151,13 +164,13 @@ static int aout_SetFormat( aout_thread_t *p_aout )
|
||||
|
||||
if( i_format != p_aout->i_format )
|
||||
{
|
||||
intf_WarnMsg( 2, "aout warning: audio output format not supported (%i)",
|
||||
p_aout->i_format );
|
||||
intf_WarnMsg( 2, "aout warning: audio output format not supported (%i)"
|
||||
,p_aout->i_format );
|
||||
p_aout->i_format = i_format;
|
||||
}
|
||||
|
||||
/* Set the number of channels */
|
||||
if( ioctl( p_aout->i_fd, SNDCTL_DSP_STEREO, &b_stereo ) < 0 )
|
||||
if( ioctl( p_aout->p_sys->i_fd, SNDCTL_DSP_STEREO, &b_stereo ) < 0 )
|
||||
{
|
||||
intf_ErrMsg( "aout error: can't set number of audio channels (%i)",
|
||||
p_aout->i_channels );
|
||||
@ -166,15 +179,15 @@ static int aout_SetFormat( aout_thread_t *p_aout )
|
||||
|
||||
if( b_stereo != p_aout->b_stereo )
|
||||
{
|
||||
intf_WarnMsg( 2, "aout warning: number of audio channels not supported (%i)",
|
||||
p_aout->i_channels );
|
||||
intf_WarnMsg( 2, "aout warning: number of audio channels not supported"
|
||||
" (%i)", p_aout->i_channels );
|
||||
p_aout->b_stereo = b_stereo;
|
||||
p_aout->i_channels = 1 + b_stereo;
|
||||
}
|
||||
|
||||
/* Set the output rate */
|
||||
l_rate = p_aout->l_rate;
|
||||
if( ioctl( p_aout->i_fd, SNDCTL_DSP_SPEED, &l_rate ) < 0 )
|
||||
if( ioctl( p_aout->p_sys->i_fd, SNDCTL_DSP_SPEED, &l_rate ) < 0 )
|
||||
{
|
||||
intf_ErrMsg( "aout error: can't set audio output rate (%li)",
|
||||
p_aout->l_rate );
|
||||
@ -204,7 +217,8 @@ static int aout_SetFormat( aout_thread_t *p_aout )
|
||||
*****************************************************************************/
|
||||
static long aout_GetBufInfo( aout_thread_t *p_aout, long l_buffer_limit )
|
||||
{
|
||||
ioctl( p_aout->i_fd, SNDCTL_DSP_GETOSPACE, &p_aout->p_sys->audio_buf );
|
||||
ioctl( p_aout->p_sys->i_fd, SNDCTL_DSP_GETOSPACE,
|
||||
&p_aout->p_sys->audio_buf );
|
||||
|
||||
/* returns the allocated space in bytes */
|
||||
return ( (p_aout->p_sys->audio_buf.fragstotal
|
||||
@ -221,7 +235,7 @@ static void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
|
||||
{
|
||||
if( p_aout->b_active )
|
||||
{
|
||||
write( p_aout->i_fd, buffer, i_size );
|
||||
write( p_aout->p_sys->i_fd, buffer, i_size );
|
||||
}
|
||||
}
|
||||
|
||||
@ -230,6 +244,6 @@ static void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
|
||||
*****************************************************************************/
|
||||
static void aout_Close( aout_thread_t *p_aout )
|
||||
{
|
||||
close( p_aout->i_fd );
|
||||
close( p_aout->p_sys->i_fd );
|
||||
free( p_aout->p_sys->psz_device );
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
* dsp.c : OSS /dev/dsp module for vlc
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2000-2001 VideoLAN
|
||||
* $Id: dsp.c,v 1.12 2001/12/30 07:09:54 sam Exp $
|
||||
* $Id: dsp.c,v 1.13 2002/02/24 20:51:09 gbazin Exp $
|
||||
*
|
||||
* Authors: Michel Kaempf <maxx@via.ecp.fr>
|
||||
* Samuel Hocevar <sam@zoy.org>
|
||||
@ -38,10 +38,11 @@ void _M( aout_getfunctions )( function_list_t * p_function_list );
|
||||
/*****************************************************************************
|
||||
* Build configuration tree.
|
||||
*****************************************************************************/
|
||||
#define DSP_DEV_VAR "dsp_dev"
|
||||
|
||||
MODULE_CONFIG_START
|
||||
ADD_WINDOW( "Configuration for dsp module" )
|
||||
ADD_FRAME( "OSS Device" )
|
||||
ADD_FILE( "Device name: ", MODULE_VAR(device), NULL )
|
||||
ADD_CATEGORY_HINT( "Misc Options", NULL )
|
||||
ADD_FILE ( DSP_DEV_VAR, "/dev/dsp", NULL,"OSS dsp device",NULL )
|
||||
MODULE_CONFIG_STOP
|
||||
|
||||
MODULE_INIT_START
|
||||
|
@ -2,7 +2,7 @@
|
||||
* dummy.c : dummy plugin for vlc
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2000, 2001 VideoLAN
|
||||
* $Id: dummy.c,v 1.14 2002/01/09 02:01:14 sam Exp $
|
||||
* $Id: dummy.c,v 1.15 2002/02/24 20:51:09 gbazin Exp $
|
||||
*
|
||||
* Authors: Samuel Hocevar <sam@zoy.org>
|
||||
*
|
||||
@ -41,8 +41,6 @@ void _M( intf_getfunctions ) ( function_list_t * p_function_list );
|
||||
* Build configuration tree.
|
||||
*****************************************************************************/
|
||||
MODULE_CONFIG_START
|
||||
ADD_WINDOW( "Configuration for dummy module" )
|
||||
ADD_COMMENT( "Ha, ha -- nothing to configure yet" )
|
||||
MODULE_CONFIG_STOP
|
||||
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
* null.c : NULL module for vlc
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2000-2001 VideoLAN
|
||||
* $Id: null.c,v 1.4 2001/12/30 07:09:55 sam Exp $
|
||||
* $Id: null.c,v 1.5 2002/02/24 20:51:09 gbazin Exp $
|
||||
*
|
||||
* Authors: Samuel Hocevar <sam@zoy.org>
|
||||
*
|
||||
@ -33,19 +33,18 @@
|
||||
* Build configuration tree.
|
||||
*****************************************************************************/
|
||||
MODULE_CONFIG_START
|
||||
ADD_WINDOW( "Configuration for null module" )
|
||||
ADD_PANE( "First pane" )
|
||||
ADD_FRAME( "First frame" )
|
||||
ADD_COMMENT( "You can put whatever you want here." )
|
||||
/* ADD_PANE( "First pane" )
|
||||
ADD_SUBCATEGORY_HINT( "First frame" )
|
||||
|
||||
ADD_STRING( "Random text: ", MODULE_VAR(text), NULL )
|
||||
ADD_FRAME( "Second frame" )
|
||||
ADD_COMMENT( "The file below is not used." )
|
||||
ADD_SUBCATEGORY_HINT( "Second frame" )
|
||||
|
||||
ADD_FILE( "Select file: ", MODULE_VAR(file), NULL )
|
||||
ADD_FRAME( "Third frame" )
|
||||
ADD_COMMENT( "This space intentionally left blank." )
|
||||
ADD_SUBCATEGORY_HINT( "Third frame" )
|
||||
|
||||
ADD_PANE( "Second pane" )
|
||||
ADD_FRAME( "Frame" )
|
||||
ADD_COMMENT( "There is nothing in this frame." )
|
||||
ADD_SUBCATEGORY_HINT( "Frame" )
|
||||
*/
|
||||
MODULE_CONFIG_STOP
|
||||
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
* -dvd_udf to find files
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1998-2001 VideoLAN
|
||||
* $Id: input_dvd.c,v 1.120 2002/02/19 00:50:19 sam Exp $
|
||||
* $Id: input_dvd.c,v 1.121 2002/02/24 20:51:09 gbazin Exp $
|
||||
*
|
||||
* Author: Stéphane Borel <stef@via.ecp.fr>
|
||||
*
|
||||
@ -263,7 +263,7 @@ static void DVDInit( input_thread_t * p_input )
|
||||
#undef area
|
||||
|
||||
/* Get requested title - if none try the first title */
|
||||
i_title = main_GetIntVariable( INPUT_TITLE_VAR, 1 );
|
||||
i_title = config_GetIntVariable( INPUT_TITLE_VAR );
|
||||
if( i_title <= 0 || i_title > title_inf.i_title_nb )
|
||||
{
|
||||
i_title = 1;
|
||||
@ -272,7 +272,7 @@ static void DVDInit( input_thread_t * p_input )
|
||||
#undef title_inf
|
||||
|
||||
/* Get requested chapter - if none defaults to first one */
|
||||
i_chapter = main_GetIntVariable( INPUT_CHAPTER_VAR, 1 );
|
||||
i_chapter = config_GetIntVariable( INPUT_CHAPTER_VAR );
|
||||
if( i_chapter <= 0 )
|
||||
{
|
||||
i_chapter = 1;
|
||||
@ -334,7 +334,7 @@ static void DVDOpen( struct input_thread_s *p_input )
|
||||
*psz_parser = '\0';
|
||||
psz_parser++;
|
||||
|
||||
main_PutPszVariable( "DVDCSS_RAW_DEVICE", psz_parser );
|
||||
config_PutPszVariable( "DVDCSS_RAW_DEVICE", psz_parser );
|
||||
}
|
||||
|
||||
intf_WarnMsg( 2, "input: dvd=%s raw=%s", psz_device, psz_parser );
|
||||
@ -452,7 +452,7 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area )
|
||||
* Angle management
|
||||
*/
|
||||
p_dvd->i_angle_nb = vmg.title_inf.p_attr[p_dvd->i_title-1].i_angle_nb;
|
||||
p_dvd->i_angle = main_GetIntVariable( INPUT_ANGLE_VAR, 1 );
|
||||
p_dvd->i_angle = config_GetIntVariable( INPUT_ANGLE_VAR );
|
||||
if( ( p_dvd->i_angle <= 0 ) || p_dvd->i_angle > p_dvd->i_angle_nb )
|
||||
{
|
||||
p_dvd->i_angle = 1;
|
||||
@ -688,16 +688,15 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area )
|
||||
if( p_main->b_audio )
|
||||
{
|
||||
/* For audio: first one if none or a not existing one specified */
|
||||
i_audio = main_GetIntVariable( INPUT_CHANNEL_VAR, 1 );
|
||||
i_audio = config_GetIntVariable( INPUT_CHANNEL_VAR );
|
||||
if( i_audio < 0 || i_audio > i_audio_nb )
|
||||
{
|
||||
main_PutIntVariable( INPUT_CHANNEL_VAR, 1 );
|
||||
i_audio = 1;
|
||||
}
|
||||
if( i_audio > 0 && i_audio_nb > 0 )
|
||||
{
|
||||
if( main_GetIntVariable( AOUT_SPDIF_VAR, 0 ) ||
|
||||
( main_GetIntVariable( INPUT_AUDIO_VAR, 0 ) ==
|
||||
if( config_GetIntVariable( AOUT_SPDIF_VAR ) ||
|
||||
( config_GetIntVariable( INPUT_AUDIO_VAR ) ==
|
||||
REQUESTED_AC3 ) )
|
||||
{
|
||||
int i_ac3 = i_audio;
|
||||
@ -724,10 +723,9 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area )
|
||||
if( p_main->b_video )
|
||||
{
|
||||
/* for spu, default is none */
|
||||
i_spu = main_GetIntVariable( INPUT_SUBTITLE_VAR, 0 );
|
||||
i_spu = config_GetIntVariable( INPUT_SUBTITLE_VAR );
|
||||
if( i_spu < 0 || i_spu > i_spu_nb )
|
||||
{
|
||||
main_PutIntVariable( INPUT_SUBTITLE_VAR, 0 );
|
||||
i_spu = 0;
|
||||
}
|
||||
if( i_spu > 0 && i_spu_nb > 0 )
|
||||
|
@ -6,7 +6,7 @@
|
||||
* It depends on: libdvdread for ifo files and block reading.
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2001 VideoLAN
|
||||
* $Id: input_dvdread.c,v 1.20 2002/02/15 13:32:53 sam Exp $
|
||||
* $Id: input_dvdread.c,v 1.21 2002/02/24 20:51:09 gbazin Exp $
|
||||
*
|
||||
* Author: Stéphane Borel <stef@via.ecp.fr>
|
||||
*
|
||||
@ -243,7 +243,7 @@ static void DvdReadInit( input_thread_t * p_input )
|
||||
#undef area
|
||||
|
||||
/* Get requested title - if none try the first title */
|
||||
i_title = main_GetIntVariable( INPUT_TITLE_VAR, 1 );
|
||||
i_title = config_GetIntVariable( INPUT_TITLE_VAR );
|
||||
if( i_title <= 0 || i_title > tt_srpt->nr_of_srpts )
|
||||
{
|
||||
i_title = 1;
|
||||
@ -252,7 +252,7 @@ static void DvdReadInit( input_thread_t * p_input )
|
||||
#undef tt_srpt
|
||||
|
||||
/* Get requested chapter - if none defaults to first one */
|
||||
i_chapter = main_GetIntVariable( INPUT_CHAPTER_VAR, 1 );
|
||||
i_chapter = config_GetIntVariable( INPUT_CHAPTER_VAR );
|
||||
if( i_chapter <= 0 )
|
||||
{
|
||||
i_chapter = 1;
|
||||
@ -473,7 +473,7 @@ static int DvdReadSetArea( input_thread_t * p_input, input_area_t * p_area )
|
||||
* Angle management
|
||||
*/
|
||||
p_area->i_angle_nb = p_vmg->tt_srpt->title[p_area->i_id-1].nr_of_angles;
|
||||
p_area->i_angle = main_GetIntVariable( INPUT_ANGLE_VAR, 1 );
|
||||
p_area->i_angle = config_GetIntVariable( INPUT_ANGLE_VAR );
|
||||
|
||||
if( ( p_area->i_angle <= 0 ) || p_area->i_angle > p_area->i_angle_nb )
|
||||
{
|
||||
@ -667,16 +667,15 @@ static int DvdReadSetArea( input_thread_t * p_input, input_area_t * p_area )
|
||||
if( p_main->b_audio )
|
||||
{
|
||||
/* For audio: first one if none or a not existing one specified */
|
||||
int i_audio = main_GetIntVariable( INPUT_CHANNEL_VAR, 1 );
|
||||
int i_audio = config_GetIntVariable( INPUT_CHANNEL_VAR );
|
||||
if( i_audio < 0 || i_audio > i_audio_nb )
|
||||
{
|
||||
main_PutIntVariable( INPUT_CHANNEL_VAR, 1 );
|
||||
i_audio = 1;
|
||||
}
|
||||
if( i_audio > 0 && i_audio_nb > 0 )
|
||||
{
|
||||
if( main_GetIntVariable( AOUT_SPDIF_VAR, 0 ) ||
|
||||
( main_GetIntVariable( INPUT_AUDIO_VAR, 0 ) ==
|
||||
if( config_GetIntVariable( AOUT_SPDIF_VAR ) ||
|
||||
( config_GetIntVariable( INPUT_AUDIO_VAR ) ==
|
||||
REQUESTED_AC3 ) )
|
||||
{
|
||||
int i_ac3 = i_audio;
|
||||
@ -703,10 +702,9 @@ static int DvdReadSetArea( input_thread_t * p_input, input_area_t * p_area )
|
||||
if( p_main->b_video )
|
||||
{
|
||||
/* for spu, default is none */
|
||||
int i_spu = main_GetIntVariable( INPUT_SUBTITLE_VAR, 0 );
|
||||
int i_spu = config_GetIntVariable( INPUT_SUBTITLE_VAR );
|
||||
if( i_spu < 0 || i_spu > i_spu_nb )
|
||||
{
|
||||
main_PutIntVariable( INPUT_SUBTITLE_VAR, 0 );
|
||||
i_spu = 0;
|
||||
}
|
||||
if( i_spu > 0 && i_spu_nb > 0 )
|
||||
|
@ -2,7 +2,7 @@
|
||||
* aout_esd.c : Esound functions library
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2000-2001 VideoLAN
|
||||
* $Id: aout_esd.c,v 1.19 2002/02/15 13:32:53 sam Exp $
|
||||
* $Id: aout_esd.c,v 1.20 2002/02/24 20:51:09 gbazin Exp $
|
||||
*
|
||||
* Authors: Samuel Hocevar <sam@zoy.org>
|
||||
*
|
||||
@ -52,6 +52,7 @@
|
||||
typedef struct aout_sys_s
|
||||
{
|
||||
esd_format_t esd_format;
|
||||
int i_fd;
|
||||
|
||||
} aout_sys_t;
|
||||
|
||||
@ -97,7 +98,8 @@ static int aout_Open( aout_thread_t *p_aout )
|
||||
}
|
||||
|
||||
/* Initialize some variables */
|
||||
p_aout->l_rate = esd_audio_rate; /* We use actual esd rate value, not AOUT_RATE_DEFAULT */
|
||||
p_aout->l_rate = esd_audio_rate; /* We use actual esd rate value, not
|
||||
* initial value */
|
||||
|
||||
i_bits = ESD_BITS16;
|
||||
i_mode = ESD_STREAM;
|
||||
@ -115,7 +117,7 @@ static int aout_Open( aout_thread_t *p_aout )
|
||||
|
||||
/* open a socket for playing a stream
|
||||
* and try to open /dev/dsp if there's no EsounD */
|
||||
if ( (p_aout->i_fd
|
||||
if ( (p_aout->p_sys->i_fd
|
||||
= esd_play_stream_fallback(p_aout->p_sys->esd_format,
|
||||
p_aout->l_rate, NULL, "vlc")) < 0 )
|
||||
{
|
||||
@ -184,7 +186,7 @@ static void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
|
||||
}
|
||||
}
|
||||
|
||||
write( p_aout->i_fd, buffer, i_size );
|
||||
write( p_aout->p_sys->i_fd, buffer, i_size );
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
@ -192,6 +194,6 @@ static void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
|
||||
*****************************************************************************/
|
||||
static void aout_Close( aout_thread_t *p_aout )
|
||||
{
|
||||
close( p_aout->i_fd );
|
||||
close( p_aout->p_sys->i_fd );
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
* esd.c : EsounD module
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2000, 2001 VideoLAN
|
||||
* $Id: esd.c,v 1.12 2001/12/31 04:53:33 sam Exp $
|
||||
* $Id: esd.c,v 1.13 2002/02/24 20:51:09 gbazin Exp $
|
||||
*
|
||||
* Authors: Samuel Hocevar <sam@zoy.org>
|
||||
*
|
||||
@ -38,9 +38,6 @@ void _M( aout_getfunctions )( function_list_t * p_function_list );
|
||||
* Build configuration tree.
|
||||
*****************************************************************************/
|
||||
MODULE_CONFIG_START
|
||||
ADD_WINDOW( "Configuration for esd module" )
|
||||
ADD_FRAME( "EsounD" )
|
||||
ADD_COMMENT( "This module does not need configuration" )
|
||||
MODULE_CONFIG_STOP
|
||||
|
||||
MODULE_INIT_START
|
||||
|
@ -2,7 +2,7 @@
|
||||
* fb.c : framebuffer plugin for vlc
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2000, 2001 VideoLAN
|
||||
* $Id: fb.c,v 1.13 2002/02/15 13:32:53 sam Exp $
|
||||
* $Id: fb.c,v 1.14 2002/02/24 20:51:09 gbazin Exp $
|
||||
*
|
||||
* Authors: Samuel Hocevar <sam@zoy.org>
|
||||
*
|
||||
@ -66,7 +66,11 @@ static void GfxMode ( int i_tty );
|
||||
/*****************************************************************************
|
||||
* Building configuration tree
|
||||
*****************************************************************************/
|
||||
#define FB_DEV_VAR "fb_dev"
|
||||
|
||||
MODULE_CONFIG_START
|
||||
ADD_CATEGORY_HINT( "Misc Options", NULL )
|
||||
ADD_STRING ( FB_DEV_VAR, "/dev/fb0", NULL,"framebuffer device",NULL )
|
||||
MODULE_CONFIG_STOP
|
||||
|
||||
MODULE_INIT_START
|
||||
@ -485,14 +489,23 @@ static int OpenDisplay( vout_thread_t *p_vout )
|
||||
struct fb_fix_screeninfo fix_info; /* framebuffer fix information */
|
||||
|
||||
/* Open framebuffer device */
|
||||
psz_device = main_GetPszVariable( VOUT_FB_DEV_VAR, VOUT_FB_DEV_DEFAULT );
|
||||
p_vout->p_sys->i_fd = open( psz_device, O_RDWR);
|
||||
if( p_vout->p_sys->i_fd == -1 )
|
||||
if( !(psz_device = config_GetPszVariable( FB_DEV_VAR )) )
|
||||
{
|
||||
intf_ErrMsg("vout error: can't open %s (%s)", psz_device, strerror(errno) );
|
||||
intf_ErrMsg( "vout error: don't know which fb device to open" );
|
||||
return( 1 );
|
||||
}
|
||||
|
||||
p_vout->p_sys->i_fd = open( psz_device, O_RDWR);
|
||||
|
||||
if( p_vout->p_sys->i_fd == -1 )
|
||||
{
|
||||
intf_ErrMsg("vout error: can't open %s (%s)",
|
||||
psz_device, strerror(errno) );
|
||||
free( psz_device );
|
||||
return( 1 );
|
||||
}
|
||||
free( psz_device );
|
||||
|
||||
/* Get framebuffer device informations */
|
||||
if( ioctl( p_vout->p_sys->i_fd,
|
||||
FBIOGET_VSCREENINFO, &p_vout->p_sys->var_info ) )
|
||||
|
@ -2,7 +2,7 @@
|
||||
* deinterlace.c : deinterlacer plugin for vlc
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2000, 2001 VideoLAN
|
||||
* $Id: deinterlace.c,v 1.5 2002/02/15 13:32:53 sam Exp $
|
||||
* $Id: deinterlace.c,v 1.6 2002/02/24 20:51:09 gbazin Exp $
|
||||
*
|
||||
* Authors: Samuel Hocevar <sam@zoy.org>
|
||||
*
|
||||
@ -113,7 +113,7 @@ static void vout_getfunctions( function_list_t * p_function_list )
|
||||
*****************************************************************************/
|
||||
static int vout_Create( vout_thread_t *p_vout )
|
||||
{
|
||||
char *psz_method;
|
||||
char *psz_method, *psz_method_tmp;
|
||||
|
||||
/* Allocate structure */
|
||||
p_vout->p_sys = malloc( sizeof( vout_sys_t ) );
|
||||
@ -124,7 +124,13 @@ static int vout_Create( vout_thread_t *p_vout )
|
||||
}
|
||||
|
||||
/* Look what method was requested */
|
||||
psz_method = main_GetPszVariable( VOUT_FILTER_VAR, "" );
|
||||
if( !(psz_method = psz_method_tmp
|
||||
= config_GetPszVariable( VOUT_FILTER_VAR )) )
|
||||
{
|
||||
intf_ErrMsg( "vout error: configuration variable %s empty",
|
||||
VOUT_FILTER_VAR );
|
||||
return( 1 );
|
||||
}
|
||||
|
||||
while( *psz_method && *psz_method != ':' )
|
||||
{
|
||||
@ -146,6 +152,8 @@ static int vout_Create( vout_thread_t *p_vout )
|
||||
p_vout->p_sys->i_mode = DEINTERLACE_MODE_BOB;
|
||||
}
|
||||
|
||||
free( psz_method_tmp );
|
||||
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
@ -180,8 +188,8 @@ static int vout_Init( vout_thread_t *p_vout )
|
||||
}
|
||||
|
||||
/* Try to open the real video output, with half the height our images */
|
||||
psz_filter = main_GetPszVariable( VOUT_FILTER_VAR, "" );
|
||||
main_PutPszVariable( VOUT_FILTER_VAR, "" );
|
||||
psz_filter = config_GetPszVariable( VOUT_FILTER_VAR );
|
||||
config_PutPszVariable( VOUT_FILTER_VAR, NULL );
|
||||
|
||||
intf_WarnMsg( 1, "filter: spawning the real video output" );
|
||||
|
||||
@ -219,6 +227,9 @@ static int vout_Init( vout_thread_t *p_vout )
|
||||
break;
|
||||
}
|
||||
|
||||
config_PutPszVariable( VOUT_FILTER_VAR, psz_filter );
|
||||
if( psz_filter ) free( psz_filter );
|
||||
|
||||
/* Everything failed */
|
||||
if( p_vout->p_sys->p_vout == NULL )
|
||||
{
|
||||
@ -229,8 +240,6 @@ static int vout_Init( vout_thread_t *p_vout )
|
||||
|
||||
p_vout->p_sys->last_date = 0;
|
||||
|
||||
main_PutPszVariable( VOUT_FILTER_VAR, psz_filter );
|
||||
|
||||
ALLOCATE_DIRECTBUFFERS( VOUT_MAX_PICTURES );
|
||||
|
||||
return( 0 );
|
||||
|
@ -2,7 +2,7 @@
|
||||
* distort.c : Misc video effects plugin for vlc
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2000, 2001 VideoLAN
|
||||
* $Id: distort.c,v 1.7 2002/02/15 13:32:53 sam Exp $
|
||||
* $Id: distort.c,v 1.8 2002/02/24 20:51:09 gbazin Exp $
|
||||
*
|
||||
* Authors: Samuel Hocevar <sam@zoy.org>
|
||||
*
|
||||
@ -121,7 +121,7 @@ static void vout_getfunctions( function_list_t * p_function_list )
|
||||
*****************************************************************************/
|
||||
static int vout_Create( vout_thread_t *p_vout )
|
||||
{
|
||||
char *psz_method;
|
||||
char *psz_method, *psz_method_tmp;
|
||||
|
||||
/* Allocate structure */
|
||||
p_vout->p_sys = malloc( sizeof( vout_sys_t ) );
|
||||
@ -132,7 +132,13 @@ static int vout_Create( vout_thread_t *p_vout )
|
||||
}
|
||||
|
||||
/* Look what method was requested */
|
||||
psz_method = main_GetPszVariable( VOUT_FILTER_VAR, "" );
|
||||
if( !(psz_method = psz_method_tmp
|
||||
= config_GetPszVariable( VOUT_FILTER_VAR )) )
|
||||
{
|
||||
intf_ErrMsg( "vout error: configuration variable %s empty",
|
||||
VOUT_FILTER_VAR );
|
||||
return( 1 );
|
||||
}
|
||||
|
||||
while( *psz_method && *psz_method != ':' )
|
||||
{
|
||||
@ -154,6 +160,8 @@ static int vout_Create( vout_thread_t *p_vout )
|
||||
p_vout->p_sys->i_mode = DISTORT_MODE_WAVE;
|
||||
}
|
||||
|
||||
free( psz_method_tmp );
|
||||
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
@ -175,8 +183,8 @@ static int vout_Init( vout_thread_t *p_vout )
|
||||
p_vout->output.i_aspect = p_vout->render.i_aspect;
|
||||
|
||||
/* Try to open the real video output */
|
||||
psz_filter = main_GetPszVariable( VOUT_FILTER_VAR, "" );
|
||||
main_PutPszVariable( VOUT_FILTER_VAR, "" );
|
||||
psz_filter = config_GetPszVariable( VOUT_FILTER_VAR );
|
||||
config_PutPszVariable( VOUT_FILTER_VAR, NULL );
|
||||
|
||||
intf_WarnMsg( 1, "filter: spawning the real video output" );
|
||||
|
||||
@ -185,6 +193,9 @@ static int vout_Init( vout_thread_t *p_vout )
|
||||
p_vout->render.i_width, p_vout->render.i_height,
|
||||
p_vout->render.i_chroma, p_vout->render.i_aspect );
|
||||
|
||||
config_PutPszVariable( VOUT_FILTER_VAR, psz_filter );
|
||||
if( psz_filter ) free( psz_filter );
|
||||
|
||||
/* Everything failed */
|
||||
if( p_vout->p_sys->p_vout == NULL )
|
||||
{
|
||||
@ -193,8 +204,6 @@ static int vout_Init( vout_thread_t *p_vout )
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
main_PutPszVariable( VOUT_FILTER_VAR, psz_filter );
|
||||
|
||||
ALLOCATE_DIRECTBUFFERS( VOUT_MAX_PICTURES );
|
||||
|
||||
p_vout->p_sys->f_angle = 0.0;
|
||||
|
@ -2,7 +2,7 @@
|
||||
* invert.c : Invert video plugin for vlc
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2000, 2001 VideoLAN
|
||||
* $Id: invert.c,v 1.7 2002/02/15 13:32:53 sam Exp $
|
||||
* $Id: invert.c,v 1.8 2002/02/24 20:51:09 gbazin Exp $
|
||||
*
|
||||
* Authors: Samuel Hocevar <sam@zoy.org>
|
||||
*
|
||||
@ -125,7 +125,7 @@ static int vout_Init( vout_thread_t *p_vout )
|
||||
int i_index;
|
||||
char *psz_filter;
|
||||
picture_t *p_pic;
|
||||
|
||||
|
||||
I_OUTPUTPICTURES = 0;
|
||||
|
||||
/* Initialize the output structure */
|
||||
@ -135,16 +135,19 @@ static int vout_Init( vout_thread_t *p_vout )
|
||||
p_vout->output.i_aspect = p_vout->render.i_aspect;
|
||||
|
||||
/* Try to open the real video output */
|
||||
psz_filter = main_GetPszVariable( VOUT_FILTER_VAR, "" );
|
||||
main_PutPszVariable( VOUT_FILTER_VAR, "" );
|
||||
psz_filter = config_GetPszVariable( VOUT_FILTER_VAR );
|
||||
config_PutPszVariable( VOUT_FILTER_VAR, NULL );
|
||||
|
||||
intf_WarnMsg( 1, "filter: spawning the real video output" );
|
||||
|
||||
|
||||
p_vout->p_sys->p_vout =
|
||||
vout_CreateThread( NULL,
|
||||
p_vout->render.i_width, p_vout->render.i_height,
|
||||
p_vout->render.i_chroma, p_vout->render.i_aspect );
|
||||
|
||||
config_PutPszVariable( VOUT_FILTER_VAR, psz_filter );
|
||||
if( psz_filter ) free( psz_filter );
|
||||
|
||||
/* Everything failed */
|
||||
if( p_vout->p_sys->p_vout == NULL )
|
||||
{
|
||||
@ -153,8 +156,6 @@ static int vout_Init( vout_thread_t *p_vout )
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
main_PutPszVariable( VOUT_FILTER_VAR, psz_filter );
|
||||
|
||||
ALLOCATE_DIRECTBUFFERS( VOUT_MAX_PICTURES );
|
||||
|
||||
return( 0 );
|
||||
|
@ -2,7 +2,7 @@
|
||||
* transform.c : transform image plugin for vlc
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2000, 2001 VideoLAN
|
||||
* $Id: transform.c,v 1.6 2002/02/15 13:32:53 sam Exp $
|
||||
* $Id: transform.c,v 1.7 2002/02/24 20:51:09 gbazin Exp $
|
||||
*
|
||||
* Authors: Samuel Hocevar <sam@zoy.org>
|
||||
*
|
||||
@ -114,7 +114,7 @@ static void vout_getfunctions( function_list_t * p_function_list )
|
||||
*****************************************************************************/
|
||||
static int vout_Create( vout_thread_t *p_vout )
|
||||
{
|
||||
char *psz_method;
|
||||
char *psz_method, *psz_method_tmp;
|
||||
|
||||
/* Allocate structure */
|
||||
p_vout->p_sys = malloc( sizeof( vout_sys_t ) );
|
||||
@ -125,7 +125,13 @@ static int vout_Create( vout_thread_t *p_vout )
|
||||
}
|
||||
|
||||
/* Look what method was requested */
|
||||
psz_method = main_GetPszVariable( VOUT_FILTER_VAR, "" );
|
||||
if( !(psz_method = psz_method_tmp
|
||||
= config_GetPszVariable( VOUT_FILTER_VAR )) )
|
||||
{
|
||||
intf_ErrMsg( "vout error: configuration variable %s empty",
|
||||
VOUT_FILTER_VAR );
|
||||
return( 1 );
|
||||
}
|
||||
|
||||
while( *psz_method && *psz_method != ':' )
|
||||
{
|
||||
@ -165,6 +171,8 @@ static int vout_Create( vout_thread_t *p_vout )
|
||||
p_vout->p_sys->b_rotation = 1;
|
||||
}
|
||||
|
||||
free( psz_method_tmp );
|
||||
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
@ -186,8 +194,8 @@ static int vout_Init( vout_thread_t *p_vout )
|
||||
p_vout->output.i_aspect = p_vout->render.i_aspect;
|
||||
|
||||
/* Try to open the real video output */
|
||||
psz_filter = main_GetPszVariable( VOUT_FILTER_VAR, "" );
|
||||
main_PutPszVariable( VOUT_FILTER_VAR, "" );
|
||||
psz_filter = config_GetPszVariable( VOUT_FILTER_VAR );
|
||||
config_PutPszVariable( VOUT_FILTER_VAR, NULL );
|
||||
|
||||
intf_WarnMsg( 1, "filter: spawning the real video output" );
|
||||
|
||||
@ -208,6 +216,9 @@ static int vout_Init( vout_thread_t *p_vout )
|
||||
p_vout->render.i_chroma, p_vout->render.i_aspect );
|
||||
}
|
||||
|
||||
config_PutPszVariable( VOUT_FILTER_VAR, psz_filter );
|
||||
if( psz_filter ) free( psz_filter );
|
||||
|
||||
/* Everything failed */
|
||||
if( p_vout->p_sys->p_vout == NULL )
|
||||
{
|
||||
@ -215,8 +226,6 @@ static int vout_Init( vout_thread_t *p_vout )
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
main_PutPszVariable( VOUT_FILTER_VAR, psz_filter );
|
||||
|
||||
ALLOCATE_DIRECTBUFFERS( VOUT_MAX_PICTURES );
|
||||
|
||||
return( 0 );
|
||||
|
@ -2,7 +2,7 @@
|
||||
* wall.c : Wall video plugin for vlc
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2000, 2001 VideoLAN
|
||||
* $Id: wall.c,v 1.12 2002/02/15 13:32:53 sam Exp $
|
||||
* $Id: wall.c,v 1.13 2002/02/24 20:51:09 gbazin Exp $
|
||||
*
|
||||
* Authors: Samuel Hocevar <sam@zoy.org>
|
||||
*
|
||||
@ -117,7 +117,7 @@ static void vout_getfunctions( function_list_t * p_function_list )
|
||||
*****************************************************************************/
|
||||
static int vout_Create( vout_thread_t *p_vout )
|
||||
{
|
||||
char *psz_method, *psz_tmp;
|
||||
char *psz_method, *psz_tmp, *psz_method_tmp;
|
||||
int i_vout;
|
||||
|
||||
/* Allocate structure */
|
||||
@ -129,7 +129,13 @@ static int vout_Create( vout_thread_t *p_vout )
|
||||
}
|
||||
|
||||
/* Look what method was requested */
|
||||
psz_method = main_GetPszVariable( VOUT_FILTER_VAR, "" );
|
||||
if( !(psz_method = psz_method_tmp
|
||||
= config_GetPszVariable( VOUT_FILTER_VAR )) )
|
||||
{
|
||||
intf_ErrMsg( "vout error: configuration variable %s empty",
|
||||
VOUT_FILTER_VAR );
|
||||
return( 1 );
|
||||
}
|
||||
|
||||
while( *psz_method && *psz_method != ':' )
|
||||
{
|
||||
@ -203,6 +209,7 @@ static int vout_Create( vout_thread_t *p_vout )
|
||||
if( p_vout->p_sys->pp_vout == NULL )
|
||||
{
|
||||
intf_ErrMsg("error: %s", strerror(ENOMEM) );
|
||||
free( psz_method_tmp );
|
||||
free( p_vout->p_sys );
|
||||
return( 1 );
|
||||
}
|
||||
@ -253,6 +260,8 @@ static int vout_Create( vout_thread_t *p_vout )
|
||||
}
|
||||
}
|
||||
|
||||
free( psz_method_tmp );
|
||||
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
@ -274,8 +283,8 @@ static int vout_Init( vout_thread_t *p_vout )
|
||||
p_vout->output.i_aspect = p_vout->render.i_aspect;
|
||||
|
||||
/* Try to open the real video output */
|
||||
psz_filter = main_GetPszVariable( VOUT_FILTER_VAR, NULL );
|
||||
main_PutPszVariable( VOUT_FILTER_VAR, "" );
|
||||
psz_filter = config_GetPszVariable( VOUT_FILTER_VAR );
|
||||
config_PutPszVariable( VOUT_FILTER_VAR, NULL );
|
||||
|
||||
intf_WarnMsg( 1, "filter: spawning the real video outputs" );
|
||||
|
||||
@ -330,6 +339,8 @@ static int vout_Init( vout_thread_t *p_vout )
|
||||
intf_ErrMsg( "vout error: failed to get %ix%i vout threads",
|
||||
p_vout->p_sys->i_col, p_vout->p_sys->i_row );
|
||||
RemoveAllVout( p_vout );
|
||||
config_PutPszVariable( VOUT_FILTER_VAR, psz_filter );
|
||||
if( psz_filter ) free( psz_filter );
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -337,7 +348,8 @@ static int vout_Init( vout_thread_t *p_vout )
|
||||
}
|
||||
}
|
||||
|
||||
main_PutPszVariable( VOUT_FILTER_VAR, psz_filter );
|
||||
config_PutPszVariable( VOUT_FILTER_VAR, psz_filter );
|
||||
if( psz_filter ) free( psz_filter );
|
||||
|
||||
ALLOCATE_DIRECTBUFFERS( VOUT_MAX_PICTURES );
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ggi.c : GGI plugin for vlc
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2000, 2001 VideoLAN
|
||||
* $Id: ggi.c,v 1.14 2002/02/19 00:50:19 sam Exp $
|
||||
* $Id: ggi.c,v 1.15 2002/02/24 20:51:09 gbazin Exp $
|
||||
*
|
||||
* Authors: Vincent Seguin <seguin@via.ecp.fr>
|
||||
* Samuel Hocevar <sam@zoy.org>
|
||||
@ -396,9 +396,10 @@ static int OpenDisplay( vout_thread_t *p_vout )
|
||||
}
|
||||
|
||||
/* Open display */
|
||||
psz_display = main_GetPszVariable( VOUT_DISPLAY_VAR, NULL );
|
||||
psz_display = config_GetPszVariable( VOUT_DISPLAY_VAR );
|
||||
|
||||
p_vout->p_sys->p_display = ggiOpen( psz_display, NULL );
|
||||
if( psz_display ) free( psz_display );
|
||||
|
||||
if( p_vout->p_sys->p_display == NULL )
|
||||
{
|
||||
@ -409,10 +410,8 @@ static int OpenDisplay( vout_thread_t *p_vout )
|
||||
|
||||
/* Find most appropriate mode */
|
||||
p_vout->p_sys->mode.frames = 2; /* 2 buffers */
|
||||
p_vout->p_sys->mode.visible.x = main_GetIntVariable( VOUT_WIDTH_VAR,
|
||||
VOUT_WIDTH_DEFAULT );
|
||||
p_vout->p_sys->mode.visible.y = main_GetIntVariable( VOUT_HEIGHT_VAR,
|
||||
VOUT_HEIGHT_DEFAULT );
|
||||
p_vout->p_sys->mode.visible.x = config_GetIntVariable( VOUT_WIDTH_VAR );
|
||||
p_vout->p_sys->mode.visible.y = config_GetIntVariable( VOUT_HEIGHT_VAR );
|
||||
p_vout->p_sys->mode.virt.x = GGI_AUTO;
|
||||
p_vout->p_sys->mode.virt.y = GGI_AUTO;
|
||||
p_vout->p_sys->mode.size.x = GGI_AUTO;
|
||||
@ -515,4 +514,3 @@ static void CloseDisplay( vout_thread_t *p_vout )
|
||||
/* Exit library */
|
||||
ggiExit();
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
* gtk_display.c: Gtk+ tools for main interface
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1999, 2000 VideoLAN
|
||||
* $Id: gtk_display.c,v 1.13 2002/01/10 04:11:25 sam Exp $
|
||||
* $Id: gtk_display.c,v 1.14 2002/02/24 20:51:10 gbazin Exp $
|
||||
*
|
||||
* Authors: Samuel Hocevar <sam@zoy.org>
|
||||
* Stéphane Borel <stef@via.ecp.fr>
|
||||
@ -147,8 +147,7 @@ gint GtkModeManage( intf_thread_t * p_intf )
|
||||
p_input_bank->pp_input[0]->p_source );
|
||||
p_channel = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
|
||||
p_intf->p_sys->p_window ), "network_channel_box" ) );
|
||||
if( main_GetIntVariable( INPUT_NETWORK_CHANNEL_VAR,
|
||||
INPUT_NETWORK_CHANNEL_DEFAULT ) )
|
||||
if( config_GetIntVariable( INPUT_NETWORK_CHANNEL_VAR ) )
|
||||
{
|
||||
gtk_widget_show( GTK_WIDGET( p_channel ) );
|
||||
}
|
||||
@ -194,8 +193,7 @@ gint GtkModeManage( intf_thread_t * p_intf )
|
||||
}
|
||||
else
|
||||
{
|
||||
if( main_GetIntVariable( INPUT_NETWORK_CHANNEL_VAR,
|
||||
INPUT_NETWORK_CHANNEL_DEFAULT ) )
|
||||
if( config_GetIntVariable( INPUT_NETWORK_CHANNEL_VAR ) )
|
||||
{
|
||||
gtk_widget_show( GTK_WIDGET( p_network_box ) );
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
* gtk_open.c : functions to handle file/disc/network open widgets.
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2000, 2001 VideoLAN
|
||||
* $Id: gtk_open.c,v 1.15 2002/01/31 23:18:27 massiot Exp $
|
||||
* $Id: gtk_open.c,v 1.16 2002/02/24 20:51:10 gbazin Exp $
|
||||
*
|
||||
* Authors: Samuel Hocevar <sam@zoy.org>
|
||||
* Stéphane Borel <stef@via.ecp.fr>
|
||||
@ -66,13 +66,16 @@ gboolean GtkFileOpenShow( GtkWidget *widget,
|
||||
/* If we have never used the file selector, open it */
|
||||
if( !GTK_IS_WIDGET( p_intf->p_sys->p_fileopen ) )
|
||||
{
|
||||
char *psz_path;
|
||||
|
||||
p_intf->p_sys->p_fileopen = create_intf_fileopen();
|
||||
gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_fileopen ),
|
||||
"p_intf", p_intf );
|
||||
|
||||
gtk_file_selection_set_filename( GTK_FILE_SELECTION(
|
||||
p_intf->p_sys->p_fileopen ),
|
||||
main_GetPszVariable( INTF_PATH_VAR, INTF_PATH_DEFAULT ) );
|
||||
if( (psz_path = config_GetPszVariable( INTF_PATH_VAR )) )
|
||||
gtk_file_selection_set_filename( GTK_FILE_SELECTION(
|
||||
p_intf->p_sys->p_fileopen ), psz_path );
|
||||
if( psz_path ) free( psz_path );
|
||||
}
|
||||
|
||||
gtk_widget_show( p_intf->p_sys->p_fileopen );
|
||||
@ -148,10 +151,13 @@ void GtkDiscOpenDvd( GtkToggleButton * togglebutton, gpointer user_data )
|
||||
{
|
||||
if( togglebutton->active )
|
||||
{
|
||||
gtk_entry_set_text(
|
||||
GTK_ENTRY( lookup_widget( GTK_WIDGET(togglebutton), "disc_name" ) ),
|
||||
main_GetPszVariable( INPUT_DVD_DEVICE_VAR, DVD_DEVICE )
|
||||
);
|
||||
char *psz_dvd_device;
|
||||
|
||||
if( (psz_dvd_device = config_GetPszVariable( INPUT_DVD_DEVICE_VAR )) )
|
||||
gtk_entry_set_text(
|
||||
GTK_ENTRY( lookup_widget( GTK_WIDGET(togglebutton),
|
||||
"disc_name" ) ), psz_dvd_device );
|
||||
if( psz_dvd_device ) free( psz_dvd_device );
|
||||
}
|
||||
}
|
||||
|
||||
@ -159,10 +165,13 @@ void GtkDiscOpenVcd( GtkToggleButton * togglebutton, gpointer user_data )
|
||||
{
|
||||
if( togglebutton->active )
|
||||
{
|
||||
gtk_entry_set_text(
|
||||
GTK_ENTRY( lookup_widget( GTK_WIDGET(togglebutton), "disc_name" ) ),
|
||||
main_GetPszVariable( INPUT_VCD_DEVICE_VAR, VCD_DEVICE )
|
||||
);
|
||||
char *psz_vcd_device;
|
||||
|
||||
if( (psz_vcd_device = config_GetPszVariable( INPUT_VCD_DEVICE_VAR )) )
|
||||
gtk_entry_set_text(
|
||||
GTK_ENTRY( lookup_widget( GTK_WIDGET(togglebutton),
|
||||
"disc_name" ) ), psz_vcd_device );
|
||||
if( psz_vcd_device ) free( psz_vcd_device );
|
||||
}
|
||||
}
|
||||
|
||||
@ -204,11 +213,11 @@ void GtkDiscOpenOk( GtkButton * button, gpointer user_data )
|
||||
}
|
||||
|
||||
/* Select title and chapter */
|
||||
main_PutIntVariable( INPUT_TITLE_VAR, gtk_spin_button_get_value_as_int(
|
||||
config_PutIntVariable( INPUT_TITLE_VAR, gtk_spin_button_get_value_as_int(
|
||||
GTK_SPIN_BUTTON( lookup_widget(
|
||||
GTK_WIDGET(button), "disc_title" ) ) ) );
|
||||
|
||||
main_PutIntVariable( INPUT_CHAPTER_VAR, gtk_spin_button_get_value_as_int(
|
||||
config_PutIntVariable( INPUT_CHAPTER_VAR, gtk_spin_button_get_value_as_int(
|
||||
GTK_SPIN_BUTTON( lookup_widget(
|
||||
GTK_WIDGET(button), "disc_chapter" ) ) ) );
|
||||
|
||||
@ -253,44 +262,30 @@ gboolean GtkNetworkOpenShow( GtkWidget *widget,
|
||||
|
||||
if( !GTK_IS_WIDGET( p_intf->p_sys->p_network ) )
|
||||
{
|
||||
char *psz_channel_server;
|
||||
|
||||
p_intf->p_sys->p_network = create_intf_network();
|
||||
gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_network ),
|
||||
"p_intf", p_intf );
|
||||
|
||||
gtk_entry_set_text( GTK_ENTRY( gtk_object_get_data(
|
||||
GTK_OBJECT( p_intf->p_sys->p_network ), "network_server" ) ),
|
||||
main_GetPszVariable( INPUT_SERVER_VAR,
|
||||
INPUT_SERVER_DEFAULT ) );
|
||||
|
||||
gtk_spin_button_set_value( GTK_SPIN_BUTTON( gtk_object_get_data(
|
||||
GTK_OBJECT( p_intf->p_sys->p_network ), "network_port" ) ),
|
||||
main_GetIntVariable( INPUT_PORT_VAR,
|
||||
INPUT_PORT_DEFAULT ) );
|
||||
config_GetIntVariable( INPUT_PORT_VAR ) );
|
||||
|
||||
gtk_entry_set_text( GTK_ENTRY( gtk_object_get_data(
|
||||
GTK_OBJECT( p_intf->p_sys->p_network ), "network_broadcast" ) ),
|
||||
main_GetPszVariable( INPUT_BCAST_ADDR_VAR,
|
||||
INPUT_BCAST_ADDR_DEFAULT ) );
|
||||
|
||||
gtk_entry_set_text( GTK_ENTRY( gtk_object_get_data(
|
||||
GTK_OBJECT( p_intf->p_sys->p_network ), "network_channel" ) ),
|
||||
main_GetPszVariable( INPUT_CHANNEL_SERVER_VAR,
|
||||
INPUT_CHANNEL_SERVER_DEFAULT ) );
|
||||
psz_channel_server = config_GetPszVariable( INPUT_CHANNEL_SERVER_VAR );
|
||||
if( psz_channel_server )
|
||||
gtk_entry_set_text( GTK_ENTRY( gtk_object_get_data(
|
||||
GTK_OBJECT( p_intf->p_sys->p_network ), "network_channel" ) ),
|
||||
psz_channel_server );
|
||||
if( psz_channel_server ) free( psz_channel_server );
|
||||
|
||||
gtk_spin_button_set_value( GTK_SPIN_BUTTON( gtk_object_get_data(
|
||||
GTK_OBJECT( p_intf->p_sys->p_network ), "network_channel_port" ) ),
|
||||
main_GetIntVariable( INPUT_CHANNEL_PORT_VAR,
|
||||
INPUT_CHANNEL_PORT_DEFAULT ) );
|
||||
config_GetIntVariable( INPUT_CHANNEL_PORT_VAR ) );
|
||||
|
||||
gtk_toggle_button_set_active( gtk_object_get_data( GTK_OBJECT(
|
||||
p_intf->p_sys->p_network ), "network_channel_check" ),
|
||||
main_GetIntVariable( INPUT_NETWORK_CHANNEL_VAR,
|
||||
INPUT_NETWORK_CHANNEL_DEFAULT ) );
|
||||
|
||||
gtk_toggle_button_set_active( gtk_object_get_data( GTK_OBJECT(
|
||||
p_intf->p_sys->p_network ), "network_broadcast_check" ),
|
||||
main_GetIntVariable( INPUT_BROADCAST_VAR,
|
||||
INPUT_BROADCAST_DEFAULT ) );
|
||||
config_GetIntVariable( INPUT_NETWORK_CHANNEL_VAR ) );
|
||||
}
|
||||
|
||||
gtk_widget_show( p_intf->p_sys->p_network );
|
||||
@ -340,7 +335,7 @@ void GtkNetworkOpenOk( GtkButton *button, gpointer user_data )
|
||||
/* Manage channel server */
|
||||
b_channel = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(
|
||||
lookup_widget( GTK_WIDGET(button), "network_channel_check" ) ) );
|
||||
main_PutIntVariable( INPUT_NETWORK_CHANNEL_VAR, b_channel );
|
||||
config_PutIntVariable( INPUT_NETWORK_CHANNEL_VAR, b_channel );
|
||||
if( b_channel )
|
||||
{
|
||||
char * psz_channel;
|
||||
@ -356,10 +351,10 @@ void GtkNetworkOpenOk( GtkButton *button, gpointer user_data )
|
||||
i_channel_port = gtk_spin_button_get_value_as_int( GTK_SPIN_BUTTON(
|
||||
lookup_widget( GTK_WIDGET(button), "network_channel_port" ) ) );
|
||||
|
||||
main_PutPszVariable( INPUT_CHANNEL_SERVER_VAR, psz_channel );
|
||||
config_PutPszVariable( INPUT_CHANNEL_SERVER_VAR, psz_channel );
|
||||
if( i_channel_port < 65536 )
|
||||
{
|
||||
main_PutIntVariable( INPUT_CHANNEL_PORT_VAR, i_channel_port );
|
||||
config_PutIntVariable( INPUT_CHANNEL_PORT_VAR, i_channel_port );
|
||||
}
|
||||
|
||||
p_intf->p_sys->b_playing = 1;
|
||||
|
@ -2,7 +2,7 @@
|
||||
* gtk_control.c : functions to handle stream control buttons.
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2000, 2001 VideoLAN
|
||||
* $Id: gtk_preferences.c,v 1.10 2002/01/02 14:37:42 sam Exp $
|
||||
* $Id: gtk_preferences.c,v 1.11 2002/02/24 20:51:10 gbazin Exp $
|
||||
*
|
||||
* Authors: Samuel Hocevar <sam@zoy.org>
|
||||
* Stéphane Borel <stef@via.ecp.fr>
|
||||
@ -56,20 +56,20 @@
|
||||
****************************************************************************/
|
||||
|
||||
/* macros to create preference box */
|
||||
#define ASSIGN_PSZ_ENTRY( var, default, name ) \
|
||||
#define ASSIGN_PSZ_ENTRY( var, name ) \
|
||||
gtk_entry_set_text( GTK_ENTRY( gtk_object_get_data( GTK_OBJECT( \
|
||||
p_intf->p_sys->p_preferences ), name ) ), \
|
||||
main_GetPszVariable( var, default ) )
|
||||
config_GetPszVariable( var ) )
|
||||
|
||||
#define ASSIGN_INT_VALUE( var, default, name ) \
|
||||
#define ASSIGN_INT_VALUE( var, name ) \
|
||||
gtk_spin_button_set_value( GTK_SPIN_BUTTON( gtk_object_get_data( \
|
||||
GTK_OBJECT( p_intf->p_sys->p_preferences ), name ) ), \
|
||||
main_GetIntVariable( var, default ) )
|
||||
config_GetIntVariable( var ) )
|
||||
|
||||
#define ASSIGN_INT_TOGGLE( var, default, name ) \
|
||||
#define ASSIGN_INT_TOGGLE( var, name ) \
|
||||
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( gtk_object_get_data( \
|
||||
GTK_OBJECT( p_intf->p_sys->p_preferences ), name ) ), \
|
||||
main_GetIntVariable( var, default ) )
|
||||
config_GetIntVariable( var ) )
|
||||
|
||||
gboolean GtkPreferencesShow( GtkWidget *widget,
|
||||
GdkEventButton *event,
|
||||
@ -85,49 +85,37 @@ gboolean GtkPreferencesShow( GtkWidget *widget,
|
||||
"p_intf", p_intf );
|
||||
|
||||
/* Default path */
|
||||
ASSIGN_PSZ_ENTRY( INTF_PATH_VAR, INTF_PATH_DEFAULT,
|
||||
ASSIGN_PSZ_ENTRY( INTF_PATH_VAR,
|
||||
"preferences_file_path_entry" );
|
||||
|
||||
/* Default DVD */
|
||||
ASSIGN_PSZ_ENTRY( INPUT_DVD_DEVICE_VAR,DVD_DEVICE,
|
||||
ASSIGN_PSZ_ENTRY( INPUT_DVD_DEVICE_VAR,
|
||||
"preferences_disc_dvd_entry" );
|
||||
|
||||
/* Default VCD */
|
||||
ASSIGN_PSZ_ENTRY( INPUT_VCD_DEVICE_VAR, VCD_DEVICE,
|
||||
ASSIGN_PSZ_ENTRY( INPUT_VCD_DEVICE_VAR,
|
||||
"preferences_disc_vcd_entry" );
|
||||
|
||||
/* Default server */
|
||||
ASSIGN_PSZ_ENTRY( INPUT_SERVER_VAR, INPUT_SERVER_DEFAULT,
|
||||
"preferences_network_server_entry" );
|
||||
|
||||
/* Default port */
|
||||
ASSIGN_INT_VALUE( INPUT_PORT_VAR, INPUT_PORT_DEFAULT,
|
||||
ASSIGN_INT_VALUE( INPUT_PORT_VAR,
|
||||
"preferences_network_port_spinbutton" );
|
||||
|
||||
/* Broadcast address */
|
||||
ASSIGN_PSZ_ENTRY( INPUT_BCAST_ADDR_VAR, INPUT_BCAST_ADDR_DEFAULT,
|
||||
"preferences_network_broadcast_entry" );
|
||||
|
||||
/* Broadcast stream by default ? */
|
||||
ASSIGN_INT_TOGGLE( INPUT_BROADCAST_VAR, INPUT_BROADCAST_DEFAULT,
|
||||
"preferences_network_broadcast_checkbutton" );
|
||||
|
||||
/* XXX Protocol */
|
||||
|
||||
/* Default interface */
|
||||
ASSIGN_PSZ_ENTRY( INTF_METHOD_VAR, INTF_METHOD_DEFAULT,
|
||||
ASSIGN_PSZ_ENTRY( INTF_METHOD_VAR,
|
||||
"preferences_interface_entry" );
|
||||
|
||||
/* Default video output */
|
||||
ASSIGN_PSZ_ENTRY( VOUT_METHOD_VAR, VOUT_METHOD_DEFAULT,
|
||||
ASSIGN_PSZ_ENTRY( VOUT_METHOD_VAR,
|
||||
"preferences_video_output_entry" );
|
||||
|
||||
/* Default output width */
|
||||
ASSIGN_INT_VALUE( VOUT_WIDTH_VAR, VOUT_WIDTH_DEFAULT,
|
||||
ASSIGN_INT_VALUE( VOUT_WIDTH_VAR,
|
||||
"preferences_video_width_spinbutton" );
|
||||
|
||||
/* Default output height */
|
||||
ASSIGN_INT_VALUE( VOUT_HEIGHT_VAR, VOUT_HEIGHT_DEFAULT,
|
||||
ASSIGN_INT_VALUE( VOUT_HEIGHT_VAR,
|
||||
"preferences_video_height_spinbutton" );
|
||||
|
||||
/* XXX Default screen depth */
|
||||
@ -137,20 +125,17 @@ gboolean GtkPreferencesShow( GtkWidget *widget,
|
||||
/* XXX Default gamma */
|
||||
|
||||
/* Fullscreen on play */
|
||||
ASSIGN_INT_TOGGLE( VOUT_FULLSCREEN_VAR, VOUT_FULLSCREEN_DEFAULT,
|
||||
ASSIGN_INT_TOGGLE( VOUT_FULLSCREEN_VAR,
|
||||
"preferences_video_fullscreen_checkbutton" );
|
||||
|
||||
/* Grayscale display */
|
||||
ASSIGN_INT_TOGGLE( VOUT_GRAYSCALE_VAR, VOUT_GRAYSCALE_DEFAULT,
|
||||
ASSIGN_INT_TOGGLE( VOUT_GRAYSCALE_VAR,
|
||||
"preferences_video_grayscale_checkbutton" );
|
||||
|
||||
/* Default audio output */
|
||||
ASSIGN_PSZ_ENTRY( AOUT_METHOD_VAR, AOUT_METHOD_DEFAULT,
|
||||
ASSIGN_PSZ_ENTRY( AOUT_METHOD_VAR,
|
||||
"preferences_audio_output_entry" );
|
||||
|
||||
/* Default audio device */
|
||||
ASSIGN_PSZ_ENTRY( AOUT_DSP_VAR, AOUT_DSP_DEFAULT,
|
||||
"preferences_audio_device_entry" );
|
||||
|
||||
|
||||
/* XXX Default frequency */
|
||||
|
||||
@ -159,23 +144,23 @@ gboolean GtkPreferencesShow( GtkWidget *widget,
|
||||
/* XXX Default number of channels */
|
||||
|
||||
/* Use spdif output ? */
|
||||
ASSIGN_INT_TOGGLE( AOUT_SPDIF_VAR, AOUT_SPDIF_DEFAULT,
|
||||
ASSIGN_INT_TOGGLE( AOUT_SPDIF_VAR,
|
||||
"preferences_audio_spdif_checkbutton" );
|
||||
|
||||
/* Launch playlist on startup */
|
||||
ASSIGN_INT_TOGGLE( PLAYLIST_STARTUP_VAR, PLAYLIST_STARTUP_DEFAULT,
|
||||
ASSIGN_INT_TOGGLE( PLAYLIST_STARTUP_VAR,
|
||||
"preferences_playlist_startup_checkbutton" );
|
||||
|
||||
/* Enqueue drag'n dropped item as default */
|
||||
ASSIGN_INT_TOGGLE( PLAYLIST_ENQUEUE_VAR, PLAYLIST_ENQUEUE_DEFAULT,
|
||||
ASSIGN_INT_TOGGLE( PLAYLIST_ENQUEUE_VAR,
|
||||
"preferences_playlist_enqueue_checkbutton" );
|
||||
|
||||
/* Loop on playlist end */
|
||||
ASSIGN_INT_TOGGLE( PLAYLIST_LOOP_VAR, PLAYLIST_LOOP_DEFAULT,
|
||||
ASSIGN_INT_TOGGLE( PLAYLIST_LOOP_VAR,
|
||||
"preferences_playlist_loop_checkbutton" );
|
||||
|
||||
/* Verbosity of warning messages */
|
||||
ASSIGN_INT_VALUE( INTF_WARNING_VAR, INTF_WARNING_DEFAULT,
|
||||
ASSIGN_INT_VALUE( INTF_WARNING_VAR,
|
||||
"preferences_misc_messages_spinbutton" );
|
||||
#undef ASSIGN_PSZ_ENTRY
|
||||
#undef ASSIGN_INT_VALUE
|
||||
@ -193,18 +178,18 @@ gboolean GtkPreferencesShow( GtkWidget *widget,
|
||||
****************************************************************************/
|
||||
|
||||
/* macros to read value frfom preference box */
|
||||
#define ASSIGN_PSZ_ENTRY( var, name ) \
|
||||
main_PutPszVariable( var, gtk_entry_get_text( \
|
||||
#define ASSIGN_PSZ_ENTRY( var, name ) \
|
||||
config_PutPszVariable( var, gtk_entry_get_text( \
|
||||
GTK_ENTRY( gtk_object_get_data( GTK_OBJECT( p_preferences ), name ) ) ) )
|
||||
|
||||
#define ASSIGN_INT_VALUE( var, name ) \
|
||||
main_PutIntVariable( var, gtk_spin_button_get_value_as_int( \
|
||||
GTK_SPIN_BUTTON( gtk_object_get_data( GTK_OBJECT( p_preferences ), \
|
||||
#define ASSIGN_INT_VALUE( var, name ) \
|
||||
config_PutIntVariable( var, gtk_spin_button_get_value_as_int( \
|
||||
GTK_SPIN_BUTTON( gtk_object_get_data( GTK_OBJECT( p_preferences ), \
|
||||
name ) ) ) )
|
||||
|
||||
#define ASSIGN_INT_TOGGLE( var, name ) \
|
||||
main_PutIntVariable( var, gtk_toggle_button_get_active( \
|
||||
GTK_TOGGLE_BUTTON( gtk_object_get_data( GTK_OBJECT( p_preferences ), \
|
||||
#define ASSIGN_INT_TOGGLE( var, name ) \
|
||||
config_PutIntVariable( var, gtk_toggle_button_get_active( \
|
||||
GTK_TOGGLE_BUTTON( gtk_object_get_data( GTK_OBJECT( p_preferences ), \
|
||||
name ) ) ) )
|
||||
|
||||
void GtkPreferencesApply( GtkButton * button, gpointer user_data )
|
||||
@ -223,20 +208,9 @@ void GtkPreferencesApply( GtkButton * button, gpointer user_data )
|
||||
/* Default VCD */
|
||||
ASSIGN_PSZ_ENTRY( INPUT_VCD_DEVICE_VAR, "preferences_disc_vcd_entry" );
|
||||
|
||||
/* Default server */
|
||||
ASSIGN_PSZ_ENTRY( INPUT_SERVER_VAR, "preferences_network_server_entry" );
|
||||
|
||||
/* Default port */
|
||||
ASSIGN_INT_VALUE( INPUT_PORT_VAR, "preferences_network_port_spinbutton" );
|
||||
|
||||
/* Broadcast address */
|
||||
ASSIGN_PSZ_ENTRY( INPUT_BCAST_ADDR_VAR,
|
||||
"preferences_network_broadcast_entry" );
|
||||
|
||||
/* Broadcast stream by default ? */
|
||||
ASSIGN_INT_TOGGLE( INPUT_BROADCAST_VAR,
|
||||
"preferences_network_broadcast_checkbutton" );
|
||||
|
||||
/* XXX Protocol */
|
||||
|
||||
/* Default interface */
|
||||
@ -268,9 +242,6 @@ void GtkPreferencesApply( GtkButton * button, gpointer user_data )
|
||||
/* Default audio output */
|
||||
ASSIGN_PSZ_ENTRY( AOUT_METHOD_VAR, "preferences_audio_output_entry" );
|
||||
|
||||
/* Default audio device */
|
||||
ASSIGN_PSZ_ENTRY( AOUT_DSP_VAR, "preferences_audio_device_entry" );
|
||||
|
||||
/* XXX Default frequency */
|
||||
|
||||
/* XXX Default quality */
|
||||
|
@ -2,7 +2,7 @@
|
||||
* idctclassic.c : Classic IDCT module
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1999-2001 VideoLAN
|
||||
* $Id: idctclassic.c,v 1.20 2002/02/15 13:32:53 sam Exp $
|
||||
* $Id: idctclassic.c,v 1.21 2002/02/24 20:51:10 gbazin Exp $
|
||||
*
|
||||
* Authors: Gaël Hendryckx <jimmy@via.ecp.fr>
|
||||
*
|
||||
@ -41,8 +41,6 @@ static void idct_getfunctions( function_list_t * p_function_list );
|
||||
* Build configuration tree.
|
||||
*****************************************************************************/
|
||||
MODULE_CONFIG_START
|
||||
ADD_WINDOW( "Configuration for classic IDCT module" )
|
||||
ADD_COMMENT( "Ha, ha -- nothing to configure yet" )
|
||||
MODULE_CONFIG_STOP
|
||||
|
||||
MODULE_INIT_START
|
||||
|
@ -2,7 +2,7 @@
|
||||
* kde.cpp : KDE plugin for vlc
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2001 VideoLAN
|
||||
* $Id: kde.cpp,v 1.6 2002/01/02 14:37:42 sam Exp $
|
||||
* $Id: kde.cpp,v 1.7 2002/02/24 20:51:10 gbazin Exp $
|
||||
*
|
||||
* Authors: Andres Krapf <dae@chez.com> Sun Mar 25 2001
|
||||
*
|
||||
@ -48,8 +48,6 @@ extern "C"
|
||||
{
|
||||
|
||||
MODULE_CONFIG_START
|
||||
ADD_WINDOW( "Configuration for KDE module" )
|
||||
ADD_COMMENT( "Ha, ha -- nothing to configure yet" )
|
||||
MODULE_CONFIG_STOP
|
||||
|
||||
MODULE_INIT_START
|
||||
|
@ -287,8 +287,8 @@ void KInterface::slotOpenDisk()
|
||||
source += fDiskDialog->device();
|
||||
|
||||
// Select title and chapter
|
||||
main_PutIntVariable( INPUT_TITLE_VAR, fDiskDialog->title() );
|
||||
main_PutIntVariable( INPUT_CHAPTER_VAR, fDiskDialog->chapter() );
|
||||
config_PutIntVariable( INPUT_TITLE_VAR, fDiskDialog->title() );
|
||||
config_PutIntVariable( INPUT_CHAPTER_VAR, fDiskDialog->chapter() );
|
||||
|
||||
// add it to playlist
|
||||
intf_PlaylistAdd( p_main->p_playlist, PLAYLIST_END, source.latin1() );
|
||||
|
@ -2,7 +2,7 @@
|
||||
* lirc.c : lirc plugin for vlc
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2002 VideoLAN
|
||||
* $Id: lirc.c,v 1.7 2002/02/21 21:55:40 sam Exp $
|
||||
* $Id: lirc.c,v 1.8 2002/02/24 20:51:10 gbazin Exp $
|
||||
*
|
||||
* Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
|
||||
*
|
||||
@ -64,8 +64,7 @@ static void intf_Run ( intf_thread_t *p_intf );
|
||||
* Build configuration tree.
|
||||
*****************************************************************************/
|
||||
MODULE_CONFIG_START
|
||||
ADD_WINDOW( "Configuration for lirc module" )
|
||||
ADD_COMMENT( "use ~/.lircrc" )
|
||||
|
||||
MODULE_CONFIG_STOP
|
||||
|
||||
MODULE_INIT_START
|
||||
@ -148,7 +147,14 @@ static void intf_Run( intf_thread_t *p_intf )
|
||||
char *code;
|
||||
char *c;
|
||||
|
||||
/* Manage core vlc functions through the callback */
|
||||
p_intf->pf_manage( p_intf );
|
||||
|
||||
<<<<<<< lirc.c
|
||||
while( !p_intf->b_die && lirc_nextcode(&code) == 0 )
|
||||
=======
|
||||
while( !p_intf->b_die )
|
||||
>>>>>>> 1.7
|
||||
{
|
||||
/* Manage core vlc functions through the callback */
|
||||
p_intf->pf_manage( p_intf );
|
||||
|
@ -2,7 +2,7 @@
|
||||
* xmga.c : X11 MGA plugin for vlc
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1998-2001 VideoLAN
|
||||
* $Id: xmga.c,v 1.5 2002/02/19 00:50:19 sam Exp $
|
||||
* $Id: xmga.c,v 1.6 2002/02/24 20:51:10 gbazin Exp $
|
||||
*
|
||||
* Authors: Vincent Seguin <seguin@via.ecp.fr>
|
||||
* Samuel Hocevar <sam@zoy.org>
|
||||
@ -267,16 +267,21 @@ static int vout_Create( vout_thread_t *p_vout )
|
||||
return( 1 );
|
||||
}
|
||||
|
||||
/* Open display, unsing 'vlc_display' or DISPLAY environment variable */
|
||||
psz_display = XDisplayName( main_GetPszVariable( VOUT_DISPLAY_VAR, NULL ) );
|
||||
/* Open display, unsing the VOUT_DISPLAY_VAR config variable or the DISPLAY
|
||||
* environment variable */
|
||||
psz_display = config_GetPszVariable( VOUT_DISPLAY_VAR );
|
||||
p_vout->p_sys->p_display = XOpenDisplay( psz_display );
|
||||
|
||||
if( p_vout->p_sys->p_display == NULL ) /* error */
|
||||
{
|
||||
intf_ErrMsg( "vout error: cannot open display %s", psz_display );
|
||||
intf_ErrMsg( "vout error: cannot open display %s",
|
||||
XDisplayName( psz_display ) );
|
||||
free( p_vout->p_sys );
|
||||
if( psz_display ) free( psz_display );
|
||||
return( 1 );
|
||||
}
|
||||
if( psz_display ) free( psz_display );
|
||||
|
||||
p_vout->p_sys->i_screen = DefaultScreen( p_vout->p_sys->p_display );
|
||||
|
||||
/* Create blank cursor (for mouse cursor autohiding) */
|
||||
|
@ -2,7 +2,7 @@
|
||||
* mpeg_adec.c: MPEG audio decoder thread
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1999-2001 VideoLAN
|
||||
* $Id: mpeg_adec.c,v 1.19 2002/02/19 00:50:19 sam Exp $
|
||||
* $Id: mpeg_adec.c,v 1.20 2002/02/24 20:51:10 gbazin Exp $
|
||||
*
|
||||
* Authors: Michel Kaempf <maxx@via.ecp.fr>
|
||||
* Michel Lespinasse <walken@via.ecp.fr>
|
||||
@ -171,7 +171,7 @@ static void DecodeThread( adec_thread_t * p_adec )
|
||||
int fifo_type;
|
||||
int channels;
|
||||
|
||||
if( main_GetIntVariable( AOUT_STEREO_VAR, 0 ) )
|
||||
if( p_main->b_stereo )
|
||||
{
|
||||
intf_WarnMsg( 4, "adec info: setting stereo output" );
|
||||
fifo_type = AOUT_ADEC_STEREO_FIFO;
|
||||
|
@ -2,7 +2,7 @@
|
||||
* input_ps.c: PS demux and packet management
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1998-2001 VideoLAN
|
||||
* $Id: input_ps.c,v 1.12 2002/02/15 13:32:53 sam Exp $
|
||||
* $Id: input_ps.c,v 1.13 2002/02/24 20:51:10 gbazin Exp $
|
||||
*
|
||||
* Authors: Christophe Massiot <massiot@via.ecp.fr>
|
||||
* Cyril Deguet <asmax@via.ecp.fr>
|
||||
@ -258,33 +258,33 @@ static void PSInit( input_thread_t * p_input )
|
||||
|
||||
case MPEG1_AUDIO_ES:
|
||||
case MPEG2_AUDIO_ES:
|
||||
if( main_GetIntVariable( INPUT_CHANNEL_VAR, 0 )
|
||||
== (p_es->i_id & 0x1F) )
|
||||
switch( main_GetIntVariable( INPUT_AUDIO_VAR, 0 ) )
|
||||
if( config_GetIntVariable( INPUT_CHANNEL_VAR )
|
||||
== (p_es->i_id & 0x1F) ||
|
||||
( config_GetIntVariable( INPUT_CHANNEL_VAR ) < 0
|
||||
&& !(p_es->i_id & 0x1F) ) )
|
||||
switch( config_GetIntVariable( INPUT_AUDIO_VAR ) )
|
||||
{
|
||||
case 0:
|
||||
main_PutIntVariable( INPUT_AUDIO_VAR,
|
||||
REQUESTED_MPEG );
|
||||
case -1:
|
||||
case REQUESTED_MPEG:
|
||||
input_SelectES( p_input, p_es );
|
||||
}
|
||||
break;
|
||||
|
||||
case AC3_AUDIO_ES:
|
||||
if( main_GetIntVariable( INPUT_CHANNEL_VAR, 0 )
|
||||
== ((p_es->i_id & 0xF00) >> 8) )
|
||||
switch( main_GetIntVariable( INPUT_AUDIO_VAR, 0 ) )
|
||||
if( config_GetIntVariable( INPUT_CHANNEL_VAR )
|
||||
== ((p_es->i_id & 0xF00) >> 8) ||
|
||||
( config_GetIntVariable( INPUT_CHANNEL_VAR ) < 0
|
||||
&& !((p_es->i_id & 0xF00) >> 8) ) )
|
||||
switch( config_GetIntVariable( INPUT_AUDIO_VAR ) )
|
||||
{
|
||||
case 0:
|
||||
main_PutIntVariable( INPUT_AUDIO_VAR,
|
||||
REQUESTED_AC3 );
|
||||
case -1:
|
||||
case REQUESTED_AC3:
|
||||
input_SelectES( p_input, p_es );
|
||||
}
|
||||
break;
|
||||
|
||||
case DVD_SPU_ES:
|
||||
if( main_GetIntVariable( INPUT_SUBTITLE_VAR, -1 )
|
||||
if( config_GetIntVariable( INPUT_SUBTITLE_VAR )
|
||||
== ((p_es->i_id & 0x1F00) >> 8) )
|
||||
{
|
||||
input_SelectES( p_input, p_es );
|
||||
@ -292,13 +292,13 @@ static void PSInit( input_thread_t * p_input )
|
||||
break;
|
||||
|
||||
case LPCM_AUDIO_ES:
|
||||
if( main_GetIntVariable( INPUT_CHANNEL_VAR, 0 )
|
||||
== ((p_es->i_id & 0x1F00) >> 8) )
|
||||
switch( main_GetIntVariable( INPUT_AUDIO_VAR, 0 ) )
|
||||
if( config_GetIntVariable( INPUT_CHANNEL_VAR )
|
||||
== ((p_es->i_id & 0x1F00) >> 8) ||
|
||||
( config_GetIntVariable( INPUT_CHANNEL_VAR ) < 0
|
||||
&& !((p_es->i_id & 0x1F00) >> 8) ) )
|
||||
switch( config_GetIntVariable( INPUT_AUDIO_VAR ) )
|
||||
{
|
||||
case 0:
|
||||
main_PutIntVariable( INPUT_AUDIO_VAR,
|
||||
REQUESTED_LPCM );
|
||||
case -1:
|
||||
case REQUESTED_LPCM:
|
||||
input_SelectES( p_input, p_es );
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
* video_parser.c : video parser thread
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1999-2001 VideoLAN
|
||||
* $Id: video_parser.c,v 1.14 2002/02/19 00:50:19 sam Exp $
|
||||
* $Id: video_parser.c,v 1.15 2002/02/24 20:51:10 gbazin Exp $
|
||||
*
|
||||
* Authors: Christophe Massiot <massiot@via.ecp.fr>
|
||||
* Samuel Hocevar <sam@via.ecp.fr>
|
||||
@ -71,7 +71,17 @@ void _M( vdec_getfunctions )( function_list_t * p_function_list )
|
||||
/*****************************************************************************
|
||||
* Build configuration tree.
|
||||
*****************************************************************************/
|
||||
/* Variable containing the motion compensation method */
|
||||
#define MOTION_METHOD_VAR "mpeg_vdec_motion"
|
||||
/* Variable containing the IDCT method */
|
||||
#define IDCT_METHOD_VAR "mpeg_vdec_idct"
|
||||
|
||||
MODULE_CONFIG_START
|
||||
ADD_CATEGORY_HINT( "Misc Options", NULL)
|
||||
ADD_PLUGIN( IDCT_METHOD_VAR, MODULE_CAPABILITY_IDCT, NULL, NULL,
|
||||
"IDCT method", NULL )
|
||||
ADD_PLUGIN( MOTION_METHOD_VAR, MODULE_CAPABILITY_MOTION, NULL, NULL,
|
||||
"motion compensation method", NULL )
|
||||
MODULE_CONFIG_STOP
|
||||
|
||||
MODULE_INIT_START
|
||||
@ -179,12 +189,15 @@ static int decoder_Run ( decoder_config_t * p_config )
|
||||
*****************************************************************************/
|
||||
static int InitThread( vpar_thread_t *p_vpar )
|
||||
{
|
||||
char *psz_name;
|
||||
|
||||
/*
|
||||
* Choose the best motion compensation module
|
||||
*/
|
||||
p_vpar->p_motion_module = module_Need( MODULE_CAPABILITY_MOTION,
|
||||
main_GetPszVariable( MOTION_METHOD_VAR, NULL ),
|
||||
NULL );
|
||||
psz_name = config_GetPszVariable( MOTION_METHOD_VAR );
|
||||
p_vpar->p_motion_module = module_Need( MODULE_CAPABILITY_MOTION, psz_name,
|
||||
NULL );
|
||||
if( psz_name ) free( psz_name );
|
||||
|
||||
if( p_vpar->p_motion_module == NULL )
|
||||
{
|
||||
@ -200,9 +213,10 @@ static int InitThread( vpar_thread_t *p_vpar )
|
||||
/*
|
||||
* Choose the best IDCT module
|
||||
*/
|
||||
p_vpar->p_idct_module = module_Need( MODULE_CAPABILITY_IDCT,
|
||||
main_GetPszVariable( IDCT_METHOD_VAR, NULL ),
|
||||
NULL );
|
||||
psz_name = config_GetPszVariable( IDCT_METHOD_VAR );
|
||||
p_vpar->p_idct_module = module_Need( MODULE_CAPABILITY_IDCT, psz_name,
|
||||
NULL );
|
||||
if( psz_name ) free( psz_name );
|
||||
|
||||
if( p_vpar->p_idct_module == NULL )
|
||||
{
|
||||
|
@ -2,7 +2,7 @@
|
||||
* vpar_synchro.c : frame dropping routines
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1999-2001 VideoLAN
|
||||
* $Id: vpar_synchro.c,v 1.6 2002/02/19 00:50:19 sam Exp $
|
||||
* $Id: vpar_synchro.c,v 1.7 2002/02/24 20:51:10 gbazin Exp $
|
||||
*
|
||||
* Authors: Christophe Massiot <massiot@via.ecp.fr>
|
||||
* Samuel Hocevar <sam@via.ecp.fr>
|
||||
@ -94,6 +94,7 @@
|
||||
/*****************************************************************************
|
||||
* Preamble
|
||||
*****************************************************************************/
|
||||
#include <stdlib.h> /* free() */
|
||||
#include <string.h> /* memcpy(), memset() */
|
||||
|
||||
#include <videolan/vlc.h>
|
||||
@ -532,13 +533,18 @@ void vpar_SynchroNewPicture( vpar_thread_t * p_vpar, int i_coding_type,
|
||||
*****************************************************************************/
|
||||
static int SynchroType( void )
|
||||
{
|
||||
char * psz_synchro = main_GetPszVariable( VPAR_SYNCHRO_VAR, NULL );
|
||||
char psz_synchro_tmp[5];
|
||||
char * psz_synchro = config_GetPszVariable( VPAR_SYNCHRO_VAR );
|
||||
|
||||
if( psz_synchro == NULL )
|
||||
{
|
||||
return VPAR_SYNCHRO_DEFAULT;
|
||||
}
|
||||
|
||||
strncpy( psz_synchro_tmp, psz_synchro, 5);
|
||||
free( psz_synchro );
|
||||
psz_synchro = psz_synchro_tmp;
|
||||
|
||||
switch( *psz_synchro++ )
|
||||
{
|
||||
case 'i':
|
||||
|
@ -41,8 +41,6 @@ void _M( vout_getfunctions )( function_list_t * p_function_list );
|
||||
* Building configuration tree
|
||||
*****************************************************************************/
|
||||
MODULE_CONFIG_START
|
||||
ADD_WINDOW( "Configuration for QNX RTOS module" )
|
||||
ADD_COMMENT( "For now, the QNX RTOS module cannot be configured" )
|
||||
MODULE_CONFIG_STOP
|
||||
|
||||
MODULE_INIT_START
|
||||
|
@ -142,14 +142,14 @@ static int vout_Create( vout_thread_t *p_vout )
|
||||
memset( p_vout->p_sys, 0, sizeof( vout_sys_t ) );
|
||||
|
||||
p_vout->b_fullscreen =
|
||||
main_GetIntVariable( VOUT_FULLSCREEN_VAR, VOUT_FULLSCREEN_DEFAULT );
|
||||
config_GetIntVariable( VOUT_FULLSCREEN_VAR );
|
||||
p_vout->p_sys->i_mode =
|
||||
main_GetIntVariable( VOUT_NOOVERLAY_VAR, VOUT_NOOVERLAY_DEFAULT ) ?
|
||||
config_GetIntVariable( VOUT_NOOVERLAY_VAR ) ?
|
||||
MODE_NORMAL_MEM : MODE_VIDEO_OVERLAY;
|
||||
p_vout->p_sys->dim.w =
|
||||
main_GetIntVariable( VOUT_WIDTH_VAR, VOUT_WIDTH_DEFAULT );
|
||||
config_GetIntVariable( VOUT_WIDTH_VAR );
|
||||
p_vout->p_sys->dim.h =
|
||||
main_GetIntVariable( VOUT_HEIGHT_VAR, VOUT_HEIGHT_DEFAULT );
|
||||
config_GetIntVariable( VOUT_HEIGHT_VAR );
|
||||
|
||||
/* init display and create window */
|
||||
if( QNXInitDisplay( p_vout ) || QNXCreateWnd( p_vout ) )
|
||||
|
@ -2,7 +2,7 @@
|
||||
* qt.cpp : Qt plugin for vlc
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2001 VideoLAN
|
||||
* $Id: qt.cpp,v 1.6 2001/12/30 07:09:56 sam Exp $
|
||||
* $Id: qt.cpp,v 1.7 2002/02/24 20:51:10 gbazin Exp $
|
||||
*
|
||||
* Authors: Samuel Hocevar <sam@zoy.org>
|
||||
*
|
||||
@ -40,8 +40,6 @@ void _M( intf_getfunctions )( function_list_t * p_function_list );
|
||||
* Build configuration tree.
|
||||
*****************************************************************************/
|
||||
MODULE_CONFIG_START
|
||||
ADD_WINDOW( "Configuration for Qt module" )
|
||||
ADD_COMMENT( "Ha, ha -- nothing to configure yet" )
|
||||
MODULE_CONFIG_STOP
|
||||
|
||||
MODULE_INIT_START
|
||||
|
@ -2,7 +2,7 @@
|
||||
* aout_sdl.c : audio sdl functions library
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1999-2001 VideoLAN
|
||||
* $Id: aout_sdl.c,v 1.25 2002/02/15 13:32:53 sam Exp $
|
||||
* $Id: aout_sdl.c,v 1.26 2002/02/24 20:51:10 gbazin Exp $
|
||||
*
|
||||
* Authors: Michel Kaempf <maxx@via.ecp.fr>
|
||||
* Samuel Hocevar <sam@zoy.org>
|
||||
@ -130,7 +130,6 @@ static int aout_Open( aout_thread_t *p_aout )
|
||||
p_aout->p_sys->audio_buf = malloc( OVERFLOWLIMIT );
|
||||
|
||||
/* Initialize some variables */
|
||||
p_aout->psz_device = 0;
|
||||
desired.freq = p_aout->l_rate;
|
||||
|
||||
/* TODO: write conversion beetween AOUT_FORMAT_DEFAULT
|
||||
|
@ -2,7 +2,7 @@
|
||||
* logger.c : file logging plugin for vlc
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2002 VideoLAN
|
||||
* $Id: logger.c,v 1.3 2002/02/20 05:56:18 sam Exp $
|
||||
* $Id: logger.c,v 1.4 2002/02/24 20:51:10 gbazin Exp $
|
||||
*
|
||||
* Authors: Samuel Hocevar <sam@zoy.org>
|
||||
*
|
||||
@ -92,7 +92,7 @@ static void intf_getfunctions( function_list_t * p_function_list )
|
||||
*****************************************************************************/
|
||||
static int intf_Open( intf_thread_t *p_intf )
|
||||
{
|
||||
char *psz_filename;
|
||||
char *psz_filename_tmp, *psz_filename;
|
||||
|
||||
/* Allocate instance and initialize some members */
|
||||
p_intf->p_sys = (intf_sys_t *)malloc( sizeof( intf_sys_t ) );
|
||||
@ -102,7 +102,13 @@ static int intf_Open( intf_thread_t *p_intf )
|
||||
return -1;
|
||||
}
|
||||
|
||||
psz_filename = main_GetPszVariable( INTF_METHOD_VAR, NULL );
|
||||
if( !(psz_filename = psz_filename_tmp
|
||||
= config_GetPszVariable( INTF_METHOD_VAR )) )
|
||||
{
|
||||
intf_ErrMsg( "intf error: configuration variable %s empty",
|
||||
INTF_METHOD_VAR );
|
||||
return -1;
|
||||
}
|
||||
|
||||
while( *psz_filename && *psz_filename != ':' )
|
||||
{
|
||||
@ -131,9 +137,12 @@ static int intf_Open( intf_thread_t *p_intf )
|
||||
intf_ErrMsg( "intf error: error opening logfile `%s'", psz_filename );
|
||||
free( p_intf->p_sys );
|
||||
intf_MsgUnsub( p_intf->p_sys->p_sub );
|
||||
free( psz_filename_tmp );
|
||||
return -1;
|
||||
}
|
||||
|
||||
free( psz_filename_tmp );
|
||||
|
||||
LOG_STRING( "-- log plugin started --\n", p_intf->p_sys->p_file );
|
||||
|
||||
return 0;
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ncurses.c : NCurses plugin for vlc
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2001 VideoLAN
|
||||
* $Id: ncurses.c,v 1.11 2002/02/15 13:32:53 sam Exp $
|
||||
* $Id: ncurses.c,v 1.12 2002/02/24 20:51:10 gbazin Exp $
|
||||
*
|
||||
* Authors: Samuel Hocevar <sam@zoy.org>
|
||||
*
|
||||
@ -50,8 +50,6 @@ static void intf_Run ( intf_thread_t *p_intf );
|
||||
* Building configuration tree
|
||||
*****************************************************************************/
|
||||
MODULE_CONFIG_START
|
||||
ADD_WINDOW( "Configuration for NCurses module" )
|
||||
ADD_COMMENT( "For now, the NCurses module cannot be configured" )
|
||||
MODULE_CONFIG_STOP
|
||||
|
||||
MODULE_INIT_START
|
||||
|
@ -280,7 +280,7 @@ static void VCDInit( input_thread_t * p_input )
|
||||
#undef area
|
||||
|
||||
/* Get requested title - if none try the first title */
|
||||
i_title = main_GetIntVariable( INPUT_TITLE_VAR, 1 );
|
||||
i_title = config_GetIntVariable( INPUT_TITLE_VAR );
|
||||
if( i_title <= 0 )
|
||||
{
|
||||
i_title = 1;
|
||||
@ -289,7 +289,7 @@ static void VCDInit( input_thread_t * p_input )
|
||||
// p_vcd->i_track = i_title-1;
|
||||
|
||||
/* Get requested chapter - if none defaults to first one */
|
||||
i_chapter = main_GetIntVariable( INPUT_CHAPTER_VAR, 1 );
|
||||
i_chapter = config_GetIntVariable( INPUT_CHAPTER_VAR );
|
||||
if( i_chapter <= 0 )
|
||||
{
|
||||
i_chapter = 1;
|
||||
|
@ -2,7 +2,7 @@
|
||||
* waveout.c : Windows waveOut plugin for vlc
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2001 VideoLAN
|
||||
* $Id: waveout.c,v 1.2 2002/02/15 20:02:21 gbazin Exp $
|
||||
* $Id: waveout.c,v 1.3 2002/02/24 20:51:10 gbazin Exp $
|
||||
*
|
||||
* Authors: Gildas Bazin <gbazin@netcourrier.com>
|
||||
*
|
||||
@ -45,8 +45,6 @@ void _M( aout_getfunctions )( function_list_t * p_function_list );
|
||||
* Building configuration tree
|
||||
*****************************************************************************/
|
||||
MODULE_CONFIG_START
|
||||
ADD_WINDOW( "Configuration for Windows waveOut module" )
|
||||
ADD_COMMENT( "For now, the Windows WaveOut module cannot be configured" )
|
||||
MODULE_CONFIG_STOP
|
||||
|
||||
MODULE_INIT_START
|
||||
@ -137,8 +135,6 @@ static int aout_Open( aout_thread_t *p_aout )
|
||||
for( i=0; i<NUMBUF; i++)
|
||||
p_aout->p_sys->waveheader[i].lpData = malloc( 1 );
|
||||
|
||||
p_aout->psz_device = 0;
|
||||
|
||||
return OpenWaveOutDevice( p_aout );
|
||||
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
* x11.c : X11 plugin for vlc
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1998-2001 VideoLAN
|
||||
* $Id: x11.c,v 1.11 2002/02/19 00:50:19 sam Exp $
|
||||
* $Id: x11.c,v 1.12 2002/02/24 20:51:10 gbazin Exp $
|
||||
*
|
||||
* Authors: Vincent Seguin <seguin@via.ecp.fr>
|
||||
* Samuel Hocevar <sam@zoy.org>
|
||||
@ -37,8 +37,6 @@
|
||||
* Building configuration tree
|
||||
*****************************************************************************/
|
||||
MODULE_CONFIG_START
|
||||
ADD_WINDOW( "Configuration for X11 module" )
|
||||
ADD_COMMENT( "For now, the X11 module cannot be configured" )
|
||||
MODULE_CONFIG_STOP
|
||||
|
||||
MODULE_INIT_START
|
||||
|
@ -2,7 +2,7 @@
|
||||
* xcommon.c: Functions common to the X11 and XVideo plugins
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1998-2001 VideoLAN
|
||||
* $Id: xcommon.c,v 1.18 2002/02/20 23:23:53 sam Exp $
|
||||
* $Id: xcommon.c,v 1.19 2002/02/24 20:51:10 gbazin Exp $
|
||||
*
|
||||
* Authors: Vincent Seguin <seguin@via.ecp.fr>
|
||||
* Samuel Hocevar <sam@zoy.org>
|
||||
@ -295,16 +295,21 @@ static int vout_Create( vout_thread_t *p_vout )
|
||||
return( 1 );
|
||||
}
|
||||
|
||||
/* Open display, unsing 'vlc_display' or DISPLAY environment variable */
|
||||
psz_display = XDisplayName( main_GetPszVariable( VOUT_DISPLAY_VAR, NULL ) );
|
||||
/* Open display, unsing the VOUT_DISPLAY_VAR config variable or the DISPLAY
|
||||
* environment variable */
|
||||
psz_display = config_GetPszVariable( VOUT_DISPLAY_VAR );
|
||||
p_vout->p_sys->p_display = XOpenDisplay( psz_display );
|
||||
|
||||
if( p_vout->p_sys->p_display == NULL ) /* error */
|
||||
{
|
||||
intf_ErrMsg( "vout error: cannot open display %s", psz_display );
|
||||
intf_ErrMsg( "vout error: cannot open display %s",
|
||||
XDisplayName( psz_display ) );
|
||||
free( p_vout->p_sys );
|
||||
if( psz_display ) free( psz_display );
|
||||
return( 1 );
|
||||
}
|
||||
if( psz_display ) free( psz_display );
|
||||
|
||||
p_vout->p_sys->i_screen = DefaultScreen( p_vout->p_sys->p_display );
|
||||
|
||||
#ifdef MODULE_NAME_IS_xvideo
|
||||
@ -1829,7 +1834,7 @@ static int XVideoGetPort( Display *dpy, u32 i_chroma, u32 *pi_newchroma )
|
||||
}
|
||||
|
||||
i_selected_port = -1;
|
||||
i_requested_adaptor = main_GetIntVariable( VOUT_XVADAPTOR_VAR, -1 );
|
||||
i_requested_adaptor = config_GetIntVariable( XVADAPTOR_VAR );
|
||||
|
||||
for( i_adaptor = 0; i_adaptor < i_num_adaptors; ++i_adaptor )
|
||||
{
|
||||
|
@ -2,7 +2,7 @@
|
||||
* xcommon.h: Common X11 and Xvideo video output display method
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1998-2001 VideoLAN
|
||||
* $Id: xcommon.h,v 1.1 2001/12/30 07:09:56 sam Exp $
|
||||
* $Id: xcommon.h,v 1.2 2002/02/24 20:51:10 gbazin Exp $
|
||||
*
|
||||
* Authors: Shane Harper <shanegh@optusnet.com.au>
|
||||
* Vincent Seguin <seguin@via.ecp.fr>
|
||||
@ -24,6 +24,11 @@
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
|
||||
*****************************************************************************/
|
||||
|
||||
/*****************************************************************************
|
||||
* Common macros
|
||||
*****************************************************************************/
|
||||
#define XVADAPTOR_VAR "xvideo_adaptor"
|
||||
|
||||
/*****************************************************************************
|
||||
* Common prototypes
|
||||
*****************************************************************************/
|
||||
|
@ -2,7 +2,7 @@
|
||||
* xvideo.c : Xvideo plugin for vlc
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1998-2001 VideoLAN
|
||||
* $Id: xvideo.c,v 1.6 2001/12/30 07:09:56 sam Exp $
|
||||
* $Id: xvideo.c,v 1.7 2002/02/24 20:51:10 gbazin Exp $
|
||||
*
|
||||
* Authors: Shane Harper <shanegh@optusnet.com.au>
|
||||
* Vincent Seguin <seguin@via.ecp.fr>
|
||||
@ -38,8 +38,8 @@
|
||||
* Building configuration tree
|
||||
*****************************************************************************/
|
||||
MODULE_CONFIG_START
|
||||
ADD_WINDOW( "Configuration for xvideo module" )
|
||||
ADD_COMMENT( "For now, the xvideo module cannot be configured" )
|
||||
ADD_CATEGORY_HINT( "Misc Options", NULL )
|
||||
ADD_INTEGER ( XVADAPTOR_VAR, -1, NULL, "XVideo adaptor number", NULL )
|
||||
MODULE_CONFIG_STOP
|
||||
|
||||
MODULE_INIT_START
|
||||
|
@ -2,7 +2,7 @@
|
||||
* audio_output.c : audio output thread
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1999-2001 VideoLAN
|
||||
* $Id: audio_output.c,v 1.76 2002/02/15 13:32:54 sam Exp $
|
||||
* $Id: audio_output.c,v 1.77 2002/02/24 20:51:10 gbazin Exp $
|
||||
*
|
||||
* Authors: Michel Kaempf <maxx@via.ecp.fr>
|
||||
* Cyril Deguet <asmax@via.ecp.fr>
|
||||
@ -93,9 +93,8 @@ aout_thread_t *aout_CreateThread( int *pi_status, int i_channels, long l_rate )
|
||||
}
|
||||
|
||||
p_aout->i_latency = 0;
|
||||
p_aout->l_rate = main_GetIntVariable( AOUT_RATE_VAR, l_rate );
|
||||
p_aout->i_channels = 1 + main_GetIntVariable( AOUT_STEREO_VAR,
|
||||
i_channels - 1 );
|
||||
p_aout->l_rate = config_GetIntVariable( AOUT_RATE_VAR );
|
||||
p_aout->i_channels = config_GetIntVariable( AOUT_MONO_VAR ) ? 1 : 2;
|
||||
|
||||
intf_WarnMsg( 3, "aout info: thread created, channels %d, rate %d",
|
||||
p_aout->i_channels, p_aout->l_rate );
|
||||
@ -105,7 +104,7 @@ aout_thread_t *aout_CreateThread( int *pi_status, int i_channels, long l_rate )
|
||||
|
||||
/* special setting for ac3 pass-through mode */
|
||||
/* FIXME is it necessary ? (cf ac3_adec.c) */
|
||||
if( main_GetIntVariable( AOUT_SPDIF_VAR, 0 ) && p_main->b_ac3 )
|
||||
if( config_GetIntVariable( AOUT_SPDIF_VAR ) && p_main->b_ac3 )
|
||||
{
|
||||
intf_WarnMsg( 4, "aout info: setting ac3 spdif" );
|
||||
p_aout->i_format = AOUT_FMT_AC3;
|
||||
@ -123,7 +122,7 @@ aout_thread_t *aout_CreateThread( int *pi_status, int i_channels, long l_rate )
|
||||
|
||||
/* Choose the best module */
|
||||
p_aout->p_module = module_Need( MODULE_CAPABILITY_AOUT,
|
||||
main_GetPszVariable( AOUT_METHOD_VAR, NULL ),
|
||||
config_GetPszVariable( AOUT_METHOD_VAR ),
|
||||
(void *)p_aout );
|
||||
|
||||
if( p_aout->p_module == NULL )
|
||||
@ -153,7 +152,7 @@ aout_thread_t *aout_CreateThread( int *pi_status, int i_channels, long l_rate )
|
||||
}
|
||||
|
||||
/* Initialize the volume level */
|
||||
p_aout->i_volume = main_GetIntVariable( AOUT_VOLUME_VAR, VOLUME_DEFAULT );
|
||||
p_aout->i_volume = config_GetIntVariable( AOUT_VOLUME_VAR );
|
||||
p_aout->i_savedvolume = 0;
|
||||
|
||||
/* FIXME: maybe it would be cleaner to change SpawnThread prototype
|
||||
|
@ -4,7 +4,7 @@
|
||||
* decoders.
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1998-2001 VideoLAN
|
||||
* $Id: input.c,v 1.175 2002/02/19 00:50:19 sam Exp $
|
||||
* $Id: input.c,v 1.176 2002/02/24 20:51:10 gbazin Exp $
|
||||
*
|
||||
* Authors: Christophe Massiot <massiot@via.ecp.fr>
|
||||
*
|
||||
@ -199,10 +199,9 @@ input_thread_t *input_CreateThread ( playlist_item_t *p_item, int *pi_status )
|
||||
p_input->stream.control.i_status = PLAYING_S;
|
||||
p_input->stream.control.i_rate = DEFAULT_RATE;
|
||||
p_input->stream.control.b_mute = 0;
|
||||
p_input->stream.control.b_grayscale = main_GetIntVariable(
|
||||
VOUT_GRAYSCALE_VAR, VOUT_GRAYSCALE_DEFAULT );
|
||||
p_input->stream.control.i_smp = main_GetIntVariable(
|
||||
VDEC_SMP_VAR, VDEC_SMP_DEFAULT );
|
||||
p_input->stream.control.b_grayscale = config_GetIntVariable(
|
||||
VOUT_GRAYSCALE_VAR );
|
||||
p_input->stream.control.i_smp = config_GetIntVariable( VDEC_SMP_VAR );
|
||||
|
||||
intf_WarnMsg( 1, "input: playlist item `%s'", p_input->p_source );
|
||||
|
||||
@ -448,11 +447,14 @@ static void RunThread( input_thread_t *p_input )
|
||||
*****************************************************************************/
|
||||
static int InitThread( input_thread_t * p_input )
|
||||
{
|
||||
/* Find appropriate module. */
|
||||
p_input->p_input_module = module_Need( MODULE_CAPABILITY_INPUT,
|
||||
main_GetPszVariable( INPUT_METHOD_VAR, NULL ),
|
||||
(void *)p_input );
|
||||
char *psz_name;
|
||||
|
||||
/* Find appropriate module. */
|
||||
psz_name = config_GetPszVariable( INPUT_METHOD_VAR );
|
||||
p_input->p_input_module = module_Need( MODULE_CAPABILITY_INPUT, psz_name,
|
||||
(void *)p_input );
|
||||
|
||||
if( psz_name ) free( psz_name );
|
||||
if( p_input->p_input_module == NULL )
|
||||
{
|
||||
intf_ErrMsg( "input error: no suitable input module for `%s'",
|
||||
@ -871,7 +873,7 @@ static void NetworkOpen( input_thread_t * p_input )
|
||||
/* Check that we got a valid port */
|
||||
if( i_bind_port == 0 )
|
||||
{
|
||||
i_bind_port = main_GetIntVariable( INPUT_PORT_VAR, INPUT_PORT_DEFAULT );
|
||||
i_bind_port = config_GetIntVariable( INPUT_PORT_VAR );
|
||||
}
|
||||
|
||||
intf_WarnMsg( 2, "input: server=%s:%d local=%s:%d",
|
||||
@ -1138,7 +1140,7 @@ static void HTTPOpen( input_thread_t * p_input )
|
||||
}
|
||||
|
||||
/* Check proxy */
|
||||
if( (psz_proxy = main_GetPszVariable( "http_proxy", NULL )) != NULL )
|
||||
if( (psz_proxy = getenv( "http_proxy" )) != NULL )
|
||||
{
|
||||
/* http://myproxy.mydomain:myport/ */
|
||||
int i_proxy_port = 0;
|
||||
|
@ -2,7 +2,7 @@
|
||||
* input_dec.c: Functions for the management of decoders
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1999-2001 VideoLAN
|
||||
* $Id: input_dec.c,v 1.27 2002/02/19 00:50:19 sam Exp $
|
||||
* $Id: input_dec.c,v 1.28 2002/02/24 20:51:10 gbazin Exp $
|
||||
*
|
||||
* Authors: Christophe Massiot <massiot@via.ecp.fr>
|
||||
*
|
||||
@ -50,16 +50,17 @@ vlc_thread_t input_RunDecoder( input_thread_t * p_input,
|
||||
|
||||
if( p_es->i_type == MPEG1_AUDIO_ES || p_es->i_type == MPEG2_AUDIO_ES )
|
||||
{
|
||||
psz_plugin = main_GetPszVariable( ADEC_MPEG_VAR, NULL );
|
||||
psz_plugin = config_GetPszVariable( ADEC_MPEG_VAR );
|
||||
}
|
||||
if( p_es->i_type == AC3_AUDIO_ES )
|
||||
{
|
||||
psz_plugin = main_GetPszVariable( ADEC_AC3_VAR, NULL );
|
||||
psz_plugin = config_GetPszVariable( ADEC_AC3_VAR );
|
||||
}
|
||||
|
||||
/* Get a suitable module */
|
||||
p_es->p_module = module_Need( MODULE_CAPABILITY_DECODER, psz_plugin,
|
||||
(void *)&p_es->i_type );
|
||||
if( psz_plugin ) free( psz_plugin );
|
||||
if( p_es->p_module == NULL )
|
||||
{
|
||||
intf_ErrMsg( "input error: no suitable decoder module for type 0x%x",
|
||||
|
@ -2,7 +2,7 @@
|
||||
* mpeg_system.c: TS, PS and PES management
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1998-2001 VideoLAN
|
||||
* $Id: mpeg_system.c,v 1.79 2002/02/19 00:50:19 sam Exp $
|
||||
* $Id: mpeg_system.c,v 1.80 2002/02/24 20:51:10 gbazin Exp $
|
||||
*
|
||||
* Authors: Christophe Massiot <massiot@via.ecp.fr>
|
||||
* Michel Lespinasse <walken@via.ecp.fr>
|
||||
@ -708,13 +708,13 @@ es_descriptor_t * input_ParsePS( input_thread_t * p_input,
|
||||
p_es->i_cat = AUDIO_ES;
|
||||
#ifdef AUTO_SPAWN
|
||||
if( !p_input->stream.b_seekable )
|
||||
if( main_GetIntVariable( INPUT_CHANNEL_VAR, 0 )
|
||||
== (p_es->i_id & 0x1F) )
|
||||
switch( main_GetIntVariable( INPUT_AUDIO_VAR, 0 ) )
|
||||
if( config_GetIntVariable( INPUT_CHANNEL_VAR )
|
||||
== (p_es->i_id & 0x1F) ||
|
||||
( config_GetIntVariable( INPUT_CHANNEL_VAR ) < 0
|
||||
&& !(p_es->i_id & 0x1F) ) )
|
||||
switch( config_GetIntVariable( INPUT_AUDIO_VAR ) )
|
||||
{
|
||||
case 0:
|
||||
main_PutIntVariable( INPUT_CHANNEL_VAR,
|
||||
REQUESTED_MPEG );
|
||||
case -1:
|
||||
case REQUESTED_MPEG:
|
||||
input_SelectES( p_input, p_es );
|
||||
}
|
||||
@ -728,13 +728,13 @@ es_descriptor_t * input_ParsePS( input_thread_t * p_input,
|
||||
p_es->i_cat = AUDIO_ES;
|
||||
#ifdef AUTO_SPAWN
|
||||
if( !p_input->stream.b_seekable )
|
||||
if( main_GetIntVariable( INPUT_CHANNEL_VAR, 0 )
|
||||
== ((p_es->i_id & 0xF00) >> 8) )
|
||||
switch( main_GetIntVariable( INPUT_AUDIO_VAR, 0 ) )
|
||||
if( config_GetIntVariable( INPUT_CHANNEL_VAR )
|
||||
== ((p_es->i_id & 0xF00) >> 8) ||
|
||||
( config_GetIntVariable( INPUT_CHANNEL_VAR ) < 0
|
||||
&& !((p_es->i_id & 0xF00) >> 8)) )
|
||||
switch( config_GetIntVariable( INPUT_AUDIO_VAR ) )
|
||||
{
|
||||
case 0:
|
||||
main_PutIntVariable( INPUT_CHANNEL_VAR,
|
||||
REQUESTED_AC3 );
|
||||
case -1:
|
||||
case REQUESTED_AC3:
|
||||
input_SelectES( p_input, p_es );
|
||||
}
|
||||
@ -746,7 +746,7 @@ es_descriptor_t * input_ParsePS( input_thread_t * p_input,
|
||||
p_es->i_type = DVD_SPU_ES;
|
||||
p_es->i_cat = SPU_ES;
|
||||
#ifdef AUTO_SPAWN
|
||||
if( main_GetIntVariable( INPUT_SUBTITLE_VAR, -1 )
|
||||
if( config_GetIntVariable( INPUT_SUBTITLE_VAR )
|
||||
== ((p_es->i_id & 0x1F00) >> 8) )
|
||||
{
|
||||
if( !p_input->stream.b_seekable )
|
||||
@ -1476,10 +1476,9 @@ static void input_DecodePMT( input_thread_t * p_input, es_descriptor_t * p_es )
|
||||
if( p_main->b_audio )
|
||||
{
|
||||
/* Default is the first one */
|
||||
i_required_audio_es = main_GetIntVariable( INPUT_CHANNEL_VAR, 1 );
|
||||
i_required_audio_es = config_GetIntVariable( INPUT_CHANNEL_VAR );
|
||||
if( i_required_audio_es < 0 )
|
||||
{
|
||||
main_PutIntVariable( INPUT_CHANNEL_VAR, 1 );
|
||||
i_required_audio_es = 1;
|
||||
}
|
||||
}
|
||||
@ -1492,10 +1491,9 @@ static void input_DecodePMT( input_thread_t * p_input, es_descriptor_t * p_es )
|
||||
if( p_main->b_video )
|
||||
{
|
||||
/* for spu, default is none */
|
||||
i_required_spu_es = main_GetIntVariable( INPUT_SUBTITLE_VAR, 0 );
|
||||
i_required_spu_es = config_GetIntVariable( INPUT_SUBTITLE_VAR );
|
||||
if( i_required_spu_es < 0 )
|
||||
{
|
||||
main_PutIntVariable( INPUT_SUBTITLE_VAR, 0 );
|
||||
i_required_spu_es = 0;
|
||||
}
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
* interface, such as command line.
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1998-2001 VideoLAN
|
||||
* $Id: interface.c,v 1.89 2002/02/19 00:50:19 sam Exp $
|
||||
* $Id: interface.c,v 1.90 2002/02/24 20:51:10 gbazin Exp $
|
||||
*
|
||||
* Authors: Vincent Seguin <seguin@via.ecp.fr>
|
||||
*
|
||||
@ -59,6 +59,7 @@ static void intf_Manage( intf_thread_t *p_intf );
|
||||
intf_thread_t* intf_Create( void )
|
||||
{
|
||||
intf_thread_t * p_intf;
|
||||
char *psz_name;
|
||||
|
||||
/* Allocate structure */
|
||||
p_intf = malloc( sizeof( intf_thread_t ) );
|
||||
@ -70,10 +71,11 @@ intf_thread_t* intf_Create( void )
|
||||
}
|
||||
|
||||
/* Choose the best module */
|
||||
p_intf->p_module = module_Need( MODULE_CAPABILITY_INTF,
|
||||
main_GetPszVariable( INTF_METHOD_VAR, NULL ),
|
||||
(void *)p_intf );
|
||||
psz_name = config_GetPszVariable( INTF_METHOD_VAR );
|
||||
p_intf->p_module = module_Need( MODULE_CAPABILITY_INTF, psz_name,
|
||||
(void *)p_intf );
|
||||
|
||||
if( psz_name ) free( psz_name );
|
||||
if( p_intf->p_module == NULL )
|
||||
{
|
||||
intf_ErrMsg( "intf error: no suitable intf module" );
|
||||
@ -163,8 +165,7 @@ static void intf_Manage( intf_thread_t *p_intf )
|
||||
|
||||
p_main->p_playlist->b_stopped = 0;
|
||||
p_main->p_playlist->i_mode = PLAYLIST_FORWARD +
|
||||
main_GetIntVariable( PLAYLIST_LOOP_VAR,
|
||||
PLAYLIST_LOOP_DEFAULT );
|
||||
config_GetIntVariable( PLAYLIST_LOOP_VAR );
|
||||
intf_WarnMsg( 3, "intf: creating new input thread" );
|
||||
p_input = input_CreateThread( &p_main->p_playlist->current,
|
||||
NULL );
|
||||
|
1109
src/interface/main.c
1109
src/interface/main.c
File diff suppressed because it is too large
Load Diff
249
src/misc/configuration.c
Normal file
249
src/misc/configuration.c
Normal file
@ -0,0 +1,249 @@
|
||||
/*****************************************************************************
|
||||
* configuration.c management of the modules configuration
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2001 VideoLAN
|
||||
* $Id: configuration.c,v 1.1 2002/02/24 20:51:10 gbazin Exp $
|
||||
*
|
||||
* Authors: Gildas Bazin <gbazin@netcourrier.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
|
||||
*****************************************************************************/
|
||||
|
||||
#include <stdlib.h> /* free(), strtol() */
|
||||
#include <stdio.h> /* sprintf() */
|
||||
#include <string.h> /* strdup() */
|
||||
|
||||
#include <videolan/vlc.h>
|
||||
|
||||
/* TODO: implement locking for config_PutPszVariable and config_GetPszVariable
|
||||
* because they are not thread safe */
|
||||
|
||||
/*****************************************************************************
|
||||
* config_GetIntVariable: get the value of an int variable
|
||||
*****************************************************************************
|
||||
* This function is used to get the value of variables which are internally
|
||||
* represented by an integer (MODULE_CONFIG_ITEM_INTEGER and
|
||||
* MODULE_CONFIG_ITEM_BOOL).
|
||||
*****************************************************************************/
|
||||
int config_GetIntVariable( const char *psz_name )
|
||||
{
|
||||
module_config_t *p_config;
|
||||
|
||||
p_config = config_FindConfig( psz_name );
|
||||
|
||||
/* sanity checks */
|
||||
if( !p_config )
|
||||
{
|
||||
intf_ErrMsg( "config_GetIntVariable: option %s doesn't exist",
|
||||
psz_name );
|
||||
return -1;
|
||||
}
|
||||
if( (p_config->i_type!=MODULE_CONFIG_ITEM_INTEGER) &&
|
||||
(p_config->i_type!=MODULE_CONFIG_ITEM_BOOL) )
|
||||
{
|
||||
intf_ErrMsg( "config_GetIntVariable: option %s doesn't refer to an int"
|
||||
, psz_name );
|
||||
return -1;
|
||||
}
|
||||
|
||||
return p_config->i_value;
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* config_GetPszVariable: get the string value of a string variable
|
||||
*****************************************************************************
|
||||
* This function is used to get the value of variables which are internally
|
||||
* represented by a string (MODULE_CONFIG_ITEM_STRING, MODULE_CONFIG_ITEM_FILE,
|
||||
* and MODULE_CONFIG_ITEM_PLUGIN).
|
||||
*
|
||||
* Important note: remember to free() the returned char* because it a duplicate
|
||||
* of the actual value. It isn't safe to return a pointer to the actual value
|
||||
* as it can be modified at any time.
|
||||
*****************************************************************************/
|
||||
char * config_GetPszVariable( const char *psz_name )
|
||||
{
|
||||
module_config_t *p_config;
|
||||
char *psz_value = NULL;
|
||||
|
||||
p_config = config_FindConfig( psz_name );
|
||||
|
||||
/* sanity checks */
|
||||
if( !p_config )
|
||||
{
|
||||
intf_ErrMsg( "config_GetPszVariable: option %s doesn't exist",
|
||||
psz_name );
|
||||
return NULL;
|
||||
}
|
||||
if( (p_config->i_type!=MODULE_CONFIG_ITEM_STRING) &&
|
||||
(p_config->i_type!=MODULE_CONFIG_ITEM_FILE) &&
|
||||
(p_config->i_type!=MODULE_CONFIG_ITEM_PLUGIN) )
|
||||
{
|
||||
intf_ErrMsg( "config_GetPszVariable: option %s doesn't refer to a "
|
||||
"string", psz_name );
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* return a copy of the string */
|
||||
if( p_config->psz_value ) psz_value = strdup( p_config->psz_value );
|
||||
|
||||
return psz_value;
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* config_PutPszVariable: set the string value of a string variable
|
||||
*****************************************************************************
|
||||
* This function is used to set the value of variables which are internally
|
||||
* represented by a string (MODULE_CONFIG_ITEM_STRING, MODULE_CONFIG_ITEM_FILE,
|
||||
* and MODULE_CONFIG_ITEM_PLUGIN).
|
||||
*****************************************************************************/
|
||||
void config_PutPszVariable( const char *psz_name, char *psz_value )
|
||||
{
|
||||
module_config_t *p_config;
|
||||
char *psz_tmp;
|
||||
|
||||
p_config = config_FindConfig( psz_name );
|
||||
|
||||
/* sanity checks */
|
||||
if( !p_config )
|
||||
{
|
||||
intf_ErrMsg( "config_PutPszVariable: option %s doesn't exist",
|
||||
psz_name );
|
||||
return;
|
||||
}
|
||||
if( (p_config->i_type!=MODULE_CONFIG_ITEM_STRING) &&
|
||||
(p_config->i_type!=MODULE_CONFIG_ITEM_FILE) &&
|
||||
(p_config->i_type!=MODULE_CONFIG_ITEM_PLUGIN) )
|
||||
{
|
||||
intf_ErrMsg( "config_PutPszVariable: option %s doesn't refer to a "
|
||||
"string", psz_name );
|
||||
return;
|
||||
}
|
||||
|
||||
psz_tmp = p_config->psz_value;
|
||||
if( psz_value ) p_config->psz_value = strdup( psz_value );
|
||||
else p_config->psz_value = NULL;
|
||||
|
||||
/* free old string */
|
||||
if( psz_tmp ) free( psz_tmp );
|
||||
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* config_PutIntVariable: set the integer value of an int variable
|
||||
*****************************************************************************
|
||||
* This function is used to set the value of variables which are internally
|
||||
* represented by an integer (MODULE_CONFIG_ITEM_INTEGER and
|
||||
* MODULE_CONFIG_ITEM_BOOL).
|
||||
*****************************************************************************/
|
||||
void config_PutIntVariable( const char *psz_name, int i_value )
|
||||
{
|
||||
module_config_t *p_config;
|
||||
|
||||
p_config = config_FindConfig( psz_name );
|
||||
|
||||
/* sanity checks */
|
||||
if( !p_config )
|
||||
{
|
||||
intf_ErrMsg( "config_PutIntVariable: option %s doesn't exist",
|
||||
psz_name );
|
||||
return;
|
||||
}
|
||||
if( (p_config->i_type!=MODULE_CONFIG_ITEM_INTEGER) &&
|
||||
(p_config->i_type!=MODULE_CONFIG_ITEM_BOOL) )
|
||||
{
|
||||
intf_ErrMsg( "config_PutIntVariable: option %s doesn't refer to an int"
|
||||
, psz_name );
|
||||
return;
|
||||
}
|
||||
|
||||
p_config->i_value = i_value;
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* config_FindConfig: find the config structure associated with an option.
|
||||
*****************************************************************************
|
||||
* FIXME: This function really needs to be optimized.
|
||||
*****************************************************************************/
|
||||
module_config_t *config_FindConfig( const char *psz_name )
|
||||
{
|
||||
module_t *p_module;
|
||||
int i;
|
||||
|
||||
if( !psz_name ) return NULL;
|
||||
|
||||
for( p_module = p_module_bank->first ;
|
||||
p_module != NULL ;
|
||||
p_module = p_module->next )
|
||||
{
|
||||
for( i = 0; i < (p_module->i_config_options -1); i++ )
|
||||
{
|
||||
if( (p_module->p_config[i].i_type ==
|
||||
MODULE_CONFIG_ITEM_CATEGORY)||
|
||||
(p_module->p_config[i].i_type ==
|
||||
MODULE_CONFIG_ITEM_SUBCATEGORY)||
|
||||
(p_module->p_config[i].i_type ==
|
||||
MODULE_CONFIG_ITEM_SUBCATEGORY_END) )
|
||||
continue;
|
||||
if( !strcmp( psz_name, p_module->p_config[i].psz_name ) )
|
||||
return &p_module->p_config[i];
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* config_Duplicate: creates a duplicate of a module's configuration data.
|
||||
*****************************************************************************
|
||||
* Unfortunatly we cannot work directly with the module's config data as
|
||||
* this module might be unloaded from memory at any time (remember HideModule).
|
||||
* This is why we need to create an exact copy of the config data.
|
||||
*****************************************************************************/
|
||||
module_config_t *config_Duplicate( module_config_t *p_config_orig,
|
||||
int i_config_options )
|
||||
{
|
||||
int i;
|
||||
module_config_t *p_config;
|
||||
|
||||
/* allocate memory */
|
||||
p_config = (module_config_t *)malloc( sizeof(module_config_t)
|
||||
* i_config_options );
|
||||
if( p_config == NULL )
|
||||
{
|
||||
intf_ErrMsg( "config_Duplicate error: can't allocate p_config" );
|
||||
return( NULL );
|
||||
}
|
||||
|
||||
for( i = 0; i < i_config_options ; i++ )
|
||||
{
|
||||
p_config[i].i_type = p_config_orig[i].i_type;
|
||||
p_config[i].i_value = p_config_orig[i].i_value;
|
||||
p_config[i].b_dirty = p_config_orig[i].b_dirty;
|
||||
if( p_config_orig[i].psz_name )
|
||||
p_config[i].psz_name = strdup( p_config_orig[i].psz_name );
|
||||
if( p_config_orig[i].psz_text )
|
||||
p_config[i].psz_text = strdup( p_config_orig[i].psz_text );
|
||||
if( p_config_orig[i].psz_longtext )
|
||||
p_config[i].psz_longtext = strdup( p_config_orig[i].psz_longtext );
|
||||
if( p_config_orig[i].psz_value )
|
||||
p_config[i].psz_value = strdup( p_config_orig[i].psz_value );
|
||||
|
||||
/* the callback pointer is only valid when the module is loaded so this
|
||||
* value is set in ActivateModule() and reset in DeactivateModule() */
|
||||
p_config_orig[i].p_callback = NULL;
|
||||
}
|
||||
|
||||
return p_config;
|
||||
}
|
@ -2,7 +2,7 @@
|
||||
* modules.c : Built-in and plugin modules management functions
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2001 VideoLAN
|
||||
* $Id: modules.c,v 1.53 2002/02/19 00:50:20 sam Exp $
|
||||
* $Id: modules.c,v 1.54 2002/02/24 20:51:10 gbazin Exp $
|
||||
*
|
||||
* Authors: Samuel Hocevar <sam@zoy.org>
|
||||
* Ethan C. Baldridge <BaldridgeE@cadmus.com>
|
||||
@ -51,6 +51,7 @@
|
||||
# undef HAVE_DYNAMIC_PLUGINS
|
||||
#endif
|
||||
|
||||
|
||||
#include "netutils.h"
|
||||
|
||||
#include "interface.h"
|
||||
@ -81,7 +82,6 @@
|
||||
static void AllocateAllPlugins ( void );
|
||||
static int AllocatePluginModule ( char * );
|
||||
#endif
|
||||
static void AllocateAllBuiltins ( void );
|
||||
static int AllocateBuiltinModule( int ( * ) ( module_t * ),
|
||||
int ( * ) ( module_t * ),
|
||||
int ( * ) ( module_t * ) );
|
||||
@ -100,8 +100,8 @@ static module_symbols_t symbols;
|
||||
/*****************************************************************************
|
||||
* module_InitBank: create the module bank.
|
||||
*****************************************************************************
|
||||
* This function creates a module bank structure and fills it with the
|
||||
* built-in modules, as well as all the plugin modules it can find.
|
||||
* This function creates a module bank structure which will be filled later
|
||||
* on with all the modules found.
|
||||
*****************************************************************************/
|
||||
void module_InitBank( void )
|
||||
{
|
||||
@ -116,24 +116,46 @@ void module_InitBank( void )
|
||||
STORE_SYMBOLS( &symbols );
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Check all the built-in modules
|
||||
*/
|
||||
intf_WarnMsg( 2, "module: checking built-in modules" );
|
||||
AllocateAllBuiltins();
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Check all the plugin modules we can find
|
||||
*/
|
||||
/*****************************************************************************
|
||||
* module_LoadMain: load the main program info into the module bank.
|
||||
*****************************************************************************
|
||||
* This function fills the module bank structure with the main module infos.
|
||||
* This is very useful as it will allow us to consider the main program just
|
||||
* as another module, and for instance the configuration options of main will
|
||||
* be available in the module bank structure just as for every other module.
|
||||
*****************************************************************************/
|
||||
void module_LoadMain( void )
|
||||
{
|
||||
AllocateBuiltinModule( InitModule__MODULE_main,
|
||||
ActivateModule__MODULE_main,
|
||||
DeactivateModule__MODULE_main );
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* module_LoadBuiltins: load all modules which we built with.
|
||||
*****************************************************************************
|
||||
* This function fills the module bank structure with the built-in modules.
|
||||
*****************************************************************************/
|
||||
void module_LoadBuiltins( void )
|
||||
{
|
||||
intf_WarnMsg( 2, "module: checking built-in modules" );
|
||||
ALLOCATE_ALL_BUILTINS();
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* module_LoadPlugins: load all plugin modules we can find.
|
||||
*****************************************************************************
|
||||
* This function fills the module bank structure with the plugin modules.
|
||||
*****************************************************************************/
|
||||
void module_LoadPlugins( void )
|
||||
{
|
||||
#ifdef HAVE_DYNAMIC_PLUGINS
|
||||
intf_WarnMsg( 2, "module: checking plugin modules" );
|
||||
AllocateAllPlugins();
|
||||
#endif
|
||||
|
||||
intf_WarnMsg( 2, "module: module bank initialized, found %i modules",
|
||||
p_module_bank->i_count );
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
@ -615,7 +637,7 @@ static int AllocatePluginModule( char * psz_filename )
|
||||
p_module->is.plugin.handle = handle;
|
||||
p_module->p_symbols = &symbols;
|
||||
|
||||
/* Initialize the module : fill p_module->psz_name, etc. */
|
||||
/* Initialize the module : fill p_module->psz_name, default config, etc. */
|
||||
if( CallSymbol( p_module, "InitModule" MODULE_SUFFIX ) != 0 )
|
||||
{
|
||||
/* We couldn't call InitModule() */
|
||||
@ -706,14 +728,6 @@ static int AllocatePluginModule( char * psz_filename )
|
||||
}
|
||||
#endif /* HAVE_DYNAMIC_PLUGINS */
|
||||
|
||||
/*****************************************************************************
|
||||
* AllocateAllBuiltins: load all modules we were built with.
|
||||
*****************************************************************************/
|
||||
static void AllocateAllBuiltins( void )
|
||||
{
|
||||
ALLOCATE_ALL_BUILTINS();
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* AllocateBuiltinModule: initialize a built-in module.
|
||||
*****************************************************************************
|
||||
|
@ -25,5 +25,9 @@
|
||||
ActivateModule__MODULE_ ## NAME, \
|
||||
DeactivateModule__MODULE_ ## NAME );
|
||||
|
||||
/* Add stuff here */
|
||||
/* We also consider the main program as a module (useful for config stuff) */
|
||||
int InitModule__MODULE_main( module_t* );
|
||||
int ActivateModule__MODULE_main( module_t* );
|
||||
int DeactivateModule__MODULE_main( module_t* );
|
||||
|
||||
/* Add stuff here */
|
||||
|
@ -2,7 +2,7 @@
|
||||
* modules_plugin.h : Plugin management functions used by the core application.
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2001 VideoLAN
|
||||
* $Id: modules_plugin.h,v 1.10 2002/02/21 23:56:08 sam Exp $
|
||||
* $Id: modules_plugin.h,v 1.11 2002/02/24 20:51:10 gbazin Exp $
|
||||
*
|
||||
* Authors: Samuel Hocevar <sam@zoy.org>
|
||||
*
|
||||
@ -157,10 +157,12 @@ module_error( void )
|
||||
(p_symbols)->p_input_bank = p_input_bank; \
|
||||
(p_symbols)->p_aout_bank = p_aout_bank; \
|
||||
(p_symbols)->p_vout_bank = p_vout_bank; \
|
||||
(p_symbols)->main_GetIntVariable = main_GetIntVariable; \
|
||||
(p_symbols)->main_GetPszVariable = main_GetPszVariable; \
|
||||
(p_symbols)->main_PutIntVariable = main_PutIntVariable; \
|
||||
(p_symbols)->main_PutPszVariable = main_PutPszVariable; \
|
||||
(p_symbols)->config_GetIntVariable = config_GetIntVariable; \
|
||||
(p_symbols)->config_GetPszVariable = config_GetPszVariable; \
|
||||
(p_symbols)->config_PutIntVariable = config_PutIntVariable; \
|
||||
(p_symbols)->config_PutPszVariable = config_PutPszVariable; \
|
||||
(p_symbols)->config_Duplicate = config_Duplicate; \
|
||||
(p_symbols)->config_FindConfig = config_FindConfig; \
|
||||
(p_symbols)->intf_MsgSub = intf_MsgSub; \
|
||||
(p_symbols)->intf_MsgUnsub = intf_MsgUnsub; \
|
||||
(p_symbols)->intf_Msg = intf_Msg; \
|
||||
@ -233,5 +235,3 @@ module_error( void )
|
||||
(p_symbols)->DecodeLanguage = DecodeLanguage; \
|
||||
(p_symbols)->module_Need = module_Need; \
|
||||
(p_symbols)->module_Unneed = module_Unneed;
|
||||
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
* netutils.c: various network functions
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1999-2001 VideoLAN
|
||||
* $Id: netutils.c,v 1.56 2002/02/20 23:23:53 sam Exp $
|
||||
* $Id: netutils.c,v 1.57 2002/02/24 20:51:10 gbazin Exp $
|
||||
*
|
||||
* Authors: Vincent Seguin <seguin@via.ecp.fr>
|
||||
* Benoit Steiner <benny@via.ecp.fr>
|
||||
@ -211,8 +211,7 @@ int network_ChannelJoin( int i_channel )
|
||||
struct timeval delay;
|
||||
fd_set fds;
|
||||
|
||||
if( !main_GetIntVariable( INPUT_NETWORK_CHANNEL_VAR,
|
||||
INPUT_NETWORK_CHANNEL_DEFAULT ) )
|
||||
if( !config_GetIntVariable( INPUT_NETWORK_CHANNEL_VAR ) )
|
||||
{
|
||||
intf_ErrMsg( "network: channels disabled, to enable them, use the"
|
||||
"--channels option" );
|
||||
@ -247,10 +246,14 @@ int network_ChannelJoin( int i_channel )
|
||||
}
|
||||
|
||||
/* Getting information about the channel server */
|
||||
psz_vlcs = main_GetPszVariable( INPUT_CHANNEL_SERVER_VAR,
|
||||
INPUT_CHANNEL_SERVER_DEFAULT );
|
||||
i_port = main_GetIntVariable( INPUT_CHANNEL_PORT_VAR,
|
||||
INPUT_CHANNEL_PORT_DEFAULT );
|
||||
if( !(psz_vlcs = config_GetPszVariable( INPUT_CHANNEL_SERVER_VAR )) )
|
||||
{
|
||||
intf_ErrMsg( "network: configuration variable %s empty",
|
||||
INPUT_CHANNEL_SERVER_VAR );
|
||||
return -1;
|
||||
}
|
||||
|
||||
i_port = config_GetIntVariable( INPUT_CHANNEL_PORT_VAR );
|
||||
|
||||
intf_WarnMsg( 5, "network: socket %i, vlcs '%s', port %d",
|
||||
i_fd, psz_vlcs, i_port );
|
||||
@ -267,6 +270,7 @@ int network_ChannelJoin( int i_channel )
|
||||
#else
|
||||
sa_server.sin_addr.s_addr = inet_addr( psz_vlcs );
|
||||
#endif
|
||||
free( psz_vlcs );
|
||||
|
||||
/* Bind the socket */
|
||||
if( bind( i_fd, (struct sockaddr*)(&sa_client), sizeof(sa_client) ) )
|
||||
@ -380,13 +384,20 @@ static int GetMacAddress( int i_fd, char *psz_mac )
|
||||
#if defined( SYS_LINUX )
|
||||
struct ifreq interface;
|
||||
int i_ret;
|
||||
char *psz_interface;
|
||||
|
||||
/*
|
||||
* Looking for information about the eth0 interface
|
||||
*/
|
||||
interface.ifr_addr.sa_family = AF_INET;
|
||||
strcpy( interface.ifr_name,
|
||||
main_GetPszVariable( INPUT_IFACE_VAR, INPUT_IFACE_DEFAULT ) );
|
||||
if( !(psz_interface = config_GetPszVariable( INPUT_IFACE_VAR )) )
|
||||
{
|
||||
intf_ErrMsg( "network error: configuration variable %s empty",
|
||||
INPUT_IFACE_VAR );
|
||||
return -1;
|
||||
}
|
||||
strcpy( interface.ifr_name, psz_interface );
|
||||
free( psz_interface );
|
||||
|
||||
i_ret = ioctl( i_fd, SIOCGIFHWADDR, &interface );
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
* thread, and destroy a previously oppened video output thread.
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2000-2001 VideoLAN
|
||||
* $Id: video_output.c,v 1.160 2002/02/19 00:50:20 sam Exp $
|
||||
* $Id: video_output.c,v 1.161 2002/02/24 20:51:10 gbazin Exp $
|
||||
*
|
||||
* Authors: Vincent Seguin <seguin@via.ecp.fr>
|
||||
*
|
||||
@ -106,10 +106,9 @@ vout_thread_t * vout_CreateThread ( int *pi_status,
|
||||
}
|
||||
|
||||
/* Choose the best module */
|
||||
psz_plugin = main_GetPszVariable( VOUT_FILTER_VAR, "" );
|
||||
if( psz_plugin[0] == '\0' )
|
||||
if( !(psz_plugin = config_GetPszVariable( VOUT_FILTER_VAR )) )
|
||||
{
|
||||
psz_plugin = main_GetPszVariable( VOUT_METHOD_VAR, "" );
|
||||
psz_plugin = config_GetPszVariable( VOUT_METHOD_VAR );
|
||||
}
|
||||
|
||||
/* Initialize thread properties - thread id and locks will be initialized
|
||||
@ -154,12 +153,13 @@ vout_thread_t * vout_CreateThread ( int *pi_status,
|
||||
p_vout->render_time = 10;
|
||||
|
||||
/* user requested fullscreen? */
|
||||
if( main_GetIntVariable( VOUT_FULLSCREEN_VAR, VOUT_FULLSCREEN_DEFAULT ) )
|
||||
if( config_GetIntVariable( VOUT_FULLSCREEN_VAR ) )
|
||||
p_vout->i_changes |= VOUT_FULLSCREEN_CHANGE;
|
||||
|
||||
p_vout->p_module
|
||||
= module_Need( MODULE_CAPABILITY_VOUT, psz_plugin, (void *)p_vout );
|
||||
|
||||
if( psz_plugin ) free( psz_plugin );
|
||||
if( p_vout->p_module == NULL )
|
||||
{
|
||||
intf_ErrMsg( "vout error: no suitable vout module" );
|
||||
|
@ -2,7 +2,7 @@
|
||||
* vout_subpictures.c : subpicture management functions
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2000 VideoLAN
|
||||
* $Id: vout_subpictures.c,v 1.8 2002/02/19 00:50:20 sam Exp $
|
||||
* $Id: vout_subpictures.c,v 1.9 2002/02/24 20:51:10 gbazin Exp $
|
||||
*
|
||||
* Authors: Vincent Seguin <seguin@via.ecp.fr>
|
||||
* Samuel Hocevar <sam@zoy.org>
|
||||
@ -60,8 +60,7 @@ void vout_DisplaySubPicture( vout_thread_t *p_vout, subpicture_t *p_subpic )
|
||||
|
||||
/* If the user requested an SPU margin, we force the position after
|
||||
* having checked that it was a valid value. */
|
||||
i_margin = main_GetIntVariable( VOUT_SPUMARGIN_VAR,
|
||||
VOUT_SPUMARGIN_DEFAULT );
|
||||
i_margin = config_GetIntVariable( VOUT_SPUMARGIN_VAR );
|
||||
|
||||
if( i_margin >= 0 )
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user