16
|
1 |
/* -*- c-basic-offset: 2 -*-
|
|
2 |
*
|
|
3 |
* GStreamer
|
|
4 |
* Copyright (C) 1999-2001 Erik Walthinsen <omega@cse.ogi.edu>
|
|
5 |
* 2006 Dreamlab Technologies Ltd. <mathis.hofer@dreamlab.net>
|
|
6 |
* 2009 Sebastian Dröge <sebastian.droege@collabora.co.uk>
|
|
7 |
*
|
|
8 |
* This library is free software; you can redistribute it and/or
|
|
9 |
* modify it under the terms of the GNU Library General Public
|
|
10 |
* License as published by the Free Software Foundation; either
|
|
11 |
* version 2 of the License, or (at your option) any later version.
|
|
12 |
*
|
|
13 |
* This library is distributed in the hope that it will be useful,
|
|
14 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
16 |
* Library General Public License for more details.
|
|
17 |
*
|
|
18 |
* You should have received a copy of the GNU Library General Public
|
|
19 |
* License along with this library; if not, write to the
|
|
20 |
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
21 |
* Boston, MA 02111-1307, USA.
|
|
22 |
*
|
|
23 |
*/
|
|
24 |
|
|
25 |
#ifndef __GST_AUDIO_FX_BASE_FIR_FILTER_H__
|
|
26 |
#define __GST_AUDIO_FX_BASE_FIR_FILTER_H__
|
|
27 |
|
|
28 |
#include <gst/gst.h>
|
|
29 |
#include <gst/gst_global.h>
|
|
30 |
#include <gst/audio/gstaudiofilter.h>
|
|
31 |
|
|
32 |
G_BEGIN_DECLS
|
|
33 |
|
|
34 |
#define GST_TYPE_AUDIO_FX_BASE_FIR_FILTER \
|
|
35 |
(gst_audio_fx_base_fir_filter_get_type())
|
|
36 |
#define GST_AUDIO_FX_BASE_FIR_FILTER(obj) \
|
|
37 |
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_AUDIO_FX_BASE_FIR_FILTER,GstAudioFXBaseFIRFilter))
|
|
38 |
#define GST_AUDIO_FX_BASE_FIR_FILTER_CLASS(klass) \
|
|
39 |
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_AUDIO_FX_BASE_FIR_FILTER,GstAudioFXBaseFIRFilterClass))
|
|
40 |
#define GST_IS_AUDIO_FX_BASE_FIR_FILTER(obj) \
|
|
41 |
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_AUDIO_FX_BASE_FIR_FILTER))
|
|
42 |
#define GST_IS_AUDIO_FX_BASE_FIR_FILTER_CLASS(klass) \
|
|
43 |
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AUDIO_FX_BASE_FIR_FILTER))
|
|
44 |
|
|
45 |
typedef struct _GstAudioFXBaseFIRFilter GstAudioFXBaseFIRFilter;
|
|
46 |
typedef struct _GstAudioFXBaseFIRFilterClass GstAudioFXBaseFIRFilterClass;
|
|
47 |
|
|
48 |
typedef void (*GstAudioFXBaseFIRFilterProcessFunc) (GstAudioFXBaseFIRFilter *, guint8 *, guint8 *, guint);
|
|
49 |
|
|
50 |
/**
|
|
51 |
* GstAudioFXBaseFIRFilter:
|
|
52 |
*
|
|
53 |
* Opaque data structure.
|
|
54 |
*/
|
|
55 |
struct _GstAudioFXBaseFIRFilter {
|
|
56 |
GstAudioFilter element;
|
|
57 |
|
|
58 |
/* < private > */
|
|
59 |
GstAudioFXBaseFIRFilterProcessFunc process;
|
|
60 |
|
|
61 |
gdouble *kernel; /* filter kernel */
|
|
62 |
guint kernel_length; /* length of the filter kernel */
|
|
63 |
gdouble *residue; /* buffer for left-over samples from previous buffer */
|
|
64 |
guint residue_length;
|
|
65 |
|
|
66 |
guint64 latency;
|
|
67 |
|
|
68 |
GstClockTime next_ts;
|
|
69 |
guint64 next_off;
|
|
70 |
};
|
|
71 |
|
|
72 |
struct _GstAudioFXBaseFIRFilterClass {
|
|
73 |
GstAudioFilterClass parent_class;
|
|
74 |
};
|
|
75 |
#ifdef __SYMBIAN32__
|
|
76 |
IMPORT_C
|
|
77 |
#endif
|
|
78 |
|
|
79 |
|
|
80 |
GType gst_audio_fx_base_fir_filter_get_type (void);
|
|
81 |
void gst_audio_fx_base_fir_filter_set_kernel (GstAudioFXBaseFIRFilter *filter, gdouble *kernel, guint kernel_length, guint64 latency);
|
|
82 |
void gst_audio_fx_base_fir_filter_push_residue (GstAudioFXBaseFIRFilter *filter);
|
|
83 |
|
|
84 |
G_END_DECLS
|
|
85 |
|
|
86 |
#endif /* __GST_AUDIO_FX_BASE_FIR_FILTER_H__ */
|