From f81256027660cc422f144e644b3960165d9b4252 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 9 Aug 2007 18:08:05 +0000 Subject: gst/filter/gstlpwsinc.*: Add double support, replace "this" with "self" as the former is a C++ keyword. Original commit message from CVS: * gst/filter/gstlpwsinc.c: (gst_lpwsinc_dispose), (gst_lpwsinc_class_init), (gst_lpwsinc_init), (process_32), (process_64), (lpwsinc_build_kernel), (lpwsinc_setup), (lpwsinc_get_unit_size), (lpwsinc_transform), (lpwsinc_set_property), (lpwsinc_get_property): * gst/filter/gstlpwsinc.h: Add double support, replace "this" with "self" as the former is a C++ keyword. Implement the frequency property in Hz instead of fraction of sampling frequency. Remove some unecessary FIXMEs and add some TODOs, add some required locking and refactor the kernel generation into a separate function that is also called when the properties change now. And use BaseTransform::transform instead of transform_ip as the convolution is done out of place anyway. Should be done in place later. --- gst/filter/gstlpwsinc.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'gst/filter/gstlpwsinc.h') diff --git a/gst/filter/gstlpwsinc.h b/gst/filter/gstlpwsinc.h index 14791b51..afb7e9c7 100644 --- a/gst/filter/gstlpwsinc.h +++ b/gst/filter/gstlpwsinc.h @@ -54,6 +54,8 @@ G_BEGIN_DECLS typedef struct _GstLPWSinc GstLPWSinc; typedef struct _GstLPWSincClass GstLPWSincClass; +typedef void (*GstLPWSincProcessFunc) (GstLPWSinc *, guint8 *, guint8 *, guint); + /** * GstLPWSinc: * @@ -62,14 +64,15 @@ typedef struct _GstLPWSincClass GstLPWSincClass; struct _GstLPWSinc { GstAudioFilter element; - void (*process)(GstLPWSinc*, gpointer, gint); + GstLPWSincProcessFunc process; - double frequency; - int wing_size; /* length of a "wing" of the filter; + gdouble frequency; + gint wing_size; /* length of a "wing" of the filter; actual length is 2 * wing_size + 1 */ - gfloat *residue; /* buffer for left-over samples from previous buffer */ - double *kernel; + gdouble *residue; /* buffer for left-over samples from previous buffer */ + gdouble *kernel; /* filter kernel */ + gboolean have_kernel; }; struct _GstLPWSincClass { -- cgit v1.2.1