90 lines
2.8 KiB
C
Executable File
90 lines
2.8 KiB
C
Executable File
/* GStreamer
|
|
* Copyright (C) 1999 Erik Walthinsen <omega@cse.ogi.edu>
|
|
* Copyright (C) 2000,2001,2002,2003,2005
|
|
* Thomas Vander Stichele <thomas at apestaart dot org>
|
|
*
|
|
* This library is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU Library General Public
|
|
* License as published by the Free Software Foundation; either
|
|
* version 2 of the License, or (at your option) any later version.
|
|
*
|
|
* This library is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
* Library General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Library General Public
|
|
* License along with this library; if not, write to the
|
|
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
|
* Boston, MA 02110-1301, USA.
|
|
*/
|
|
|
|
|
|
#ifndef __GST_BEAT_DETECTOR_H__
|
|
#define __GST_BEAT_DETECTOR_H__
|
|
|
|
#define VERSION "1"
|
|
#define GST_PACKAGE_NAME "package"
|
|
#define GST_PACKAGE_ORIGIN "unknown"
|
|
#define GST_LICENSE "LGPL"
|
|
#define PACKAGE "gst-beat-detector"
|
|
|
|
#include <gst/gst.h>
|
|
#include <gst/base/gstbasetransform.h>
|
|
#include <gst/audio/audio.h>
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
|
#define GST_TYPE_BEAT_DETECTOR \
|
|
(gst_beat_detector_get_type())
|
|
#define GST_BEAT_DETECTOR(obj) \
|
|
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_BEAT_DETECTOR,GstBeatDetector))
|
|
#define GST_BEAT_DETECTOR_CLASS(klass) \
|
|
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_BEAT_DETECTOR,GstBeatDetectorClass))
|
|
#define GST_BEAT_DETECTOR_GET_CLASS(obj) \
|
|
(G_TYPE_INSTANCE_GET_CLASS((obj),GST_TYPE_BEAT_DETECTOR,GstBeatDetectorClass))
|
|
#define GST_IS_BEAT_DETECTOR(obj) \
|
|
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_BEAT_DETECTOR))
|
|
#define GST_IS_BEAT_DETECTOR_CLASS(klass) \
|
|
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_BEAT_DETECTOR))
|
|
|
|
|
|
typedef struct _GstBeatDetector GstBeatDetector;
|
|
typedef struct _GstBeatDetectorClass GstBeatDetectorClass;
|
|
|
|
/**
|
|
* GstBeatDetector:
|
|
*
|
|
* Opaque data structure.
|
|
*/
|
|
struct _GstBeatDetector {
|
|
GstBaseTransform element;
|
|
|
|
/* properties */
|
|
gboolean post_messages; /* whether or not to post messages */
|
|
guint64 interval; /* how many nanoseconds between emits */
|
|
gdouble decay_peak_ttl; /* time to live for peak in nanoseconds */
|
|
gdouble decay_peak_falloff; /* falloff in dB/sec */
|
|
|
|
GstAudioInfo info;
|
|
gint num_frames; /* frame count (1 sample per channel)
|
|
* since last emit */
|
|
gint interval_frames; /* after how many frame to sent a message */
|
|
GstClockTime message_ts; /* starttime for next message */
|
|
|
|
void (*process)(gpointer, guint, guint, gdouble*, gdouble*);
|
|
};
|
|
|
|
struct _GstBeatDetectorClass {
|
|
GstBaseTransformClass parent_class;
|
|
};
|
|
|
|
GType gst_beat_detector_get_type (void);
|
|
|
|
|
|
G_END_DECLS
|
|
|
|
|
|
#endif /* __GST_BEAT_DETECTOR_H__ */
|