From 7a14b5d39304b3ad823a5aa6e73a3cc99f21b896 Mon Sep 17 00:00:00 2001 From: Stefan Kost Date: Thu, 25 Mar 2010 23:24:36 +0200 Subject: [PATCH] signalprocessor: add more logging --- .../gst/signalprocessor/gstsignalprocessor.c | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/gst-libs/gst/signalprocessor/gstsignalprocessor.c b/gst-libs/gst/signalprocessor/gstsignalprocessor.c index a6908ba5fb..07109db3da 100644 --- a/gst-libs/gst/signalprocessor/gstsignalprocessor.c +++ b/gst-libs/gst/signalprocessor/gstsignalprocessor.c @@ -572,6 +572,8 @@ gst_signal_processor_event (GstPad * pad, GstEvent * event) self = GST_SIGNAL_PROCESSOR (gst_pad_get_parent (pad)); bclass = GST_SIGNAL_PROCESSOR_GET_CLASS (self); + GST_DEBUG_OBJECT (pad, "got event %s", GST_EVENT_TYPE_NAME (event)); + /* FIXME, this probably isn't the correct interface: what about return values, * what about overriding event_default * Sync with GstBaseTransform::gst_base_transform_sink_event */ @@ -678,6 +680,9 @@ gst_signal_processor_prepare (GstSignalProcessor * self, guint nframes) is the exact size of the number of samples we are processing. */ sinks = elem->sinkpads; srcs = elem->srcpads; + + GST_LOG_OBJECT (self, "allocating %d buffers", g_list_length (srcs)); + if (GST_SIGNAL_PROCESSOR_CLASS_CAN_PROCESS_IN_PLACE (klass)) { while (sinks && srcs) { GstSignalProcessorPad *sinkpad, *srcpad; @@ -711,12 +716,15 @@ gst_signal_processor_prepare (GstSignalProcessor * self, guint nframes) srcpad = (GstSignalProcessorPad *) srcs->data; - ret = - gst_pad_alloc_buffer_and_set_caps (GST_PAD (srcpad), -1, + ret = gst_pad_alloc_buffer_and_set_caps (GST_PAD (srcpad), + GST_CLOCK_TIME_NONE, samples_avail * srcpad->channels * sizeof (gfloat), self->caps, &srcpad->pen); if (ret != GST_FLOW_OK) { + GST_INFO_OBJECT (self, + "allocating buffer for %u samples, %u channels failed", samples_avail, + srcpad->channels); self->flow_state = ret; return 0; } else if (srcpad->channels > 1) { @@ -823,8 +831,9 @@ gst_signal_processor_process (GstSignalProcessor * self, guint nframes) flow_error: { - GST_WARNING ("gst_pad_alloc_buffer_and_set_caps() returned %d", - self->flow_state); + GST_WARNING_OBJECT (self, + "gst_signal_processor_prepare() returned %d, flow_ref=%s", nframes, + gst_flow_get_name (self->flow_state)); return; } } @@ -1018,6 +1027,9 @@ gst_signal_processor_chain (GstPad * pad, GstBuffer * buffer) self = GST_SIGNAL_PROCESSOR (gst_pad_get_parent (pad)); + GST_LOG_OBJECT (self, "chain(%s:%s, %p) : p_in=%u, p_out=%u", + GST_DEBUG_PAD_NAME (pad), buffer, self->pending_in, self->pending_out); + gst_signal_processor_pen_buffer (self, pad, buffer); if (self->pending_in == 0) {