diff options
author | Stéphane Cerveau <scerveau@collabora.com> | 2020-12-10 15:02:12 +0100 |
---|---|---|
committer | Stéphane Cerveau <scerveau@collabora.com> | 2020-12-10 17:03:19 +0100 |
commit | 37f3a0362625054840ee1c137ec7e8e90288000a (patch) | |
tree | f69e1efb87910d3e25d8c1cd2e2637bde317d386 | |
parent | d80bfacde35f027c6221516f9996c579df6d3ea7 (diff) |
gst-plugin: allow per feature registration
Split plugin into features including
typefind functions which can be indiviually
registered during a static build.
More details here:
https://gitlab.freedesktop.org/gstreamer/gst-build/-/merge_requests/199
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/661
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-template/-/merge_requests/6>
-rw-r--r-- | gst-plugin/src/gstaudiofilter.c | 6 | ||||
-rw-r--r-- | gst-plugin/src/gstplugin.c | 5 | ||||
-rw-r--r-- | gst-plugin/src/gsttransform.c | 5 |
3 files changed, 10 insertions, 6 deletions
diff --git a/gst-plugin/src/gstaudiofilter.c b/gst-plugin/src/gstaudiofilter.c index 2e4af9a..894a529 100644 --- a/gst-plugin/src/gstaudiofilter.c +++ b/gst-plugin/src/gstaudiofilter.c @@ -96,6 +96,9 @@ enum G_DEFINE_TYPE (GstAudioFilterTemplate, gst_audio_filter_template, GST_TYPE_AUDIO_FILTER); +GST_ELEMENT_REGISTER_DEFINE (audiofiltertemplate, "audiofiltertemplate", + GST_RANK_NONE, GST_TYPE_AUDIO_FILTER_TEMPLATE); + static void gst_audio_filter_template_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec); static void gst_audio_filter_template_get_property (GObject * object, @@ -305,8 +308,7 @@ plugin_init (GstPlugin * plugin) "Audio filter template example"); /* This is the name used in gst-launch-1.0 and gst_element_factory_make() */ - return gst_element_register (plugin, "audiofiltertemplate", GST_RANK_NONE, - GST_TYPE_AUDIO_FILTER_TEMPLATE); + return GST_ELEMENT_REGISTER (audiofiltertemplate, plugin); } /* gstreamer looks for this structure to register plugins diff --git a/gst-plugin/src/gstplugin.c b/gst-plugin/src/gstplugin.c index 3ee7e72..cb6305f 100644 --- a/gst-plugin/src/gstplugin.c +++ b/gst-plugin/src/gstplugin.c @@ -99,6 +99,8 @@ static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src", #define gst_plugin_template_parent_class parent_class G_DEFINE_TYPE (GstPluginTemplate, gst_plugin_template, GST_TYPE_ELEMENT); +GST_ELEMENT_REGISTER_DEFINE (myfirstplugin, "myfirstplugin", GST_RANK_NONE, + GST_TYPE_PLUGIN); static void gst_plugin_template_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec); @@ -261,8 +263,7 @@ plugin_init (GstPlugin * plugin) GST_DEBUG_CATEGORY_INIT (gst_plugin_template_debug, "plugin", 0, "Template plugin"); - return gst_element_register (plugin, "plugin", GST_RANK_NONE, - GST_TYPE_PLUGIN_TEMPLATE); + return GST_ELEMENT_REGISTER (myfirstplugin, plugin); } /* PACKAGE: this is usually set by meson depending on some _INIT macro diff --git a/gst-plugin/src/gsttransform.c b/gst-plugin/src/gsttransform.c index 9bbc3fa..984a132 100644 --- a/gst-plugin/src/gsttransform.c +++ b/gst-plugin/src/gsttransform.c @@ -76,6 +76,8 @@ static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src", #define gst_plugin_template_parent_class parent_class G_DEFINE_TYPE (GstPluginTemplate, gst_plugin_template, GST_TYPE_BASE_TRANSFORM); +GST_ELEMENT_REGISTER_DEFINE (myfirstplugin, "myfirstplugin", GST_RANK_NONE, + GST_TYPE_PLUGIN); static void gst_plugin_template_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec); @@ -195,8 +197,7 @@ gst_plugin_template_transform_ip (GstBaseTransform * base, GstBuffer * outbuf) static gboolean plugin_init (GstPlugin * plugin) { - return gst_element_register (plugin, "plugin", GST_RANK_NONE, - GST_TYPE_PLUGIN_TEMPLATE); + return GST_ELEMENT_REGISTER (myfirstplugin, plugin); } /* gstreamer looks for this structure to register plugins |