* decoders.
*****************************************************************************
* Copyright (C) 1998-2002 VideoLAN
- * $Id: input.c,v 1.234 2003/07/23 01:13:48 gbazin Exp $
+ * $Id: input.c,v 1.235 2003/07/23 22:01:25 gbazin Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
ParseOption( p_input, p_item->ppsz_options[i] );
}
- /* Create a few object variables we'll need later */
- if( !var_Type( p_input, "sout" ) )
- {
- var_Create( p_input, "sout", VLC_VAR_STRING );
- var_Change( p_input, "sout", VLC_VAR_INHERITVALUE, NULL, NULL );
- }
- if( !var_Type( p_input, "sout-audio" ) )
- {
- var_Create( p_input, "sout-audio", VLC_VAR_BOOL );
- var_Change( p_input, "sout-audio", VLC_VAR_INHERITVALUE, NULL, NULL );
- }
- if( !var_Type( p_input, "sout-video" ) )
- {
- var_Create( p_input, "sout-video", VLC_VAR_BOOL );
- var_Change( p_input, "sout-video", VLC_VAR_INHERITVALUE, NULL, NULL );
- }
+ /* Create a few object variables we'll need later on */
+ var_Create( p_input, "video", VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
+ var_Create( p_input, "audio", VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
+ var_Create( p_input, "audio-channel", VLC_VAR_INTEGER|VLC_VAR_DOINHERIT );
+ var_Create( p_input, "spu-channel", VLC_VAR_INTEGER|VLC_VAR_DOINHERIT );
+
+ var_Create( p_input, "sout", VLC_VAR_STRING | VLC_VAR_DOINHERIT );
+ var_Create( p_input, "sout-audio", VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
+ var_Create( p_input, "sout-video", VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
/* Initialize thread properties */
p_input->b_eof = 0;
/* Initialize optional stream output. */
var_Get( p_input, "sout", &val );
- if ( val.psz_string != NULL )
+ if( val.psz_string != NULL )
{
if ( *val.psz_string && (p_input->stream.p_sout =
sout_NewInstance( p_input, val.psz_string )) == NULL )
* input_programs.c: es_descriptor_t, pgrm_descriptor_t management
*****************************************************************************
* Copyright (C) 1999-2002 VideoLAN
- * $Id: input_programs.c,v 1.114 2003/05/18 23:16:57 fenrir Exp $
+ * $Id: input_programs.c,v 1.115 2003/07/23 22:01:25 gbazin Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
#undef p_es
}
}
+
/* Get the number of the required audio stream */
- if( config_GetInt( p_input, "audio" ) )
+ var_Get( p_input, "audio", &val );
+ if( val.b_bool )
{
/* Default is the first one */
- i_required_audio_es = config_GetInt( p_input, "audio-channel" );
+ var_Get( p_input, "audio-channel", &val );
+ i_required_audio_es = val.i_int;
if( i_required_audio_es < 0 )
{
i_required_audio_es = 1;
}
/* Same thing for subtitles */
- if( config_GetInt( p_input, "video" ) )
+ var_Get( p_input, "video", &val );
+ if( val.b_bool )
{
/* for spu, default is none */
- i_required_spu_es = config_GetInt( p_input, "spu-channel" );
+ var_Get( p_input, "spu-channel", &val );
+ i_required_spu_es = val.i_int;
if( i_required_spu_es < 0 )
{
i_required_spu_es = 0;
return -1;
}
- if( ((p_es->i_cat == VIDEO_ES) || (p_es->i_cat == SPU_ES))
- && !config_GetInt( p_input, "video" ) )
+ if( p_es->i_cat == VIDEO_ES || p_es->i_cat == SPU_ES )
{
- msg_Dbg( p_input,
- "video is disabled, not selecting ES 0x%x", p_es->i_id );
- return -1;
+ var_Get( p_input, "video", &val );
+ if( !val.b_bool )
+ {
+ msg_Dbg( p_input, "video is disabled, not selecting ES 0x%x",
+ p_es->i_id );
+ return -1;
+ }
}
- if( (p_es->i_cat == AUDIO_ES) && !config_GetInt( p_input, "audio" ) )
+ if( p_es->i_cat == AUDIO_ES )
{
- msg_Dbg( p_input,
- "audio is disabled, not selecting ES 0x%x", p_es->i_id );
- return -1;
+ var_Get( p_input, "audio", &val );
+ if( !val.b_bool )
+ {
+ msg_Dbg( p_input, "audio is disabled, not selecting ES 0x%x",
+ p_es->i_id );
+ return -1;
+ }
}
msg_Dbg( p_input, "selecting ES 0x%x", p_es->i_id );
* thread, and destroy a previously oppened video output thread.
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
- * $Id: video_output.c,v 1.229 2003/07/14 21:32:59 sigmunau Exp $
+ * $Id: video_output.c,v 1.230 2003/07/23 22:01:25 gbazin Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
return NULL;
}
+ /* Initialize pictures and subpictures - translation tables and functions
+ * will be initialized later in InitThread */
+ for( i_index = 0; i_index < 2 * VOUT_MAX_PICTURES; i_index++)
+ {
+ p_vout->p_picture[i_index].pf_lock = NULL;
+ p_vout->p_picture[i_index].pf_unlock = NULL;
+ p_vout->p_picture[i_index].i_status = FREE_PICTURE;
+ p_vout->p_picture[i_index].i_type = EMPTY_PICTURE;
+ }
+
+ for( i_index = 0; i_index < VOUT_MAX_SUBPICTURES; i_index++)
+ {
+ p_vout->p_subpicture[i_index].i_status = FREE_SUBPICTURE;
+ p_vout->p_subpicture[i_index].i_type = EMPTY_SUBPICTURE;
+ }
+
+ /* No images in the heap */
+ p_vout->i_heap_size = 0;
+
+ /* Initialize the rendering heap */
+ I_RENDERPICTURES = 0;
+ p_vout->render.i_width = i_width;
+ p_vout->render.i_height = i_height;
+ p_vout->render.i_chroma = i_chroma;
+ p_vout->render.i_aspect = i_aspect;
+
+ p_vout->render.i_rmask = 0;
+ p_vout->render.i_gmask = 0;
+ p_vout->render.i_bmask = 0;
+
+ p_vout->render.i_last_used_pic = -1;
+ p_vout->render.b_allow_modify_pics = 1;
+
+ /* Zero the output heap */
+ I_OUTPUTPICTURES = 0;
+ p_vout->output.i_width = 0;
+ p_vout->output.i_height = 0;
+ p_vout->output.i_chroma = 0;
+ p_vout->output.i_aspect = 0;
+
+ p_vout->output.i_rmask = 0;
+ p_vout->output.i_gmask = 0;
+ p_vout->output.i_bmask = 0;
+
+ /* Initialize misc stuff */
+ p_vout->i_changes = 0;
+ p_vout->f_gamma = 0;
+ p_vout->b_grayscale = 0;
+ p_vout->b_info = 0;
+ p_vout->b_interface = 0;
+ p_vout->b_scale = 1;
+ p_vout->b_fullscreen = 0;
+ p_vout->render_time = 10;
+ p_vout->c_fps_samples = 0;
+ p_vout->b_filter_change = 0;
+
+ /* Mouse coordinates */
+ var_Create( p_vout, "mouse-x", VLC_VAR_INTEGER );
+ var_Create( p_vout, "mouse-y", VLC_VAR_INTEGER );
+ var_Create( p_vout, "mouse-button-down", VLC_VAR_INTEGER );
+ var_Create( p_vout, "mouse-moved", VLC_VAR_BOOL );
+ var_Create( p_vout, "mouse-clicked", VLC_VAR_INTEGER );
+ var_Create( p_vout, "key-pressed", VLC_VAR_STRING );
+
var_Create( p_vout, "intf-change", VLC_VAR_BOOL );
val.b_bool = VLC_TRUE;
var_Set( p_vout, "intf-change", val );
+ /* Initialize locks */
+ vlc_mutex_init( p_vout, &p_vout->picture_lock );
+ vlc_mutex_init( p_vout, &p_vout->subpicture_lock );
+ vlc_mutex_init( p_vout, &p_vout->change_lock );
+
+ /* Attach the new object now so we can use var inheritance below */
+ vlc_object_attach( p_vout, p_parent );
+
+ /* Create a few object variables we'll need later on */
+ var_Create( p_vout, "aspect-ratio", VLC_VAR_STRING | VLC_VAR_DOINHERIT );
+ var_Create( p_vout, "width", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
+ var_Create( p_vout, "height", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
+ var_Create( p_vout, "zoom", VLC_VAR_FLOAT | VLC_VAR_DOINHERIT );
+
p_vout->b_override_aspect = VLC_FALSE;
/* If the parent is not a VOUT object, that means we are at the start of
* the video output pipe */
if( p_parent->i_object_type != VLC_OBJECT_VOUT )
{
- char *psz_aspect = config_GetPsz( p_parent, "aspect-ratio" );
+ var_Get( p_vout, "aspect-ratio", &val );
/* Check whether the user tried to override aspect ratio */
- if( psz_aspect )
+ if( val.psz_string )
{
unsigned int i_new_aspect = i_aspect;
- char *psz_parser = strchr( psz_aspect, ':' );
+ char *psz_parser = strchr( val.psz_string, ':' );
if( psz_parser )
{
*psz_parser++ = '\0';
- i_new_aspect = atoi( psz_aspect ) * VOUT_ASPECT_FACTOR
- / atoi( psz_parser );
+ i_new_aspect = atoi( val.psz_string ) * VOUT_ASPECT_FACTOR
+ / atoi( psz_parser );
}
else
{
i_new_aspect = i_width * VOUT_ASPECT_FACTOR
- * atof( psz_aspect )
+ * atof( val.psz_string )
/ i_height;
}
- free( psz_aspect );
+ free( val.psz_string );
if( i_new_aspect && i_new_aspect != i_aspect )
{
msg_Dbg( p_vout, "overriding source aspect ratio to %i:%i",
i_new_aspect / i_pgcd, VOUT_ASPECT_FACTOR / i_pgcd );
- i_aspect = i_new_aspect;
+ p_vout->render.i_aspect = i_new_aspect;
p_vout->b_override_aspect = VLC_TRUE;
}
}
/* Look for the default filter configuration */
- p_vout->psz_filter_chain = config_GetPsz( p_parent, "filter" );
+ var_Create( p_vout, "filter", VLC_VAR_STRING | VLC_VAR_DOINHERIT );
+ var_Get( p_vout, "filter", &val );
+ p_vout->psz_filter_chain = val.psz_string;
}
else
{
/* Choose the video output module */
if( !p_vout->psz_filter_chain || !*p_vout->psz_filter_chain )
{
- psz_plugin = config_GetPsz( p_parent, "vout" );
+ var_Create( p_vout, "vout", VLC_VAR_STRING | VLC_VAR_DOINHERIT );
+ var_Get( p_vout, "vout", &val );
+ psz_plugin = val.psz_string;
}
else
{
else psz_plugin = strdup( p_vout->psz_filter_chain );
}
- /* Initialize pictures and subpictures - translation tables and functions
- * will be initialized later in InitThread */
- for( i_index = 0; i_index < 2 * VOUT_MAX_PICTURES; i_index++)
- {
- p_vout->p_picture[i_index].pf_lock = NULL;
- p_vout->p_picture[i_index].pf_unlock = NULL;
- p_vout->p_picture[i_index].i_status = FREE_PICTURE;
- p_vout->p_picture[i_index].i_type = EMPTY_PICTURE;
- }
-
- for( i_index = 0; i_index < VOUT_MAX_SUBPICTURES; i_index++)
- {
- p_vout->p_subpicture[i_index].i_status = FREE_SUBPICTURE;
- p_vout->p_subpicture[i_index].i_type = EMPTY_SUBPICTURE;
- }
-
- /* No images in the heap */
- p_vout->i_heap_size = 0;
-
- /* Initialize the rendering heap */
- I_RENDERPICTURES = 0;
- p_vout->render.i_width = i_width;
- p_vout->render.i_height = i_height;
- p_vout->render.i_chroma = i_chroma;
- p_vout->render.i_aspect = i_aspect;
-
- p_vout->render.i_rmask = 0;
- p_vout->render.i_gmask = 0;
- p_vout->render.i_bmask = 0;
-
- p_vout->render.i_last_used_pic = -1;
- p_vout->render.b_allow_modify_pics = 1;
-
- /* Zero the output heap */
- I_OUTPUTPICTURES = 0;
- p_vout->output.i_width = 0;
- p_vout->output.i_height = 0;
- p_vout->output.i_chroma = 0;
- p_vout->output.i_aspect = 0;
-
- p_vout->output.i_rmask = 0;
- p_vout->output.i_gmask = 0;
- p_vout->output.i_bmask = 0;
-
- /* Initialize misc stuff */
- p_vout->i_changes = 0;
- p_vout->f_gamma = 0;
- p_vout->b_grayscale = 0;
- p_vout->b_info = 0;
- p_vout->b_interface = 0;
- p_vout->b_scale = 1;
- p_vout->b_fullscreen = 0;
- p_vout->render_time = 10;
- p_vout->c_fps_samples = 0;
- p_vout->b_filter_change = 0;
-
- /* Mouse coordinates */
- var_Create( p_vout, "mouse-x", VLC_VAR_INTEGER );
- var_Create( p_vout, "mouse-y", VLC_VAR_INTEGER );
- var_Create( p_vout, "mouse-button-down", VLC_VAR_INTEGER );
- var_Create( p_vout, "mouse-moved", VLC_VAR_BOOL );
- var_Create( p_vout, "mouse-clicked", VLC_VAR_INTEGER );
- var_Create( p_vout, "key-pressed", VLC_VAR_STRING );
-
/* Initialize the dimensions of the video window */
InitWindowSize( p_vout, &p_vout->i_window_width,
&p_vout->i_window_height );
- /* Create thread and set locks */
- vlc_mutex_init( p_vout, &p_vout->picture_lock );
- vlc_mutex_init( p_vout, &p_vout->subpicture_lock );
- vlc_mutex_init( p_vout, &p_vout->change_lock );
-
- vlc_object_attach( p_vout, p_parent );
-
+ /* Create the vout thread */
p_vout->p_module = module_Need( p_vout,
( p_vout->psz_filter_chain &&
*p_vout->psz_filter_chain ) ?
static void InitWindowSize( vout_thread_t *p_vout, int *pi_width,
int *pi_height )
{
+ vlc_value_t val;
int i_width, i_height;
uint64_t ll_zoom;
#define FP_FACTOR 1000 /* our fixed point factor */
- i_width = config_GetInt( p_vout, "width" );
- i_height = config_GetInt( p_vout, "height" );
- ll_zoom = (uint64_t)( FP_FACTOR * config_GetFloat( p_vout, "zoom" ) );
+ var_Get( p_vout, "width", &val );
+ i_width = val.i_int;
+ var_Get( p_vout, "height", &val );
+ i_height = val.i_int;
+ var_Get( p_vout, "zoom", &val );
+ ll_zoom = (uint64_t)( FP_FACTOR * val.f_float );
if( i_width > 0 && i_height > 0)
{