mpeg2dec: allow per feature registration
authorStéphane Cerveau <scerveau@collabora.com>
Mon, 29 Mar 2021 10:31:26 +0000 (12:31 +0200)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Mon, 29 Mar 2021 19:13:36 +0000 (19:13 +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-ugly/-/merge_requests/79>

ext/mpeg2dec/gstmpeg2dec.c
ext/mpeg2dec/gstmpeg2dec.h

index 36f68db..8f6ae84 100644 (file)
@@ -62,6 +62,8 @@ GST_STATIC_PAD_TEMPLATE ("src",
 
 #define gst_mpeg2dec_parent_class parent_class
 G_DEFINE_TYPE (GstMpeg2dec, gst_mpeg2dec, GST_TYPE_VIDEO_DECODER);
+GST_ELEMENT_REGISTER_DEFINE (mpeg2dec, "mpeg2dec", GST_RANK_SECONDARY,
+    GST_TYPE_MPEG2DEC);
 
 static void gst_mpeg2dec_finalize (GObject * object);
 
@@ -1160,11 +1162,7 @@ done:
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
-  if (!gst_element_register (plugin, "mpeg2dec", GST_RANK_SECONDARY,
-          GST_TYPE_MPEG2DEC))
-    return FALSE;
-
-  return TRUE;
+  return GST_ELEMENT_REGISTER (mpeg2dec, plugin);
 }
 
 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
index f88459e..3ae4b7b 100644 (file)
@@ -83,6 +83,7 @@ struct _GstMpeg2decClass {
 };
 
 GType gst_mpeg2dec_get_type(void);
+GST_ELEMENT_REGISTER_DECLARE (mpeg2dec);
 
 G_END_DECLS