Page 1 of 1

Adding an "out of tree" module to VLC (.so file)

Posted: 30 May 2019 05:42
by QcMrHyde
I just built the "Hello" module example on the Wiki, compiled like the OutOfTreeCompilation page explains, but I can't find the place were to put the resulting libfoo_plugin.so file to see the module in VLC. When I search for answers on the net, I can only find examples on how to add .lua extensions to VLC. Can anyone help? Thanks!

PS: I'm on Ubuntu, in case it changes anything.

Re: Adding an "out of tree" module to VLC (.so file)

Posted: 30 May 2019 09:40
by RĂ©mi Denis-Courmont
$libdir/vlc/plugins

Re: Adding an "out of tree" module to VLC (.so file)

Posted: 30 May 2019 18:55
by QcMrHyde
OK, I see my mistake. I had probably old traces of some other version of VLC and I was putting the plugin in the wrong libdir, for those who are curious mine is "/usr/lib/x86_64-linux-gnu/vlc/plugins". Now, the only thing I need left is to set VLC_MODULE_CAPABILITY and VLC_MODULE_SCORE but I don't know where to do that for OutOfTree modules. I've seen a module setting it in the code via the module struct in vlc_module_create() so I was wondering what is the best practice. Do I only (re)define VLC_MODULE_CAPABILITY and VLC_MODULE_SCORE in my module code or I set it via the module struct (or something else)? Merci! ;)

Re: Adding an "out of tree" module to VLC (.so file)

Posted: 01 Jun 2019 18:40
by unidan
Hi, did you check other modules' code ? you can use macro to declare your module and set capability/score, or look at what they do.

Re: Adding an "out of tree" module to VLC (.so file)

Posted: 03 Jun 2019 18:49
by QcMrHyde
When I define VLC_MODULE_CAPABILITY and VLC_MODULE_SCORE in my code, only VLC_MODULE_SCORE changes in VLC. When I search VLC_MODULE_CAPABILITY in the Github, not a single line of code #define it. So I was asking what's the best practice to set them since I always get "none" as the module capability once loaded in VLC.

Edit: When I use set_capability("stream_filter", 1), VLC doesn't start

Re: Adding an "out of tree" module to VLC (.so file)

Posted: 03 Jun 2019 19:00
by unidan
Did you checked include/vlc_plugin.h ?

Re: Adding an "out of tree" module to VLC (.so file)

Posted: 03 Jun 2019 20:09
by QcMrHyde
I did, include/vlc_plugin.h seems to define set_capability(), which doesn't work for me when I use it. I think it's due to the fact that I'm compiling OutOfTree but at this point it's all guesses since I don't have any feedback from VLC. I thought my VLC_MODULE_SCORE was getting set but finally I always get default score 1 and "none" as capability. I guess nobody does modules "OutOfTree" and actually use them or at least they don't publish the code online.

Re: Adding an "out of tree" module to VLC (.so file)

Posted: 04 Jun 2019 00:15
by QcMrHyde
OK, I was adding the wrong header for the capability I've chosen. Now, I can see my module with the good score and capability in the modules list but it never gets loaded in the module tree, whatever the score I put in. Is there any reason why it doesn't get loaded even with the highest score even if it's recognized as a functional module? ...I say it is "functional" because VLC wouldn't start if there was a problem with the modules setting and now it does.

Re: Adding an "out of tree" module to VLC (.so file)

Posted: 04 Jun 2019 11:27
by unidan
Hi, can you show your module declaration ?

Do you have it in plugin list ? (plugin window with Qt, or vlc -l)