openaptx: allow per feature registration
authorStéphane Cerveau <scerveau@collabora.com>
Thu, 18 Feb 2021 09:58:28 +0000 (10:58 +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/openaptx/gstopenaptxdec.c
ext/openaptx/gstopenaptxdec.h
ext/openaptx/gstopenaptxenc.c
ext/openaptx/gstopenaptxenc.h
ext/openaptx/openaptx-plugin.c

index 8a61eba..5d08353 100644 (file)
@@ -54,6 +54,8 @@ GST_DEBUG_CATEGORY_STATIC (openaptx_dec_debug);
 
 #define parent_class gst_openaptx_dec_parent_class
 G_DEFINE_TYPE (GstOpenaptxDec, gst_openaptx_dec, GST_TYPE_AUDIO_DECODER);
+GST_ELEMENT_REGISTER_DEFINE (openaptxdec, "openaptxdec", GST_RANK_NONE,
+    GST_TYPE_OPENAPTX_DEC);
 
 static GstStaticPadTemplate openaptx_dec_sink_factory =
     GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_SINK, GST_PAD_ALWAYS,
index bcc9891..95b126c 100644 (file)
@@ -40,6 +40,8 @@ struct _GstOpenaptxDec {
   struct aptx_context *aptx_c;
 };
 
+GST_ELEMENT_REGISTER_DECLARE (openaptxdec)
+
 G_END_DECLS
 
 #endif /* __GST_OPENAPTXDEC_H__ */
index 7d38c98..db054ab 100644 (file)
@@ -49,6 +49,8 @@ GST_DEBUG_CATEGORY_STATIC (openaptx_enc_debug);
 #define gst_openaptx_enc_parent_class parent_class
 
 G_DEFINE_TYPE (GstOpenaptxEnc, gst_openaptx_enc, GST_TYPE_AUDIO_ENCODER);
+GST_ELEMENT_REGISTER_DEFINE (openaptxenc, "openaptxenc", GST_RANK_NONE,
+    GST_TYPE_OPENAPTX_ENC);
 
 static GstStaticPadTemplate openaptx_enc_sink_factory =
 GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_SINK, GST_PAD_ALWAYS,
index 48bc5af..ab80b61 100644 (file)
@@ -39,6 +39,8 @@ struct _GstOpenaptxEnc {
   struct aptx_context *aptx_c;
 };
 
+GST_ELEMENT_REGISTER_DECLARE(openaptxenc);
+
 G_END_DECLS
 
 #endif /* __GST_OPENAPTXENC_H__ */
index 71ee53b..bc55838 100644 (file)
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
-  gst_element_register (plugin, "openaptxdec", GST_RANK_NONE,
-      GST_TYPE_OPENAPTX_DEC);
-  gst_element_register (plugin, "openaptxenc", GST_RANK_NONE,
-      GST_TYPE_OPENAPTX_ENC);
+  gboolean ret = FALSE;
+  ret |= GST_ELEMENT_REGISTER (openaptxdec, plugin);
+  ret |= GST_ELEMENT_REGISTER (openaptxenc, plugin);
   return TRUE;
 }