y4m: allow per feature registration
authorStéphane Cerveau <scerveau@collabora.com>
Tue, 16 Feb 2021 16:34:34 +0000 (17:34 +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/y4m/gsty4mencode.c
gst/y4m/gsty4mencode.h

index e4a1e60..16890e7 100644 (file)
@@ -84,7 +84,8 @@ static gboolean gst_y4m_encode_set_format (GstVideoEncoder * encoder,
 
 #define gst_y4m_encode_parent_class parent_class
 G_DEFINE_TYPE (GstY4mEncode, gst_y4m_encode, GST_TYPE_VIDEO_ENCODER);
-
+GST_ELEMENT_REGISTER_DEFINE (y4menc, "y4menc", GST_RANK_PRIMARY,
+    GST_TYPE_Y4M_ENCODE);
 
 static void
 gst_y4m_encode_class_init (GstY4mEncodeClass * klass)
@@ -301,8 +302,7 @@ gst_y4m_encode_change_state (GstElement * element, GstStateChange transition)
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
-  return gst_element_register (plugin, "y4menc", GST_RANK_PRIMARY,
-      GST_TYPE_Y4M_ENCODE);
+  return GST_ELEMENT_REGISTER (y4menc, plugin);
 }
 
 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
index 13a7a1b..77c5edd 100644 (file)
@@ -59,6 +59,8 @@ struct _GstY4mEncodeClass {
 
 GType gst_y4m_encode_get_type(void);
 
+GST_ELEMENT_REGISTER_DECLARE (y4menc);
+
 G_END_DECLS
 
 #endif /* __GST_Y4MENCODE_H__ */