monoscope: allow per feature registration
authorStéphane Cerveau <scerveau@collabora.com>
Tue, 16 Feb 2021 16:27:12 +0000 (17:27 +0100)
committerStéphane Cerveau <scerveau@collabora.com>
Mon, 29 Mar 2021 10:45:23 +0000 (12:45 +0200)
Split plugin into features including
dynamic types 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-plugins-good/-/merge_requests/876>

gst/monoscope/gstmonoscope.c
gst/monoscope/gstmonoscope.h

index 6ecf6bb..867e7ec 100644 (file)
@@ -75,6 +75,10 @@ static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink",
 
 #define gst_monoscope_parent_class parent_class
 G_DEFINE_TYPE (GstMonoscope, gst_monoscope, GST_TYPE_ELEMENT);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (monoscope, "monoscope",
+    GST_RANK_NONE, GST_TYPE_MONOSCOPE,
+    GST_DEBUG_CATEGORY_INIT (monoscope_debug, "monoscope", 0,
+        "monoscope element"););
 
 static void gst_monoscope_finalize (GObject * object);
 static GstFlowReturn gst_monoscope_chain (GstPad * pad, GstObject * parent,
@@ -583,11 +587,8 @@ gst_monoscope_change_state (GstElement * element, GstStateChange transition)
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
-  GST_DEBUG_CATEGORY_INIT (monoscope_debug, "monoscope", 0,
-      "monoscope element");
+  return GST_ELEMENT_REGISTER (monoscope, plugin);
 
-  return gst_element_register (plugin, "monoscope",
-      GST_RANK_NONE, GST_TYPE_MONOSCOPE);
 }
 
 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
index da23327..f8f8211 100644 (file)
@@ -78,6 +78,8 @@ struct _GstMonoscopeClass
 
 GType gst_monoscope_get_type (void);
 
+GST_ELEMENT_REGISTER_DECLARE (monoscope);
+
 G_END_DECLS
 
 #endif /* __GST_MONOSCOPE__ */