dtmf: 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-good/-/merge_requests/876>
This commit is contained in:
Stéphane Cerveau 2021-02-15 15:03:10 +01:00
parent 6823afde01
commit 6c8eb5bcd6
7 changed files with 14 additions and 33 deletions

View file

@ -27,16 +27,13 @@
static gboolean
plugin_init (GstPlugin * plugin)
{
if (!gst_dtmf_src_plugin_init (plugin))
return FALSE;
gboolean ret = FALSE;
if (!gst_rtp_dtmf_src_plugin_init (plugin))
return FALSE;
ret |= GST_ELEMENT_REGISTER (dtmfsrc, plugin);
ret |= GST_ELEMENT_REGISTER (rtpdtmfsrc, plugin);
ret |= GST_ELEMENT_REGISTER (rtpdtmfdepay, plugin);
if (!gst_rtp_dtmf_depay_plugin_init (plugin))
return FALSE;
return TRUE;
return ret;
}
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,

View file

@ -173,6 +173,8 @@ GST_STATIC_PAD_TEMPLATE ("src",
#define parent_class gst_dtmf_src_parent_class
G_DEFINE_TYPE (GstDTMFSrc, gst_dtmf_src, GST_TYPE_BASE_SRC);
GST_ELEMENT_REGISTER_DEFINE (dtmfsrc, "dtmfsrc", GST_RANK_NONE,
GST_TYPE_DTMF_SRC);
static void gst_dtmf_src_finalize (GObject * object);
@ -949,10 +951,3 @@ failure:
return result;
}
}
gboolean
gst_dtmf_src_plugin_init (GstPlugin * plugin)
{
return gst_element_register (plugin, "dtmfsrc",
GST_RANK_NONE, GST_TYPE_DTMF_SRC);
}

View file

@ -95,7 +95,7 @@ struct _GstDTMFSrcClass
GType gst_dtmf_src_get_type (void);
gboolean gst_dtmf_src_plugin_init (GstPlugin * plugin);
GST_ELEMENT_REGISTER_DECLARE (dtmfsrc);
G_END_DECLS
#endif /* __GST_DTMF_SRC_H__ */

View file

@ -155,6 +155,8 @@ GST_STATIC_PAD_TEMPLATE ("sink",
G_DEFINE_TYPE (GstRtpDTMFDepay, gst_rtp_dtmf_depay,
GST_TYPE_RTP_BASE_DEPAYLOAD);
GST_ELEMENT_REGISTER_DEFINE (rtpdtmfdepay, "rtpdtmfdepay", GST_RANK_MARGINAL,
GST_TYPE_RTP_DTMF_DEPAY);
static void gst_rtp_dtmf_depay_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec);
@ -489,10 +491,3 @@ bad_packet:
return NULL;
}
gboolean
gst_rtp_dtmf_depay_plugin_init (GstPlugin * plugin)
{
return gst_element_register (plugin, "rtpdtmfdepay",
GST_RANK_MARGINAL, GST_TYPE_RTP_DTMF_DEPAY);
}

View file

@ -62,7 +62,7 @@ struct _GstRtpDTMFDepayClass
GType gst_rtp_dtmf_depay_get_type (void);
gboolean gst_rtp_dtmf_depay_plugin_init (GstPlugin * plugin);
GST_ELEMENT_REGISTER_DECLARE (rtpdtmfdepay);
G_END_DECLS
#endif /* __GST_RTP_DTMF_DEPAY_H__ */

View file

@ -135,6 +135,8 @@ GST_STATIC_PAD_TEMPLATE ("src",
G_DEFINE_TYPE (GstRTPDTMFSrc, gst_rtp_dtmf_src, GST_TYPE_BASE_SRC);
GST_ELEMENT_REGISTER_DEFINE (rtpdtmfsrc, "rtpdtmfsrc", GST_RANK_NONE,
GST_TYPE_RTP_DTMF_SRC);
static void gst_rtp_dtmf_src_finalize (GObject * object);
@ -1137,10 +1139,3 @@ gst_rtp_dtmf_src_unlock_stop (GstBaseSrc * src)
return TRUE;
}
gboolean
gst_rtp_dtmf_src_plugin_init (GstPlugin * plugin)
{
return gst_element_register (plugin, "rtpdtmfsrc",
GST_RANK_NONE, GST_TYPE_RTP_DTMF_SRC);
}

View file

@ -108,8 +108,7 @@ struct _GstRTPDTMFSrcClass
GType gst_rtp_dtmf_src_get_type (void);
gboolean gst_rtp_dtmf_src_plugin_init (GstPlugin * plugin);
GST_ELEMENT_REGISTER_DECLARE (rtpdtmfsrc);
G_END_DECLS
#endif /* __GST_RTP_DTMF_SRC_H__ */