Need a help to build custom VLC codec plugins via CMake

For questions and discussion that is NOT (I repeat NOT) specific to a certain Operating System.
User avatar
Wohlstand
Blank Cone
Blank Cone
Posts: 16
Joined: 12 Apr 2018 15:57
VLC version: 3.0.9.2
Operating System: Linux Mint 20.1
Location: Moscow, Russia

Need a help to build custom VLC codec plugins via CMake

Postby Wohlstand » 12 Apr 2018 16:11

Hello!

I have the audio library of custom MIDI player which uses a set of emulated YMF262 chips. For it I have made the VLC plugin which successfully compiling through autotools and copied binary into /usr/lib/vlc/plugins/codec works fine in VLC 2.2.2 I have installed into my system.

https://github.com/Wohlstand/libADLMIDI ... /vlc_codec

I trying to make it be buildable via CMake build system:
https://github.com/Wohlstand/libADLMIDI ... #L431-L464

However, built binary don't want work in the VLC by unknown reason for me yet. I linking my library statically.
What I did wrong or what I have missed up?
Can you explain or refer the documentation how to correctly compile the codec plugin for VLC? I mean not via autotools. I.e. What I must to link or do NOT link, which compiler/linker flags are required to make the codec plugin work fine?

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

Re: Need a help to build custom VLC codec plugins via CMake

Postby Rémi Denis-Courmont » 12 Apr 2018 17:13

You can get the necessary link options normally:

Code: Select all

pkg-config --libs vlc-plugin
But first, you should check if VLC finds the plugin:

Code: Select all

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

User avatar
Wohlstand
Blank Cone
Blank Cone
Posts: 16
Joined: 12 Apr 2018 15:57
VLC version: 3.0.9.2
Operating System: Linux Mint 20.1
Location: Moscow, Russia

Re: Need a help to build custom VLC codec plugins via CMake

Postby Wohlstand » 12 Apr 2018 19:13

I had no troubles with linked libraries, but vlc --list -v usually returned absence of my plugin when it was built via CMake.
Anyway, I just now have checked pkg-config's --cflags, and I have found this:

$ pkg-config --cflags vlc-plugin

Code: Select all

-D__PLUGIN__ -D_FILE_OFFSET_BITS=64 -D_REENTRANT -D_THREAD_SAFE -I/usr/include/vlc/plugins
And then I have changed my CMake script to use vlc-plugin's setup and macros right:
https://github.com/Wohlstand/libADLMIDI ... ec6834dccc
Then, CMake-built plugin is finally shown in the vlc --list -v output and playing the music!

So, the reason why my plugin wasn't worked is a missing of a set of important macros are was given by pkg-config of vlc-plugin.

Thank you for a help! :D


Return to “General VLC media player Troubleshooting”

Who is online

Users browsing this forum: Google [Bot] and 6 guests