fluidsynth: 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>
This commit is contained in:
Stéphane Cerveau 2021-02-17 18:01:05 +01:00 committed by GStreamer Marge Bot
parent c1b47c0780
commit 08ea6d39a3
2 changed files with 11 additions and 2 deletions

View file

@ -99,6 +99,7 @@ static void gst_fluid_dec_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec);
static void gst_fluid_dec_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec);
static gboolean fluiddec_element_init (GstPlugin * plugin);
static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink",
GST_PAD_SINK,
@ -116,6 +117,7 @@ static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src",
#define parent_class gst_fluid_dec_parent_class
G_DEFINE_TYPE (GstFluidDec, gst_fluid_dec, GST_TYPE_ELEMENT);
GST_ELEMENT_REGISTER_DEFINE_CUSTOM (fluiddec, fluiddec_element_init);
/* initialize the plugin's class */
static void
@ -707,7 +709,7 @@ gst_fluid_synth_debug_log_function (int level, const char *message, void *data)
}
static gboolean
plugin_init (GstPlugin * plugin)
fluiddec_element_init (GstPlugin * plugin)
{
GST_DEBUG_CATEGORY_INIT (gst_fluid_dec_debug, "fluiddec",
0, "Fluidsynth MIDI decoder plugin");
@ -744,11 +746,16 @@ plugin_init (GstPlugin * plugin)
}
}
#endif
return gst_element_register (plugin, "fluiddec",
GST_RANK_SECONDARY, GST_TYPE_FLUID_DEC);
}
static gboolean
plugin_init (GstPlugin * plugin)
{
return GST_ELEMENT_REGISTER (fluiddec, plugin);
}
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
GST_VERSION_MINOR,
fluidsynthmidi,

View file

@ -73,6 +73,8 @@ struct _GstFluidDecClass
GType gst_fluid_dec_get_type (void);
GST_ELEMENT_REGISTER_DECLARE (fluiddec);
G_END_DECLS
#endif /* __GST_FLUID_DEC_H__ */