summaryrefslogtreecommitdiffstats
path: root/gst/level/gstlevel.h
diff options
context:
space:
mode:
authorThomas Vander Stichele <thomas@apestaart.org>2003-09-21 12:21:49 +0000
committerThomas Vander Stichele <thomas@apestaart.org>2003-09-21 12:21:49 +0000
commit1bb14f4e4864696d32bdbb24168a6b8d7e561753 (patch)
tree3c0144bc47002a73db98a1883049a271e6e340c7 /gst/level/gstlevel.h
parent6ecea15a25119e14d754450db283be5102645cb5 (diff)
reworked level plugin. It now does RMS, peak, and decay peak signaling per interleaved channel.
Original commit message from CVS: reworked level plugin. It now does RMS, peak, and decay peak signaling per interleaved channel.
Diffstat (limited to 'gst/level/gstlevel.h')
-rw-r--r--gst/level/gstlevel.h32
1 files changed, 27 insertions, 5 deletions
diff --git a/gst/level/gstlevel.h b/gst/level/gstlevel.h
index dd5edab4..d5b8fd7e 100644
--- a/gst/level/gstlevel.h
+++ b/gst/level/gstlevel.h
@@ -1,6 +1,10 @@
/* GStreamer
* Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
*
+ * gstlevel.c: signals RMS, peak and decaying peak levels
+ * Copyright (C) 2000,2001,2002,2003
+ * 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
@@ -24,8 +28,8 @@
#include <config.h>
#include <gst/gst.h>
-/* #include <gst/meta/audioraw.h> */
+#include "gstlevel-marshal.h"
#ifdef __cplusplus
extern "C" {
@@ -49,14 +53,32 @@ typedef struct _GstLevelClass GstLevelClass;
struct _GstLevel {
GstElement element;
- GstPad *sinkpad,*srcpad;
-
- /*MetaAudioRaw meta; */
-
+ GstPad *sinkpad, *srcpad;
+ gboolean signal; /* whether or not to emit signals */
+ gdouble interval; /* how many seconds between emits */
+
+ gint rate; /* caps variables */
+ gint width;
+ gint channels;
+
+ gdouble decay_peak_ttl; /* time to live for peak in seconds */
+ gdouble decay_peak_falloff; /* falloff in dB/sec */
+ gdouble num_samples; /* cumulative sample count */
+
+ /* per-channel arrays for intermediate values */
+ gdouble *CS; /* normalized Cumulative Square */
+ gdouble *peak; /* normalized Peak value over buffer */
+ gdouble *last_peak; /* last normalized Peak value over interval */
+ gdouble *decay_peak; /* running decaying normalized Peak */
+ gdouble *MS; /* normalized Mean Square of buffer */
+ gdouble *RMS_dB; /* RMS in dB to emit */
+ gdouble *decay_peak_age; /* age of last peak */
};
struct _GstLevelClass {
GstElementClass parent_class;
+ void (*level) (GstElement *element, gint channel,
+ gdouble RMS_dB, gdouble peak_dB, gdouble decay_peak_dB);
};
GType gst_level_get_type(void);