[Spice-commits] 2 commits - gtk/channel-display.c

Yonit Halperin yhalperi at kemper.freedesktop.org
Mon Jun 24 14:45:28 PDT 2013


 gtk/channel-display.c |   43 +++++++++++++++++++++++++++++--------------
 1 file changed, 29 insertions(+), 14 deletions(-)

New commits:
commit 150b6ab8c371b4b9c8416c9e5f08bc62f1aacdfa
Author: Yonit Halperin <yhalperi at redhat.com>
Date:   Mon Jun 24 14:11:23 2013 -0400

    display: disabling adaptive video streaming via env var SPICE_DISABLE_ADAPTIVE_STREAMING
    
    spice-server supports adaptive video streaming only if the client
    publishes SPICE_DISPLAY_CAP_STREAM_REPORT.
    
    Disabling this feature is useful for debugging and performance comparison.

diff --git a/gtk/channel-display.c b/gtk/channel-display.c
index 07f6c1e..14c80d2 100644
--- a/gtk/channel-display.c
+++ b/gtk/channel-display.c
@@ -79,6 +79,7 @@ struct _SpiceDisplayChannelPrivate {
     guint                       mark_false_event_id;
     GArray                      *monitors;
     guint                       monitors_max;
+    gboolean                    enable_adaptive_streaming;
 #ifdef WIN32
     HDC dc;
 #endif
@@ -693,7 +694,9 @@ static void spice_display_channel_reset_capabilities(SpiceChannel *channel)
     spice_channel_set_capability(SPICE_CHANNEL(channel), SPICE_DISPLAY_CAP_MONITORS_CONFIG);
     spice_channel_set_capability(SPICE_CHANNEL(channel), SPICE_DISPLAY_CAP_COMPOSITE);
     spice_channel_set_capability(SPICE_CHANNEL(channel), SPICE_DISPLAY_CAP_A8_SURFACE);
-    spice_channel_set_capability(SPICE_CHANNEL(channel), SPICE_DISPLAY_CAP_STREAM_REPORT);
+    if (SPICE_DISPLAY_CHANNEL(channel)->priv->enable_adaptive_streaming) {
+        spice_channel_set_capability(SPICE_CHANNEL(channel), SPICE_DISPLAY_CAP_STREAM_REPORT);
+    }
 }
 
 static void spice_display_channel_init(SpiceDisplayChannel *channel)
@@ -710,6 +713,13 @@ static void spice_display_channel_init(SpiceDisplayChannel *channel)
     c->dc = create_compatible_dc();
 #endif
     c->monitors_max = 1;
+
+    if (g_getenv("SPICE_DISABLE_ADAPTIVE_STREAMING")) {
+        SPICE_DEBUG("adaptive video disabled");
+        c->enable_adaptive_streaming = FALSE;
+    } else {
+        c->enable_adaptive_streaming = TRUE;
+    }
     spice_display_channel_reset_capabilities(SPICE_CHANNEL(channel));
 }
 
@@ -1471,11 +1481,13 @@ static void display_handle_stream_data(SpiceChannel *channel, SpiceMsgIn *in)
         }
         st->playback_sync_drops_seq_len = 0;
     }
-    display_update_stream_report(SPICE_DISPLAY_CHANNEL(channel), op->id,
-                                 op->multi_media_time, latency);
-    if (st->playback_sync_drops_seq_len >= STREAM_PLAYBACK_SYNC_DROP_SEQ_LEN_LIMIT) {
-        spice_session_sync_playback_latency(spice_channel_get_session(channel));
-        st->playback_sync_drops_seq_len = 0;
+    if (c->enable_adaptive_streaming) {
+        display_update_stream_report(SPICE_DISPLAY_CHANNEL(channel), op->id,
+                                     op->multi_media_time, latency);
+        if (st->playback_sync_drops_seq_len >= STREAM_PLAYBACK_SYNC_DROP_SEQ_LEN_LIMIT) {
+            spice_session_sync_playback_latency(spice_channel_get_session(channel));
+            st->playback_sync_drops_seq_len = 0;
+        }
     }
 }
 
commit ccf52d0f81ca9dc8c25ea2444b1aeb5020e8988a
Author: Yonit Halperin <yhalperi at redhat.com>
Date:   Mon Jun 24 14:10:14 2013 -0400

    display: video stats logging - improve readability and ease of parsing

diff --git a/gtk/channel-display.c b/gtk/channel-display.c
index bc6fc08..07f6c1e 100644
--- a/gtk/channel-display.c
+++ b/gtk/channel-display.c
@@ -1511,6 +1511,7 @@ static void destroy_stream(SpiceChannel *channel, int id)
     SpiceDisplayChannelPrivate *c = SPICE_DISPLAY_CHANNEL(channel)->priv;
     display_stream *st;
     guint64 drops_duration_total = 0;
+    guint32 num_out_frames;
     int i;
 
     g_return_if_fail(c != NULL);
@@ -1521,29 +1522,31 @@ static void destroy_stream(SpiceChannel *channel, int id)
     if (!st)
         return;
 
-    CHANNEL_DEBUG(channel, "%s: id %d #frames-in %d #drops-on-arive %d (%.2f) avg-late-time %.2f"
-        " #drops-on-playback %d (%.2f)", __FUNCTION__,
+    num_out_frames = st->num_input_frames - st->num_drops_on_arive - st->num_drops_on_playback;
+    CHANNEL_DEBUG(channel, "%s: id=%d #in-frames=%d out/in=%.2f "
+        "#drops-on-arrive=%d avg-late-time(ms)=%.2f "
+        "#drops-on-playback=%d", __FUNCTION__,
         id,
         st->num_input_frames,
-        st->num_drops_on_arive, st->num_drops_on_arive / ((double)st->num_input_frames),
+        num_out_frames / (double)st->num_input_frames,
+        st->num_drops_on_arive,
         st->num_drops_on_arive ? st->arrive_late_time / ((double)st->num_drops_on_arive): 0,
-        st->num_drops_on_playback,
-        st->num_drops_on_playback / ((double)st->num_input_frames));
+        st->num_drops_on_playback);
     if (st->num_drops_seqs) {
-        CHANNEL_DEBUG(channel, "%s: #drops sequences %u ==>", __FUNCTION__, st->num_drops_seqs);
+        CHANNEL_DEBUG(channel, "%s: #drops-sequences=%u ==>", __FUNCTION__, st->num_drops_seqs);
     }
     for (i = 0; i < st->num_drops_seqs; i++) {
             drops_sequence_stats *stats = &g_array_index(st->drops_seqs_stats_arr,
                                                          drops_sequence_stats,
                                                          i);
             drops_duration_total += stats->duration;
-            CHANNEL_DEBUG(channel, "%s: \t len %u start-ms %u duration-ms %u", __FUNCTION__,
+            CHANNEL_DEBUG(channel, "%s: \t len=%u start-ms=%u duration-ms=%u", __FUNCTION__,
                                    stats->len,
                                    stats->start_mm_time - st->first_frame_mm_time,
                                    stats->duration);
     }
     if (st->num_drops_seqs) {
-        CHANNEL_DEBUG(channel, "%s: drops total duration %"G_GUINT64_FORMAT" ==>", __FUNCTION__, drops_duration_total);
+        CHANNEL_DEBUG(channel, "%s: drops-total-duration=%"G_GUINT64_FORMAT" ==>", __FUNCTION__, drops_duration_total);
     }
 
     g_array_free(st->drops_seqs_stats_arr, TRUE);


More information about the Spice-commits mailing list