From 44e09dddc430f9e24f0db08fc86120e3cd8b13c7 Mon Sep 17 00:00:00 2001 From: Stefan Kost Date: Fri, 9 Mar 2007 08:58:26 +0000 Subject: gst/equalizer/: Refactor plugin into a base class and a first subclass (nband eq). The nband eq uses GstChildProxy an... Original commit message from CVS: * gst/equalizer/Makefile.am: * gst/equalizer/gstiirequalizer.c: (_do_init), (gst_iir_equalizer_band_set_property), (gst_iir_equalizer_band_get_property), (gst_iir_equalizer_band_class_init), (gst_iir_equalizer_band_get_type), (gst_iir_equalizer_child_proxy_get_child_by_index), (gst_iir_equalizer_child_proxy_get_children_count), (gst_iir_equalizer_child_proxy_interface_init), (gst_iir_equalizer_base_init), (gst_iir_equalizer_class_init), (gst_iir_equalizer_finalize), (setup_filter), (gst_iir_equalizer_compute_frequencies), (gst_iir_equalizer_set_property), (gst_iir_equalizer_get_property), (gst_iir_equalizer_setup), (plugin_init): * gst/equalizer/gstiirequalizer.h: * gst/equalizer/gstiirequalizernbands.c: (gst_iir_equalizer_nbands_base_init), (gst_iir_equalizer_nbands_class_init), (gst_iir_equalizer_nbands_init), (gst_iir_equalizer_nbands_set_property), (gst_iir_equalizer_nbands_get_property): * gst/equalizer/gstiirequalizernbands.h: Refactor plugin into a base class and a first subclass (nband eq). The nband eq uses GstChildProxy and is controlable. More subclasses will follow. --- gst/equalizer/gstiirequalizer.h | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) (limited to 'gst/equalizer/gstiirequalizer.h') diff --git a/gst/equalizer/gstiirequalizer.h b/gst/equalizer/gstiirequalizer.h index 2193369b..03fe6a72 100644 --- a/gst/equalizer/gstiirequalizer.h +++ b/gst/equalizer/gstiirequalizer.h @@ -1,5 +1,6 @@ /* GStreamer IIR equalizer * Copyright (C) <2004> Benjamin Otte + * <2007> Stefan Kost * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -22,9 +23,19 @@ #include #include +#include + + +#define GST_EQUALIZER_TRANSFORM_LOCK(eq) \ + g_mutex_lock (GST_BASE_TRANSFORM(eq)->transform_lock) + +#define GST_EQUALIZER_TRANSFORM_UNLOCK(eq) \ + g_mutex_unlock (GST_BASE_TRANSFORM(eq)->transform_lock) + typedef struct _GstIirEqualizer GstIirEqualizer; typedef struct _GstIirEqualizerClass GstIirEqualizerClass; +typedef struct _GstIirEqualizerBand GstIirEqualizerBand; #define GST_TYPE_IIR_EQUALIZER \ (gst_iir_equalizer_get_type()) @@ -43,30 +54,22 @@ typedef struct _GstIirEqualizerClass GstIirEqualizerClass; typedef void (*ProcessFunc) (GstIirEqualizer * eq, guint8 * data, guint size, guint channels); -typedef struct -{ - gdouble alpha; /* IIR coefficients for outputs */ - gdouble beta; /* IIR coefficients for inputs */ - gdouble gamma; /* IIR coefficients for inputs */ -} SecondOrderFilter; - struct _GstIirEqualizer { GstAudioFilter audiofilter; /*< private >*/ + + GstIirEqualizerBand **bands; /* properties */ - guint freq_count; + guint freq_band_count; gdouble band_width; - gdouble *freqs; - gdouble *values; - - /* data */ - SecondOrderFilter *filter; + /* for each band and channel */ gpointer history; - ProcessFunc process; guint history_size; + + ProcessFunc process; }; struct _GstIirEqualizerClass @@ -74,4 +77,8 @@ struct _GstIirEqualizerClass GstAudioFilterClass audiofilter_class; }; +extern void gst_iir_equalizer_compute_frequencies (GstIirEqualizer * equ, guint new_count); + +extern GType gst_iir_equalizer_get_type(void); + #endif /* __GST_IIR_EQUALIZER__ */ -- cgit