Postby Erwan100 » 10 Oct 2008 03:38
Hi,
You can do something along this line :
1) play a media with an option like : "--video-filter=adjust@my_label"
2) retrieve the internal reference to the first object libvlc
int object_id = libvlc_get_vlc_id( p_vlc_instance );
vlc_object_t* p_libvlc = (vlc_object_t *) vlc_object_get ( object_id );
3) retrieve the filter object named my_label
vlc_object_t* p_filter = (vlc_object_t *) vlc_object_find_name( p_libvlc, "my_label", FIND_CHILD );
4) Get or Set the variables associated with this object, for example :
int hue = var_GetInteger ( p_filter, "hue" )
var_SetInteger(( p_filter, "hue", new_hue )
The variables available for this filter are the following :
(excerpt from the command "vars my_label" from the rc interface)
o 00000739 filter "my_label", refcount 2, parent 731
|-o "brightness" (float), command, 1 callbacks: 1.000000
|-o "gamma" (float), command, 1 callbacks: 1.000000
|-o "hue" (integer), command, 1 callbacks: 0
|-o "saturation" (float), command, 1 callbacks: 1.000000
|-o "brightness-threshold" (bool), command, 1 callbacks: false
`-o "contrast" (float), command, 1 callbacks: 1.000000
each type float, integer or boolean has got its own var_Getxxx/varSetxxx functions.
the @my_label is optional but it makes it simpler to address the right filter should you use several inputs.
Actually, this method addresses a lot of issues not directly accessible through the libvlc API.