From 3347e1786f3d926be9ec53e6772870a51548ab5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Cerveau?= Date: Tue, 16 Feb 2021 17:19:52 +0100 Subject: [PATCH] id3demux: 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: --- gst/id3demux/gstid3demux.c | 13 ++++++++----- gst/id3demux/gstid3demux.h | 2 ++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/gst/id3demux/gstid3demux.c b/gst/id3demux/gstid3demux.c index b96eeb353c..7c2b5e75e3 100644 --- a/gst/id3demux/gstid3demux.c +++ b/gst/id3demux/gstid3demux.c @@ -91,6 +91,12 @@ static void gst_id3demux_get_property (GObject * object, guint prop_id, #define gst_id3demux_parent_class parent_class G_DEFINE_TYPE (GstID3Demux, gst_id3demux, GST_TYPE_TAG_DEMUX); +#define _do_init \ + GST_DEBUG_CATEGORY_INIT (id3demux_debug, "id3demux", 0, \ + "GStreamer ID3 tag demuxer"); \ + gst_tag_register_musicbrainz_tags (); +GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (id3demux, "id3demux", + GST_RANK_PRIMARY, GST_TYPE_ID3DEMUX, _do_init); static void gst_id3demux_class_init (GstID3DemuxClass * klass) @@ -273,13 +279,10 @@ gst_id3demux_get_property (GObject * object, guint prop_id, static gboolean plugin_init (GstPlugin * plugin) { - GST_DEBUG_CATEGORY_INIT (id3demux_debug, "id3demux", 0, - "GStreamer ID3 tag demuxer"); - gst_tag_register_musicbrainz_tags (); + return GST_ELEMENT_REGISTER (id3demux, plugin); + - return gst_element_register (plugin, "id3demux", - GST_RANK_PRIMARY, GST_TYPE_ID3DEMUX); } GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, diff --git a/gst/id3demux/gstid3demux.h b/gst/id3demux/gstid3demux.h index 9561dfdf2d..e8d74eb096 100644 --- a/gst/id3demux/gstid3demux.h +++ b/gst/id3demux/gstid3demux.h @@ -53,6 +53,8 @@ struct _GstID3DemuxClass GType gst_id3demux_get_type (void); +GST_ELEMENT_REGISTER_DECLARE (id3demux); + G_END_DECLS #endif /* __GST_ID3DEMUX_H__ */