diff options
author | Stéphane Cerveau <scerveau@collabora.com> | 2021-02-19 12:54:56 +0100 |
---|---|---|
committer | GStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org> | 2021-03-23 14:19:17 +0000 |
commit | 27ab8f8bceb39715a7d54d705840abe272790d26 (patch) | |
tree | a8db551d29535ba9cfa9e46353b48dcfdee0b0b6 /ext | |
parent | c8ef250fe22f89bdb85d725b02a7e805030741de (diff) | |
download | gstreamer-plugins-bad-27ab8f8bceb39715a7d54d705840abe272790d26.tar.gz |
spandsp: 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-bad/-/merge_requests/2038>
Diffstat (limited to 'ext')
-rw-r--r-- | ext/spandsp/gstdtmfdetect.c | 10 | ||||
-rw-r--r-- | ext/spandsp/gstdtmfdetect.h | 2 | ||||
-rw-r--r-- | ext/spandsp/gstspandsp.c | 11 | ||||
-rw-r--r-- | ext/spandsp/gstspanplc.c | 2 | ||||
-rw-r--r-- | ext/spandsp/gstspanplc.h | 1 | ||||
-rw-r--r-- | ext/spandsp/gsttonegeneratesrc.c | 17 | ||||
-rw-r--r-- | ext/spandsp/gsttonegeneratesrc.h | 2 |
7 files changed, 20 insertions, 25 deletions
diff --git a/ext/spandsp/gstdtmfdetect.c b/ext/spandsp/gstdtmfdetect.c index 6adf37153..26a33f1be 100644 --- a/ext/spandsp/gstdtmfdetect.c +++ b/ext/spandsp/gstdtmfdetect.c @@ -93,6 +93,8 @@ static gboolean gst_dtmf_detect_sink_event (GstBaseTransform * trans, GstEvent * event); G_DEFINE_TYPE (GstDtmfDetect, gst_dtmf_detect, GST_TYPE_BASE_TRANSFORM); +GST_ELEMENT_REGISTER_DEFINE (dtmfdetect, "dtmfdetect", + GST_RANK_MARGINAL, GST_TYPE_DTMF_DETECT); static void gst_dtmf_detect_class_init (GstDtmfDetectClass * klass) @@ -278,11 +280,3 @@ gst_dtmf_detect_sink_event (GstBaseTransform * trans, GstEvent * event) return GST_BASE_TRANSFORM_CLASS (gst_dtmf_detect_parent_class)->sink_event (trans, event); } - - -gboolean -gst_dtmf_detect_plugin_init (GstPlugin * plugin) -{ - return gst_element_register (plugin, "dtmfdetect", - GST_RANK_MARGINAL, GST_TYPE_DTMF_DETECT); -} diff --git a/ext/spandsp/gstdtmfdetect.h b/ext/spandsp/gstdtmfdetect.h index e0de5c14b..b8e8c980d 100644 --- a/ext/spandsp/gstdtmfdetect.h +++ b/ext/spandsp/gstdtmfdetect.h @@ -64,7 +64,7 @@ struct _GstDtmfDetectClass GType gst_dtmf_detect_get_type (void); -gboolean gst_dtmf_detect_plugin_init (GstPlugin *plugin); +GST_ELEMENT_REGISTER_DECLARE (dtmfdetect); G_END_DECLS diff --git a/ext/spandsp/gstspandsp.c b/ext/spandsp/gstspandsp.c index 37a080669..0725bf00d 100644 --- a/ext/spandsp/gstspandsp.c +++ b/ext/spandsp/gstspandsp.c @@ -31,10 +31,13 @@ static gboolean plugin_init (GstPlugin * plugin) { - return gst_element_register (plugin, "spanplc", - GST_RANK_PRIMARY, GST_TYPE_SPAN_PLC) && - gst_dtmf_detect_plugin_init (plugin) && - gst_tone_generate_src_plugin_init (plugin); + gboolean ret = FALSE; + + ret |= GST_ELEMENT_REGISTER (spanplc, plugin); + ret |= GST_ELEMENT_REGISTER (dtmfdetect, plugin); + ret |= GST_ELEMENT_REGISTER (tonegeneratesrc, plugin); + + return ret; } GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, diff --git a/ext/spandsp/gstspanplc.c b/ext/spandsp/gstspanplc.c index 602c6f07c..f1e29494d 100644 --- a/ext/spandsp/gstspanplc.c +++ b/ext/spandsp/gstspanplc.c @@ -38,6 +38,8 @@ #include <gst/audio/audio.h> G_DEFINE_TYPE (GstSpanPlc, gst_span_plc, GST_TYPE_ELEMENT); +GST_ELEMENT_REGISTER_DEFINE (spanplc, "spanplc", GST_RANK_PRIMARY, + GST_TYPE_SPAN_PLC); GST_DEBUG_CATEGORY_STATIC (gst_span_plc_debug); #define GST_CAT_DEFAULT gst_span_plc_debug diff --git a/ext/spandsp/gstspanplc.h b/ext/spandsp/gstspanplc.h index ae599ada5..58f99bcd1 100644 --- a/ext/spandsp/gstspanplc.h +++ b/ext/spandsp/gstspanplc.h @@ -59,6 +59,7 @@ struct _GstSpanPlcClass }; GType gst_span_plc_get_type (void); +GST_ELEMENT_REGISTER_DECLARE (spanplc); G_END_DECLS diff --git a/ext/spandsp/gsttonegeneratesrc.c b/ext/spandsp/gsttonegeneratesrc.c index 341aeab5a..71d5cf2c0 100644 --- a/ext/spandsp/gsttonegeneratesrc.c +++ b/ext/spandsp/gsttonegeneratesrc.c @@ -63,8 +63,13 @@ GST_STATIC_PAD_TEMPLATE ("src", ); #define gst_tone_generate_src_parent_class parent_class -G_DEFINE_TYPE (GstToneGenerateSrc, gst_tone_generate_src, GST_TYPE_PUSH_SRC); +G_DEFINE_TYPE_WITH_CODE (GstToneGenerateSrc, gst_tone_generate_src, + GST_TYPE_PUSH_SRC, GST_DEBUG_CATEGORY_INIT (tone_generate_src_debug, + "tonegeneratesrc", 0, "Telephony Tone Test Source"); + ); +GST_ELEMENT_REGISTER_DEFINE (tonegeneratesrc, "tonegeneratesrc", GST_RANK_NONE, + GST_TYPE_TONE_GENERATE_SRC); static void gst_tone_generate_src_finalize (GObject * object); static void gst_tone_generate_src_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec); @@ -403,13 +408,3 @@ gst_tone_generate_src_get_property (GObject * object, guint prop_id, break; } } - -gboolean -gst_tone_generate_src_plugin_init (GstPlugin * plugin) -{ - GST_DEBUG_CATEGORY_INIT (tone_generate_src_debug, "tonegeneratesrc", 0, - "Telephony Tone Test Source"); - - return gst_element_register (plugin, "tonegeneratesrc", - GST_RANK_NONE, GST_TYPE_TONE_GENERATE_SRC); -} diff --git a/ext/spandsp/gsttonegeneratesrc.h b/ext/spandsp/gsttonegeneratesrc.h index 200e13d43..28b79f0eb 100644 --- a/ext/spandsp/gsttonegeneratesrc.h +++ b/ext/spandsp/gsttonegeneratesrc.h @@ -82,7 +82,7 @@ struct _GstToneGenerateSrcClass { }; GType gst_tone_generate_src_get_type (void); -gboolean gst_tone_generate_src_plugin_init (GstPlugin *plugin); +GST_ELEMENT_REGISTER_DECLARE (tonegeneratesrc); G_END_DECLS |