4 * Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Aditi Narula <aditi.n@samsung.com>
8 * This library is free software; you can redistribute it and/or modify it under
9 * the terms of the GNU Lesser General Public License as published by the
10 * Free Software Foundation; either version 2.1 of the License, or (at your option)
13 * This library is distributed in the hope that it will be useful, but WITHOUT ANY
14 * WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
16 * License for more details.
18 * You should have received a copy of the GNU Lesser General Public License
19 * along with this library; if not, write to the Free Software Foundation, Inc., 51
20 * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
25 #ifndef __GST_AUDIOEQ_H__
26 #define __GST_AUDIOEQ_H__
30 #include <gst/base/gstbasetransform.h>
31 #include <gst/audio/gstaudiofilter.h>
32 #include <gst/audio/gstringbuffer.h>
33 #include <gst/controller/gstcontroller.h>
37 #define GST_TYPE_AUDIOEQ \
38 (gst_audioeq_get_type())
39 #define GST_AUDIOEQ(obj) \
40 (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_AUDIOEQ,Gstaudioeq))
41 #define GST_audioeq_CLASS(klass) \
42 (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_AUDIOEQ,GstaudioeqClass))
43 #define GST_IS_AUDIOEQ(obj) \
44 (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_AUDIOEQ))
45 #define GST_IS_AUDIOEQ_CLASS(klass) \
46 (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AUDIOEQ))
47 #define GST_TYPE_IIR_EQUALIZER \
48 (gst_iir_equalizer_get_type())
49 #define GST_IIR_EQUALIZER(obj) \
50 (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_IIR_EQUALIZER,GstIirEqualizer))
51 #define GST_IIR_EQUALIZER_CLASS(klass) \
52 (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_IIR_EQUALIZER,GstIirEqualizerClass))
53 #define GST_IS_IIR_EQUALIZER(obj) \
54 (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_IIR_EQUALIZER))
55 #define GST_IS_IIR_EQUALIZER_CLASS(klass) \
56 (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_IIR_EQUALIZER))
58 typedef struct _Gstaudioeq Gstaudioeq;
59 typedef struct _GstaudioeqClass GstaudioeqClass;
60 typedef struct _GstIirEqualizer GstIirEqualizer;
61 typedef struct _GstIirEqualizerClass GstIirEqualizerClass;
62 typedef struct _GstIirEqualizerBand GstIirEqualizerBand;
64 #define CUSTOM_EQ_BAND_MAX 9
66 #define LOWEST_FREQ (20.0)
67 #define HIGHEST_FREQ (20000.0)
69 typedef void (*ProcessFunc) (GstIirEqualizer * eq, guint8 * data, guint size,
72 struct _GstIirEqualizer
74 GstAudioFilter audiofilter;
79 GstIirEqualizerBand **bands;
82 guint freq_band_count;
83 /* for each band and channel */
87 gboolean need_new_coefficients;
92 struct _GstIirEqualizerClass
94 GstAudioFilterClass audiofilter_class;
101 GstBaseTransform element;
108 gint custom_eq[CUSTOM_EQ_BAND_MAX];
109 gboolean need_update_filter;
113 struct _GstaudioeqClass
115 GstAudioFilterClass parent_class;
118 void gst_iir_equalizer_compute_frequencies (Gstaudioeq * audioeq, guint new_count);
120 GType gst_iir_equalizer_get_type(void);
122 GType gst_audioeq_get_type (void);
126 #endif /* __GST_AUDIOEQ_H__ */