From 2f5d6d60edd4ebee10345f6318813f1af30ba2ab Mon Sep 17 00:00:00 2001 From: Rafostar <40623528+Rafostar@users.noreply.github.com> Date: Thu, 6 May 2021 14:22:48 +0200 Subject: [PATCH] API: add debug messages about dropped buffers --- lib/gst/clapper/gstclapper.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/lib/gst/clapper/gstclapper.c b/lib/gst/clapper/gstclapper.c index 17dd69ef..b9c6f41f 100644 --- a/lib/gst/clapper/gstclapper.c +++ b/lib/gst/clapper/gstclapper.c @@ -1891,6 +1891,27 @@ element_cb (G_GNUC_UNUSED GstBus * bus, GstMessage * msg, gpointer user_data) } } +static void +qos_cb (G_GNUC_UNUSED GstBus * bus, GstMessage * msg, gpointer user_data) +{ + GstClapper *self = GST_CLAPPER (user_data); + gboolean live; + guint64 running_time, stream_time, timestamp, duration; + + gst_message_parse_qos (msg, &live, &running_time, &stream_time, + ×tamp, &duration); + + GST_DEBUG_OBJECT (self, "QOS dropped buffer" + ", element live: %s" + ", running time: %" GST_TIME_FORMAT + ", stream time: %" GST_TIME_FORMAT + ", timestamp: %" GST_TIME_FORMAT + ", duration: %" GST_TIME_FORMAT, + live ? "yes" : "no", GST_TIME_ARGS (running_time), + GST_TIME_ARGS (stream_time), GST_TIME_ARGS (timestamp), + GST_TIME_ARGS (duration)); +} + /* Must be called with lock */ static gboolean update_stream_collection (GstClapper * self, GstStreamCollection * collection) @@ -2926,6 +2947,9 @@ gst_clapper_main (gpointer data) g_signal_connect (G_OBJECT (bus), "message::tag", G_CALLBACK (tags_cb), self); g_signal_connect (G_OBJECT (bus), "message::toc", G_CALLBACK (toc_cb), self); + if (gst_debug_category_get_threshold (gst_clapper_debug) >= GST_LEVEL_DEBUG) + g_signal_connect (G_OBJECT (bus), "message::qos", G_CALLBACK (qos_cb), self); + if (self->use_playbin3) { g_signal_connect (G_OBJECT (bus), "message::stream-collection", G_CALLBACK (stream_collection_cb), self);