#define change_autosave() \
p_config[i_config].b_autosave = VLC_TRUE;
+
+
+/****************************************************************************
+ * config_chain_t:
+ ****************************************************************************/
+struct config_chain_t
+{
+ config_chain_t *p_next;
+
+ char *psz_name;
+ char *psz_value;
+};
+
+#define config_ChainParse( a, b, c, d ) __config_ChainParse( VLC_OBJECT(a), b, c, d )
+VLC_EXPORT( void, __config_ChainParse, ( vlc_object_t *, char *psz_prefix, const char **ppsz_options, config_chain_t * ) );
+VLC_EXPORT( char *, config_ChainCreate, ( char **, config_chain_t **, char * ) );
+VLC_EXPORT( void, config_ChainDestroy, ( config_chain_t * ) );
+
+static inline config_chain_t *config_chain_find( config_chain_t *p_cfg, char *psz_name )
+{
+ while( p_cfg && strcmp( p_cfg->psz_name, psz_name ) )
+ {
+ p_cfg = p_cfg->p_next;
+ }
+
+ return p_cfg;
+}
+
+static inline char *config_chain_find_value( config_chain_t *p_cfg, char *psz_name )
+{
+ while( p_cfg && strcmp( p_cfg->psz_name, psz_name ) )
+ {
+ p_cfg = p_cfg->p_next;
+ }
+
+ if( p_cfg && p_cfg->psz_value )
+ {
+ return( p_cfg->psz_value );
+ }
+
+ return NULL;
+}
sout_instance_sys_t *p_sys;
};
-/****************************************************************************
- * sout_cfg_t:
- ****************************************************************************/
-struct sout_cfg_t
-{
- sout_cfg_t *p_next;
-
- char *psz_name;
- char *psz_value;
-};
-
-#define sout_CfgParse( a, b, c, d ) __sout_CfgParse( VLC_OBJECT(a), b, c, d )
-VLC_EXPORT( void, __sout_CfgParse, ( vlc_object_t *, char *psz_prefix, const char **ppsz_options, sout_cfg_t * ) );
-VLC_EXPORT( char *, sout_CfgCreate, ( char **, sout_cfg_t **, char * ) );
-
/****************************************************************************
* sout_stream_id_t: opaque (private for all sout_stream_t)
****************************************************************************/
sout_instance_t *p_sout;
char *psz_access;
- sout_cfg_t *p_cfg;
+ config_chain_t *p_cfg;
int i_writes;
int64_t i_sent_bytes; ///< This is a "local" counter that is reset each
sout_instance_t *p_sout;
char *psz_mux;
- sout_cfg_t *p_cfg;
+ config_chain_t *p_cfg;
sout_access_out_t *p_access;
sout_instance_t *p_sout;
char *psz_name;
- sout_cfg_t *p_cfg;
+ config_chain_t *p_cfg;
char *psz_next;
/* Subpicture unit */
/* End */
-
-static inline sout_cfg_t *sout_cfg_find( sout_cfg_t *p_cfg, char *psz_name )
-{
- while( p_cfg && strcmp( p_cfg->psz_name, psz_name ) )
- {
- p_cfg = p_cfg->p_next;
- }
-
- return p_cfg;
-}
-
-static inline char *sout_cfg_find_value( sout_cfg_t *p_cfg, char *psz_name )
-{
- while( p_cfg && strcmp( p_cfg->psz_name, psz_name ) )
- {
- p_cfg = p_cfg->p_next;
- }
-
- if( p_cfg && p_cfg->psz_value )
- {
- return( p_cfg->psz_value );
- }
-
- return NULL;
-}
-
/* Announce system */
VLC_EXPORT( int, sout_AnnounceRegister, (sout_instance_t *,session_descriptor_t*, announce_method_t* ) );
VLC_EXPORT(session_descriptor_t*,sout_AnnounceRegisterSDP, (sout_instance_t *,const char *, const char *, announce_method_t* ) );
* these are handled like in transcode.c
* XXX: we might need to merge the two chains (v1 and v2 filters) */
char *psz_vfilters[MAX_VFILTERS];
- sout_cfg_t *p_vfilters_cfg[MAX_VFILTERS];
+ config_chain_t *p_vfilters_cfg[MAX_VFILTERS];
int i_vfilters_cfg;
filter_t *pp_vfilters[MAX_VFILTERS];
int i_tolerance; /* Bitrate tolerance */
/* Encoder config */
- sout_cfg_t *p_cfg;
+ config_chain_t *p_cfg;
};
/**
typedef struct sout_stream_t sout_stream_t;
typedef struct sout_stream_sys_t sout_stream_sys_t;
-typedef struct sout_cfg_t sout_cfg_t;
+typedef struct config_chain_t config_chain_t;
typedef struct sap_session_t sap_session_t;
typedef struct sap_address_t sap_address_t;
typedef struct session_descriptor_t session_descriptor_t;
es_format_t fmt_out;
/* Filter configuration */
- sout_cfg_t * p_cfg;
+ config_chain_t * p_cfg;
picture_t * ( * pf_video_filter ) ( filter_t *, picture_t * );
block_t * ( * pf_audio_filter ) ( filter_t *, block_t * );
void (*__vout_OSDMessage_inner) (vlc_object_t *, int, char *, ...);
void (*vout_OSDSlider_inner) (vlc_object_t *, int, int , short);
void (*vout_OSDIcon_inner) (vlc_object_t *, int, short);
- void (*__sout_CfgParse_inner) (vlc_object_t *, char *psz_prefix, const char **ppsz_options, sout_cfg_t *);
- char * (*sout_CfgCreate_inner) (char **, sout_cfg_t **, char *);
+ void *__sout_CfgParse_deprecated;
+ void *sout_CfgCreate_deprecated;
sout_instance_t * (*__sout_NewInstance_inner) (vlc_object_t *, char *);
void (*sout_DeleteInstance_inner) (sout_instance_t *);
sout_packetizer_input_t * (*sout_InputNew_inner) (sout_instance_t *, es_format_t *);
void *input_AskForArt_deprecated;
int (*playlist_AskForArtEnqueue_inner) (playlist_t *, input_item_t *);
uint32_t (*input_CurrentMetaFlags_inner) (vlc_meta_t *p_meta);
+ void (*__config_ChainParse_inner) (vlc_object_t *, char *psz_prefix, const char **ppsz_options, config_chain_t *);
+ void (*config_ChainDestroy_inner) (config_chain_t *);
+ char * (*config_ChainCreate_inner) (char **, config_chain_t **, char *);
};
# if defined (__PLUGIN__)
# define aout_FiltersCreatePipeline (p_symbols)->aout_FiltersCreatePipeline_inner
# define __vout_OSDMessage (p_symbols)->__vout_OSDMessage_inner
# define vout_OSDSlider (p_symbols)->vout_OSDSlider_inner
# define vout_OSDIcon (p_symbols)->vout_OSDIcon_inner
-# define __sout_CfgParse (p_symbols)->__sout_CfgParse_inner
-# define sout_CfgCreate (p_symbols)->sout_CfgCreate_inner
# define __sout_NewInstance (p_symbols)->__sout_NewInstance_inner
# define sout_DeleteInstance (p_symbols)->sout_DeleteInstance_inner
# define sout_InputNew (p_symbols)->sout_InputNew_inner
# define input_ItemAddOptionNoDup (p_symbols)->input_ItemAddOptionNoDup_inner
# define playlist_AskForArtEnqueue (p_symbols)->playlist_AskForArtEnqueue_inner
# define input_CurrentMetaFlags (p_symbols)->input_CurrentMetaFlags_inner
+# define __config_ChainParse (p_symbols)->__config_ChainParse_inner
+# define config_ChainDestroy (p_symbols)->config_ChainDestroy_inner
+# define config_ChainCreate (p_symbols)->config_ChainCreate_inner
# elif defined (HAVE_DYNAMIC_PLUGINS) && !defined (__BUILTIN__)
/******************************************************************
* STORE_SYMBOLS: store VLC APIs into p_symbols for plugin access.
((p_symbols)->__vout_OSDMessage_inner) = __vout_OSDMessage; \
((p_symbols)->vout_OSDSlider_inner) = vout_OSDSlider; \
((p_symbols)->vout_OSDIcon_inner) = vout_OSDIcon; \
- ((p_symbols)->__sout_CfgParse_inner) = __sout_CfgParse; \
- ((p_symbols)->sout_CfgCreate_inner) = sout_CfgCreate; \
((p_symbols)->__sout_NewInstance_inner) = __sout_NewInstance; \
((p_symbols)->sout_DeleteInstance_inner) = sout_DeleteInstance; \
((p_symbols)->sout_InputNew_inner) = sout_InputNew; \
((p_symbols)->input_ItemAddOptionNoDup_inner) = input_ItemAddOptionNoDup; \
((p_symbols)->playlist_AskForArtEnqueue_inner) = playlist_AskForArtEnqueue; \
((p_symbols)->input_CurrentMetaFlags_inner) = input_CurrentMetaFlags; \
+ ((p_symbols)->__config_ChainParse_inner) = __config_ChainParse; \
+ ((p_symbols)->config_ChainDestroy_inner) = config_ChainDestroy; \
+ ((p_symbols)->config_ChainCreate_inner) = config_ChainCreate; \
(p_symbols)->net_ConvertIPv4_deprecated = NULL; \
+ (p_symbols)->__sout_CfgParse_deprecated = NULL; \
+ (p_symbols)->sout_CfgCreate_deprecated = NULL; \
(p_symbols)->vlc_input_item_GetInfo_deprecated = NULL; \
(p_symbols)->vlc_input_item_AddInfo_deprecated = NULL; \
(p_symbols)->__playlist_ItemNew_deprecated = NULL; \
int i_flags;
vlc_value_t val;
- sout_CfgParse( p_access, SOUT_CFG_PREFIX, ppsz_sout_options, p_access->p_cfg );
+ config_ChainParse( p_access, SOUT_CFG_PREFIX, ppsz_sout_options, p_access->p_cfg );
if( !p_access->psz_name )
{
return VLC_ENOMEM ;
}
- sout_CfgParse( p_access, SOUT_CFG_PREFIX, ppsz_sout_options, p_access->p_cfg );
+ config_ChainParse( p_access, SOUT_CFG_PREFIX, ppsz_sout_options, p_access->p_cfg );
/* p_access->psz_name = "hostname:port/filename" */
psz_bind_addr = psz_parser = strdup( p_access->psz_name );
char *psz_genre = NULL;
char *psz_url = NULL;
- sout_CfgParse( p_access, SOUT_CFG_PREFIX, ppsz_sout_options, p_access->p_cfg );
+ config_ChainParse( p_access, SOUT_CFG_PREFIX, ppsz_sout_options, p_access->p_cfg );
psz_accessname = psz_parser = strdup( p_access->psz_name );
vlc_value_t val;
- sout_CfgParse( p_access, SOUT_CFG_PREFIX,
+ config_ChainParse( p_access, SOUT_CFG_PREFIX,
ppsz_sout_options, p_access->p_cfg );
if( !( p_sys = malloc( sizeof( sout_access_out_sys_t ) ) ) )
p_enc->fmt_in.video.i_bits_per_pixel = 12;
p_enc->fmt_out.i_codec = VLC_FOURCC('d','r','a','c');
- sout_CfgParse( p_enc, ENC_CFG_PREFIX, ppsz_enc_options, p_enc->p_cfg );
+ config_ChainParse( p_enc, ENC_CFG_PREFIX, ppsz_enc_options, p_enc->p_cfg );
/* Initialse the encoder context with the presets for SD576 - Standard
* Definition Digital (some parameters will be overwritten later on) */
p_enc->fmt_out.i_codec = VLC_FOURCC('d','v','b','s');
p_enc->fmt_out.subs.dvb.i_id = 1 << 16 | 1;
- sout_CfgParse( p_enc, ENC_CFG_PREFIX, ppsz_enc_options, p_enc->p_cfg );
+ config_ChainParse( p_enc, ENC_CFG_PREFIX, ppsz_enc_options, p_enc->p_cfg );
p_sys->i_page_ver = 0;
p_sys->i_region_ver = 0;
p_context->dsp_mask |= FF_MM_SSE2;
}
- sout_CfgParse( p_enc, ENC_CFG_PREFIX, ppsz_enc_options, p_enc->p_cfg );
+ config_ChainParse( p_enc, ENC_CFG_PREFIX, ppsz_enc_options, p_enc->p_cfg );
var_Get( p_enc, ENC_CFG_PREFIX "keyint", &val );
p_sys->i_key_int = val.i_int;
p_enc->fmt_in.i_codec = VLC_FOURCC('I','4','2','0');
p_enc->fmt_out.i_codec = VLC_FOURCC('t','h','e','o');
- sout_CfgParse( p_enc, ENC_CFG_PREFIX, ppsz_enc_options, p_enc->p_cfg );
+ config_ChainParse( p_enc, ENC_CFG_PREFIX, ppsz_enc_options, p_enc->p_cfg );
var_Get( p_enc, ENC_CFG_PREFIX "quality", &val );
i_quality = val.i_int;
p_enc->fmt_in.i_codec = AOUT_FMT_S16_NE;
p_enc->fmt_out.i_codec = VLC_FOURCC('m','p','g','a');
- sout_CfgParse( p_enc, ENC_CFG_PREFIX, ppsz_enc_options, p_enc->p_cfg );
+ config_ChainParse( p_enc, ENC_CFG_PREFIX, ppsz_enc_options, p_enc->p_cfg );
p_sys->p_twolame = twolame_init();
p_enc->fmt_in.i_codec = VLC_FOURCC('f','l','3','2');
p_enc->fmt_out.i_codec = VLC_FOURCC('v','o','r','b');
- sout_CfgParse( p_enc, ENC_CFG_PREFIX, ppsz_enc_options, p_enc->p_cfg );
+ config_ChainParse( p_enc, ENC_CFG_PREFIX, ppsz_enc_options, p_enc->p_cfg );
var_Get( p_enc, ENC_CFG_PREFIX "quality", &val );
i_quality = val.i_int;
}
#endif
- sout_CfgParse( p_enc, SOUT_CFG_PREFIX, ppsz_sout_options, p_enc->p_cfg );
+ config_ChainParse( p_enc, SOUT_CFG_PREFIX, ppsz_sout_options, p_enc->p_cfg );
p_enc->fmt_out.i_codec = VLC_FOURCC( 'h', '2', '6', '4' );
p_enc->fmt_in.i_codec = VLC_FOURCC('I','4','2','0');
if( p_intf->p_sys->b_intf_show )
{
p_main_interface->Raise();
+ p_main_interface->Show();
p_intf->p_sys->b_intf_show = VLC_FALSE;
}
int i;
msg_Dbg( p_mux, "asf muxer opened" );
- sout_CfgParse( p_mux, SOUT_CFG_PREFIX, ppsz_sout_options, p_mux->p_cfg );
+ config_ChainParse( p_mux, SOUT_CFG_PREFIX, ppsz_sout_options, p_mux->p_cfg );
p_mux->pf_control = Control;
p_mux->pf_addstream = AddStream;
bo_t *box;
msg_Dbg( p_mux, "Mp4 muxer opend" );
- sout_CfgParse( p_mux, SOUT_CFG_PREFIX, ppsz_sout_options, p_mux->p_cfg );
+ config_ChainParse( p_mux, SOUT_CFG_PREFIX, ppsz_sout_options, p_mux->p_cfg );
p_mux->pf_control = Control;
p_mux->pf_addstream = AddStream;
vlc_value_t val;
msg_Info( p_mux, "Open" );
- sout_CfgParse( p_mux, SOUT_CFG_PREFIX, ppsz_sout_options, p_mux->p_cfg );
+ config_ChainParse( p_mux, SOUT_CFG_PREFIX, ppsz_sout_options, p_mux->p_cfg );
p_mux->pf_control = Control;
p_mux->pf_addstream = AddStream;
vlc_value_t val;
int i;
- sout_CfgParse( p_mux, SOUT_CFG_PREFIX, ppsz_sout_options, p_mux->p_cfg );
+ config_ChainParse( p_mux, SOUT_CFG_PREFIX, ppsz_sout_options, p_mux->p_cfg );
p_sys = malloc( sizeof( sout_mux_sys_t ) );
if( !p_sys )
char *psz_separator_block, *psz_separator;
msg_Dbg( p_mux, "Multipart jpeg muxer opened" );
- sout_CfgParse( p_mux, SOUT_CFG_PREFIX, ppsz_sout_options, p_mux->p_cfg );
+ config_ChainParse( p_mux, SOUT_CFG_PREFIX, ppsz_sout_options, p_mux->p_cfg );
p_sys = p_mux->p_sys = malloc( sizeof(sout_mux_sys_t) );
p_sys->b_send_headers = VLC_TRUE;
out_sout_stream_sys_t *p_sys;
vlc_value_t val;
- sout_CfgParse( p_stream, SOUT_CFG_PREFIX_OUT, ppsz_sout_options_out,
+ config_ChainParse( p_stream, SOUT_CFG_PREFIX_OUT, ppsz_sout_options_out,
p_stream->p_cfg );
p_sys = malloc( sizeof( out_sout_stream_sys_t ) );
return VLC_EGENERIC;
}
- sout_CfgParse( p_stream, SOUT_CFG_PREFIX_IN, ppsz_sout_options_in,
+ config_ChainParse( p_stream, SOUT_CFG_PREFIX_IN, ppsz_sout_options_in,
p_stream->p_cfg );
var_Get( p_this->p_libvlc_global, "bridge-lock", &val );
sout_stream_sys_t *p_sys;
vlc_value_t val;
- sout_CfgParse( p_stream, SOUT_CFG_PREFIX, ppsz_sout_options,
+ config_ChainParse( p_stream, SOUT_CFG_PREFIX, ppsz_sout_options,
p_stream->p_cfg );
p_sys = malloc( sizeof( sout_stream_sys_t ) );
{
sout_stream_t *p_stream = (sout_stream_t*)p_this;
sout_stream_sys_t *p_sys;
- sout_cfg_t *p_cfg;
+ config_chain_t *p_cfg;
msg_Dbg( p_stream, "creating 'duplicate'" );
sout_stream_sys_t *p_sys;
vlc_value_t val;
- sout_CfgParse( p_stream, SOUT_CFG_PREFIX, ppsz_sout_options, p_stream->p_cfg );
+ config_ChainParse( p_stream, SOUT_CFG_PREFIX, ppsz_sout_options, p_stream->p_cfg );
p_sys = malloc( sizeof( sout_stream_sys_t ) );
p_sys->i_count = 0;
libvlc_global_data_t *p_libvlc_global = p_this->p_libvlc_global;
vlc_value_t val;
- sout_CfgParse( p_stream, SOUT_CFG_PREFIX, ppsz_sout_options,
+ config_ChainParse( p_stream, SOUT_CFG_PREFIX, ppsz_sout_options,
p_stream->p_cfg );
p_sys = malloc( sizeof( sout_stream_sys_t ) );
sout_stream_t *p_stream = (sout_stream_t*)p_this;
sout_instance_t *p_sout = p_stream->p_sout;
sout_stream_sys_t *p_sys = NULL;
- sout_cfg_t *p_cfg = NULL;
+ config_chain_t *p_cfg = NULL;
vlc_value_t val;
vlc_bool_t b_rtsp = VLC_FALSE;
- sout_CfgParse( p_stream, SOUT_CFG_PREFIX, ppsz_sout_options, p_stream->p_cfg );
+ config_ChainParse( p_stream, SOUT_CFG_PREFIX,
+ ppsz_sout_options, p_stream->p_cfg );
p_sys = malloc( sizeof( sout_stream_sys_t ) );
var_Get( p_stream, SOUT_CFG_PREFIX "sdp", &val );
if( *val.psz_string )
{
- sout_cfg_t *p_cfg;
+ config_chain_t *p_cfg;
SDPHandleUrl( p_stream, val.psz_string );
char *psz_mux_byext = NULL;
- sout_CfgParse( p_stream, SOUT_CFG_PREFIX, ppsz_sout_options,
+ config_ChainParse( p_stream, SOUT_CFG_PREFIX, ppsz_sout_options,
p_stream->p_cfg );
var_Get( p_stream, SOUT_CFG_PREFIX "access", &val );
return VLC_EGENERIC;
}
- sout_CfgParse( p_stream, SOUT_CFG_PREFIX, ppsz_sout_options,
+ config_ChainParse( p_stream, SOUT_CFG_PREFIX, ppsz_sout_options,
p_stream->p_cfg );
var_Get( p_stream, SOUT_CFG_PREFIX "files", &val );
/* Audio */
vlc_fourcc_t i_acodec; /* codec audio (0 if not transcode) */
char *psz_aenc;
- sout_cfg_t *p_audio_cfg;
+ config_chain_t *p_audio_cfg;
int i_sample_rate;
int i_channels;
int i_abitrate;
char *psz_afilters[TRANSCODE_FILTERS];
- sout_cfg_t *p_afilters_cfg[TRANSCODE_FILTERS];
+ config_chain_t *p_afilters_cfg[TRANSCODE_FILTERS];
int i_afilters;
/* Video */
vlc_fourcc_t i_vcodec; /* codec video (0 if not transcode) */
char *psz_venc;
- sout_cfg_t *p_video_cfg;
+ config_chain_t *p_video_cfg;
int i_vbitrate;
double f_scale;
double f_fps;
unsigned int i_height, i_maxheight;
vlc_bool_t b_deinterlace;
char *psz_deinterlace;
- sout_cfg_t *p_deinterlace_cfg;
+ config_chain_t *p_deinterlace_cfg;
int i_threads;
vlc_bool_t b_high_priority;
vlc_bool_t b_hurry_up;
char *psz_vfilters[TRANSCODE_FILTERS];
- sout_cfg_t *p_vfilters_cfg[TRANSCODE_FILTERS];
+ config_chain_t *p_vfilters_cfg[TRANSCODE_FILTERS];
int i_vfilters;
int i_crop_top;
vlc_fourcc_t i_scodec; /* codec spu (0 if not transcode) */
char *psz_senc;
vlc_bool_t b_soverlay;
- sout_cfg_t *p_spu_cfg;
+ config_chain_t *p_spu_cfg;
spu_t *p_spu;
/* OSD Menu */
sout_stream_id_t *id_osd; /* extension for streaming OSD menus */
vlc_fourcc_t i_osdcodec; /* codec osd menu (0 if not transcode) */
char *psz_osdenc;
- sout_cfg_t *p_osd_cfg;
+ config_chain_t *p_osd_cfg;
vlc_bool_t b_es_osd; /* VLC_TRUE when osd es is registered */
vlc_bool_t b_sout_osd;
p_sys->i_master_drift = 0;
- sout_CfgParse( p_stream, SOUT_CFG_PREFIX, ppsz_sout_options,
+ config_ChainParse( p_stream, SOUT_CFG_PREFIX, ppsz_sout_options,
p_stream->p_cfg );
/* Audio transcoding parameters */
if( val.psz_string && *val.psz_string )
{
char *psz_next;
- psz_next = sout_CfgCreate( &p_sys->psz_aenc, &p_sys->p_audio_cfg,
- val.psz_string );
+ psz_next = config_ChainCreate( &p_sys->psz_aenc, &p_sys->p_audio_cfg,
+ val.psz_string );
if( psz_next ) free( psz_next );
}
if( val.psz_string ) free( val.psz_string );
while( (psz_parser != NULL) && (*psz_parser != '\0')
&& (p_sys->i_afilters < TRANSCODE_FILTERS) )
{
- psz_parser = sout_CfgCreate(
+ psz_parser = config_ChainCreate(
&p_sys->psz_afilters[p_sys->i_afilters],
&p_sys->p_afilters_cfg[p_sys->i_afilters],
psz_parser );
if( val.psz_string && *val.psz_string )
{
char *psz_next;
- psz_next = sout_CfgCreate( &p_sys->psz_venc, &p_sys->p_video_cfg,
+ psz_next = config_ChainCreate( &p_sys->psz_venc, &p_sys->p_video_cfg,
val.psz_string );
if( psz_next ) free( psz_next );
}
while( (psz_parser != NULL) && (*psz_parser != '\0')
&& (p_sys->i_vfilters < TRANSCODE_FILTERS) )
{
- psz_parser = sout_CfgCreate(
+ psz_parser = config_ChainCreate(
&p_sys->psz_vfilters[p_sys->i_vfilters],
&p_sys->p_vfilters_cfg[p_sys->i_vfilters],
psz_parser );
if( val.psz_string && *val.psz_string )
{
char *psz_next;
- psz_next = sout_CfgCreate( &p_sys->psz_deinterlace,
+ psz_next = config_ChainCreate( &p_sys->psz_deinterlace,
&p_sys->p_deinterlace_cfg,
val.psz_string );
if( psz_next ) free( psz_next );
if( val.psz_string && *val.psz_string )
{
char *psz_next;
- psz_next = sout_CfgCreate( &p_sys->psz_senc, &p_sys->p_spu_cfg,
+ psz_next = config_ChainCreate( &p_sys->psz_senc, &p_sys->p_spu_cfg,
val.psz_string );
if( psz_next ) free( psz_next );
}
vlc_value_t osd_val;
char *psz_next;
- psz_next = sout_CfgCreate( &p_sys->psz_osdenc,
+ psz_next = config_ChainCreate( &p_sys->psz_osdenc,
&p_sys->p_osd_cfg, strdup( "dvbsub") );
if( psz_next ) free( psz_next );
while( p_sys->p_audio_cfg != NULL )
{
- sout_cfg_t *p_next = p_sys->p_audio_cfg->p_next;
+ config_chain_t *p_next = p_sys->p_audio_cfg->p_next;
if( p_sys->p_audio_cfg->psz_name )
free( p_sys->p_audio_cfg->psz_name );
while( p_sys->p_video_cfg != NULL )
{
- sout_cfg_t *p_next = p_sys->p_video_cfg->p_next;
+ config_chain_t *p_next = p_sys->p_video_cfg->p_next;
if( p_sys->p_video_cfg->psz_name )
free( p_sys->p_video_cfg->psz_name );
while( p_sys->p_deinterlace_cfg != NULL )
{
- sout_cfg_t *p_next = p_sys->p_deinterlace_cfg->p_next;
+ config_chain_t *p_next = p_sys->p_deinterlace_cfg->p_next;
if( p_sys->p_deinterlace_cfg->psz_name )
free( p_sys->p_deinterlace_cfg->psz_name );
while( p_sys->p_spu_cfg != NULL )
{
- sout_cfg_t *p_next = p_sys->p_spu_cfg->p_next;
+ config_chain_t *p_next = p_sys->p_spu_cfg->p_next;
if( p_sys->p_spu_cfg->psz_name )
free( p_sys->p_spu_cfg->psz_name );
while( p_sys->p_osd_cfg != NULL )
{
- sout_cfg_t *p_next = p_sys->p_osd_cfg->p_next;
+ config_chain_t *p_next = p_sys->p_osd_cfg->p_next;
if( p_sys->p_osd_cfg->psz_name )
free( p_sys->p_osd_cfg->psz_name );
/* needed to get options passed in transcode using the
* adjust{name=value} syntax */
- sout_CfgParse( p_filter, "", ppsz_filter_options,
+ config_ChainParse( p_filter, "", ppsz_filter_options,
p_filter->p_cfg );
var_Create( p_filter, "contrast",
p_filter->p_sys = (filter_sys_t *)p_vout;
p_vout->render.i_chroma = p_filter->fmt_in.video.i_chroma;
- sout_CfgParse( p_filter, FILTER_CFG_PREFIX, ppsz_filter_options,
+ config_ChainParse( p_filter, FILTER_CFG_PREFIX, ppsz_filter_options,
p_filter->p_cfg );
var_Get( p_filter, FILTER_CFG_PREFIX "mode", &val );
var_Create( p_filter, "deinterlace-mode", VLC_VAR_STRING );
p_filter->p_sys->p_pre_hough = NULL;
- sout_CfgParse( p_filter, FILTER_PREFIX, ppsz_filter_options,
+ config_ChainParse( p_filter, FILTER_PREFIX, ppsz_filter_options,
p_filter->p_cfg );
var_Create( p_filter, FILTER_PREFIX "mode",
misc/unicode.c \
misc/cpu.c \
misc/configuration.c \
+ misc/configuration_chain.c \
misc/image.c \
misc/iso_lang.c \
misc/iso-639_def.h \
--- /dev/null
+/*****************************************************************************
+ * configuration_chain.c : configuration module chain parsing stuff
+ *****************************************************************************
+ * Copyright (C) 2002-2006 the VideoLAN team
+ * $Id$
+ *
+ * Authors: Christophe Massiot <massiot@via.ecp.fr>
+ * Laurent Aimar <fenrir@via.ecp.fr>
+ * Eric Petit <titer@videolan.org>
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+
+/*****************************************************************************
+ * Preamble
+ *****************************************************************************/
+
+#include <vlc/vlc.h>
+
+#include <stdlib.h> /* free() */
+#include <stdio.h> /* sprintf() */
+#include <string.h> /* strerror() */
+
+/*****************************************************************************
+ * Local prototypes
+ *****************************************************************************/
+
+/* chain format:
+ module{option=*:option=*}[:module{option=*:...}]
+ */
+#define SKIPSPACE( p ) { while( *p && ( *p == ' ' || *p == '\t' ) ) p++; }
+#define SKIPTRAILINGSPACE( p, e ) \
+ { while( e > p && ( *(e-1) == ' ' || *(e-1) == '\t' ) ) e--; }
+
+/* go accross " " and { } */
+static char *_get_chain_end( char *str )
+{
+ char c, *p = str;
+
+ SKIPSPACE( p );
+
+ for( ;; )
+ {
+ if( !*p || *p == ',' || *p == '}' ) return p;
+
+ if( *p != '{' && *p != '"' && *p != '\'' )
+ {
+ p++;
+ continue;
+ }
+
+ if( *p == '{' ) c = '}';
+ else c = *p;
+ p++;
+
+ for( ;; )
+ {
+ if( !*p ) return p;
+
+ if( *p == c ) return ++p;
+ else if( *p == '{' && c == '}' ) p = _get_chain_end( p );
+ else p++;
+ }
+ }
+}
+
+char *config_ChainCreate( char **ppsz_name, config_chain_t **pp_cfg, char *psz_chain )
+{
+ config_chain_t *p_cfg = NULL;
+ char *p = psz_chain;
+
+ *ppsz_name = NULL;
+ *pp_cfg = NULL;
+
+ if( !p ) return NULL;
+
+ SKIPSPACE( p );
+
+ while( *p && *p != '{' && *p != ':' && *p != ' ' && *p != '\t' ) p++;
+
+ if( p == psz_chain ) return NULL;
+
+ *ppsz_name = strndup( psz_chain, p - psz_chain );
+
+ SKIPSPACE( p );
+
+ if( *p == '{' )
+ {
+ char *psz_name;
+
+ p++;
+
+ for( ;; )
+ {
+ config_chain_t cfg;
+
+ SKIPSPACE( p );
+
+ psz_name = p;
+
+ while( *p && *p != '=' && *p != ',' && *p != '{' && *p != '}' &&
+ *p != ' ' && *p != '\t' ) p++;
+
+ /* fprintf( stderr, "name=%s - rest=%s\n", psz_name, p ); */
+ if( p == psz_name )
+ {
+ fprintf( stderr, "invalid options (empty)" );
+ break;
+ }
+
+ cfg.psz_name = strndup( psz_name, p - psz_name );
+
+ SKIPSPACE( p );
+
+ if( *p == '=' || *p == '{' )
+ {
+ char *end;
+ vlc_bool_t b_keep_brackets = (*p == '{');
+
+ if( *p == '=' ) p++;
+
+ end = _get_chain_end( p );
+ if( end <= p )
+ {
+ cfg.psz_value = NULL;
+ }
+ else
+ {
+ /* Skip heading and trailing spaces.
+ * This ain't necessary but will avoid simple
+ * user mistakes. */
+ SKIPSPACE( p );
+ }
+
+ if( end <= p )
+ {
+ cfg.psz_value = NULL;
+ }
+ else
+ {
+ if( *p == '\'' || *p == '"' ||
+ ( !b_keep_brackets && *p == '{' ) )
+ {
+ p++;
+
+ if( *(end-1) != '\'' && *(end-1) == '"' )
+ SKIPTRAILINGSPACE( p, end );
+
+ if( end - 1 <= p ) cfg.psz_value = NULL;
+ else cfg.psz_value = strndup( p, end -1 - p );
+ }
+ else
+ {
+ SKIPTRAILINGSPACE( p, end );
+ if( end <= p ) cfg.psz_value = NULL;
+ else cfg.psz_value = strndup( p, end - p );
+ }
+ }
+
+ p = end;
+ SKIPSPACE( p );
+ }
+ else
+ {
+ cfg.psz_value = NULL;
+ }
+
+ cfg.p_next = NULL;
+ if( p_cfg )
+ {
+ p_cfg->p_next = malloc( sizeof( config_chain_t ) );
+ memcpy( p_cfg->p_next, &cfg, sizeof( config_chain_t ) );
+
+ p_cfg = p_cfg->p_next;
+ }
+ else
+ {
+ p_cfg = malloc( sizeof( config_chain_t ) );
+ memcpy( p_cfg, &cfg, sizeof( config_chain_t ) );
+
+ *pp_cfg = p_cfg;
+ }
+
+ if( *p == ',' ) p++;
+
+ if( *p == '}' )
+ {
+ p++;
+ break;
+ }
+ }
+ }
+
+ if( *p == ':' ) return( strdup( p + 1 ) );
+
+ return NULL;
+}
+
+void config_ChainDestroy( config_chain_t *p_cfg )
+{
+ while( p_cfg != NULL )
+ {
+ config_chain_t *p_next;
+
+ p_next = p_cfg->p_next;
+
+ FREENULL( p_cfg->psz_name );
+ FREENULL( p_cfg->psz_value );
+ free( p_cfg );
+
+ p_cfg = p_next;
+ }
+}
+
+void __config_ChainParse( vlc_object_t *p_this, char *psz_prefix,
+ const char **ppsz_options, config_chain_t *cfg )
+{
+ char *psz_name;
+ int i_type;
+ int i;
+
+ /* First, var_Create all variables */
+ for( i = 0; ppsz_options[i] != NULL; i++ )
+ {
+ asprintf( &psz_name, "%s%s", psz_prefix,
+ *ppsz_options[i] == '*' ? &ppsz_options[i][1] : ppsz_options[i] );
+
+ i_type = config_GetType( p_this, psz_name );
+
+ var_Create( p_this, psz_name, i_type | VLC_VAR_DOINHERIT );
+ free( psz_name );
+ }
+
+ /* Now parse options and set value */
+ if( psz_prefix == NULL ) psz_prefix = "";
+
+ while( cfg )
+ {
+ vlc_value_t val;
+ vlc_bool_t b_yes = VLC_TRUE;
+ vlc_bool_t b_once = VLC_FALSE;
+ module_config_t *p_conf;
+
+ if( cfg->psz_name == NULL || *cfg->psz_name == '\0' )
+ {
+ cfg = cfg->p_next;
+ continue;
+ }
+ for( i = 0; ppsz_options[i] != NULL; i++ )
+ {
+ if( !strcmp( ppsz_options[i], cfg->psz_name ) )
+ {
+ break;
+ }
+ if( ( !strncmp( cfg->psz_name, "no-", 3 ) &&
+ !strcmp( ppsz_options[i], cfg->psz_name + 3 ) ) ||
+ ( !strncmp( cfg->psz_name, "no", 2 ) &&
+ !strcmp( ppsz_options[i], cfg->psz_name + 2 ) ) )
+ {
+ b_yes = VLC_FALSE;
+ break;
+ }
+
+ if( *ppsz_options[i] == '*' &&
+ !strcmp( &ppsz_options[i][1], cfg->psz_name ) )
+ {
+ b_once = VLC_TRUE;
+ break;
+ }
+
+ }
+ if( ppsz_options[i] == NULL )
+ {
+ msg_Warn( p_this, "option %s is unknown", cfg->psz_name );
+ cfg = cfg->p_next;
+ continue;
+ }
+
+ /* create name */
+ asprintf( &psz_name, "%s%s", psz_prefix, b_once ? &ppsz_options[i][1] : ppsz_options[i] );
+
+ /* Check if the option is deprecated */
+ p_conf = config_FindConfig( p_this, psz_name );
+
+ /* This is basically cut and paste from src/misc/configuration.c
+ * with slight changes */
+ if( p_conf && p_conf->psz_current )
+ {
+ if( !strcmp( p_conf->psz_current, "SUPPRESSED" ) )
+ {
+ msg_Err( p_this, "Option %s is no longer used.",
+ p_conf->psz_name );
+ goto next;
+ }
+ else if( p_conf->b_strict )
+ {
+ msg_Err( p_this, "Option %s is deprecated. Use %s instead.",
+ p_conf->psz_name, p_conf->psz_current );
+ /* TODO: this should return an error and end option parsing
+ * ... but doing this would change the VLC API and all the
+ * modules so i'll do it later */
+ goto next;
+ }
+ else
+ {
+ msg_Warn( p_this, "Option %s is deprecated. You should use "
+ "%s instead.", p_conf->psz_name, p_conf->psz_current );
+ free( psz_name );
+ psz_name = strdup( p_conf->psz_current );
+ }
+ }
+ /* </Check if the option is deprecated> */
+
+ /* get the type of the variable */
+ i_type = config_GetType( p_this, psz_name );
+ if( !i_type )
+ {
+ msg_Warn( p_this, "unknown option %s (value=%s)",
+ cfg->psz_name, cfg->psz_value );
+ goto next;
+ }
+ if( i_type != VLC_VAR_BOOL && cfg->psz_value == NULL )
+ {
+ msg_Warn( p_this, "missing value for option %s", cfg->psz_name );
+ goto next;
+ }
+ if( i_type != VLC_VAR_STRING && b_once )
+ {
+ msg_Warn( p_this, "*option_name need to be a string option" );
+ goto next;
+ }
+
+ switch( i_type )
+ {
+ case VLC_VAR_BOOL:
+ val.b_bool = b_yes;
+ break;
+ case VLC_VAR_INTEGER:
+ val.i_int = strtol( cfg->psz_value ? cfg->psz_value : "0",
+ NULL, 0 );
+ break;
+ case VLC_VAR_FLOAT:
+ val.f_float = atof( cfg->psz_value ? cfg->psz_value : "0" );
+ break;
+ case VLC_VAR_STRING:
+ case VLC_VAR_MODULE:
+ val.psz_string = cfg->psz_value;
+ break;
+ default:
+ msg_Warn( p_this, "unhandled config var type" );
+ memset( &val, 0, sizeof( vlc_value_t ) );
+ break;
+ }
+ if( b_once )
+ {
+ vlc_value_t val2;
+
+ var_Get( p_this, psz_name, &val2 );
+ if( *val2.psz_string )
+ {
+ free( val2.psz_string );
+ msg_Dbg( p_this, "ignoring option %s (not first occurrence)", psz_name );
+ goto next;
+ }
+ free( val2.psz_string );
+ }
+ var_Set( p_this, psz_name, val );
+ msg_Dbg( p_this, "set config option: %s to %s", psz_name, cfg->psz_value );
+
+ next:
+ free( psz_name );
+ cfg = cfg->p_next;
+ }
+}
/*****************************************************************************
* Local prototypes
*****************************************************************************/
-static void sout_CfgDestroy( sout_cfg_t * );
-
#define sout_stream_url_to_chain( p, s ) \
_sout_stream_url_to_chain( VLC_OBJECT(p), s )
static char *_sout_stream_url_to_chain( vlc_object_t *, char * );
return NULL;
}
- psz_next = sout_CfgCreate( &p_access->psz_access, &p_access->p_cfg,
- psz_access );
+ psz_next = config_ChainCreate( &p_access->psz_access, &p_access->p_cfg,
+ psz_access );
if( psz_next )
{
free( psz_next );
}
free( p_access->psz_access );
- sout_CfgDestroy( p_access->p_cfg );
+ config_ChainDestroy( p_access->p_cfg );
free( p_access->psz_name );
}
p_mux->p_sout = p_sout;
- psz_next = sout_CfgCreate( &p_mux->psz_mux, &p_mux->p_cfg, psz_mux );
+ psz_next = config_ChainCreate( &p_mux->psz_mux, &p_mux->p_cfg, psz_mux );
if( psz_next ) free( psz_next );
p_mux->p_access = p_access;
}
free( p_mux->psz_mux );
- sout_CfgDestroy( p_mux->p_cfg );
+ config_ChainDestroy( p_mux->p_cfg );
vlc_object_destroy( p_mux );
}
}
}
-char *sout_CfgCreate( char **ppsz_name, sout_cfg_t **pp_cfg, char *psz_chain )
-{
- sout_cfg_t *p_cfg = NULL;
- char *p = psz_chain;
-
- *ppsz_name = NULL;
- *pp_cfg = NULL;
-
- if( !p ) return NULL;
-
- SKIPSPACE( p );
-
- while( *p && *p != '{' && *p != ':' && *p != ' ' && *p != '\t' ) p++;
-
- if( p == psz_chain ) return NULL;
-
- *ppsz_name = strndup( psz_chain, p - psz_chain );
-
- SKIPSPACE( p );
-
- if( *p == '{' )
- {
- char *psz_name;
-
- p++;
-
- for( ;; )
- {
- sout_cfg_t cfg;
-
- SKIPSPACE( p );
-
- psz_name = p;
-
- while( *p && *p != '=' && *p != ',' && *p != '{' && *p != '}' &&
- *p != ' ' && *p != '\t' ) p++;
-
- /* fprintf( stderr, "name=%s - rest=%s\n", psz_name, p ); */
- if( p == psz_name )
- {
- fprintf( stderr, "invalid options (empty)" );
- break;
- }
-
- cfg.psz_name = strndup( psz_name, p - psz_name );
-
- SKIPSPACE( p );
-
- if( *p == '=' || *p == '{' )
- {
- char *end;
- vlc_bool_t b_keep_brackets = (*p == '{');
-
- if( *p == '=' ) p++;
-
- end = _get_chain_end( p );
- if( end <= p )
- {
- cfg.psz_value = NULL;
- }
- else
- {
- /* Skip heading and trailing spaces.
- * This ain't necessary but will avoid simple
- * user mistakes. */
- SKIPSPACE( p );
- }
-
- if( end <= p )
- {
- cfg.psz_value = NULL;
- }
- else
- {
- if( *p == '\'' || *p == '"' ||
- ( !b_keep_brackets && *p == '{' ) )
- {
- p++;
-
- if( *(end-1) != '\'' && *(end-1) == '"' )
- SKIPTRAILINGSPACE( p, end );
-
- if( end - 1 <= p ) cfg.psz_value = NULL;
- else cfg.psz_value = strndup( p, end -1 - p );
- }
- else
- {
- SKIPTRAILINGSPACE( p, end );
- if( end <= p ) cfg.psz_value = NULL;
- else cfg.psz_value = strndup( p, end - p );
- }
- }
-
- p = end;
- SKIPSPACE( p );
- }
- else
- {
- cfg.psz_value = NULL;
- }
-
- cfg.p_next = NULL;
- if( p_cfg )
- {
- p_cfg->p_next = malloc( sizeof( sout_cfg_t ) );
- memcpy( p_cfg->p_next, &cfg, sizeof( sout_cfg_t ) );
-
- p_cfg = p_cfg->p_next;
- }
- else
- {
- p_cfg = malloc( sizeof( sout_cfg_t ) );
- memcpy( p_cfg, &cfg, sizeof( sout_cfg_t ) );
-
- *pp_cfg = p_cfg;
- }
-
- if( *p == ',' ) p++;
-
- if( *p == '}' )
- {
- p++;
- break;
- }
- }
- }
-
- if( *p == ':' ) return( strdup( p + 1 ) );
-
- return NULL;
-}
-
-static void sout_CfgDestroy( sout_cfg_t *p_cfg )
-{
- while( p_cfg != NULL )
- {
- sout_cfg_t *p_next;
-
- p_next = p_cfg->p_next;
-
- FREENULL( p_cfg->psz_name );
- FREENULL( p_cfg->psz_value );
- free( p_cfg );
-
- p_cfg = p_next;
- }
-}
-
-void __sout_CfgParse( vlc_object_t *p_this, char *psz_prefix,
- const char **ppsz_options, sout_cfg_t *cfg )
-{
- char *psz_name;
- int i_type;
- int i;
-
- /* First, var_Create all variables */
- for( i = 0; ppsz_options[i] != NULL; i++ )
- {
- asprintf( &psz_name, "%s%s", psz_prefix,
- *ppsz_options[i] == '*' ? &ppsz_options[i][1] : ppsz_options[i] );
-
- i_type = config_GetType( p_this, psz_name );
-
- var_Create( p_this, psz_name, i_type | VLC_VAR_DOINHERIT );
- free( psz_name );
- }
-
- /* Now parse options and set value */
- if( psz_prefix == NULL ) psz_prefix = "";
-
- while( cfg )
- {
- vlc_value_t val;
- vlc_bool_t b_yes = VLC_TRUE;
- vlc_bool_t b_once = VLC_FALSE;
- module_config_t *p_conf;
-
- if( cfg->psz_name == NULL || *cfg->psz_name == '\0' )
- {
- cfg = cfg->p_next;
- continue;
- }
- for( i = 0; ppsz_options[i] != NULL; i++ )
- {
- if( !strcmp( ppsz_options[i], cfg->psz_name ) )
- {
- break;
- }
- if( ( !strncmp( cfg->psz_name, "no-", 3 ) &&
- !strcmp( ppsz_options[i], cfg->psz_name + 3 ) ) ||
- ( !strncmp( cfg->psz_name, "no", 2 ) &&
- !strcmp( ppsz_options[i], cfg->psz_name + 2 ) ) )
- {
- b_yes = VLC_FALSE;
- break;
- }
-
- if( *ppsz_options[i] == '*' &&
- !strcmp( &ppsz_options[i][1], cfg->psz_name ) )
- {
- b_once = VLC_TRUE;
- break;
- }
-
- }
- if( ppsz_options[i] == NULL )
- {
- msg_Warn( p_this, "option %s is unknown", cfg->psz_name );
- cfg = cfg->p_next;
- continue;
- }
-
- /* create name */
- asprintf( &psz_name, "%s%s", psz_prefix, b_once ? &ppsz_options[i][1] : ppsz_options[i] );
-
- /* Check if the option is deprecated */
- p_conf = config_FindConfig( p_this, psz_name );
-
- /* This is basically cut and paste from src/misc/configuration.c
- * with slight changes */
- if( p_conf && p_conf->psz_current )
- {
- if( !strcmp( p_conf->psz_current, "SUPPRESSED" ) )
- {
- msg_Err( p_this, "Option %s is no longer used.",
- p_conf->psz_name );
- goto next;
- }
- else if( p_conf->b_strict )
- {
- msg_Err( p_this, "Option %s is deprecated. Use %s instead.",
- p_conf->psz_name, p_conf->psz_current );
- /* TODO: this should return an error and end option parsing
- * ... but doing this would change the VLC API and all the
- * modules so i'll do it later */
- goto next;
- }
- else
- {
- msg_Warn( p_this, "Option %s is deprecated. You should use "
- "%s instead.", p_conf->psz_name, p_conf->psz_current );
- free( psz_name );
- psz_name = strdup( p_conf->psz_current );
- }
- }
- /* </Check if the option is deprecated> */
-
- /* get the type of the variable */
- i_type = config_GetType( p_this, psz_name );
- if( !i_type )
- {
- msg_Warn( p_this, "unknown option %s (value=%s)",
- cfg->psz_name, cfg->psz_value );
- goto next;
- }
- if( i_type != VLC_VAR_BOOL && cfg->psz_value == NULL )
- {
- msg_Warn( p_this, "missing value for option %s", cfg->psz_name );
- goto next;
- }
- if( i_type != VLC_VAR_STRING && b_once )
- {
- msg_Warn( p_this, "*option_name need to be a string option" );
- goto next;
- }
-
- switch( i_type )
- {
- case VLC_VAR_BOOL:
- val.b_bool = b_yes;
- break;
- case VLC_VAR_INTEGER:
- val.i_int = strtol( cfg->psz_value ? cfg->psz_value : "0",
- NULL, 0 );
- break;
- case VLC_VAR_FLOAT:
- val.f_float = atof( cfg->psz_value ? cfg->psz_value : "0" );
- break;
- case VLC_VAR_STRING:
- case VLC_VAR_MODULE:
- val.psz_string = cfg->psz_value;
- break;
- default:
- msg_Warn( p_this, "unhandled config var type" );
- memset( &val, 0, sizeof( vlc_value_t ) );
- break;
- }
- if( b_once )
- {
- vlc_value_t val2;
-
- var_Get( p_this, psz_name, &val2 );
- if( *val2.psz_string )
- {
- free( val2.psz_string );
- msg_Dbg( p_this, "ignoring option %s (not first occurrence)", psz_name );
- goto next;
- }
- free( val2.psz_string );
- }
- var_Set( p_this, psz_name, val );
- msg_Dbg( p_this, "set sout option: %s to %s", psz_name, cfg->psz_value );
-
- next:
- free( psz_name );
- cfg = cfg->p_next;
- }
-}
-
-
/*
* XXX name and p_cfg are used (-> do NOT free them)
*/
p_stream->p_sys = NULL;
p_stream->psz_next =
- sout_CfgCreate( &p_stream->psz_name, &p_stream->p_cfg, psz_chain);
+ config_ChainCreate( &p_stream->psz_name, &p_stream->p_cfg, psz_chain);
msg_Dbg( p_sout, "stream=`%s'", p_stream->psz_name );
FREENULL( p_stream->psz_name );
FREENULL( p_stream->psz_next );
- sout_CfgDestroy( p_stream->p_cfg );
+ config_ChainDestroy( p_stream->p_cfg );
msg_Dbg( p_stream, "destroying chain done" );
vlc_object_destroy( p_stream );
#include "vlc_playlist.h"
#include "vlc_filter.h"
-#include <vlc/sout.h> /* sout_CfgParse */
#if defined( __APPLE__ )
#include "darwin_specific.h"
int i;
for( i = 0; i < p_vout->i_vfilters_cfg; i++ )
{
- /* FIXME: this should be moved in a separate function */
- struct sout_cfg_t *p_cfg =
+ struct config_chain_t *p_cfg =
p_vout->p_vfilters_cfg[p_vout->i_vfilters_cfg];
- while( p_cfg )
- {
- struct sout_cfg_t *p_next = p_cfg->p_next;
- free( p_cfg->psz_name );
- free( p_cfg->psz_value );
- free( p_cfg );
- p_cfg = p_next;
- }
- /* </FIXME> */
-
+ config_ChainDestroy( p_cfg );
free( p_vout->psz_vfilters[p_vout->i_vfilters_cfg] );
}
p_vout->i_vfilters_cfg = 0;
while( psz_parser && *psz_parser )
{
- psz_parser = sout_CfgCreate(
+ psz_parser = config_ChainCreate(
&p_vout->psz_vfilters[p_vout->i_vfilters_cfg],
&p_vout->p_vfilters_cfg[p_vout->i_vfilters_cfg],
psz_parser );