Commit c90be618 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

More libvlc_global presumed abuse

parent 64f49994
......@@ -638,15 +638,15 @@ static void Run( intf_thread_t *p_intf )
psz_cmd, i_ret, vlc_error( i_ret ) );
}
/* Or maybe it's a global command */
else if( var_Type( p_intf->p_libvlc_global, psz_cmd ) & VLC_VAR_ISCOMMAND )
else if( var_Type( p_intf->p_libvlc, psz_cmd ) & VLC_VAR_ISCOMMAND )
{
vlc_value_t val;
int i_ret;
val.psz_string = psz_arg;
/* FIXME: it's a global command, but we should pass the
* local object as an argument, not p_intf->p_libvlc_global. */
i_ret = var_Set( p_intf->p_libvlc_global, psz_cmd, val );
* local object as an argument, not p_intf->p_libvlc. */
i_ret = var_Set( p_intf->p_libvlc, psz_cmd, val );
if( i_ret != 0 )
{
msg_rc( "%s: returned %i (%s)",
......
......@@ -321,58 +321,58 @@ static VLCsFilters *_o_sharedInstance = nil;
}
if( p_input )
var_Set( p_input->p_libvlc_global, "marq-marquee", val );
var_Set( p_input->p_libvlc, "marq-marquee", val );
config_PutPsz( p_intf, "marq-marquee", val.psz_string );
}
else if( sender == o_marq_pos_radio )
{
val.i_int = [[o_marq_pos_radio selectedCell] tag];
if( p_input )
var_Set( p_input->p_libvlc_global, "marq-position", val );
var_Set( p_input->p_libvlc, "marq-position", val );
config_PutInt( p_intf, "marq-position", val.i_int );
}
else if( sender == o_marq_color_pop )
{
val.i_int = strtol( [[[o_colors objectAtIndex: [o_marq_color_pop
indexOfSelectedItem]] objectAtIndex: 1] UTF8String], NULL, 0 );
if( p_input )
var_Set( p_input->p_libvlc_global, "marq-color", val );
var_Set( p_input->p_libvlc, "marq-color", val );
config_PutInt( p_intf, "marq-color", val.i_int );
}
else if( sender == o_marq_opaque_sld )
{
val.i_int = [o_marq_opaque_sld intValue];
if( p_input )
var_Set( p_input->p_libvlc_global, "marq-opacity", val );
var_Set( p_input->p_libvlc, "marq-opacity", val );
config_PutInt( p_intf, "marq-opacity", val.i_int );
}
else if( sender == o_marq_size_pop )
{
val.i_int = [[o_marq_size_pop titleOfSelectedItem] intValue];
if( p_input )
var_Set( p_input->p_libvlc_global, "marq-size", val );
var_Set( p_input->p_libvlc, "marq-size", val );
config_PutInt( p_intf, "marq-size", val.i_int );
}
else if( sender == o_marq_tmOut_fld && [[sender stringValue] length] > 0 )
{
val.i_int = [o_marq_tmOut_fld intValue];
if( p_input )
var_Set( p_input->p_libvlc_global, "marq-timeout", val );
var_Set( p_input->p_libvlc, "marq-timeout", val );
config_PutInt( p_intf, "marq-timeout", val.i_int );
}
......@@ -391,7 +391,7 @@ static VLCsFilters *_o_sharedInstance = nil;
}
if( p_input )
var_Set( p_input->p_libvlc_global, "time-format", val );
var_Set( p_input->p_libvlc, "time-format", val );
config_PutPsz( p_intf, "time-format", val.psz_string );
}
......@@ -401,38 +401,38 @@ static VLCsFilters *_o_sharedInstance = nil;
val.i_int = [[o_time_pos_radio selectedCell] tag];
if( p_input )
var_Set( p_input->p_libvlc_global, "time-position", val );
var_Set( p_input->p_libvlc, "time-position", val );
config_PutInt( p_intf, "time-position", val.i_int );
}
else if( sender == o_time_color_pop )
{
val.i_int = strtol( [[[o_colors objectAtIndex: [o_time_color_pop
indexOfSelectedItem]] objectAtIndex: 1] UTF8String], NULL, 0 );
if( p_input )
var_Set( p_input->p_libvlc_global, "time-color", val );
var_Set( p_input->p_libvlc, "time-color", val );
config_PutInt( p_intf, "time-color", val.i_int );
}
else if( sender == o_time_opaque_sld )
{
val.i_int = [o_time_opaque_sld intValue];
if( p_input )
var_Set( p_input->p_libvlc_global, "time-opacity", val );
var_Set( p_input->p_libvlc, "time-opacity", val );
config_PutInt( p_intf, "time-opacity", val.i_int );
}
else if( sender == o_time_size_pop )
{
val.i_int = [[o_time_size_pop titleOfSelectedItem] intValue];
if( p_input )
var_Set( p_input->p_libvlc_global, "time-size", val );
var_Set( p_input->p_libvlc, "time-size", val );
config_PutInt( p_intf, "time-size", val.i_int );
}
......@@ -443,17 +443,17 @@ static VLCsFilters *_o_sharedInstance = nil;
val.i_int = [o_logo_opaque_sld intValue];
if( p_input )
var_Set( p_input->p_libvlc_global, "logo-transparency", val );
var_Set( p_input->p_libvlc, "logo-transparency", val );
config_PutInt( p_intf, "logo-transparency", val.i_int );
}
else if( sender == o_logo_pos_radio )
{
val.i_int = [[o_logo_pos_radio selectedCell] tag];
if( p_input )
var_Set( p_input->p_libvlc_global, "logo-position", val );
var_Set( p_input->p_libvlc, "logo-position", val );
config_PutInt( p_intf, "logo-position", val.i_int );
}
......@@ -462,7 +462,7 @@ static VLCsFilters *_o_sharedInstance = nil;
val.psz_string = (char *)[[o_logo_image_fld stringValue] UTF8String];
if( p_input )
var_Set( p_input->p_libvlc_global, "logo-file", val );
var_Set( p_input->p_libvlc, "logo-file", val );
config_PutPsz( p_intf, "logo-file", val.psz_string );
}
......
......@@ -61,18 +61,18 @@ static int Signal ( vlc_object_t *, char const *,
*****************************************************************************/
vlc_module_begin();
set_description( _("Miscellaneous stress tests") );
var_Create( p_module->p_libvlc_global, "foo-test",
var_Create( p_module->p_libvlc, "foo-test",
VLC_VAR_VOID | VLC_VAR_ISCOMMAND );
var_AddCallback( p_module->p_libvlc_global, "foo-test", Foo, NULL );
var_Create( p_module->p_libvlc_global, "callback-test",
var_AddCallback( p_module->p_libvlc, "foo-test", Foo, NULL );
var_Create( p_module->p_libvlc, "callback-test",
VLC_VAR_VOID | VLC_VAR_ISCOMMAND );
var_AddCallback( p_module->p_libvlc_global, "callback-test", Callback, NULL );
var_Create( p_module->p_libvlc_global, "stress-test",
var_AddCallback( p_module->p_libvlc, "callback-test", Callback, NULL );
var_Create( p_module->p_libvlc, "stress-test",
VLC_VAR_STRING | VLC_VAR_ISCOMMAND );
var_AddCallback( p_module->p_libvlc_global, "stress-test", Stress, NULL );
var_Create( p_module->p_libvlc_global, "signal",
var_AddCallback( p_module->p_libvlc, "stress-test", Stress, NULL );
var_Create( p_module->p_libvlc, "signal",
VLC_VAR_STRING | VLC_VAR_ISCOMMAND );
var_AddCallback( p_module->p_libvlc_global, "signal", Signal, NULL );
var_AddCallback( p_module->p_libvlc, "signal", Signal, NULL );
vlc_module_end();
/*****************************************************************************
......
......@@ -778,13 +778,13 @@ static void DestroyFilter( vlc_object_t *p_this )
free( p_sys );
/* Delete the logo variables from INPUT */
var_Destroy( p_filter->p_libvlc_global , "logo-file" );
var_Destroy( p_filter->p_libvlc_global , "logo-x" );
var_Destroy( p_filter->p_libvlc_global , "logo-y" );
var_Destroy( p_filter->p_libvlc_global , "logo-delay" );
var_Destroy( p_filter->p_libvlc_global , "logo-repeat" );
var_Destroy( p_filter->p_libvlc_global , "logo-position" );
var_Destroy( p_filter->p_libvlc_global , "logo-transparency" );
var_Destroy( p_filter->p_libvlc, "logo-file" );
var_Destroy( p_filter->p_libvlc, "logo-x" );
var_Destroy( p_filter->p_libvlc, "logo-y" );
var_Destroy( p_filter->p_libvlc, "logo-delay" );
var_Destroy( p_filter->p_libvlc, "logo-repeat" );
var_Destroy( p_filter->p_libvlc, "logo-position" );
var_Destroy( p_filter->p_libvlc, "logo-transparency" );
}
/*****************************************************************************
......
......@@ -64,7 +64,7 @@ vlc_module_begin();
set_shortname( _( "OpenCV example" ));
set_capability( "opencv example", 1 );
add_shortcut( "opencv_example" );
set_category( CAT_VIDEO );
set_subcategory( SUBCAT_VIDEO_VFILTER2 );
set_callbacks( OpenFilter, CloseFilter );
......@@ -89,7 +89,7 @@ static int OpenFilter( vlc_object_t *p_this )
msg_Err( p_filter, "out of memory" );
return VLC_EGENERIC;
}
//init the video_filter_event_info_t struct
p_sys->event_info.i_region_size = 0;
p_sys->event_info.p_region = NULL;
......@@ -99,11 +99,11 @@ static int OpenFilter( vlc_object_t *p_this )
//create the VIDEO_FILTER_EVENT_VARIABLE
vlc_value_t val;
if (var_Create( p_filter->p_libvlc_global, VIDEO_FILTER_EVENT_VARIABLE, VLC_VAR_ADDRESS | VLC_VAR_DOINHERIT ) != VLC_SUCCESS)
if (var_Create( p_filter->p_libvlc, VIDEO_FILTER_EVENT_VARIABLE, VLC_VAR_ADDRESS | VLC_VAR_DOINHERIT ) != VLC_SUCCESS)
msg_Err( p_filter, "Could not create %s\n", VIDEO_FILTER_EVENT_VARIABLE);
val.p_address = &(p_sys->event_info);
if (var_Set( p_filter->p_libvlc_global, VIDEO_FILTER_EVENT_VARIABLE, val )!=VLC_SUCCESS)
if (var_Set( p_filter->p_libvlc, VIDEO_FILTER_EVENT_VARIABLE, val )!=VLC_SUCCESS)
msg_Err( p_filter, "Could not set %s\n", VIDEO_FILTER_EVENT_VARIABLE);
//OpenCV init specific to this example
......@@ -121,7 +121,7 @@ static void CloseFilter( vlc_object_t *p_this )
{
filter_t *p_filter = (filter_t*)p_this;
filter_sys_t *p_sys = p_filter->p_sys;
if( p_filter->p_sys->p_cascade )
cvReleaseHaarClassifierCascade( &p_filter->p_sys->p_cascade );
......@@ -133,7 +133,7 @@ static void CloseFilter( vlc_object_t *p_this )
free( p_sys );
var_Destroy( p_filter->p_libvlc_global, VIDEO_FILTER_EVENT_VARIABLE);
var_Destroy( p_filter->p_libvlc, VIDEO_FILTER_EVENT_VARIABLE);
}
/****************************************************************************
......@@ -225,11 +225,11 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
}
if (faces && (faces->total > 0)) //raise the video filter event
var_Change( p_filter->p_libvlc_global, VIDEO_FILTER_EVENT_VARIABLE, VLC_VAR_TRIGGER_CALLBACKS, NULL, NULL );
var_Change( p_filter->p_libvlc, VIDEO_FILTER_EVENT_VARIABLE, VLC_VAR_TRIGGER_CALLBACKS, NULL, NULL );
}
else
msg_Err( p_filter, "No cascade - is opencv-haarcascade-file valid?" );
return p_pic;
}
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