/* If we now have a video output, check it has the right properties */
if( p_vout )
{
- char *psz_filter_chain;
- vlc_value_t val;
-
vlc_mutex_lock( &p_vout->change_lock );
/* We don't directly check for the "vout-filter" variable for obvious
* performance reasons. */
if( p_vout->p->b_filter_change )
{
- var_Get( p_vout, "vout-filter", &val );
- psz_filter_chain = val.psz_string;
+ char *psz_filter_chain = var_GetString( p_vout, "vout-filter" );
if( psz_filter_chain && !*psz_filter_chain )
{
free( psz_filter_chain );
}
- if( p_vout->fmt_render.i_chroma != p_fmt->i_chroma ||
+ if( p_vout->fmt_render.i_chroma != vlc_fourcc_GetCodec( VIDEO_ES, p_fmt->i_chroma ) ||
p_vout->fmt_render.i_width != p_fmt->i_width ||
p_vout->fmt_render.i_height != p_fmt->i_height ||
p_vout->p->b_filter_change )
{
msg_Dbg( p_this, "reusing provided vout" );
- spu_Attach( p_vout->p_spu, p_this, true );
-
+ spu_Attach( p_vout->p_spu, VLC_OBJECT(p_vout), false );
vlc_object_detach( p_vout );
+
vlc_object_attach( p_vout, p_this );
+ spu_Attach( p_vout->p_spu, VLC_OBJECT(p_vout), true );
}
}
{
vout_thread_t * p_vout; /* thread descriptor */
int i_index; /* loop variable */
- vlc_value_t val, text;
+ vlc_value_t text;
unsigned int i_width = p_fmt->i_width;
unsigned int i_height = p_fmt->i_height;
- vlc_fourcc_t i_chroma = p_fmt->i_chroma;
+ vlc_fourcc_t i_chroma = vlc_fourcc_GetCodec( VIDEO_ES, p_fmt->i_chroma );
unsigned int i_aspect = p_fmt->i_aspect;
config_chain_t *p_cfg;
/* Initialize subpicture unit */
p_vout->p_spu = spu_Create( p_vout );
- spu_Attach( p_vout->p_spu, p_parent, true );
/* Attach the new object now so we can use var inheritance below */
vlc_object_attach( p_vout, p_parent );
+ /* */
spu_Init( p_vout->p_spu );
+ spu_Attach( p_vout->p_spu, VLC_OBJECT(p_vout), true );
+
/* Take care of some "interface/control" related initialisations */
vout_IntfInit( p_vout );
/* Choose the video output module */
if( !p_vout->p->psz_filter_chain || !*p_vout->p->psz_filter_chain )
{
- var_Create( p_vout, "vout", VLC_VAR_STRING | VLC_VAR_DOINHERIT );
- var_Get( p_vout, "vout", &val );
- psz_parser = val.psz_string;
+ psz_parser = var_CreateGetString( p_vout, "vout" );
}
else
{
if( !vout_ChromaCmp( p_output->i_chroma, p_render->i_chroma ) )
return false;
- if( p_output->i_chroma != FOURCC_RV15 &&
- p_output->i_chroma != FOURCC_RV16 &&
- p_output->i_chroma != FOURCC_RV24 &&
- p_output->i_chroma != FOURCC_RV32 )
+ if( p_output->i_chroma != VLC_CODEC_RGB15 &&
+ p_output->i_chroma != VLC_CODEC_RGB16 &&
+ p_output->i_chroma != VLC_CODEC_RGB24 &&
+ p_output->i_chroma != VLC_CODEC_RGB32 )
return true;
return p_output->i_rmask == p_render->i_rmask &&
}
/* following functions are local */
-static int ReduceHeight( int i_ratio )
-{
- int i_dummy = VOUT_ASPECT_FACTOR;
- int i_pgcd = 1;
-
- if( !i_ratio )
- {
- return i_pgcd;
- }
-
- /* VOUT_ASPECT_FACTOR is (2^7 * 3^3 * 5^3), we just check for 2, 3 and 5 */
- while( !(i_ratio & 1) && !(i_dummy & 1) )
- {
- i_ratio >>= 1;
- i_dummy >>= 1;
- i_pgcd <<= 1;
- }
-
- while( !(i_ratio % 3) && !(i_dummy % 3) )
- {
- i_ratio /= 3;
- i_dummy /= 3;
- i_pgcd *= 3;
- }
-
- while( !(i_ratio % 5) && !(i_dummy % 5) )
- {
- i_ratio /= 5;
- i_dummy /= 5;
- i_pgcd *= 5;
- }
-
- return i_pgcd;
-}
-
static void AspectRatio( int i_aspect, int *i_aspect_x, int *i_aspect_y )
{
- unsigned int i_pgcd = ReduceHeight( i_aspect );
+ const int i_pgcd = i_aspect ? GCD( i_aspect, VOUT_ASPECT_FACTOR ) : 1;
*i_aspect_x = i_aspect / i_pgcd;
*i_aspect_y = VOUT_ASPECT_FACTOR / i_pgcd;
}
{
vout_thread_t *p_vout = (vout_thread_t *)p_this;
input_thread_t *p_input;
- vlc_value_t val;
(void)psz_cmd; (void)oldval; (void)p_data;
p_input = (input_thread_t *)vlc_object_find( p_this, VLC_OBJECT_INPUT,
if (!p_input)
{
msg_Err( p_vout, "Input not found" );
- return( VLC_EGENERIC );
+ return VLC_EGENERIC;
}
- val.b_bool = true;
- var_Set( p_vout, "intf-change", val );
+ var_SetBool( p_vout, "intf-change", true );
/* Modify input as well because the vout might have to be restarted */
- val.psz_string = newval.psz_string;
var_Create( p_input, "vout-filter", VLC_VAR_STRING );
-
- var_Set( p_input, "vout-filter", val );
+ var_SetString( p_input, "vout-filter", newval.psz_string );
/* Now restart current video stream */
input_Control( p_input, INPUT_RESTART_ES, -VIDEO_ES );
}
}
if( psz_vf2 )
+ {
var_SetString( p_vout, "video-filter", psz_vf2 );
+ free( psz_vf2 );
+ }
return VLC_SUCCESS;
}
const mtime_t i_start = mdate();
const mtime_t i_stop = i_start + INT64_C(1000) * p_vout->p->i_title_timeout;
+ if( i_stop <= i_start )
+ return
+
vlc_assert_locked( &p_vout->change_lock );
vout_ShowTextAbsolute( p_vout, DEFAULT_CHAN,
for( int i = 0; p_deinterlace_mode[i].psz_mode; i++ )
{
val.psz_string = (char*)p_deinterlace_mode[i].psz_mode;
- text.psz_string = (char*)_(p_deinterlace_mode[i].psz_description);
+ text.psz_string = (char*)vlc_gettext(p_deinterlace_mode[i].psz_description);
var_Change( p_vout, "deinterlace", VLC_VAR_ADDCHOICE, &val, &text );
}
var_AddCallback( p_vout, "deinterlace", DeinterlaceCallback, NULL );