summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorStéphane Cerveau <scerveau@collabora.com>2021-04-21 10:27:10 +0200
committerStéphane Cerveau <scerveau@collabora.com>2021-04-21 12:40:53 +0200
commit74346080bade9d2a845bc1c5038f5221e3ef2596 (patch)
tree971aa6857fbac287c458a283d6561e6f6a6e12c9 /ext
parente7855606876f558490e62d0af8cc79db1f12edb0 (diff)
vorbis: avoid duplicate symbols
Use TREMOR define to avoid duplicate symbols of ivodebis and vorbis plugins when static linking GStreamer. Rearrange debug category init. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1116>
Diffstat (limited to 'ext')
-rw-r--r--ext/vorbis/gstivorbisdec.c11
-rw-r--r--ext/vorbis/gstvorbisdec.c20
-rw-r--r--ext/vorbis/gstvorbiselement.c13
-rw-r--r--ext/vorbis/gstvorbisenc.c7
-rw-r--r--ext/vorbis/gstvorbisparse.c7
-rw-r--r--ext/vorbis/gstvorbistag.c8
6 files changed, 30 insertions, 36 deletions
diff --git a/ext/vorbis/gstivorbisdec.c b/ext/vorbis/gstivorbisdec.c
index 3dc2a6035..166f934aa 100644
--- a/ext/vorbis/gstivorbisdec.c
+++ b/ext/vorbis/gstivorbisdec.c
@@ -23,19 +23,10 @@
#include "gstvorbiselements.h"
-GST_DEBUG_CATEGORY (ivorbisdec_debug);
-
static gboolean
plugin_init (GstPlugin * plugin)
{
- gboolean ret = FALSE;
-
- GST_DEBUG_CATEGORY_INIT (ivorbisdec_debug, "ivorbisdec", 0,
- "vorbis decoding element (integer decoder)");
-
- ret |= GST_ELEMENT_REGISTER (ivorbisdec, plugin);
-
- return ret;
+ return GST_ELEMENT_REGISTER (ivorbisdec, plugin);
}
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
diff --git a/ext/vorbis/gstvorbisdec.c b/ext/vorbis/gstvorbisdec.c
index 817b17f96..0ce2dc5d8 100644
--- a/ext/vorbis/gstvorbisdec.c
+++ b/ext/vorbis/gstvorbisdec.c
@@ -48,10 +48,10 @@
#include "gstvorbiscommon.h"
#ifndef TREMOR
-GST_DEBUG_CATEGORY_EXTERN (vorbisdec_debug);
+GST_DEBUG_CATEGORY_STATIC (vorbisdec_debug);
#define GST_CAT_DEFAULT vorbisdec_debug
#else
-GST_DEBUG_CATEGORY_EXTERN (ivorbisdec_debug);
+GST_DEBUG_CATEGORY_STATIC (ivorbisdec_debug);
#define GST_CAT_DEFAULT ivorbisdec_debug
#endif
@@ -70,11 +70,19 @@ GST_STATIC_PAD_TEMPLATE ("sink",
#define gst_vorbis_dec_parent_class parent_class
G_DEFINE_TYPE (GstVorbisDec, gst_vorbis_dec, GST_TYPE_AUDIO_DECODER);
+#ifndef TREMOR
GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (vorbisdec, "vorbisdec",
- GST_RANK_PRIMARY, GST_TYPE_VORBIS_DEC, vorbis_element_init (plugin));
-
-GST_ELEMENT_REGISTER_DEFINE (ivorbisdec, "ivorbisdec",
- GST_RANK_SECONDARY, GST_TYPE_VORBIS_DEC);
+ GST_RANK_PRIMARY, GST_TYPE_VORBIS_DEC,
+ GST_DEBUG_CATEGORY_INIT (vorbisdec_debug, "vorbisdec", 0,
+ "vorbis decoding element");
+ vorbis_element_init (plugin));
+#else
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (ivorbisdec, "ivorbisdec",
+ GST_RANK_SECONDARY, GST_TYPE_VORBIS_DEC,
+ GST_DEBUG_CATEGORY_INIT (ivorbisdec_debug, "ivorbisdec", 0,
+ "vorbis decoding element (integer decoder)");
+ vorbis_element_init (plugin));
+#endif
static void vorbis_dec_finalize (GObject * object);
diff --git a/ext/vorbis/gstvorbiselement.c b/ext/vorbis/gstvorbiselement.c
index a99a2654e..bde9945df 100644
--- a/ext/vorbis/gstvorbiselement.c
+++ b/ext/vorbis/gstvorbiselement.c
@@ -26,10 +26,6 @@
#include "gstvorbiselements.h"
#include "gst/tag/tag.h"
-GST_DEBUG_CATEGORY (vorbisenc_debug);
-GST_DEBUG_CATEGORY (vorbisdec_debug);
-GST_DEBUG_CATEGORY (vorbisparse_debug);
-GST_DEBUG_CATEGORY (vorbistag_debug);
void
vorbis_element_init (GstPlugin * plugin)
@@ -39,15 +35,6 @@ vorbis_element_init (GstPlugin * plugin)
if (g_once_init_enter (&res)) {
gst_tag_register_musicbrainz_tags ();
- GST_DEBUG_CATEGORY_INIT (vorbisenc_debug, "vorbisenc", 0,
- "vorbis encoding element");
- GST_DEBUG_CATEGORY_INIT (vorbisdec_debug, "vorbisdec", 0,
- "vorbis decoding element");
- GST_DEBUG_CATEGORY_INIT (vorbisparse_debug, "vorbisparse", 0,
- "vorbis parsing element");
- GST_DEBUG_CATEGORY_INIT (vorbistag_debug, "vorbistag", 0,
- "vorbis tagging element");
-
g_once_init_leave (&res, TRUE);
}
}
diff --git a/ext/vorbis/gstvorbisenc.c b/ext/vorbis/gstvorbisenc.c
index b2cb66c74..091cb58fe 100644
--- a/ext/vorbis/gstvorbisenc.c
+++ b/ext/vorbis/gstvorbisenc.c
@@ -55,7 +55,7 @@
#include "gstvorbiselements.h"
#include "gstvorbiscommon.h"
-GST_DEBUG_CATEGORY_EXTERN (vorbisenc_debug);
+GST_DEBUG_CATEGORY_STATIC (vorbisenc_debug);
#define GST_CAT_DEFAULT vorbisenc_debug
static GstStaticPadTemplate vorbis_enc_src_factory =
@@ -110,7 +110,10 @@ static void gst_vorbis_enc_flush (GstAudioEncoder * vorbisenc);
G_DEFINE_TYPE_WITH_CODE (GstVorbisEnc, gst_vorbis_enc,
GST_TYPE_AUDIO_ENCODER, G_IMPLEMENT_INTERFACE (GST_TYPE_TAG_SETTER, NULL));
GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (vorbisenc, "vorbisenc",
- GST_RANK_PRIMARY, GST_TYPE_VORBISENC, vorbis_element_init (plugin));
+ GST_RANK_PRIMARY, GST_TYPE_VORBISENC,
+ GST_DEBUG_CATEGORY_INIT (vorbisenc_debug, "vorbisenc", 0,
+ "vorbis encoding element");
+ vorbis_element_init (plugin));
static void
gst_vorbis_enc_class_init (GstVorbisEncClass * klass)
diff --git a/ext/vorbis/gstvorbisparse.c b/ext/vorbis/gstvorbisparse.c
index 20dd67e12..52b438232 100644
--- a/ext/vorbis/gstvorbisparse.c
+++ b/ext/vorbis/gstvorbisparse.c
@@ -56,7 +56,7 @@
#include "gstvorbiselements.h"
#include "gstvorbisparse.h"
-GST_DEBUG_CATEGORY_EXTERN (vorbisparse_debug);
+GST_DEBUG_CATEGORY_STATIC (vorbisparse_debug);
#define GST_CAT_DEFAULT vorbisparse_debug
static GstStaticPadTemplate vorbis_parse_sink_factory =
@@ -76,7 +76,10 @@ GST_STATIC_PAD_TEMPLATE ("src",
#define gst_vorbis_parse_parent_class parent_class
G_DEFINE_TYPE (GstVorbisParse, gst_vorbis_parse, GST_TYPE_ELEMENT);
GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (vorbisparse, "vorbisparse",
- GST_RANK_NONE, GST_TYPE_VORBIS_PARSE, vorbis_element_init (plugin));
+ GST_RANK_NONE, GST_TYPE_VORBIS_PARSE,
+ GST_DEBUG_CATEGORY_INIT (vorbisparse_debug, "vorbisparse", 0,
+ "vorbis parsing element");
+ vorbis_element_init (plugin));
static GstFlowReturn vorbis_parse_chain (GstPad * pad, GstObject * parent,
GstBuffer * buffer);
diff --git a/ext/vorbis/gstvorbistag.c b/ext/vorbis/gstvorbistag.c
index 6613c27a5..5b5193c98 100644
--- a/ext/vorbis/gstvorbistag.c
+++ b/ext/vorbis/gstvorbistag.c
@@ -59,8 +59,8 @@
#include "gstvorbistag.h"
-GST_DEBUG_CATEGORY_EXTERN (vorbisparse_debug);
-#define GST_CAT_DEFAULT vorbisparse_debug
+GST_DEBUG_CATEGORY_STATIC (vorbistag_debug);
+#define GST_CAT_DEFAULT vorbistag_debug
static GstFlowReturn gst_vorbis_tag_parse_packet (GstVorbisParse * parse,
GstBuffer * buffer);
@@ -69,7 +69,9 @@ static GstFlowReturn gst_vorbis_tag_parse_packet (GstVorbisParse * parse,
G_DEFINE_TYPE_WITH_CODE (GstVorbisTag, gst_vorbis_tag,
GST_TYPE_VORBIS_PARSE, G_IMPLEMENT_INTERFACE (GST_TYPE_TAG_SETTER, NULL));
GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (vorbistag, "vorbistag",
- GST_RANK_NONE, GST_TYPE_VORBIS_TAG, vorbis_element_init (plugin));
+ GST_RANK_NONE, GST_TYPE_VORBIS_TAG,
+ GST_DEBUG_CATEGORY_INIT (vorbistag_debug, "vorbistag", 0,
+ "vorbis tagging element"); vorbis_element_init (plugin));
static void
gst_vorbis_tag_class_init (GstVorbisTagClass * klass)