summaryrefslogtreecommitdiffstats
path: root/gst
diff options
context:
space:
mode:
authorThomas Vander Stichele <thomas@apestaart.org>2002-08-30 13:37:31 +0000
committerThomas Vander Stichele <thomas@apestaart.org>2002-08-30 13:37:31 +0000
commit81fc9a9cb315a495050bec082b47307eae92fe75 (patch)
tree4e35e78b507038347765f6093a4184a4ae9e4982 /gst
parent259097a3a7f1bba5e0791e86dc34a0027e822380 (diff)
cleanups and clarifications
Original commit message from CVS: cleanups and clarifications
Diffstat (limited to 'gst')
-rw-r--r--gst/level/filter.func2
-rw-r--r--gst/level/gstlevel.c46
2 files changed, 27 insertions, 21 deletions
diff --git a/gst/level/filter.func b/gst/level/filter.func
index ccdaf616..8ef4753f 100644
--- a/gst/level/filter.func
+++ b/gst/level/filter.func
@@ -40,6 +40,6 @@
threshold_dB += 1;
}
/* printf ("RMS in dB (for 16bit) : %f\n", RMS_dB); */
- printf ("%f %f\n", timepoint, RMS_dB);
+ printf ("%f s %f dB\n", timepoint, RMS_dB);
}
diff --git a/gst/level/gstlevel.c b/gst/level/gstlevel.c
index a49657c7..debab4b7 100644
--- a/gst/level/gstlevel.c
+++ b/gst/level/gstlevel.c
@@ -172,41 +172,46 @@ gst_level_chain (GstPad *pad, GstBuffer *buf)
in_data = (gint16 *) GST_BUFFER_DATA(buf);
outbuf = gst_buffer_new();
- GST_BUFFER_DATA (outbuf) = (gchar*) g_new (gint16, GST_BUFFER_SIZE(buf)/2);
- GST_BUFFER_SIZE (outbuf) = GST_BUFFER_SIZE(buf);
+ GST_BUFFER_DATA (outbuf) = (gchar *) g_new (gint16,
+ GST_BUFFER_SIZE (buf) / 2);
+ GST_BUFFER_SIZE (outbuf) = GST_BUFFER_SIZE (buf);
- out_data = (gint16*)GST_BUFFER_DATA(outbuf);
+ out_data = (gint16 *) GST_BUFFER_DATA (outbuf);
+ g_print ("%s: ", gst_element_get_name (GST_ELEMENT (filter)));
switch (width) {
case 16:
- gst_level_fast_16bit_chain(in_data,&out_data,GST_BUFFER_SIZE(buf)/2);
+ gst_level_fast_16bit_chain (in_data, &out_data,
+ GST_BUFFER_SIZE (buf) / 2);
break;
case 8:
- gst_level_fast_8bit_chain((gint8*)in_data,(gint8**)&out_data,GST_BUFFER_SIZE(buf));
+ gst_level_fast_8bit_chain ((gint8 *) in_data,
+ (gint8 **) &out_data, GST_BUFFER_SIZE(buf));
break;
}
- gst_buffer_unref(buf);
- gst_pad_push(filter->srcpad,outbuf);
+ gst_buffer_unref (buf);
+ gst_pad_push (filter->srcpad,outbuf);
}
static void inline
-gst_level_fast_16bit_chain(gint16* in_data, gint16** out_data,
- guint num_samples)
+gst_level_fast_16bit_chain (gint16* in_data, gint16** out_data,
+ guint num_samples)
#include "filter.func"
static void inline
-gst_level_fast_8bit_chain(gint8* in_data, gint8** out_data,
- guint num_samples)
+gst_level_fast_8bit_chain (gint8* in_data, gint8** out_data,
+ guint num_samples)
#include "filter.func"
static void
-gst_level_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
+gst_level_set_property (GObject *object, guint prop_id,
+ const GValue *value, GParamSpec *pspec)
{
GstLevel *filter;
/* it's not null if we got it, but it might not be ours */
- g_return_if_fail(GST_IS_LEVEL(object));
- filter = GST_LEVEL(object);
+ g_return_if_fail (GST_IS_LEVEL (object));
+ filter = GST_LEVEL (object);
switch (prop_id) {
default:
@@ -215,13 +220,14 @@ gst_level_set_property (GObject *object, guint prop_id, const GValue *value, GPa
}
static void
-gst_level_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
+gst_level_get_property (GObject *object, guint prop_id,
+ GValue *value, GParamSpec *pspec)
{
GstLevel *filter;
/* it's not null if we got it, but it might not be ours */
- g_return_if_fail(GST_IS_LEVEL(object));
- filter = GST_LEVEL(object);
+ g_return_if_fail (GST_IS_LEVEL (object));
+ filter = GST_LEVEL (object);
switch (prop_id) {
default:
@@ -264,9 +270,9 @@ plugin_init (GModule *module, GstPlugin *plugin)
{
GstElementFactory *factory;
- factory = gst_element_factory_new("level",GST_TYPE_LEVEL,
- &level_details);
- g_return_val_if_fail(factory != NULL, FALSE);
+ factory = gst_element_factory_new ("level", GST_TYPE_LEVEL,
+ &level_details);
+ g_return_val_if_fail (factory != NULL, FALSE);
gst_element_factory_add_pad_template (factory, level_src_factory ());
gst_element_factory_add_pad_template (factory, level_sink_factory ());