diff options
author | Sebastian Dröge <slomo@circular-chaos.org> | 2009-01-14 10:46:54 +0000 |
---|---|---|
committer | Sebastian Dröge <slomo@circular-chaos.org> | 2009-01-14 10:46:54 +0000 |
commit | 5d001b3ab629e91803c369fd843b75c728ebfdd2 (patch) | |
tree | 86418eb341b3812b818c2efcd797a3f3551e3265 /gst/spectrum/gstspectrum.h | |
parent | 75c1c9f3789568b69678cd3babb4d29e0ebdd87b (diff) |
gst/spectrum/: Post a spectrum message on the bus for every interval, even if the interval is small than the length o...
Original commit message from CVS:
* gst/spectrum/Makefile.am:
* gst/spectrum/README:
* gst/spectrum/gstspectrum.c: (gst_spectrum_base_init),
(gst_spectrum_class_init), (gst_spectrum_init),
(gst_spectrum_reset_state), (gst_spectrum_finalize),
(gst_spectrum_set_property), (gst_spectrum_start),
(gst_spectrum_stop), (gst_spectrum_setup),
(gst_spectrum_transform_ip):
* gst/spectrum/gstspectrum.h:
Post a spectrum message on the bus for every interval, even
if the interval is small than the length of the FFT.
Fixes bug #567642.
Major cleanup of the spectrum element.
Diffstat (limited to 'gst/spectrum/gstspectrum.h')
-rw-r--r-- | gst/spectrum/gstspectrum.h | 47 |
1 files changed, 18 insertions, 29 deletions
diff --git a/gst/spectrum/gstspectrum.h b/gst/spectrum/gstspectrum.h index ec41668f..8c5e533c 100644 --- a/gst/spectrum/gstspectrum.h +++ b/gst/spectrum/gstspectrum.h @@ -1,5 +1,6 @@ /* GStreamer * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu> + * Copyright (C) <2009> Sebastian Dröge <sebastian.droege@collabora.co.uk> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -21,67 +22,55 @@ #ifndef __GST_SPECTRUM_H__ #define __GST_SPECTRUM_H__ - #include <gst/gst.h> -#include <gst/base/gstadapter.h> -#include <gst/base/gstbasetransform.h> #include <gst/audio/gstaudiofilter.h> +#include <gst/fft/gstfftf32.h> -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - +G_BEGIN_DECLS #define GST_TYPE_SPECTRUM (gst_spectrum_get_type()) #define GST_SPECTRUM(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_SPECTRUM,GstSpectrum)) #define GST_IS_SPECTRUM(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_SPECTRUM)) #define GST_SPECTRUM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_SPECTRUM,GstSpectrumClass)) #define GST_IS_SPECTRUM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_SPECTRUM)) - typedef struct _GstSpectrum GstSpectrum; typedef struct _GstSpectrumClass GstSpectrumClass; -typedef void (*GstSpectrumProcessFunc) (GstSpectrum *, const guint8 *); -typedef void (*GstSpectrumFFTFreeFunc) (void *); -struct _GstSpectrum { - GstAudioFilter element; - - GstPad *sinkpad,*srcpad; - GstAdapter *adapter; +struct _GstSpectrum +{ + GstAudioFilter parent; /* properties */ gboolean message; /* whether or not to post messages */ gboolean message_magnitude; gboolean message_phase; - guint64 interval; /* how many seconds between emits */ + guint64 interval; /* how many nanoseconds between emits */ + guint64 frames_per_interval; /* how many frames per interval */ guint bands; /* number of spectrum bands */ gint threshold; /* energy level treshold */ - gint num_frames; /* frame count (1 sample per channel) + guint num_frames; /* frame count (1 sample per channel) * since last emit */ - gint num_fft; /* number of FFTs since last emit */ + guint num_fft; /* number of FFTs since last emit */ GstClockTime message_ts; /* starttime for next message */ /* <private> */ + gfloat *input; + guint input_pos; + gfloat *input_tmp; + GstFFTF32Complex *freqdata; gfloat *spect_magnitude; gfloat *spect_phase; - GstSpectrumProcessFunc process; - void *fft_ctx; - GstSpectrumFFTFreeFunc fft_free_func; - void *in; - void *freqdata; + GstFFTF32 *fft_ctx; }; -struct _GstSpectrumClass { +struct _GstSpectrumClass +{ GstAudioFilterClass parent_class; }; GType gst_spectrum_get_type (void); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - +G_END_DECLS #endif /* __GST_SPECTRUM_H__ */ |