[vlc-devel] Filters in libvlc

Lukas Durfina lukas.durfina at gmail.com
Thu Jun 19 09:37:32 CEST 2008

>  Yes, dionoea is right, I am working on a filter API for libvlc. I need
>  access to 4 filters: adjust, marq, logo and magnify.
>  I have taken a look at your code. And again dionoea is right: your
>  approach in get_adjust_module will remove any other filters that may
>  be present. But dionoea's filter API makes it easy to fix that. This
>  API works great and is easy to use. I will post my code for the adjust
>  filter in videolan's pastebin so you can take a quick look and see how
>  the filter API is used. Its here: http://paste.videolan.org/4339

I review that, and have some comments:
libvlc_video_add_adjust() => maybe we should make function:
libvlc_activate_video_filter(char *psz_filter) than it would be more
general and we can have some array with video filter names
I dont if it is usefull to apply one filter twice or more times, if not
it can also control applied filters to avoid adding them twice.

Next point, some variables in filters are floats (brightness,
contrast, gamma and
saturation) and int is only hue, and parameter "float i_gamma" is a a bit
confusing and bad readable....

Anyway I will try to commit changes to my repo often to make it
available for comments and maybe testing.

>  What I have been trying to do for persistence, is add code to the
>  filter API  to also save filters to the config. The code I have done
>  is here: http://paste.videolan.org/4341 It works partly, the filter
>  stays even when vout is deleted and recreated, but the options to the
>  filter are lost. This code must be called at the end of
>  filter_chain_AppendFilter and filter_chain_DeleteFilter. But, has
>  dionoea pointed out, it is more a patch/kludge than a real solution.
>  My problem is that my knowledge of the inner workings of VLC is
>  extremely limited and I hit a brick wall rather quickly.

I am not sure, but wouldnt it be better if we handle filters and
options by some internal (static) functions in libvlc?

>  I hope I am helping. Please ask all the questions you may have, I am
>  glad if my little experience in this can be of help to you. Of course,
>  only one API for filters is needed, since you are embarking on a GSoC
>  project I will let you take the lead. But I will be glad to help you
>  out. We should communicate and combine our efforts as much as
>  possible.

At this moment I would appreciate something for testing that, because
I have only phonon backend for testing and it supports only adjust
options and what is worse, backend is broken now.
So if you have some program for testing that, it would help
me a lot.


More information about the vlc-devel mailing list