[Spice-devel] [PATCH spice-server v2] stream-channel: Tell client we are just streaming data
Frediano Ziglio
fziglio at redhat.com
Tue Nov 21 12:28:59 UTC 2017
This give an hint to client which can optimise rendering.
Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
---
configure.ac | 11 +++++++++++
server/stream-channel.c | 7 +++++++
2 files changed, 18 insertions(+)
Changes since v1:
- do not require identity macro on spice-common/spice-protocol.
diff --git a/configure.ac b/configure.ac
index fb266ad4..be299e05 100644
--- a/configure.ac
+++ b/configure.ac
@@ -160,6 +160,17 @@ SPICE_PROTOCOL_MIN_VER=0.12.13
PKG_CHECK_MODULES([SPICE_PROTOCOL], [spice-protocol >= $SPICE_PROTOCOL_MIN_VER])
AC_SUBST([SPICE_PROTOCOL_MIN_VER])
+save_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS $SPICE_PROTOCOL_CFLAGS"
+AC_CHECK_HEADER([spice/enums.h], [], [AC_MSG_ERROR(enums.h required)])
+
+AC_COMPILE_IFELSE([AC_LANG_SOURCE([
+#include <spice/enums.h>
+int main () { return (int) SPICE_SURFACE_FLAGS_STREAMING_MODE; }
+])], [AC_DEFINE([HAVE_SPICE_SURFACE_FLAGS_STREAMING_MODE], [1], [Define if SPICE_SURFACE_FLAGS_STREAMING_MODE is present])])
+
+CFLAGS="$save_CFLAGS"
+
GLIB2_REQUIRED=2.28
GLIB2_ENCODED_VERSION="GLIB_VERSION_2_28"
PKG_CHECK_MODULES([GLIB2], [glib-2.0 >= $GLIB2_REQUIRED gio-2.0 >= $GLIB2_REQUIRED])
diff --git a/server/stream-channel.c b/server/stream-channel.c
index c7ca0206..da3f3a4f 100644
--- a/server/stream-channel.c
+++ b/server/stream-channel.c
@@ -203,6 +203,13 @@ stream_channel_send_item(RedChannelClient *rcc, RedPipeItem *pipe_item)
channel->width, channel->height,
SPICE_SURFACE_FMT_32_xRGB, SPICE_SURFACE_FLAGS_PRIMARY
};
+#ifdef HAVE_SPICE_SURFACE_FLAGS_STREAMING_MODE
+ // give an hint to client that we are sending just streaming
+ // see spice.proto for capability check here
+ if (red_channel_client_test_remote_cap(rcc, SPICE_DISPLAY_CAP_MULTI_CODEC)) {
+ surface_create.flags |= SPICE_SURFACE_FLAGS_STREAMING_MODE;
+ }
+#endif
spice_marshall_msg_display_surface_create(m, &surface_create);
break;
}
--
2.14.3
More information about the Spice-devel
mailing list