From e1003b56ba03cfb8458d3e167fc30554180ac1ff Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Sun, 20 Sep 2015 16:16:10 -0700 Subject: [PATCH] GUAC-1305: Add image mimetypes to Guacamole protocol handshake. --- .../protocol/ConfiguredGuacamoleSocket.java | 7 +++++++ .../protocol/GuacamoleClientInformation.java | 19 ++++++++++++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/guacamole-common/src/main/java/org/glyptodon/guacamole/protocol/ConfiguredGuacamoleSocket.java b/guacamole-common/src/main/java/org/glyptodon/guacamole/protocol/ConfiguredGuacamoleSocket.java index 5856b6cd3..ab5bffe88 100644 --- a/guacamole-common/src/main/java/org/glyptodon/guacamole/protocol/ConfiguredGuacamoleSocket.java +++ b/guacamole-common/src/main/java/org/glyptodon/guacamole/protocol/ConfiguredGuacamoleSocket.java @@ -183,6 +183,13 @@ public class ConfiguredGuacamoleSocket implements GuacamoleSocket { info.getVideoMimetypes().toArray(new String[0]) )); + // Send supported image formats + writer.writeInstruction( + new GuacamoleInstruction( + "image", + info.getImageMimetypes().toArray(new String[0]) + )); + // Send args writer.writeInstruction(new GuacamoleInstruction("connect", arg_values)); diff --git a/guacamole-common/src/main/java/org/glyptodon/guacamole/protocol/GuacamoleClientInformation.java b/guacamole-common/src/main/java/org/glyptodon/guacamole/protocol/GuacamoleClientInformation.java index 2974c94d4..3302fab9c 100644 --- a/guacamole-common/src/main/java/org/glyptodon/guacamole/protocol/GuacamoleClientInformation.java +++ b/guacamole-common/src/main/java/org/glyptodon/guacamole/protocol/GuacamoleClientInformation.java @@ -55,10 +55,15 @@ public class GuacamoleClientInformation { private final List audioMimetypes = new ArrayList(); /** - * The list of audio mimetypes reported by the client to be supported. + * The list of video mimetypes reported by the client to be supported. */ private final List videoMimetypes = new ArrayList(); + /** + * The list of image mimetypes reported by the client to be supported. + */ + private final List imageMimetypes = new ArrayList(); + /** * Returns the optimal screen width requested by the client, in pixels. * @return The optimal screen width requested by the client, in pixels. @@ -133,4 +138,16 @@ public class GuacamoleClientInformation { return videoMimetypes; } + /** + * Returns the list of image mimetypes supported by the client. To add or + * removed supported mimetypes, the list returned by this function can be + * modified. + * + * @return + * The set of image mimetypes supported by the client. + */ + public List getImageMimetypes() { + return imageMimetypes; + } + }