[Spice-devel] [PATCH] Proto: Add preferred compression message and constants.

Christophe Fergeau cfergeau at redhat.com
Fri Apr 24 05:10:37 PDT 2015


On Fri, Apr 17, 2015 at 12:39:34PM +0200, Javier Celaya wrote:
> When accessing a virtual desktop from different devices, some may have
> different image compression requirements, e.g. slow devices may prefer
> the faster LZ4 over GLZ. This message instructs the server to switch the
> image compression algorithm. This patch also promotes the
> SPICE_IMAGE_COMPRESS_* constants so that they are available from both
> the server and the client.
> ---
>  common/client_marshallers.h |  1 +
>  common/messages.h           |  4 ++++
>  spice.proto                 | 15 +++++++++++++++
>  3 files changed, 20 insertions(+)
> 
> diff --git a/common/client_marshallers.h b/common/client_marshallers.h
> index 85051a0..522f620 100644
> --- a/common/client_marshallers.h
> +++ b/common/client_marshallers.h
> @@ -72,6 +72,7 @@ typedef struct {
>      void (*msgc_smartcard_reader_add)(SpiceMarshaller *m, VSCMsgReaderAdd *msg);
>  #endif
>      void (*msgc_port_event)(SpiceMarshaller *m, SpiceMsgcPortEvent *msg);
> +    void (*msgc_display_preferred_compression)(SpiceMarshaller *m, SpiceMsgcDisplayPreferredCompression *msg);
>  } SpiceMessageMarshallers;
>  
>  SpiceMessageMarshallers *spice_message_marshallers_get(void);
> diff --git a/common/messages.h b/common/messages.h
> index a8a0eee..1114adf 100644
> --- a/common/messages.h
> +++ b/common/messages.h
> @@ -630,6 +630,10 @@ typedef struct SpiceMsgcPortEvent {
>      uint8_t event;
>  } SpiceMsgcPortEvent;
>  
> +typedef struct SpiceMsgcDisplayPreferredCompression {
> +    int8_t image_compression;

This could be an uint8_t I think.

> +} SpiceMsgcDisplayPreferredCompression;
> +
>  SPICE_END_DECLS
>  
>  #endif /* _H_SPICE_PROTOCOL */
> diff --git a/spice.proto b/spice.proto
> index 01493c9..f47fd23 100644
> --- a/spice.proto
> +++ b/spice.proto
> @@ -361,6 +361,17 @@ enum8 image_type {
>      LZ4,
>  };
>  
> +enum8 image_compress {
> +    INVALID  = 0,
> +    OFF,
> +    AUTO_GLZ,
> +    AUTO_LZ,
> +    QUIC,
> +    GLZ,
> +    LZ,
> +    LZ4,
> +};
> +
>  flags8 image_flags {
>      CACHE_ME,
>      HIGH_BITS_SET,
> @@ -922,6 +933,10 @@ channel DisplayChannel : BaseChannel {
>          int32 last_frame_delay;
>          uint32 audio_delay;
>      } stream_report;
> +
> +    message {
> +        int8 image_compression;

And here too.

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20150424/5f3563c5/attachment.sig>


More information about the Spice-devel mailing list