summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-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__ */