From 945fd11907e93712f1f3a45f61f9420f59edab38 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Mon, 20 Dec 2021 21:43:25 +0530 Subject: [PATCH] audio: Add logging that was useful in figuring out the last commit Part-of: --- .../gst-libs/gst/audio/gstaudioaggregator.c | 4 +++- .../gst-plugins-base/gst/audioresample/gstaudioresample.c | 3 +++ subprojects/gstreamer/libs/gst/base/gstaggregator.c | 8 ++++++-- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/subprojects/gst-plugins-base/gst-libs/gst/audio/gstaudioaggregator.c b/subprojects/gst-plugins-base/gst-libs/gst/audio/gstaudioaggregator.c index 4eb91db927..40e569a740 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/audio/gstaudioaggregator.c +++ b/subprojects/gst-plugins-base/gst-libs/gst/audio/gstaudioaggregator.c @@ -282,6 +282,7 @@ gst_audio_aggregator_convert_pad_update_converter (GstAudioAggregatorConvertPad if (in_info->finfo->format == GST_AUDIO_FORMAT_UNKNOWN) { /* If we haven't received caps yet, this pad should not have * a buffer to convert anyway */ + GST_FIXME_OBJECT (aaggcpad, "UNREACHABLE CODE: Unknown input format"); return; } @@ -293,6 +294,7 @@ gst_audio_aggregator_convert_pad_update_converter (GstAudioAggregatorConvertPad /* FIXME: Not converting when we need to but the config is invalid (e.g. * because the mix-matrix is not the right size) produces garbage. An * invalid config should cause a GST_FLOW_NOT_NEGOTIATED. */ + GST_FIXME_OBJECT (aaggcpad, "Failed to update converter"); return; } @@ -1335,7 +1337,7 @@ gst_audio_aggregator_sink_event (GstAggregator * agg, gst_event_parse_segment (event, &segment); if (segment->format != GST_FORMAT_TIME) { - GST_ERROR_OBJECT (agg, "Segment of type %s are not supported," + GST_ERROR_OBJECT (aggpad, "Segment of type %s are not supported," " only TIME segments are supported", gst_format_get_name (segment->format)); gst_event_unref (event); diff --git a/subprojects/gst-plugins-base/gst/audioresample/gstaudioresample.c b/subprojects/gst-plugins-base/gst/audioresample/gstaudioresample.c index f031bb64f5..fbfb5ca636 100644 --- a/subprojects/gst-plugins-base/gst/audioresample/gstaudioresample.c +++ b/subprojects/gst-plugins-base/gst/audioresample/gstaudioresample.c @@ -759,6 +759,9 @@ gst_audio_resample_process (GstAudioResample * resample, GstBuffer * inbuf, in_len = srcabuf.n_samples; out_len = gst_audio_converter_get_out_frames (resample->converter, in_len); + GST_DEBUG_OBJECT (resample, "in %" G_GSIZE_FORMAT " frames, out %" + G_GSIZE_FORMAT " frames", in_len, out_len); + /* ensure that the output buffer is not bigger than what we need */ gst_buffer_set_size (outbuf, out_len * resample->in.bpf); diff --git a/subprojects/gstreamer/libs/gst/base/gstaggregator.c b/subprojects/gstreamer/libs/gst/base/gstaggregator.c index cdf8883081..b24ef483bc 100644 --- a/subprojects/gstreamer/libs/gst/base/gstaggregator.c +++ b/subprojects/gstreamer/libs/gst/base/gstaggregator.c @@ -3016,6 +3016,8 @@ gst_aggregator_pad_chain_internal (GstAggregator * self, GstFlowReturn flow_return; GstClockTime buf_pts; + GST_TRACE_OBJECT (aggpad, "entering chain internal"); + PAD_LOCK (aggpad); flow_return = aggpad->priv->flow_return; if (flow_return != GST_FLOW_OK) @@ -3054,7 +3056,7 @@ gst_aggregator_pad_chain_internal (GstAggregator * self, SRC_UNLOCK (self); goto flushing; } - GST_DEBUG_OBJECT (aggpad, "Waiting for buffer to be consumed"); + GST_DEBUG_OBJECT (aggpad, "Waiting for buffer to be consumed (chain)"); GST_OBJECT_UNLOCK (self); SRC_UNLOCK (self); PAD_WAIT_EVENT (aggpad); @@ -3112,7 +3114,7 @@ gst_aggregator_pad_chain_internal (GstAggregator * self, GST_OBJECT_UNLOCK (self); SRC_UNLOCK (self); - GST_DEBUG_OBJECT (aggpad, "Done chaining"); + GST_TRACE_OBJECT (aggpad, "Done chaining"); return flow_return; @@ -3133,6 +3135,8 @@ gst_aggregator_pad_chain (GstPad * pad, GstObject * object, GstBuffer * buffer) GstFlowReturn ret; GstAggregatorPad *aggpad = GST_AGGREGATOR_PAD (pad); + GST_TRACE_OBJECT (aggpad, "entering chain"); + PAD_FLUSH_LOCK (aggpad); ret = gst_aggregator_pad_chain_internal (GST_AGGREGATOR_CAST (object),