Commit Graph

83 Commits

Author SHA1 Message Date
Snir Sheriber
a3598f62aa protocol: Add support for h265 video codec
Signed-off-by: Snir Sheriber <ssheribe@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2018-06-19 15:29:27 +01:00
Eduardo Lima (Etrunko)
d84f5a5e63 Fix field names for Smartcard protocol structures
Rename struct VSCMsgReaderAdd field 'reader_name' to 'name', and struct
VSCMsgATR field 'data' to 'atr' to match their definitions in file
vscard_common.h.

The error log follows:

generated_server_demarshallers.c:1985:30: note: each undeclared identifier is reported only once for each function it appears in
generated_server_demarshallers.c:1994:15: error: ‘VSCMsgReaderAdd {aka struct VSCMsgReaderAdd}’ has no member named ‘reader_name’
     memcpy(out->reader_name, in, reader_name__nelements);
               ^~

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2018-05-17 21:03:01 +01:00
Frediano Ziglio
df4ec5c318 Fix generation of Smartcard channel
The Smartcard channel definition has been always broken.
Multiple client messages with the same ID are defined in the channel.
This cause on server demarshaller to only have last message defined,
while on the client marshaller code all message marshallers are
defined but client uses only header message.

Following the difference of the generated code.

  diff -rup old/generated_client_marshallers.c common/generated_client_marshallers.c
  --- old/generated_client_marshallers.c	2018-05-14 22:49:07.641778414 +0100
  +++ common/generated_client_marshallers.c	2018-05-14 22:49:22.266329296 +0100
  @@ -389,27 +389,6 @@ static void spice_marshall_msgc_tunnel_s
   }

   #ifdef USE_SMARTCARD
  -static void spice_marshall_msgc_smartcard_data(SPICE_GNUC_UNUSED SpiceMarshaller *m, SPICE_GNUC_UNUSED SpiceMsgcSmartcard *msg, SpiceMarshaller **reader_name_out)
  -{
  -    SPICE_GNUC_UNUSED SpiceMarshaller *m2;
  -    SpiceMsgcSmartcard *src;
  -    *reader_name_out = NULL;
  -    src = (SpiceMsgcSmartcard *)msg;
  -
  -    /* header */ {
  -        spice_marshaller_add_uint32(m, src->header.type);
  -        spice_marshaller_add_uint32(m, src->header.reader_id);
  -        spice_marshaller_add_uint32(m, src->header.length);
  -    }
  -    if (src->header.type == SPICE_VSC_MESSAGE_TYPE_ReaderAdd) {
  -        /* Don't marshall @nomarshal reader_name */
  -    } else if (src->header.type == SPICE_VSC_MESSAGE_TYPE_ATR || src->header.type == SPICE_VSC_MESSAGE_TYPE_APDU) {
  -        /* Remaining data must be appended manually */
  -    } else if (src->header.type == SPICE_VSC_MESSAGE_TYPE_Error) {
  -        spice_marshaller_add_uint32(m, src->error.code);
  -    }
  -}
  -
   static void spice_marshall_msgc_smartcard_header(SPICE_GNUC_UNUSED SpiceMarshaller *m, SPICE_GNUC_UNUSED VSCMsgHeader *msg)
   {
       SPICE_GNUC_UNUSED SpiceMarshaller *m2;
  @@ -421,25 +400,6 @@ static void spice_marshall_msgc_smartcar
       spice_marshaller_add_uint32(m, src->length);
   }

  -static void spice_marshall_msgc_smartcard_error(SPICE_GNUC_UNUSED SpiceMarshaller *m, SPICE_GNUC_UNUSED VSCMsgError *msg)
  -{
  -    SPICE_GNUC_UNUSED SpiceMarshaller *m2;
  -    VSCMsgError *src;
  -    src = (VSCMsgError *)msg;
  -
  -    spice_marshaller_add_uint32(m, src->code);
  -}
  -
  -static void spice_marshall_msgc_smartcard_atr(SPICE_GNUC_UNUSED SpiceMarshaller *m, SPICE_GNUC_UNUSED VSCMsgATR *msg)
  -{
  -    SPICE_GNUC_UNUSED SpiceMarshaller *m2;
  -}
  -
  -static void spice_marshall_msgc_smartcard_reader_add(SPICE_GNUC_UNUSED SpiceMarshaller *m, SPICE_GNUC_UNUSED VSCMsgReaderAdd *msg)
  -{
  -    SPICE_GNUC_UNUSED SpiceMarshaller *m2;
  -}
  -
   #endif /* USE_SMARTCARD */
   static void spice_marshall_SpiceMsgCompressedData(SPICE_GNUC_UNUSED SpiceMarshaller *m, SPICE_GNUC_UNUSED SpiceMsgCompressedData *msg)
   {
  @@ -496,20 +456,8 @@ SpiceMessageMarshallers * spice_message_
       marshallers.msgc_record_mode = spice_marshall_msgc_record_mode;
       marshallers.msgc_record_start_mark = spice_marshall_msgc_record_start_mark;
   #ifdef USE_SMARTCARD
  -    marshallers.msgc_smartcard_atr = spice_marshall_msgc_smartcard_atr;
  -#endif /* USE_SMARTCARD */
  -#ifdef USE_SMARTCARD
  -    marshallers.msgc_smartcard_data = spice_marshall_msgc_smartcard_data;
  -#endif /* USE_SMARTCARD */
  -#ifdef USE_SMARTCARD
  -    marshallers.msgc_smartcard_error = spice_marshall_msgc_smartcard_error;
  -#endif /* USE_SMARTCARD */
  -#ifdef USE_SMARTCARD
       marshallers.msgc_smartcard_header = spice_marshall_msgc_smartcard_header;
   #endif /* USE_SMARTCARD */
  -#ifdef USE_SMARTCARD
  -    marshallers.msgc_smartcard_reader_add = spice_marshall_msgc_smartcard_reader_add;
  -#endif /* USE_SMARTCARD */
       marshallers.msgc_tunnel_service_add = spice_marshall_msgc_tunnel_service_add;
       marshallers.msgc_tunnel_service_remove = spice_marshall_msgc_tunnel_service_remove;
       marshallers.msgc_tunnel_socket_closed = spice_marshall_msgc_tunnel_socket_closed;
  diff -rup old/generated_client_marshallers.h common/generated_client_marshallers.h
  --- old/generated_client_marshallers.h	2018-05-14 22:49:07.641778414 +0100
  +++ common/generated_client_marshallers.h	2018-05-14 22:49:22.739358627 +0100
  @@ -61,11 +61,7 @@ typedef struct {
       void (*msgc_tunnel_socket_data)(SpiceMarshaller *m, SpiceMsgcTunnelSocketData *msg);
       void (*msgc_tunnel_socket_token)(SpiceMarshaller *m, SpiceMsgcTunnelSocketTokens *msg);
   #ifdef USE_SMARTCARD
  -    void (*msgc_smartcard_data)(SpiceMarshaller *m, SpiceMsgcSmartcard *msg, SpiceMarshaller **reader_name_out);
       void (*msgc_smartcard_header)(SpiceMarshaller *m, VSCMsgHeader *msg);
  -    void (*msgc_smartcard_error)(SpiceMarshaller *m, VSCMsgError *msg);
  -    void (*msgc_smartcard_atr)(SpiceMarshaller *m, VSCMsgATR *msg);
  -    void (*msgc_smartcard_reader_add)(SpiceMarshaller *m, VSCMsgReaderAdd *msg);
   #endif /* USE_SMARTCARD */
       void (*msg_SpiceMsgCompressedData)(SpiceMarshaller *m, SpiceMsgCompressedData *msg);
       void (*msgc_port_event)(SpiceMarshaller *m, SpiceMsgcPortEvent *msg);
  Only in common/: generated_client_marshallers.lo
  diff -rup old/generated_server_demarshallers.c common/generated_server_demarshallers.c
  --- old/generated_server_demarshallers.c	2018-05-14 22:49:07.641778414 +0100
  +++ common/generated_server_demarshallers.c	2018-05-14 22:49:23.498405695 +0100
  @@ -1957,24 +1957,18 @@ static uint8_t * parse_TunnelChannel_msg

   #ifdef USE_SMARTCARD

  -static uint8_t * parse_msgc_smartcard_reader_add(uint8_t *message_start, uint8_t *message_end, SPICE_GNUC_UNUSED int minor, size_t *size, message_destructor_t *free_message)
  +static uint8_t * parse_msgc_smartcard_header(uint8_t *message_start, uint8_t *message_end, SPICE_GNUC_UNUSED int minor, size_t *size, message_destructor_t *free_message)
   {
       SPICE_GNUC_UNUSED uint8_t *pos;
       uint8_t *start = message_start;
       uint8_t *data = NULL;
       uint64_t nw_size;
  +    uint64_t mem_size;
       uint8_t *in, *end;
  -    uint64_t reader_name__nw_size;
  -    uint64_t reader_name__nelements;
  -    VSCMsgReaderAdd *out;
  +    VSCMsgHeader *out;

  -    { /* reader_name */
  -        reader_name__nelements = message_end - (start + 0);
  -
  -        reader_name__nw_size = reader_name__nelements;
  -    }
  -
  -    nw_size = 0 + reader_name__nw_size;
  +    nw_size = 12;
  +    mem_size = sizeof(VSCMsgHeader);

       /* Check if message fits in reported side */
       if (nw_size > (uintptr_t) (message_end - start)) {
  @@ -1986,13 +1980,14 @@ static uint8_t * parse_msgc_smartcard_re
       if (SPICE_UNLIKELY(data == NULL)) {
           goto error;
       }
  -    end = data + sizeof(VSCMsgReaderAdd);
  +    end = data + sizeof(VSCMsgHeader);
       in = start;

  -    out = (VSCMsgReaderAdd *)data;
  +    out = (VSCMsgHeader *)data;

  -    memcpy(out->reader_name, in, reader_name__nelements);
  -    in += reader_name__nelements;
  +    out->type = consume_uint32(&in);
  +    out->reader_id = consume_uint32(&in);
  +    out->length = consume_uint32(&in);

       assert(in <= message_end);
       assert(end <= data + mem_size);
  @@ -2017,7 +2012,7 @@ static uint8_t * parse_SmartcardChannel_
           parse_msgc_disconnecting
       };
       static parse_msg_func_t funcs2[1] =  {
  -        parse_msgc_smartcard_reader_add
  +        parse_msgc_smartcard_header
       };
       if (message_type >= 1 && message_type < 7) {
           return funcs1[message_type-1](message_start, message_end, minor, size_out, free_message);

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2018-05-17 12:25:42 +01:00
Frediano Ziglio
b98f19b168 protocol: Use a typedef to specify stream_id type
This change does not affect generated code but make source more
readable. Also document in a single location the range of this
type.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2018-05-10 19:49:03 +01:00
Frediano Ziglio
2eaef9c16d protocol: Add some documentation for inval_all_pixmaps message
This message is not straight forward to grasp.
Not clear by the name why we need to wait other channels messages
before resetting the image cache.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2018-03-18 09:14:29 +00:00
Frediano Ziglio
53f6d1269a protocol: Allow to specify a surface will be streamed
This flag will allow the client to perform some optimisations
on output and buffering processing.
Old clients will ignore this additional flag.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2017-12-01 15:48:56 +00:00
Frediano Ziglio
94898df6b4 proto: Add some documentation to stream_report message
Most of the documentation is extracted from notes in spice-server
code and comments.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2017-11-29 11:50:54 +00:00
Frediano Ziglio
30e8237934 protocol: Add support for VP9 video codec
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2017-01-31 08:51:33 +00:00
Victor Toso
6439bec0de protocol: add preferred video codec message
Client might want to choose a preferred video codec for streaming for
different reasons which having hardware decoder support being the most
interest one.

This message allows the client to send an array of video codecs in
order of preference.

Signed-off-by: Victor Toso <victortoso@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2017-01-06 12:20:47 +00:00
snir sheriber
4284011bdc Add LZ4 data compression and use it in spicevmc channel
Compressed message type is CompressedData which contains compression
type (1 byte) followed by the uncompressed data size (4 bytes-exists
only if data was compressed) followed by the compressed data

Update the required protocol to 0.12.12:

Signed-off-by: Snir Sheriber <ssheribe@redhat.com>
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-06-13 23:00:28 +01:00
Frediano Ziglio
1c97fea956 Explicitly specify size of SpiceMsgSmartcardData
Without this, the demarshalling code does not know we expect exactly
SpiceMsgSmartcardData::length bytes, and has to guess it from the
amount of data which was sent

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2016-05-13 13:32:10 +01:00
Francois Gouget
00db440878 protocol: Add support for the VP8 and h264 video codecs
Clients that support multiple codecs must advertise the
SPICE_DISPLAY_CAP_MULTI_CODEC capability and one
SPICE_DISPLAY_CAP_CODEC_XXX per supported codec.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>

(cherry picked from spice-protocol commit 7937915d67702a5c4b5147b277c432f5555e3852)

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2016-03-10 16:59:18 +01:00
Marc-Andre Lureau
279be89836 protocol: add unix GL scanout messages
Add 2 new messages to the display channel to stream pre-rendered GL
images of the display. This is only possible when the client supports
SPICE_DISPLAY_CAP_GL_SCANOUT capability.

The first message, SPICE_MSG_DISPLAY_GL_SCANOUT_UNIX, sends a gl image
file handle via socket ancillary data, and can be imported in a GL
context with the help of eglCreateImageKHR() (as with the 2d canvas, the
SPICE_MSG_DISPLAY_MONITORS_CONFIG will give the monitors
coordinates (x/y/w/h) within the image). There can be only one scanount
per display channel.

A SPICE_MSG_DISPLAY_GL_DRAW message is sent with the coordinate of the
region within the scanount to (re)draw on the client display. For each
draw, once the client is done with the rendering, it must acknowldge it
by sending a SPICE_MSGC_DISPLAY_GL_DRAW_DONE message, in order to
release the context (it is expected to improve this in the future with a
cross-process GL fence).

The relation with the existing display channel messages is that all
other messages are unchanged: the last drawing command received must be
displayed. However the scanout display is all or nothing. Consequently,
if a 2d canvas draw is received, the display must be switched to the
drawn canvas. In other words, if the last message received is a GL draw
the display should switch to the GL display, if it's a 2d draw message
the display should be switched to the client 2d canvas.

(there will probably be a stipped-down "gl-only" channel in the future,
or support for other streaming methods, but this protocol change should
be enough for basic virgl or other gpu-accelerated support)

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>

(cherry picked from spice-protocol commit 3fc2221e965623c5a7e50d95f1623269a067c2d3)

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2016-03-10 16:01:46 +01:00
Christophe Fergeau
0853b579df proto: Use proper type for preferred_compression field
No need to use an uint8 typed member, we can directly use the
appropriate enum8 type here, which makes everything more explicit.

(cherry picked from spice-protocol commit 8a3def14e35039753097094ba356e85e8fc2d128)

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2016-03-10 16:01:46 +01:00
Christophe Fergeau
2ccf106920 proto: Rename image_compress to image_compression
Re-using the SPICE_IMAGE_COMPRESS_ prefix in newer spice-protocol
releases is going to cause issues as there will be clashing enum members
in older spice-server releases. Using SPICE_IMAGE_COMPRESSION_ as a
prefix sidesteps these backward compability issues.

(cherry picked from spice-protocol commit e857cd9a378cdf56805b64284491a12af93a7cbf)

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2016-03-10 16:01:46 +01:00
Marc-André Lureau
1cd26b87c1 Revert "Remove files moved to spice-protocol"
This reverts commit 7665dcf1bb.

Also revert the related build-sys changes to fix the build.

codegen generated code depends on spice-common code (marshaller,
messages etc), it makes more sense to keep the generator along
this. Otherwise a newer protocol release will fail to build older
projects.

*.proto files are required as well, since it generates code that parent
modules depend on unconditionnaly.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2016-03-10 16:01:36 +01:00
Frediano Ziglio
7665dcf1bb Remove files moved to spice-protocol
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2015-08-11 10:26:06 +02:00
Christophe Fergeau
5720971c45 proto: Remove space before tab
There are 3 lines in spice.proto/spice1.proto which start with spaces
and then contain a tab. This commit removes the spaces and only keep the
tab.
2015-07-20 20:55:47 +02:00
Javier Celaya
127a76a3b8 Proto: Add preferred compression message and constants.
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.
2015-06-22 19:54:30 +02:00
Javier Celaya
5b3cdad921 Add LZ4 image compression support.
- Add a new LZ4 image type to spice.proto.
- Add canvas_get_lz4() to common_canvas_base, to get a pixmap from an
  lz4 image.
- Add an enable-lz4 switch to the configure script, disabled by default.
2014-12-02 19:23:53 +01:00
Marc-André Lureau
01955e7007 spice.proto: add webdav channel
This channel provides a webdav server (rfc4918). This allows various
guest or remote system that support webdav to access a folder shared by
the client (some agent can be used to proxy the requests on a local port
for example). The webdav server may also be accessed by an hypervisor as
a remote filesystem interface, which can then be accessed by the guest
via other means (fs/fat emulation, mtp device, etc)

Due to the usage of a single channel stream and the need for concurrent
requests, webdav clients streams are multiplexed. Each client stream is
framed within 64k max messages (in little-endian)

 int64    client_id
 uint16   size
 char     data[size]

A new client_id indicates a new connection. A new communication stream
with the webdav server should be started. A client stream message of
size 0 indicates a disconnection of client_id. This multiplexed
communication happens over the channel "data" message.

Only when the port is opened may the communication be started.
A closed port event should close all currently known multiplexed
connections.

Why WebDAV?

webdav is supported natively by various OS for a long time (circa
Windows XP). It has several open-source implementations and a variety of
tools exist. A webdav implementation can be tested and used without a
Spice server or any virtualization (this also permit sharing the
implementation with other projects in the future, such as GNOME). It is
an IETF open standard and thus thoroughly specified.

The basic requirements for an efficient remote filesystem are provided
by the standard (pipelining, concurrency, caching, copy/move, partial
io, compression, locking ...) While other features are easily possible
via extensions to the protocol (common ones are executable attributes,
or searching for example).

Given the requirements, and the popularity of http/webdav, I believe it
is the best candidate for Spice remote filesystem support.

Other alternatives (adhoc, p9, smb2, sftp) have been studied and
discarded so far since they do not match in term of features or
requirements.
2014-03-19 14:47:04 +01:00
Jeremy White
57ce430ccd Add support for the Opus codec.
Signed-off-by: Jeremy White <jwhite@codeweavers.com>
2014-01-02 12:28:21 +01:00
Marc-André Lureau
6440a1e533 proto: add fake last message in base channel
Make it explicit that 100 is the last value of the base channel
messages. This allows clients to use the generated enum value too.
2013-09-12 13:49:25 +02:00
Marc-André Lureau
4d8d2b6124 proto: comment future surface flags usage 2013-09-12 13:49:25 +02:00
Yonit Halperin
30e84783ca add SPICE_MSG_PLAYBACK_LATENCY
SPICE_MSG_PLAYBACK_LATENCY is intended for adjusting the
latency of the audio playback. It is used for synchronizing
the audio and video playback.
The corresponding capability is SPICE_PLAYBACK_CAP_LATENCY.
2013-04-22 11:34:49 -04:00
Yonit Halperin
7cdf8de00a add stream report messages
If the server & client support SPICE_DISPLAY_CAP_STREAM_REPORT,
the server first sends SPICE_MSG_DISPLAY_STREAM_ACTIVATE_REPORT. Then,
the client periodically sends SPICE_MSGC_DISPLAY_STREAM_REPORT
messages that supply the server details about the current quality of
the video streaming on the client side. The server analyses the
report and adjust the stream parameters accordingly.
2013-04-22 11:34:20 -04:00
Marc-André Lureau
b46d36bc1c Add a "port" channel
A Spice port channel carry arbitrary data between the Spice client and
the Spice server. It may be used to provide additional services on top
of a Spice connection. For example, a channel can be associated with
the qemu monitor for the client to interact with it, just like any
qemu chardev. Or it may be used with various protocols, such as the
Spice Controller.

A port kind is identified simply by its fqdn, such as org.qemu.monitor,
org.spice.spicy.test or org.ovirt.controller...

The channel is based on Spicevmc which simply tunnels data between
client and server. A few messages have been added:

SPICE_MSG_PORT_INIT: Describes the port state and fqdn name, should be
sent only once when the client connects.

SPICE_MSG_PORT_EVENT: Server port event. SPICE_PORT_EVENT_OPENED and
SPICE_PORT_EVENT_CLOSED are typical values when the chardev is opened
or closed.

SPICE_MSGC_PORT_EVENT: Client port event.
2012-12-05 11:24:05 +01:00
Marc-André Lureau
86e286ba20 inputs: add a INPUTS_KEY_SCANCODE message
Add a new arbitrary keyboard scancodes message.

For now, it will be used to avoid unwanted key repeatition when there
is jitter in the network and too much time between DOWN and UP
messages, instead the client will send the press & release scancode in
a sequence.

See also: https://bugzilla.redhat.com/show_bug.cgi?id=812347
2012-08-27 17:12:07 +02:00
Yonit Halperin
c2f58492ad support seamless migration
see spice-protocol for more details
commit 3838ad140a046c4ddf42fef58c9727ecfdc09f9f
2012-08-27 09:06:26 +03:00
Yonit Halperin
c6bd210ad0 add SPICE_MSG_MAIN_AGENT_CONNECTED_TOKENS
The msg is used for setting the number of allocated client tokens when
we notify the client that the agent is attached.
2012-08-27 09:02:05 +03:00
Søren Sandmann Pedersen
c0b048ebef Add support for A8 images to the LZ routines
This format is needed to add Render support to the X driver, so we
need the ability to compress and decompress it.
2012-08-24 13:37:51 -04:00
Alon Levy
7eba850ad5 support multiple monitors in single display channel
See spice-protocol commit for details:
 da908f89b581fd4725da997fdaea209f8e6548f6
 support multiple monitors on a single display channel
2012-07-12 19:50:40 +03:00
Alon Levy
535b52db66 smartcard: build fixes for spice server
Define different enums that have a SPICE_ prefix to not conflict with same
value enums from libcacard/vsccard_common.h, and continue to use the same
SPICE_MSG_SMARTCARD_DATA and SPICE_MSGC_SMARTCARD_DATA enum that is used by the
server and clients (spice-gtk, spicec) alike.
2012-06-14 13:53:46 +03:00
Yonit Halperin
22fc0b0145 video streaming: add support for frames of different sizes
rhbz #813826, #815426

Add SPICE_MSG_DISPLAY_STREAM_DATA_SIZED, for stream_data message
that also contains the size and destination box of the data.
The server can send such messages only to clients with
SPICE_DISPLAY_CAP_SIZED_STREAM.
2012-05-02 14:47:29 +03:00
Marc-André Lureau
feaee86076 spice.proto: fix demarshaller crash with name message
It turned out the demarshaller wasn't allocating enough space to
memcpy the name. In order to take into account the size of a variable
array, it needs to be marked with the @end tag so that the
"extra_size" is added to the allocated memory.

It would be nice if the demarshaller would somehow fail if this wasn't
set explicitly, or do the right thing by default.

@end the name so that demarshaller
2012-03-21 13:24:17 +01:00
Christophe Fergeau
3df7798413 use new @ifdef directive for smartcard messages
We don't want to conditionally compile the smartcard messages
depending on whether USE_SMARTCARD is set or not, we can now use
the @ifdef attribute for that.
2012-03-20 15:31:30 +01:00
Christophe Fergeau
7f86151f18 add smartcard bits to spice.proto 2012-03-20 15:31:30 +01:00
Marc-André Lureau
1a9f61dd17 Send name & uuid to capable clients
Add spice_server_set_name() and spice_server_set_uuid() that allows
the client to identify a Spice server (useful to associate settings
with a particular server)

The SPICE_MSG_MAIN_NAME and SPICE_MSG_MAIN_UUID messages are only sent
to capable clients, announcing SPICE_MAIN_CAP_NAME_AND_UUID.
2012-03-20 15:25:56 +01:00
Yonit Halperin
ec119c67f3 spice.proto: add SPICE_MSG_LIST to base channel 2012-03-20 15:25:54 +01:00
Hans de Goede
9ef008e5c3 codegen: Fix enums.h generation
With the new usbredir code we have the new concept of the abstract /
generic spicevmc channel type (which just tunnels data from a qemu chardev),
and we've the usbredir channel, which is the only current user of this.

This was reflected in the protocols enum in spice-protocol.h by a manual
edit done by me, my bad. This patch teaches spice.proto about the relation
between the abstract spicevmc channel and the usbredir channel and
modifies codegen to deal with this.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2012-03-20 15:25:54 +01:00
Yonit Halperin
4b1c0afd7d spice.proto: add SPICE_MSG_MAIN_MIGRATE_END & SPICE_MSGC_MAIN_MIGRATE_END
(cherry picked from commit cfbd07710562e522179ae5a7085a789489a821bb branch 0.8)
2012-03-20 15:25:54 +01:00
Yonit Halperin
9cf6d39b36 server,proto: tell the clients to connect to the migration target before migraton starts
(1) send SPICE_MSG_MAIN_MIGRATE_BEGIN upon spice_server_migrate_connect
    (to all the clients that support it)
(2) wait for SPICE_MSGC_MAIN_MIGRATE_(CONNECTED|CONNECT_ERROR) from all the relevant clients,
    or a timeout, in order to complete client_migrate_info monitor command
(cherry picked from commit 5560c56ef05c74da5e0e0825dc1f134019593cad branch 0.8;
 Was modified to support the separation of main channel from reds, and multiple clients)

Conflicts:

	server/reds.c
2012-03-20 15:25:54 +01:00
Alon Levy
4f60889f23 spice.proto: add comment for origin of STYLED and START_WITH_GAP 2012-03-20 15:25:54 +01:00
Hans de Goede
d69f4ccea2 server: Add a usbredir channel 2012-03-20 15:25:54 +01:00
Marc-André Lureau
85a49d512a sndworker: add AudioVolume/AudioMute messages
These messages allow the guest to send the audio device volume to the
client. It uses an arbitrary scale of 16bits, which works good enough
for now.

Save VolumeState in {Playback,Record}State, so that we can send the
current volume on channel connection.

Note about future improvements:
- add exact dB support
- add client to guest volume change

Updated since v2:
- bumped record and playback interface minor version to allow
  conditional compilation
Updated since v1:
- sync record volume on connection too
2012-03-20 15:25:53 +01:00
Alon Levy
5b0b6d2f84 spice.proto: Fill.rop_descriptor type s/uint16/ropd (10x atiti) 2012-03-20 15:25:51 +01:00
Alon Levy
8bea72b751 smartcard: add to spice.proto 2012-03-20 15:25:50 +01:00
Alexander Larsson
68d204f649 Don't send padding over the network with video data 2012-03-20 15:25:49 +01:00
Alexander Larsson
7897a338db Don't send CursorHeader if cursor_flags is NONE 2012-03-20 15:25:49 +01:00
Alexander Larsson
efba88ce72 Send Clip.rects inline rather than using a pointer 2012-03-20 15:25:49 +01:00