wpe: allow per feature registration
authorStéphane Cerveau <scerveau@collabora.com>
Thu, 25 Feb 2021 08:45:10 +0000 (09:45 +0100)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Tue, 23 Mar 2021 14:19:17 +0000 (14:19 +0000)
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-bad/-/merge_requests/2038>

ext/wpe/gstwpesrc.cpp
ext/wpe/gstwpesrc.h

index ebdeae6..fa1a1ca 100644 (file)
@@ -142,7 +142,10 @@ static void gst_wpe_src_uri_handler_init (gpointer iface, gpointer data);
 
 #define gst_wpe_src_parent_class parent_class
 G_DEFINE_TYPE_WITH_CODE (GstWpeSrc, gst_wpe_src, GST_TYPE_GL_BASE_SRC,
-    G_IMPLEMENT_INTERFACE (GST_TYPE_URI_HANDLER, gst_wpe_src_uri_handler_init));
+    G_IMPLEMENT_INTERFACE (GST_TYPE_URI_HANDLER, gst_wpe_src_uri_handler_init);
+    GST_DEBUG_CATEGORY_INIT (wpe_src_debug, "wpesrc", 0, "WPE Source"););
+GST_ELEMENT_REGISTER_DEFINE (wpesrc, "wpesrc", GST_RANK_NONE,
+      GST_TYPE_WPE_SRC);
 
 #if ENABLE_SHM_BUFFER_SUPPORT
 #define WPE_RAW_CAPS "; video/x-raw, "          \
@@ -767,10 +770,9 @@ gst_wpe_src_class_init (GstWpeSrcClass * klass)
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
-  GST_DEBUG_CATEGORY_INIT (wpe_src_debug, "wpesrc", 0, "WPE Source");
 
-  return gst_element_register (plugin, "wpesrc", GST_RANK_NONE,
-      GST_TYPE_WPE_SRC);
+
+  return GST_ELEMENT_REGISTER (wpesrc, plugin);
 }
 
 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, GST_VERSION_MINOR,
index 81e87ba..1368077 100644 (file)
@@ -41,6 +41,8 @@ struct _GstWpeSrcClass
 
 GType gst_wpe_src_get_type (void);
 
+GST_ELEMENT_REGISTER_DECLARE (wpesrc);
+
 void gst_wpe_src_configure_web_view(GstWpeSrc * src, WebKitWebView * webview);
 
 G_END_DECLS