How does GStreamer load static plugins?

Nikos Chantziaras realnc at gmail.com
Wed Jun 5 08:06:48 PDT 2013


On 05/06/13 09:33, Sebastian Dröge wrote:
> On Mi, 2013-06-05 at 04:21 +0300, Nikos Chantziaras wrote:
>> On 03/06/13 00:28, Sebastian Dröge wrote:
>>> On So, 2013-06-02 at 13:58 +0300, Nikos Chantziaras wrote:
>>>> I'm not able to find any documentation on this.  How would I use
>>>> GStreamer in an application that has GStreamer itself as well the
>>>> plugins linked-in statically?  And for that matter, how would I link it
>>>> correctly?  Are the pkg-config files enough, or should I instead
>>>> manually link-in every plugin?
>>>
>>> You need to manually link in every single plugin that is going to be
>>> used by your application and manually register it with
>>> GST_PLUGIN_STATIC_DECLARE() and GST_PLUGIN_STATIC_REGISTER().
>>
>> I've been battling with this for quite a while now.  I've successfully
>> built gstreamer 0.10 from the SDK source repo, so I've now got those
>> macros.  I used the "--enable-static-plugins" option when building.
>>
>> But no matter what I do, I get "undefined reference" linker errors.
>>  [...]
>>     gcc `pkg-config gstreamer-0.10 --cflags` main.c \
>>       `pkg-config gstreamer-0.10 --libs` \
>>       `pkg-config gstreamer-plugins-base-0.10 --libs` \
>>       -L/prefix/usr/lib/gstreamer-0.10 -lgstcoreelements
>>
>> And even that produces the same "undefined reference" error.
>
> That's exactly what you need to do, yes. What's the linker error you
> get, what's the complete compiler output?

I found the problem.  I was not running ./autogen.sh before building.  I 
didn't realize that ./common is a Git submodule.  So I was building with 
an outdated ./common and this resulted in plugins not even having a 
register function.


More information about the gstreamer-devel mailing list