#include <gst/gst.h>
#include <gst/base/gstbasetransform.h>
-
+#include <gst/audio/audio.h>
G_BEGIN_DECLS
typedef struct _GstLevel GstLevel;
typedef struct _GstLevelClass GstLevelClass;
-
+/**
+ * GstLevel:
+ *
+ * Opaque data structure.
+ */
struct _GstLevel {
GstBaseTransform element;
gboolean message; /* whether or not to post messages */
guint64 interval; /* how many seconds between emits */
- gint rate; /* caps variables */
- gint width;
- gint channels;
+ GstAudioInfo info;
gdouble decay_peak_ttl; /* time to live for peak in seconds */
gdouble decay_peak_falloff; /* falloff in dB/sec */
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 */
/* per-channel arrays for intermediate values */
gdouble *CS; /* normalized Cumulative Square */
gdouble *MS; /* normalized Mean Square of buffer */
gdouble *RMS_dB; /* RMS in dB to emit */
GstClockTime *decay_peak_age; /* age of last peak */
+
+ void (*process)(gpointer, guint, guint, gdouble*, gdouble*);
};
struct _GstLevelClass {