summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYonit Halperin <yhalperi@redhat.com>2013-06-24 14:11:23 -0400
committerYonit Halperin <yhalperi@redhat.com>2013-06-24 15:33:59 -0400
commit150b6ab8c371b4b9c8416c9e5f08bc62f1aacdfa (patch)
tree05211f51370a1f25e2dc70618c40c8b064c1b59e
parentccf52d0f81ca9dc8c25ea2444b1aeb5020e8988a (diff)
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.
-rw-r--r--gtk/channel-display.c24
1 files changed, 18 insertions, 6 deletions
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;
+ }
}
}