Re: [PATCH spice-html5] Display: Implement change preferred compression message

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Tomáš,

This patch looks essentially correct to me.

But could you also add constants for the image_compression enums?  i.e.
SPICE_IMAGE_COMPRESSION_INVALID and friends?

Cheers,

Jeremy

On 05/24/2017 06:08 AM, Tomáš Bohdálek wrote:
> ---
>  display.js  |  9 +++++++++
>  enums.js    |  1 +
>  spicemsg.js | 20 ++++++++++++++++++++
>  3 files changed, 30 insertions(+)
> 
> diff --git a/display.js b/display.js
> index 7719b23..501ef03 100644
> --- a/display.js
> +++ b/display.js
> @@ -1245,3 +1245,12 @@ function listen_for_video_events(stream)
>      if (STREAM_DEBUG > 1)
>          video_2_events.forEach(video_debug_listen_for_one_event, stream.video);
>  }
> +
> +SpiceDisplayConn.prototype.change_preferred_compression = function(compression_id)
> +{
> +    var msg = new SpiceMiniData();
> +    var compression = new SpiceMsgcDisplayPreferredCompression(compression_id);
> +
> +    msg.build_msg(SPICE_MSGC_DISPLAY_PREFERRED_COMPRESSION, compression);
> +    this.send_msg(msg);
> +}
> \ No newline at end of file
> diff --git a/enums.js b/enums.js
> index b6e013c..f25afe6 100644
> --- a/enums.js
> +++ b/enums.js
> @@ -134,6 +134,7 @@ var SPICE_MSG_DISPLAY_STREAM_ACTIVATE_REPORT = 319;
>  
>  var SPICE_MSGC_DISPLAY_INIT             = 101;
>  var SPICE_MSGC_DISPLAY_STREAM_REPORT    = 102;
> +var SPICE_MSGC_DISPLAY_PREFERRED_COMPRESSION = 103;
>  
>  var SPICE_MSG_INPUTS_INIT               = 101;
>  var SPICE_MSG_INPUTS_KEY_MODIFIERS      = 102;
> diff --git a/spicemsg.js b/spicemsg.js
> index 3619996..7b9494f 100644
> --- a/spicemsg.js
> +++ b/spicemsg.js
> @@ -1296,3 +1296,23 @@ SpiceMsgPortInit.prototype =
>          this.name = a.slice(offset, offset + namesize - 1);
>      }
>  }
> +
> +function SpiceMsgcDisplayPreferredCompression(compression)
> +{
> +    this.image_compression = compression;
> +}
> +
> +SpiceMsgcDisplayPreferredCompression.prototype =
> +{
> +    to_buffer: function(a, at)
> +    {
> +        at = at || 0;
> +        var dv = new SpiceDataView(a);
> +        dv.setUint8(at, this.image_compression, true); at += 1;
> +        return at;
> +    },
> +    buffer_size: function()
> +    {
> +        return 1;
> +    }
> +}
> \ No newline at end of file
> 

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]