summaryrefslogtreecommitdiff
path: root/gst/spectrum
diff options
context:
space:
mode:
Diffstat (limited to 'gst/spectrum')
-rw-r--r--gst/spectrum/gstspectrum.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/gst/spectrum/gstspectrum.c b/gst/spectrum/gstspectrum.c
index ab3a556b1..0dbf37273 100644
--- a/gst/spectrum/gstspectrum.c
+++ b/gst/spectrum/gstspectrum.c
@@ -949,12 +949,20 @@ gst_spectrum_transform_ip (GstBaseTransform * trans, GstBuffer * buffer)
gst_spectrum_alloc_channel_data (spectrum);
+ /* number of sample frames we process before posting a message
+ * interval is in ns */
spectrum->frames_per_interval =
gst_util_uint64_scale (spectrum->interval, rate, GST_SECOND);
+ /* rounding error in ns, aggregated it in accumulated_error */
spectrum->error_per_interval = (spectrum->interval * rate) % GST_SECOND;
if (spectrum->frames_per_interval == 0)
spectrum->frames_per_interval = 1;
+ GST_INFO_OBJECT (spectrum, "interval %" GST_TIME_FORMAT ", fpi %"
+ G_GUINT64_FORMAT ", error %" GST_TIME_FORMAT,
+ GST_TIME_ARGS (spectrum->interval), spectrum->frames_per_interval,
+ GST_TIME_ARGS (spectrum->error_per_interval));
+
spectrum->input_pos = 0;
gst_spectrum_flush (spectrum);
@@ -995,9 +1003,8 @@ gst_spectrum_transform_ip (GstBaseTransform * trans, GstBuffer * buffer)
/* Do we have the FFTs for one interval? */
if (have_full_interval) {
-
- GST_INFO ("nfft: %u num_frames: %" G_GUINT64_FORMAT " fpi: %"
- G_GUINT64_FORMAT " error: %" GST_TIME_FORMAT, nfft,
+ GST_DEBUG_OBJECT (spectrum, "nfft: %u frames: %" G_GUINT64_FORMAT
+ " fpi: %" G_GUINT64_FORMAT " error: %" GST_TIME_FORMAT, nfft,
spectrum->num_frames, spectrum->frames_per_interval,
GST_TIME_ARGS (spectrum->accumulated_error));
@@ -1062,8 +1069,8 @@ gst_spectrum_transform_ip (GstBaseTransform * trans, GstBuffer * buffer)
/* Do we have the FFTs for one interval? */
if (have_full_interval) {
- GST_INFO ("nfft: %u num_frames: %" G_GUINT64_FORMAT " fpi: %"
- G_GUINT64_FORMAT " error: %" GST_TIME_FORMAT, nfft,
+ GST_DEBUG_OBJECT (spectrum, "nfft: %u frames: %" G_GUINT64_FORMAT
+ " fpi: %" G_GUINT64_FORMAT " error: %" GST_TIME_FORMAT, nfft,
spectrum->num_frames, spectrum->frames_per_interval,
GST_TIME_ARGS (spectrum->accumulated_error));