[vlc-devel] Re: vlc-python again

Vaclav Koldus vaclav.koldus at avpark.cz
Sun Nov 27 16:20:34 CET 2005


Clément Stenac wrote:

>Hello,
>
>configuration data is not meant to be changed "on the fly", which
>explains why you need to use the hack of recreating the variables and
>inheriting its value.
>
>You can use the "variables" mechanism, which can be used on the fly, so
>instead of :
>
>  
>
>>  vo.config_set("vt-render",1)
>>    
>>
>
>use :
>
>vo.set( "vt-render", 1 )
>
>To get the updated variable, you can either use 
>* var_Get( p_vout, "vt-render", &val ); at each frame
>  (btw, there is a "shortcut" for this :
>    p_sys->render = var_GetInteger( p_vout, "vt-render" );
>* a callback
>  You need to: 
>   * Write the callback function
>    like 
>  
>
>>	static int VTRenderCallaback( vlc_object_t*p_this,
>>				      const char *psz_cmd,
>>				      vlc_value_t old,
>>			              vlc_value_t new,
>>				      void *p_data )
>>	{
>>		vout_thread_sys_t *p_sys = (vout_thread_sys_t*)p_data;
>>		p_sys->render = new.i_int;
>>	}
>>    
>>
>
>   * Add the callback and tell VLC that you want p_sys to be passed to  
>     the callback, so in your Open function of the filter, add:  
>  
>
>>	var_AddCallback( p_vout, "vt-render", VTRenderCallback, p_sys );
>>    
>>
>   * Remove the callback in the Close function
>  
>
>>       var_DelCallback( p_vout, "vt-render", VTRenderCallback,
>>    
>>
>p_sys );
>
>Hope this helps,
>
>  
>
This is just perfect.
Thanks a lot!

Vaclav

-- 
This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://developers.videolan.org/lists.html



More information about the vlc-devel mailing list