From f5097772e7598ef32847cb6894b86f671cc40411 Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Sun, 4 May 2008 11:44:01 +0200 Subject: [PATCH] src/aubiopitch.{c,h}: only one channel as input, pos is signed, indent --- src/gstaubiopitch.c | 16 +++++++++------- src/gstaubiopitch.h | 2 +- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/gstaubiopitch.c b/src/gstaubiopitch.c index 7eaecd7..69b0d39 100644 --- a/src/gstaubiopitch.c +++ b/src/gstaubiopitch.c @@ -64,8 +64,8 @@ enum "audio/x-raw-float," \ " width=(int)32," \ " endianness=(int)BYTE_ORDER," \ - " rate=(int)44100," \ - " channels=(int)[1,MAX]" + " rate=(int)44100," \ + " channels=(int)1" GST_BOILERPLATE (GstAubioPitch, gst_aubio_pitch, GstAudioFilter, GST_TYPE_AUDIO_FILTER); @@ -76,7 +76,8 @@ static void gst_aubio_pitch_set_property (GObject * object, guint prop_id, static void gst_aubio_pitch_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec); -static GstFlowReturn gst_aubio_pitch_transform_ip (GstBaseTransform * trans, GstBuffer * buf); +static GstFlowReturn gst_aubio_pitch_transform_ip (GstBaseTransform * trans, + GstBuffer * buf); /* GObject vmethod implementations */ static void @@ -115,8 +116,8 @@ gst_aubio_pitch_class_init (GstAubioPitchClass * klass) gobject_class->get_property = gst_aubio_pitch_get_property; g_object_class_install_property (gobject_class, PROP_SILENT, - g_param_spec_boolean ("silent", "Silent", "Produce verbose output ?", - FALSE, G_PARAM_READWRITE)); + g_param_spec_boolean ("silent", "Silent", "Produce verbose output", + TRUE, G_PARAM_READWRITE)); } static void @@ -204,11 +205,12 @@ gst_aubio_pitch_transform_ip (GstBaseTransform * trans, GstBuffer * buf) if (filter->pos == filter->hop_size - 1) { smpl_t pitch = aubio_pitchdetection(filter->t, filter->ibuf); - gint64 now = GST_BUFFER_TIMESTAMP (buf); + GstClockTime now = GST_BUFFER_TIMESTAMP (buf); // correction of inside buffer time now += GST_FRAMES_TO_CLOCK_TIME(j, audiofilter->format.rate); if (filter->silent == FALSE) { - g_print ("pitch: %4.3f \t%" GST_TIME_FORMAT "\n", pitch, GST_TIME_ARGS(now)); + g_print ("%" GST_TIME_FORMAT "\tpitch: %.3f\n", + GST_TIME_ARGS(now), pitch); } filter->pos = -1; /* so it will be zero next j loop */ diff --git a/src/gstaubiopitch.h b/src/gstaubiopitch.h index 3cc5c37..40a076f 100644 --- a/src/gstaubiopitch.h +++ b/src/gstaubiopitch.h @@ -62,7 +62,7 @@ struct _GstAubioPitch uint hop_size; uint channels; uint samplerate; - uint pos; + signed int pos; aubio_pitchdetection_type type_pitch; aubio_pitchdetection_mode mode_pitch; -- 2.11.0