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.
This commit is contained in:
Stefan Kost 2007-02-22 14:35:28 +00:00
parent 6e44a9c618
commit 5c1b116dc8
4 changed files with 15 additions and 2 deletions

View file

@ -1,3 +1,11 @@
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>
* gst/level/gstlevel.c: (gst_level_init), (gst_level_set_caps),

View file

@ -514,12 +514,13 @@ gst_level_transform_ip (GstBaseTransform * trans, GstBuffer * in)
for (i = 0; i < filter->channels; ++i) {
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]);
GST_LOG_OBJECT (filter,
"channel %d, cumulative sum %f, peak %f, over %d samples/%d channels",
i, CS, filter->peak[i], num_int_samples, filter->channels);
filter->CS[i] += CS;
in_data += (filter->width / 8);
}
filter->num_frames += num_frames;

View file

@ -26,3 +26,7 @@ V4L2 API: http://linux.bytesex.org/v4l2/.
Kernel patches available from
http://dl.bytesex.org/patches/.
Articles:
http://lwn.net/Articles/203924/

View file

@ -157,6 +157,7 @@ GST_START_TEST (test_int16)
list = gst_structure_get_value (structure, fields[j]);
value = gst_value_list_get_value (list, i);
dB = g_value_get_double (value);
GST_DEBUG ("%s is %lf", fields[j], dB);
fail_if (dB < -6.0);
fail_if (dB > -5.9);
}
@ -165,7 +166,6 @@ GST_START_TEST (test_int16)
fail_if ((outbuffer = (GstBuffer *) buffers->data) == NULL);
fail_unless (inbuffer == outbuffer);
/* clean up */
/* flush current messages,and future state change messages */
gst_bus_set_flushing (bus, TRUE);