Commit 5d001b3a authored by Sebastian Dröge's avatar Sebastian Dröge 🍵

gst/spectrum/: Post a spectrum message on the bus for every interval, even if...

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.
parent 75c1c9f3
2009-01-14 Sebastian Dröge <sebastian.droege@collabora.co.uk>
* 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.
2009-01-13 Sebastian Dröge <sebastian.droege@collabora.co.uk>
* configure.ac:
......
plugin_LTLIBRARIES = libgstspectrum.la
libgstspectrum_la_SOURCES = gstspectrum.c
......@@ -11,5 +10,3 @@ libgstspectrum_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
libgstspectrum_la_LIBTOOLFLAGS = --tag=disable-static
noinst_HEADERS = gstspectrum.h
EXTRA_DIST = README
This diff is collapsed.
/* 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__ */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment