dts: 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 15:35:10 +01:00 committed by GStreamer Marge Bot
parent a216a1f2cf
commit 2cf00e75b1
2 changed files with 15 additions and 6 deletions

View file

@ -126,7 +126,7 @@ static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src",
"rate = (int) [ 4000, 96000 ], " "channels = (int) [ 1, 6 ]")
);
G_DEFINE_TYPE (GstDtsDec, gst_dtsdec, GST_TYPE_AUDIO_DECODER);
static gboolean gst_dtsdec_start (GstAudioDecoder * dec);
static gboolean gst_dtsdec_stop (GstAudioDecoder * dec);
@ -143,6 +143,10 @@ static void gst_dtsdec_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec);
static void gst_dtsdec_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec);
static gboolean dtsdec_element_init (GstPlugin * plugin);
G_DEFINE_TYPE (GstDtsDec, gst_dtsdec, GST_TYPE_AUDIO_DECODER);
GST_ELEMENT_REGISTER_DEFINE_CUSTOM (dtsdec, dtsdec_element_init);
static void
gst_dtsdec_class_init (GstDtsDecClass * klass)
@ -784,7 +788,7 @@ gst_dtsdec_get_property (GObject * object, guint prop_id, GValue * value,
}
static gboolean
plugin_init (GstPlugin * plugin)
dtsdec_element_init (GstPlugin * plugin)
{
GST_DEBUG_CATEGORY_INIT (dtsdec_debug, "dtsdec", 0, "DTS/DCA audio decoder");
@ -792,11 +796,14 @@ plugin_init (GstPlugin * plugin)
orc_init ();
#endif
if (!gst_element_register (plugin, "dtsdec", GST_RANK_PRIMARY,
GST_TYPE_DTSDEC))
return FALSE;
return gst_element_register (plugin, "dtsdec", GST_RANK_PRIMARY,
GST_TYPE_DTSDEC);
}
return TRUE;
static gboolean
plugin_init (GstPlugin * plugin)
{
return GST_ELEMENT_REGISTER (dtsdec, plugin);
}
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,

View file

@ -78,6 +78,8 @@ struct _GstDtsDecClass {
GType gst_dtsdec_get_type(void);
GST_ELEMENT_REGISTER_DECLARE (dtsdec);
G_END_DECLS
#endif /* __GST_DTSDEC_H__ */