[Spice-devel] [spice-protocol PATCH] add volume syncronizatin to protocol

Marc-André Lureau mlureau at redhat.com
Wed Mar 18 10:33:16 PDT 2015



----- Original Message -----
> ---
>  spice/vd_agent.h | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/spice/vd_agent.h b/spice/vd_agent.h
> index 7464661..1747735 100644
> --- a/spice/vd_agent.h
> +++ b/spice/vd_agent.h
> @@ -77,6 +77,7 @@ enum {
>      VD_AGENT_FILE_XFER_DATA,
>      VD_AGENT_CLIENT_DISCONNECTED,
>      VD_AGENT_MAX_CLIPBOARD,
> +    VD_AGENT_AUDIO_VOLUME_SYNC,
>      VD_AGENT_END_MESSAGE,
>  };
>  
> @@ -207,6 +208,18 @@ typedef struct SPICE_ATTR_PACKED VDAgentMaxClipboard {
>  } VDAgentMaxClipboard;
>  
>  enum {
> +    VD_AGENT_AUDIO_VOLUME_SYNC_FLAG_IS_PLAYBACK = (1 << 0),
> +    VD_AGENT_AUDIO_VOLUME_SYNC_FLAG_IS_RECORD = (1 << 1),
> +    VD_AGENT_AUDIO_VOLUME_SYNC_FLAG_IS_MUTE = (1 << 2),
> +};

That looks reasonable. I am not so fond of flags :) It's not like sending this struct all the time. mute could be a seperate bool, and playback/record are mutually exclusive anyway.

Further extension of the protocol can be added by extending the struct.

But flags are quite fine too here.

> +
> +typedef struct SPICE_ATTR_PACKED VDAgentAudioVolumeSync {
> +    uint8_t flags;
> +    uint8_t nchannels;
> +    uint16_t volume[0];
> +} VDAgentAudioVolumeSync;
> +
> +enum {
>      VD_AGENT_CAP_MOUSE_STATE = 0,
>      VD_AGENT_CAP_MONITORS_CONFIG,
>      VD_AGENT_CAP_REPLY,
> @@ -218,6 +231,7 @@ enum {
>      VD_AGENT_CAP_GUEST_LINEEND_LF,
>      VD_AGENT_CAP_GUEST_LINEEND_CRLF,
>      VD_AGENT_CAP_MAX_CLIPBOARD,
> +    VD_AGENT_CAP_AUDIO_VOLUME_SYNC,
>      VD_AGENT_END_CAP,
>  };
>  
> --
> 2.1.0
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
> 


More information about the Spice-devel mailing list