opus: 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-18 15:56:44 +01:00 committed by GStreamer Marge Bot
parent 051ae23c2f
commit 358e030c09
3 changed files with 20 additions and 10 deletions

View file

@ -23,18 +23,10 @@
#include "gstopusparse.h"
#include <gst/tag/tag.h>
static gboolean
plugin_init (GstPlugin * plugin)
{
if (!gst_element_register (plugin, "opusparse", GST_RANK_NONE,
GST_TYPE_OPUS_PARSE))
return FALSE;
gst_tag_register_musicbrainz_tags ();
return TRUE;
return GST_ELEMENT_REGISTER (opusparse, plugin);
}
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,

View file

@ -45,6 +45,7 @@
#include <gst/audio/audio.h>
#include <gst/pbutils/pbutils.h>
#include <gst/tag/tag.h>
GST_DEBUG_CATEGORY_STATIC (opusparse_debug);
#define GST_CAT_DEFAULT opusparse_debug
@ -65,7 +66,7 @@ GST_STATIC_PAD_TEMPLATE ("sink",
GST_STATIC_CAPS ("audio/x-opus")
);
G_DEFINE_TYPE (GstOpusParse, gst_opus_parse, GST_TYPE_BASE_PARSE);
static gboolean gst_opus_parse_start (GstBaseParse * parse);
static gboolean gst_opus_parse_stop (GstBaseParse * parse);
@ -73,6 +74,10 @@ static GstFlowReturn gst_opus_parse_handle_frame (GstBaseParse * base,
GstBaseParseFrame * frame, gint * skip);
static GstFlowReturn gst_opus_parse_parse_frame (GstBaseParse * base,
GstBaseParseFrame * frame);
static gboolean opusparse_element_init (GstPlugin * plugin);
G_DEFINE_TYPE (GstOpusParse, gst_opus_parse, GST_TYPE_BASE_PARSE);
GST_ELEMENT_REGISTER_DEFINE_CUSTOM (opusparse, opusparse_element_init);
static void
gst_opus_parse_class_init (GstOpusParseClass * klass)
@ -428,3 +433,14 @@ gst_opus_parse_parse_frame (GstBaseParse * base, GstBaseParseFrame * frame)
return GST_FLOW_OK;
}
static gboolean
opusparse_element_init (GstPlugin * plugin)
{
if (!gst_element_register (plugin, "opusparse", GST_RANK_NONE,
GST_TYPE_OPUS_PARSE))
return FALSE;
gst_tag_register_musicbrainz_tags ();
return TRUE;
}

View file

@ -57,6 +57,8 @@ struct _GstOpusParseClass {
GType gst_opus_parse_get_type (void);
GST_ELEMENT_REGISTER_DECLARE (opusparse);
G_END_DECLS
#endif /* __GST_OPUS_PARSE_H__ */