mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-05 23:18:52 +00:00
equalizer: 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-good/-/merge_requests/876>
This commit is contained in:
parent
4d6a69c655
commit
1f8dd4029b
7 changed files with 69 additions and 25 deletions
|
@ -893,29 +893,12 @@ gst_iir_equalizer_setup (GstAudioFilter * audio, const GstAudioInfo * info)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
static gboolean
|
equalizer_element_init (GstPlugin * plugin)
|
||||||
plugin_init (GstPlugin * plugin)
|
|
||||||
{
|
{
|
||||||
GST_DEBUG_CATEGORY_INIT (equalizer_debug, "equalizer", 0, "equalizer");
|
static gsize res = FALSE;
|
||||||
|
if (g_once_init_enter (&res)) {
|
||||||
if (!(gst_element_register (plugin, "equalizer-nbands", GST_RANK_NONE,
|
GST_DEBUG_CATEGORY_INIT (equalizer_debug, "equalizer", 0, "equalizer");
|
||||||
GST_TYPE_IIR_EQUALIZER_NBANDS)))
|
g_once_init_leave (&res, TRUE);
|
||||||
return FALSE;
|
}
|
||||||
|
|
||||||
if (!(gst_element_register (plugin, "equalizer-3bands", GST_RANK_NONE,
|
|
||||||
GST_TYPE_IIR_EQUALIZER_3BANDS)))
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
if (!(gst_element_register (plugin, "equalizer-10bands", GST_RANK_NONE,
|
|
||||||
GST_TYPE_IIR_EQUALIZER_10BANDS)))
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
|
|
||||||
GST_VERSION_MINOR,
|
|
||||||
equalizer,
|
|
||||||
"GStreamer audio equalizers",
|
|
||||||
plugin_init, VERSION, GST_LICENSE, GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN)
|
|
||||||
|
|
|
@ -23,6 +23,12 @@
|
||||||
|
|
||||||
#include <gst/audio/gstaudiofilter.h>
|
#include <gst/audio/gstaudiofilter.h>
|
||||||
|
|
||||||
|
void equalizer_element_init (GstPlugin * plugin);
|
||||||
|
|
||||||
|
GST_ELEMENT_REGISTER_DECLARE (equalizer_nbands);
|
||||||
|
GST_ELEMENT_REGISTER_DECLARE (equalizer_3bands);
|
||||||
|
GST_ELEMENT_REGISTER_DECLARE (equalizer_10bands);
|
||||||
|
|
||||||
typedef struct _GstIirEqualizer GstIirEqualizer;
|
typedef struct _GstIirEqualizer GstIirEqualizer;
|
||||||
typedef struct _GstIirEqualizerClass GstIirEqualizerClass;
|
typedef struct _GstIirEqualizerClass GstIirEqualizerClass;
|
||||||
typedef struct _GstIirEqualizerBand GstIirEqualizerBand;
|
typedef struct _GstIirEqualizerBand GstIirEqualizerBand;
|
||||||
|
|
|
@ -65,6 +65,9 @@ GST_DEBUG_CATEGORY_EXTERN (equalizer_debug);
|
||||||
#define gst_iir_equalizer_10bands_parent_class parent_class
|
#define gst_iir_equalizer_10bands_parent_class parent_class
|
||||||
G_DEFINE_TYPE (GstIirEqualizer10Bands, gst_iir_equalizer_10bands,
|
G_DEFINE_TYPE (GstIirEqualizer10Bands, gst_iir_equalizer_10bands,
|
||||||
GST_TYPE_IIR_EQUALIZER);
|
GST_TYPE_IIR_EQUALIZER);
|
||||||
|
GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (equalizer_10bands, "equalizer-10bands",
|
||||||
|
GST_RANK_NONE, GST_TYPE_IIR_EQUALIZER_10BANDS,
|
||||||
|
equalizer_element_init (plugin));
|
||||||
|
|
||||||
/* equalizer implementation */
|
/* equalizer implementation */
|
||||||
|
|
||||||
|
|
|
@ -56,6 +56,9 @@ GST_DEBUG_CATEGORY_EXTERN (equalizer_debug);
|
||||||
#define gst_iir_equalizer_3bands_parent_class parent_class
|
#define gst_iir_equalizer_3bands_parent_class parent_class
|
||||||
G_DEFINE_TYPE (GstIirEqualizer3Bands, gst_iir_equalizer_3bands,
|
G_DEFINE_TYPE (GstIirEqualizer3Bands, gst_iir_equalizer_3bands,
|
||||||
GST_TYPE_IIR_EQUALIZER);
|
GST_TYPE_IIR_EQUALIZER);
|
||||||
|
GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (equalizer_3bands, "equalizer-3bands",
|
||||||
|
GST_RANK_NONE, GST_TYPE_IIR_EQUALIZER_3BANDS,
|
||||||
|
equalizer_element_init (plugin));
|
||||||
|
|
||||||
/* equalizer implementation */
|
/* equalizer implementation */
|
||||||
|
|
||||||
|
|
|
@ -99,7 +99,9 @@ GST_DEBUG_CATEGORY_EXTERN (equalizer_debug);
|
||||||
#define gst_iir_equalizer_nbands_parent_class parent_class
|
#define gst_iir_equalizer_nbands_parent_class parent_class
|
||||||
G_DEFINE_TYPE (GstIirEqualizerNBands, gst_iir_equalizer_nbands,
|
G_DEFINE_TYPE (GstIirEqualizerNBands, gst_iir_equalizer_nbands,
|
||||||
GST_TYPE_IIR_EQUALIZER);
|
GST_TYPE_IIR_EQUALIZER);
|
||||||
|
GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (equalizer_nbands, "equalizer-nbands",
|
||||||
|
GST_RANK_NONE, GST_TYPE_IIR_EQUALIZER_NBANDS,
|
||||||
|
equalizer_element_init (plugin));
|
||||||
/* equalizer implementation */
|
/* equalizer implementation */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
45
gst/equalizer/gstiirequalizerplugin.c
Normal file
45
gst/equalizer/gstiirequalizerplugin.c
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
/* GStreamer
|
||||||
|
* Copyright (C) <2004> Benjamin Otte <otte@gnome.org>
|
||||||
|
* <2007> Stefan Kost <ensonic@users.sf.net>
|
||||||
|
* <2007> Sebastian Dröge <slomo@circular-chaos.org>
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "gstiirequalizer.h"
|
||||||
|
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
plugin_init (GstPlugin * plugin)
|
||||||
|
{
|
||||||
|
gboolean ret = FALSE;
|
||||||
|
|
||||||
|
ret |= GST_ELEMENT_REGISTER (equalizer_nbands, plugin);
|
||||||
|
ret |= GST_ELEMENT_REGISTER (equalizer_3bands, plugin);
|
||||||
|
ret |= GST_ELEMENT_REGISTER (equalizer_10bands, plugin);
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
|
||||||
|
GST_VERSION_MINOR,
|
||||||
|
equalizer,
|
||||||
|
"GStreamer audio equalizers",
|
||||||
|
plugin_init, VERSION, GST_LICENSE, GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN)
|
|
@ -1,8 +1,10 @@
|
||||||
eq_sources = [
|
eq_sources = [
|
||||||
'gstiirequalizer.c',
|
'gstiirequalizer.c',
|
||||||
|
'gstiirequalizerplugin.c',
|
||||||
'gstiirequalizernbands.c',
|
'gstiirequalizernbands.c',
|
||||||
'gstiirequalizer3bands.c',
|
'gstiirequalizer3bands.c',
|
||||||
'gstiirequalizer10bands.c',
|
'gstiirequalizer10bands.c',
|
||||||
|
'gstiirequalizerplugin.c',
|
||||||
]
|
]
|
||||||
|
|
||||||
gstequalizer = library('gstequalizer',
|
gstequalizer = library('gstequalizer',
|
||||||
|
|
Loading…
Reference in a new issue