audiorate: allow per feature registration
authorStéphane Cerveau <scerveau@collabora.com>
Mon, 29 Mar 2021 12:06:00 +0000 (14:06 +0200)
committerStéphane Cerveau <scerveau@collabora.com>
Mon, 29 Mar 2021 12:06:00 +0000 (14:06 +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-base/-/merge_requests/1089>

gst/audiorate/gstaudiorate.c
gst/audiorate/gstaudiorate.h

index e3d218f..bcb35f0 100644 (file)
@@ -138,6 +138,9 @@ static GParamSpec *pspec_add = NULL;
 
 #define gst_audio_rate_parent_class parent_class
 G_DEFINE_TYPE (GstAudioRate, gst_audio_rate, GST_TYPE_ELEMENT);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (audiorate, "audiorate", GST_RANK_NONE,
+    GST_TYPE_AUDIO_RATE, GST_DEBUG_CATEGORY_INIT (audio_rate_debug, "audiorate",
+        0, "AudioRate stream fixer"));
 
 static void
 gst_audio_rate_class_init (GstAudioRateClass * klass)
@@ -782,11 +785,7 @@ gst_audio_rate_change_state (GstElement * element, GstStateChange transition)
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
-  GST_DEBUG_CATEGORY_INIT (audio_rate_debug, "audiorate", 0,
-      "AudioRate stream fixer");
-
-  return gst_element_register (plugin, "audiorate", GST_RANK_NONE,
-      GST_TYPE_AUDIO_RATE);
+  return GST_ELEMENT_REGISTER (audiorate, plugin);
 }
 
 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
index 84e401b..1c8fd16 100644 (file)
@@ -60,6 +60,7 @@ struct _GstAudioRate
   /* we output TIME format on the src */
   GstSegment src_segment;
 };
+GST_ELEMENT_REGISTER_DECLARE (audiorate);
 
 G_END_DECLS