plugin: Unify static and dynamic plugin interface
authorNicolas Dufresne <nicolas.dufresne@collabora.com>
Tue, 28 Feb 2017 02:38:11 +0000 (21:38 -0500)
committerNicolas Dufresne <nicolas.dufresne@collabora.com>
Tue, 9 May 2017 12:48:19 +0000 (08:48 -0400)
commite7ede5a487d8c1571a4387a5f8eeb4d5e73a9553
treef31636d07d474adf023bdcf2faba847d44aa914d
parent04a0eace30a790a6ad491ebbf3c28ae3cac43f5d
plugin: Unify static and dynamic plugin interface

This patch changes the entry point of each plugin in order to unify the
interface for static and dynamic plugin. What we do is replace the
current static plugin interface and extend the dymamic one. The plugin
entry was a C structure, name "gst_plugin_desc". With this patch, the
interface is now:

  GstPpluginDesc *gst_plugin_<name>_get_desc(void);

The reason we change the C structure into function, is that it is
potentially more common to have function pointers, avoiding possible
binding language limitation. Additionally to that. This change prevents
the symbols from clashing between plugins, allowing to build once the
plugin (assuming you have -fPIC).

On the plugin loader side, we symply derive the shared object basename
to extract the plugin name. If this symbol is not found, we fallback to
gst_plugin_desc for backward compatibility.

This has one side effect, which is that the shared objects now need to
be named after their plugin name. This is generally the case with few
exceptions. The benifit of this limitation is that you can control the
gst_plugin_<name>_desc clash at file level.

https://bugzilla.gnome.org/show_bug.cgi?id=779344
gst/gst_private.h
gst/gstplugin.c
gst/gstplugin.h