[vlc-devel] [PATCH] logo.c add support for item-specific options

Robert Stepanek rost at lo-res.org
Mon Jan 15 19:28:22 CET 2007


Hello,

attached is a small svn diff for logo.c to add support for item  
specific options. In the current SVN it is not possible to set  
parameters like --logo-file for each media time individually by using  
the :option=value syntax. As a consequence it is not possible to set  
the logo-file per media item when setting up vod streams in VLM  
(which is my use case).

This is due to the CreateFilter routine in which logo checks for it's  
parameters by use of the global vlc instance, e.g. to retrieve the  
"logo-file" parameter the following call is made:

var_CreateGetString( p_filter->p_libvlc_global , "logo-file" );

I replaced all occurences of these calls with calls like:
var_CreateGetString( p_this , "logo-file" );

and it works fine for my local build.

I tested the changed code with the following use cases:
Test 1: setting up the logo-file parameters using the "set Foo option  
logo-file=/whereever/bar.png" syntax in VLM:
Result: each media item now contains the logo file as specified in  
the media option.

Test 2: setting up the logo-file parameters in some media items using  
VLM but omitting it in others (which still call the logo sfilter  
using transcode) and calling vlc with --logo-file=/foo/bar.png on the  
command line:
the media specific logo files are overlayed but the ones with no  
extra "set Foo option" line use the global logo-file parameter

Test 3: setting up no media item in VLM with media specific logo- 
files but calling vlc with a global --logo-file option
Result: All logo filter instances use the global logo-file parameter  
as it is done currently.

Some remarks:
I am quite a novice on VLC hacking so I hope that using p_this at  
this point is not a dangerous/stupid thing to do. I just replicated  
what's done in the Create() routines of vfilters.

The same pattern occurs in files like mosaic.c. I did not change  
anything there since I have no experience using this filter and more  
importantly it seems a bit more tricky since the mosaic filter  
creates mutexes in libvlc_global.

Hope it helps,
regards,
Robert

-------------- next part --------------
A non-text attachment was scrubbed...
Name: logo.c-svndiff
Type: application/octet-stream
Size: 3525 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20070115/7bfb927a/attachment.obj>


More information about the vlc-devel mailing list