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

This forum is about all development around libVLC.
QcMrHyde
New Cone
New Cone
Posts: 6
Joined: 29 May 2019 22:35

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

Postby QcMrHyde » 30 May 2019 05:42

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.

Rémi Denis-Courmont
Developer
Developer
Posts: 15267
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

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

Postby Rémi Denis-Courmont » 30 May 2019 09:40

$libdir/vlc/plugins
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

QcMrHyde
New Cone
New Cone
Posts: 6
Joined: 29 May 2019 22:35

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

Postby QcMrHyde » 30 May 2019 18:55

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! ;)

unidan
Developer
Developer
Posts: 1493
Joined: 25 Mar 2018 01:00

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

Postby unidan » 01 Jun 2019 18:40

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.

QcMrHyde
New Cone
New Cone
Posts: 6
Joined: 29 May 2019 22:35

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

Postby QcMrHyde » 03 Jun 2019 18:49

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

unidan
Developer
Developer
Posts: 1493
Joined: 25 Mar 2018 01:00

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

Postby unidan » 03 Jun 2019 19:00

Did you checked include/vlc_plugin.h ?

QcMrHyde
New Cone
New Cone
Posts: 6
Joined: 29 May 2019 22:35

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

Postby QcMrHyde » 03 Jun 2019 20:09

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.

QcMrHyde
New Cone
New Cone
Posts: 6
Joined: 29 May 2019 22:35

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

Postby QcMrHyde » 04 Jun 2019 00:15

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.

unidan
Developer
Developer
Posts: 1493
Joined: 25 Mar 2018 01:00

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

Postby unidan » 04 Jun 2019 11:27

Hi, can you show your module declaration ?

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


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 6 guests