GUAC-1305: Send supported image formats within Guacamole protocol handshake.

This commit is contained in:
Michael Jumper
2015-09-20 17:06:46 -07:00
parent 8e15aa94db
commit dc1fb9deaa
3 changed files with 57 additions and 12 deletions

View File

@@ -92,6 +92,13 @@ public abstract class TunnelRequest {
*/
public static final String VIDEO_PARAMETER = "GUAC_VIDEO";
/**
* The name of the parameter specifying one supported image mimetype. This
* will normally appear multiple times within a single tunnel request -
* once for each mimetype.
*/
public static final String IMAGE_PARAMETER = "GUAC_IMAGE";
/**
* All supported object types that can be used as the destination of a
* tunnel.
@@ -350,4 +357,16 @@ public abstract class TunnelRequest {
return getParameterValues(VIDEO_PARAMETER);
}
/**
* Returns a list of all image mimetypes declared as supported within the
* tunnel request.
*
* @return
* A list of all image mimetypes declared as supported within the
* tunnel request, or null if no mimetypes were specified.
*/
public List<String> getImageMimetypes() {
return getParameterValues(IMAGE_PARAMETER);
}
}

View File

@@ -114,6 +114,11 @@ public class TunnelRequestService {
if (videoMimetypes != null)
info.getVideoMimetypes().addAll(videoMimetypes);
// Add image mimetypes
List<String> imageMimetypes = request.getImageMimetypes();
if (imageMimetypes != null)
info.getImageMimetypes().addAll(imageMimetypes);
return info;
}