[spice-gtk v1 10/11] channel-display-gst: summarize number of frames dropped

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Victor Toso <me@xxxxxxxxxxxxxx>

For example, this has produced 9 lines of debug below instead of 31.

GSpice-DEBUG: channel-display-gst.c:247 the GStreamer pipeline dropped 4 frames
GSpice-DEBUG: channel-display-gst.c:247 the GStreamer pipeline dropped 5 frames
GSpice-DEBUG: channel-display-gst.c:247 the GStreamer pipeline dropped 4 frames
GSpice-DEBUG: channel-display-gst.c:247 the GStreamer pipeline dropped 4 frames
GSpice-DEBUG: channel-display-gst.c:247 the GStreamer pipeline dropped 4 frames
GSpice-DEBUG: channel-display-gst.c:247 the GStreamer pipeline dropped 4 frames
GSpice-DEBUG: channel-display-gst.c:247 the GStreamer pipeline dropped 3 frames
GSpice-DEBUG: channel-display-gst.c:247 the GStreamer pipeline dropped 2 frames
GSpice-DEBUG: channel-display-gst.c:247 the GStreamer pipeline dropped 1 frames

Signed-off-by: Victor Toso <victortoso@xxxxxxxxxx>
---
 src/channel-display-gst.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/channel-display-gst.c b/src/channel-display-gst.c
index d2847ec..72b5a16 100644
--- a/src/channel-display-gst.c
+++ b/src/channel-display-gst.c
@@ -207,6 +207,7 @@ static GstFlowReturn new_sample(GstAppSink *gstappsink, gpointer video_decoder)
     GstSample *sample = gst_app_sink_pull_sample(decoder->appsink);
     if (sample) {
         GstBuffer *buffer = gst_sample_get_buffer(sample);
+        guint num_frames_dropped = 0;
         g_mutex_lock(&decoder->queues_mutex);
 
         /* gst_app_sink_pull_sample() sometimes returns the same buffer twice
@@ -235,13 +236,16 @@ static GstFlowReturn new_sample(GstAppSink *gstappsink, gpointer video_decoder)
                     /* The GStreamer pipeline dropped the corresponding
                      * buffer.
                      */
-                    SPICE_DEBUG("the GStreamer pipeline dropped a frame");
+                    num_frames_dropped++;
                     free_gst_frame(gstframe);
                 }
                 break;
             }
             l = l->next;
         }
+        if (num_frames_dropped != 0) {
+            SPICE_DEBUG("the GStreamer pipeline dropped %u frames", num_frames_dropped);
+        }
         if (!l) {
             spice_warning("got an unexpected decoded buffer!");
             gst_sample_unref(sample);
-- 
2.16.2

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]