summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStéphane Cerveau <scerveau@collabora.com>2021-03-29 10:37:26 +0200
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>2021-03-29 19:13:36 +0000
commita423f23fc70f48e4a6041b3c11ccabf8673feb6d (patch)
treed1fcc3e50a7a6d59bab96782bc10930805ad8d26
parent6399179d7a2e51e5d9b159986104d733464180f9 (diff)
downloadgstreamer-plugins-ugly-a423f23fc70f48e4a6041b3c11ccabf8673feb6d.tar.gz
a52dec: allow per feature registration
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>
-rw-r--r--ext/a52dec/gsta52dec.c16
-rw-r--r--ext/a52dec/gsta52dec.h1
2 files changed, 12 insertions, 5 deletions
diff --git a/ext/a52dec/gsta52dec.c b/ext/a52dec/gsta52dec.c
index 25db7836..5beba90d 100644
--- a/ext/a52dec/gsta52dec.c
+++ b/ext/a52dec/gsta52dec.c
@@ -92,8 +92,11 @@ static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src",
"rate = (int) [ 4000, 96000 ], " "channels = (int) [ 1, 6 ]")
);
+static gboolean a52_element_init (GstPlugin * plugin);
+
#define gst_a52dec_parent_class parent_class
G_DEFINE_TYPE (GstA52Dec, gst_a52dec, GST_TYPE_AUDIO_DECODER);
+GST_ELEMENT_REGISTER_DEFINE_CUSTOM (a52dec, a52_element_init);
static gboolean gst_a52dec_start (GstAudioDecoder * dec);
static gboolean gst_a52dec_stop (GstAudioDecoder * dec);
@@ -822,17 +825,20 @@ gst_a52dec_get_property (GObject * object, guint prop_id, GValue * value,
}
static gboolean
-plugin_init (GstPlugin * plugin)
+a52_element_init (GstPlugin * plugin)
{
#if HAVE_ORC
orc_init ();
#endif
- if (!gst_element_register (plugin, "a52dec", GST_RANK_SECONDARY,
- GST_TYPE_A52DEC))
- return FALSE;
+ return gst_element_register (plugin, "a52dec", GST_RANK_SECONDARY,
+ GST_TYPE_A52DEC);
+}
- return TRUE;
+static gboolean
+plugin_init (GstPlugin * plugin)
+{
+ return GST_ELEMENT_REGISTER (a52dec, plugin);
}
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
diff --git a/ext/a52dec/gsta52dec.h b/ext/a52dec/gsta52dec.h
index 4d1f6507..c50450e4 100644
--- a/ext/a52dec/gsta52dec.h
+++ b/ext/a52dec/gsta52dec.h
@@ -73,6 +73,7 @@ struct _GstA52DecClass {
};
GType gst_a52dec_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (a52dec);
#ifndef A52_MONO
#define A52_MONO 1