summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStéphane Cerveau <scerveau@collabora.com>2021-02-18 15:56:44 +0100
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>2021-03-23 14:19:17 +0000
commit358e030c09679005e9d308d1de873d5a79fef652 (patch)
tree039ad87e55bcc3695da6aad853d7a1ea7263ad41
parent051ae23c2f8059a817c752bf575066b6bd0204bd (diff)
downloadgstreamer-plugins-bad-358e030c09679005e9d308d1de873d5a79fef652.tar.gz
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>
-rw-r--r--ext/opus/gstopus.c10
-rw-r--r--ext/opus/gstopusparse.c18
-rw-r--r--ext/opus/gstopusparse.h2
3 files changed, 20 insertions, 10 deletions
diff --git a/ext/opus/gstopus.c b/ext/opus/gstopus.c
index d53600035..30be42e9d 100644
--- a/ext/opus/gstopus.c
+++ b/ext/opus/gstopus.c
@@ -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,
diff --git a/ext/opus/gstopusparse.c b/ext/opus/gstopusparse.c
index 8196f54c7..bc8362093 100644
--- a/ext/opus/gstopusparse.c
+++ b/ext/opus/gstopusparse.c
@@ -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;
+}
diff --git a/ext/opus/gstopusparse.h b/ext/opus/gstopusparse.h
index 6379de07b..84501d92c 100644
--- a/ext/opus/gstopusparse.h
+++ b/ext/opus/gstopusparse.h
@@ -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__ */