Commit 5c1b116d authored by Stefan Kost's avatar Stefan Kost
Browse files

Fix level for multi-channel case.

Original commit message from CVS:
* gst/level/gstlevel.c: (gst_level_set_caps),
(gst_level_transform_ip):
* sys/v4l2/README:
* tests/check/elements/level.c: (GST_START_TEST):
Fix level for multi-channel case.
parent 6e44a9c6
2007-02-22 Stefan Kost <ensonic@users.sf.net>
* gst/level/gstlevel.c: (gst_level_set_caps),
(gst_level_transform_ip):
* sys/v4l2/README:
* tests/check/elements/level.c: (GST_START_TEST):
Fix level for multi-channel case.
2007-02-21 Stefan Kost <ensonic@users.sf.net> 2007-02-21 Stefan Kost <ensonic@users.sf.net>
* gst/level/gstlevel.c: (gst_level_init), (gst_level_set_caps), * gst/level/gstlevel.c: (gst_level_init), (gst_level_set_caps),
......
...@@ -514,12 +514,13 @@ gst_level_transform_ip (GstBaseTransform * trans, GstBuffer * in) ...@@ -514,12 +514,13 @@ gst_level_transform_ip (GstBaseTransform * trans, GstBuffer * in)
for (i = 0; i < filter->channels; ++i) { for (i = 0; i < filter->channels; ++i) {
CS = 0.0; CS = 0.0;
filter->process (in_data + i, num_int_samples, filter->channels, &CS, filter->process (in_data, num_int_samples, filter->channels, &CS,
&filter->peak[i]); &filter->peak[i]);
GST_LOG_OBJECT (filter, GST_LOG_OBJECT (filter,
"channel %d, cumulative sum %f, peak %f, over %d samples/%d channels", "channel %d, cumulative sum %f, peak %f, over %d samples/%d channels",
i, CS, filter->peak[i], num_int_samples, filter->channels); i, CS, filter->peak[i], num_int_samples, filter->channels);
filter->CS[i] += CS; filter->CS[i] += CS;
in_data += (filter->width / 8);
} }
filter->num_frames += num_frames; filter->num_frames += num_frames;
......
...@@ -26,3 +26,7 @@ V4L2 API: http://linux.bytesex.org/v4l2/. ...@@ -26,3 +26,7 @@ V4L2 API: http://linux.bytesex.org/v4l2/.
Kernel patches available from Kernel patches available from
http://dl.bytesex.org/patches/. http://dl.bytesex.org/patches/.
Articles:
http://lwn.net/Articles/203924/
...@@ -157,6 +157,7 @@ GST_START_TEST (test_int16) ...@@ -157,6 +157,7 @@ GST_START_TEST (test_int16)
list = gst_structure_get_value (structure, fields[j]); list = gst_structure_get_value (structure, fields[j]);
value = gst_value_list_get_value (list, i); value = gst_value_list_get_value (list, i);
dB = g_value_get_double (value); dB = g_value_get_double (value);
GST_DEBUG ("%s is %lf", fields[j], dB);
fail_if (dB < -6.0); fail_if (dB < -6.0);
fail_if (dB > -5.9); fail_if (dB > -5.9);
} }
...@@ -165,7 +166,6 @@ GST_START_TEST (test_int16) ...@@ -165,7 +166,6 @@ GST_START_TEST (test_int16)
fail_if ((outbuffer = (GstBuffer *) buffers->data) == NULL); fail_if ((outbuffer = (GstBuffer *) buffers->data) == NULL);
fail_unless (inbuffer == outbuffer); fail_unless (inbuffer == outbuffer);
/* clean up */ /* clean up */
/* flush current messages,and future state change messages */ /* flush current messages,and future state change messages */
gst_bus_set_flushing (bus, TRUE); gst_bus_set_flushing (bus, TRUE);
......
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