Commit 15267bb4 authored by Antoine Cellerier's avatar Antoine Cellerier

Allow using the config chain syntax for vout filters and vouts.

parent 5f6ded0e
...@@ -493,6 +493,9 @@ struct vout_thread_t ...@@ -493,6 +493,9 @@ struct vout_thread_t
/* Misc */ /* Misc */
vlc_bool_t b_snapshot; /**< take one snapshot on the next loop */ vlc_bool_t b_snapshot; /**< take one snapshot on the next loop */
/* Video output configuration */
config_chain_t *p_cfg;
}; };
#define I_OUTPUTPICTURES p_vout->output.i_pictures #define I_OUTPUTPICTURES p_vout->output.i_pictures
......
...@@ -228,7 +228,7 @@ vout_thread_t * __vout_Create( vlc_object_t *p_parent, video_format_t *p_fmt ) ...@@ -228,7 +228,7 @@ vout_thread_t * __vout_Create( vlc_object_t *p_parent, video_format_t *p_fmt )
vout_thread_t * p_vout; /* thread descriptor */ vout_thread_t * p_vout; /* thread descriptor */
input_thread_t * p_input_thread; input_thread_t * p_input_thread;
int i_index; /* loop variable */ int i_index; /* loop variable */
char * psz_plugin; char * psz_plugin = NULL;
vlc_value_t val, text; vlc_value_t val, text;
unsigned int i_width = p_fmt->i_width; unsigned int i_width = p_fmt->i_width;
...@@ -236,6 +236,10 @@ vout_thread_t * __vout_Create( vlc_object_t *p_parent, video_format_t *p_fmt ) ...@@ -236,6 +236,10 @@ vout_thread_t * __vout_Create( vlc_object_t *p_parent, video_format_t *p_fmt )
vlc_fourcc_t i_chroma = p_fmt->i_chroma; vlc_fourcc_t i_chroma = p_fmt->i_chroma;
unsigned int i_aspect = p_fmt->i_aspect; unsigned int i_aspect = p_fmt->i_aspect;
config_chain_t *p_cfg;
char *psz_parser;
char *psz_name;
/* Allocate descriptor */ /* Allocate descriptor */
p_vout = vlc_object_create( p_parent, VLC_OBJECT_VOUT ); p_vout = vlc_object_create( p_parent, VLC_OBJECT_VOUT );
if( p_vout == NULL ) if( p_vout == NULL )
...@@ -371,6 +375,7 @@ vout_thread_t * __vout_Create( vlc_object_t *p_parent, video_format_t *p_fmt ) ...@@ -371,6 +375,7 @@ vout_thread_t * __vout_Create( vlc_object_t *p_parent, video_format_t *p_fmt )
var_Get( p_vout, "vout", &val ); var_Get( p_vout, "vout", &val );
psz_plugin = val.psz_string; psz_plugin = val.psz_string;
} }
#if 0
else else
{ {
/* the filter chain is a string list of filters separated by double /* the filter chain is a string list of filters separated by double
...@@ -383,11 +388,17 @@ vout_thread_t * __vout_Create( vlc_object_t *p_parent, video_format_t *p_fmt ) ...@@ -383,11 +388,17 @@ vout_thread_t * __vout_Create( vlc_object_t *p_parent, video_format_t *p_fmt )
psz_end - p_vout->psz_filter_chain ); psz_end - p_vout->psz_filter_chain );
else psz_plugin = strdup( p_vout->psz_filter_chain ); else psz_plugin = strdup( p_vout->psz_filter_chain );
} }
#endif
/* Create the vout thread */ /* Create the vout thread */
psz_parser = p_vout->psz_filter_chain;
printf("psz_parser: %s\n", psz_parser );
psz_parser = config_ChainCreate( &psz_name, &p_cfg, psz_parser );
printf("psz_parser: %s\n", psz_parser );
p_vout->p_cfg = p_cfg;
p_vout->p_module = module_Need( p_vout, p_vout->p_module = module_Need( p_vout,
( p_vout->psz_filter_chain && *p_vout->psz_filter_chain ) ? ( p_vout->psz_filter_chain && *p_vout->psz_filter_chain ) ?
"video filter" : "video output", psz_plugin, 0 ); "video filter" : "video output", psz_name, 0 );
if( psz_plugin ) free( psz_plugin ); if( psz_plugin ) free( psz_plugin );
if( p_vout->p_module == NULL ) if( p_vout->p_module == NULL )
...@@ -491,6 +502,8 @@ void vout_Destroy( vout_thread_t *p_vout ) ...@@ -491,6 +502,8 @@ void vout_Destroy( vout_thread_t *p_vout )
if( p_vout->psz_filter_chain ) free( p_vout->psz_filter_chain ); if( p_vout->psz_filter_chain ) free( p_vout->psz_filter_chain );
config_ChainDestroy( p_vout->p_cfg );
/* Free structure */ /* Free structure */
vlc_object_destroy( p_vout ); vlc_object_destroy( p_vout );
#ifndef __APPLE__ #ifndef __APPLE__
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment