#include <gst/base/gstbitreader.h>
#include <gst/pbutils/pbutils.h>
+#include "gstaudioparserselements.h"
#include "gstaacparse.h"
#define gst_aac_parse_parent_class parent_class
G_DEFINE_TYPE (GstAacParse, gst_aac_parse, GST_TYPE_BASE_PARSE);
+GST_ELEMENT_REGISTER_DEFINE (aacparse, "aacparse",
+ GST_RANK_PRIMARY + 1, GST_TYPE_AAC_PARSE);
/**
* gst_aac_parse_class_init:
#include <string.h>
+#include "gstaudioparserselements.h"
#include "gstac3parse.h"
#include <gst/base/base.h>
#include <gst/pbutils/pbutils.h>
#define gst_ac3_parse_parent_class parent_class
G_DEFINE_TYPE (GstAc3Parse, gst_ac3_parse, GST_TYPE_BASE_PARSE);
+GST_ELEMENT_REGISTER_DEFINE (ac3parse, "ac3parse",
+ GST_RANK_PRIMARY + 1, GST_TYPE_AC3_PARSE);
static void
gst_ac3_parse_class_init (GstAc3ParseClass * klass)
#include <string.h>
+#include "gstaudioparserselements.h"
#include "gstamrparse.h"
#include <gst/pbutils/pbutils.h>
GstBaseParseFrame * frame);
G_DEFINE_TYPE (GstAmrParse, gst_amr_parse, GST_TYPE_BASE_PARSE);
+GST_ELEMENT_REGISTER_DEFINE (amrparse, "amrparse",
+ GST_RANK_PRIMARY + 1, GST_TYPE_AMR_PARSE);
/**
* gst_amr_parse_class_init:
--- /dev/null
+/* GStreamer audio parsers
+ * Copyright (C) 2009 Tim-Philipp Müller <tim centricular net>
+ * Copyright (C) 2020 Huawei Technologies Co., Ltd.
+ * @Author: Julian Bouzas <julian.bouzas@collabora.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef __GST_AUDIOPARSERS_ELEMENTS_H__
+#define __GST_AUDIOPARSERS_ELEMENTS_H__
+
+#include <gst/gst.h>
+
+G_BEGIN_DECLS
+
+GST_ELEMENT_REGISTER_DECLARE (aacparse);
+GST_ELEMENT_REGISTER_DECLARE (amrparse);
+GST_ELEMENT_REGISTER_DECLARE (ac3parse);
+GST_ELEMENT_REGISTER_DECLARE (dcaparse);
+GST_ELEMENT_REGISTER_DECLARE (flacparse);
+GST_ELEMENT_REGISTER_DECLARE (mpegaudioparse);
+GST_ELEMENT_REGISTER_DECLARE (sbcparse);
+GST_ELEMENT_REGISTER_DECLARE (wavpackparse);
+
+G_END_DECLS
+
+#endif /* __GST_AUDIOPARSERS_ELEMENTS_H__ */
#include <string.h>
+#include "gstaudioparserselements.h"
#include "gstdcaparse.h"
#include <gst/base/base.h>
#include <gst/pbutils/pbutils.h>
#define gst_dca_parse_parent_class parent_class
G_DEFINE_TYPE (GstDcaParse, gst_dca_parse, GST_TYPE_BASE_PARSE);
+GST_ELEMENT_REGISTER_DEFINE (dcaparse, "dcaparse",
+ GST_RANK_PRIMARY + 1, GST_TYPE_DCA_PARSE);
static void
gst_dca_parse_class_init (GstDcaParseClass * klass)
#include "config.h"
#endif
+#include "gstaudioparserselements.h"
#include "gstflacparse.h"
#include <string.h>
#define gst_flac_parse_parent_class parent_class
G_DEFINE_TYPE (GstFlacParse, gst_flac_parse, GST_TYPE_BASE_PARSE);
+GST_ELEMENT_REGISTER_DEFINE (flacparse, "flacparse",
+ GST_RANK_PRIMARY + 1, GST_TYPE_FLAC_PARSE);
static void
gst_flac_parse_class_init (GstFlacParseClass * klass)
#include <string.h>
+#include "gstaudioparserselements.h"
#include "gstmpegaudioparse.h"
#include <gst/base/gstbytereader.h>
#include <gst/pbutils/pbutils.h>
#define gst_mpeg_audio_parse_parent_class parent_class
G_DEFINE_TYPE (GstMpegAudioParse, gst_mpeg_audio_parse, GST_TYPE_BASE_PARSE);
+GST_ELEMENT_REGISTER_DEFINE (mpegaudioparse, "mpegaudioparse",
+ GST_RANK_PRIMARY + 2, GST_TYPE_MPEG_AUDIO_PARSE);
#define GST_TYPE_MPEG_AUDIO_CHANNEL_MODE \
(gst_mpeg_audio_channel_mode_get_type())
#include "config.h"
#endif
+#include "gstaudioparserselements.h"
#include "gstsbcparse.h"
#include <string.h>
#define parent_class gst_sbc_parse_parent_class
G_DEFINE_TYPE (GstSbcParse, gst_sbc_parse, GST_TYPE_BASE_PARSE);
+GST_ELEMENT_REGISTER_DEFINE (sbcparse, "sbcparse",
+ GST_RANK_PRIMARY + 1, GST_TYPE_SBC_PARSE);
static void
gst_sbc_parse_class_init (GstSbcParseClass * klass)
#include <string.h>
+#include "gstaudioparserselements.h"
#include "gstwavpackparse.h"
#include <gst/base/base.h>
#define gst_wavpack_parse_parent_class parent_class
G_DEFINE_TYPE (GstWavpackParse, gst_wavpack_parse, GST_TYPE_BASE_PARSE);
+GST_ELEMENT_REGISTER_DEFINE (wavpackparse, "wavpackparse",
+ GST_RANK_PRIMARY + 1, GST_TYPE_WAVPACK_PARSE);
static void
gst_wavpack_parse_class_init (GstWavpackParseClass * klass)
#include "config.h"
#endif
-#include "gstaacparse.h"
-#include "gstamrparse.h"
-#include "gstac3parse.h"
-#include "gstdcaparse.h"
-#include "gstflacparse.h"
-#include "gstmpegaudioparse.h"
-#include "gstsbcparse.h"
-#include "gstwavpackparse.h"
+#include "gstaudioparserselements.h"
static gboolean
plugin_init (GstPlugin * plugin)
{
- gboolean ret;
+ gboolean ret = FALSE;
- ret = gst_element_register (plugin, "aacparse",
- GST_RANK_PRIMARY + 1, GST_TYPE_AAC_PARSE);
- ret &= gst_element_register (plugin, "amrparse",
- GST_RANK_PRIMARY + 1, GST_TYPE_AMR_PARSE);
- ret &= gst_element_register (plugin, "ac3parse",
- GST_RANK_PRIMARY + 1, GST_TYPE_AC3_PARSE);
- ret &= gst_element_register (plugin, "dcaparse",
- GST_RANK_PRIMARY + 1, GST_TYPE_DCA_PARSE);
- ret &= gst_element_register (plugin, "flacparse",
- GST_RANK_PRIMARY + 1, GST_TYPE_FLAC_PARSE);
- ret &= gst_element_register (plugin, "mpegaudioparse",
- GST_RANK_PRIMARY + 2, GST_TYPE_MPEG_AUDIO_PARSE);
- ret &= gst_element_register (plugin, "sbcparse",
- GST_RANK_PRIMARY + 1, GST_TYPE_SBC_PARSE);
- ret &= gst_element_register (plugin, "wavpackparse",
- GST_RANK_PRIMARY + 1, GST_TYPE_WAVPACK_PARSE);
+ ret |= GST_ELEMENT_REGISTER (aacparse, plugin);
+ ret |= GST_ELEMENT_REGISTER (amrparse, plugin);
+ ret |= GST_ELEMENT_REGISTER (ac3parse, plugin);
+ ret |= GST_ELEMENT_REGISTER (dcaparse, plugin);
+ ret |= GST_ELEMENT_REGISTER (flacparse, plugin);
+ ret |= GST_ELEMENT_REGISTER (mpegaudioparse, plugin);
+ ret |= GST_ELEMENT_REGISTER (sbcparse, plugin);
+ ret |= GST_ELEMENT_REGISTER (wavpackparse, plugin);
return ret;
}