Commit Graph

33 Commits

Author SHA1 Message Date
Frediano Ziglio
b0374ff7da build: Prepare for 0.16 release
Quite some improvements to video encoding.
More details on change logs.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
2025-05-05 17:06:36 +01:00
Qiang Yu
535b1b3572 red-qxl: add spice_qxl_gl_scanout2
For multi plane support.

Signed-off-by: Qiang Yu <yuq825@gmail.com>
Acked-by: Frediano Ziglio <freddy77@gmail.com>
2025-04-25 08:26:39 +01:00
Frediano Ziglio
85461f59cc Remove reference to removed ABI
spice_server_migrate_client_state was removed by

  commit 3c6b4e415f
  Author: Marc-André Lureau <marcandre.lureau@gmail.com>
  Date:   Fri Oct 24 17:16:35 2014 +0200

    Remove spice-experimental

    Remove unneded symbols that nobody should be using anyway.
    ABI is modified with this patch, but the library version is not bumped.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Uri Lublin <uril@redhat.com>
2019-08-15 11:16:42 +01:00
Kevin Pouget
321c5cb7f6 reds: Add ability to query the video-codecs currently enabled
spice_server_get_video_codecs: new public function to query the video
encoders/codecs currently enabled in the spice server. It returns a
string that can be fed to the setter counter
(spice_server_set_video_codecs). The string returned by this function
should be released with spice_server_free_video_codecs.

spice_server_free_video_codecs: new public function to free the the
video codec list returned by spice_server_get_video_codecs.

video_codecs_to_string: new private function to transform an array of
RedVideoCodec into a string.

Signed-off-by: Kevin Pouget <kpouget@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2019-07-05 11:11:57 +01:00
Lukáš Hrázký
3de5f9ff48 QXL interface: add a function to identify monitors in the guest
Adds a function to let QEMU provide information to identify graphics
devices and their monitors in the guest. The function
(spice_qxl_set_device_info) sets the device address (e.g. a PCI path)
and monitor ID -> device display ID mapping of displays exposed by given
QXL interface.

Signed-off-by: Lukáš Hrázký <lhrazky@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2019-01-26 09:40:10 +00:00
Francois Gouget
497fcbb0a3 streaming: Let the administrator pick the video encoder and codec
The Spice server administrator can specify the encoder and codec
preferences to optimize for CPU or bandwidth usage. Preferences are
described in a semi-colon separated list of encoder:codec pairs.
The server has a default preference list which can explicitly be
selected by specifying 'auto'.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
2016-06-14 17:04:40 +02:00
Christophe Fergeau
4c1471d0b6 Remove spice_server_set_keepalive_timeout
This public API is no longer needed as the keepalive interval does not
need to be configurable.
This API was present in the 0.13.0 release, but was never added to a
stable release, in my opinion it's still acceptable to remove it without
changing soname.
2016-03-11 18:27:51 +01:00
Marc-André Lureau
ebf461b8e6 Add new spice-gl stubs API
- spice_qxl_gl_scanout() to take the current scanout

- spice_qxl_gl_draw_async() to draw the scanout, is like other Spice async
  functions, it takes a cookie and will return in the
  QXLInterface.async_complete()

Two new fields are also added to QXLState, in order to save the current
scanout, and the pending async.

A scanout can't be updated if there are pending draw atm. Discarding
outdated draws is left as a future improvement to allow updating the
scanout without waiting for draw async to be done.

Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
[make QXL function names more coherent - Frediano Ziglio]
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2016-02-09 14:01:12 +00:00
Sunny Shin
b9b0590bc0 channel: add option tcp keepalive timeout to channels 2016-01-12 15:10:47 +01:00
Alon Levy
3c7026b180 server/red_{record, replay}.[ch]: introduce
Currently hand crafted with some sed scripts and alot of vim macros from
red_parse_qxl after considering the logger in qemu/hw/qxl-logger.c and seeing
it was incomplete. The only problem with logging from the server and
not from qemu is that it requires coordinated shutdown to avoid half a message.

Should be automatically generated from a declarative syntax, i.e. qxl.proto.

Note: zlib compression is introduced in a disabled state, see ZLIB
define

Now with a simple versioned header and generated ids by the server
instead of based on the recorded file, and doesn't use more then 1024
surfaces (configurable).

Signed-off-by: Alon Levy <alon@pobox.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
2015-08-21 09:38:44 +01:00
Frediano Ziglio
6d4e58f70d server: allows to set maximum monitors
spice-server will attempt to limit number of monitors.
Guest machine can send monitor list it accepts. Limiting the number sent
by guest will limit the number of monitors client will try to enable.
The guest usually see client monitors enabled and start using it so
not seeing client monitor won't try to enable more monitor.
In this case the additional monitor guest can support will always be
seen as heads with no attached monitors.
This allows limiting monitors number without changing guest drivers.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2015-06-26 16:17:42 +02:00
Jeremy White
ce9b714137 Add support for the Opus codec
Signed-off-by: Jeremy White <jwhite@codeweavers.com>
2014-01-02 12:36:59 +01:00
Hans de Goede
db278430f8 server: Add support for filtering out agent file-xfer msgs (rhbz#961848)
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2013-06-06 16:07:30 +02:00
Hans de Goede
f7f876a3cb server: Add public spice_qxl_driver_unload method
With a SPICE_DISPLAY_CAP_MONITORS_CONFIG capable client, the client needs to
know what part of the primary to use for each monitor. If the guest driver
does not support this, the server sends messages to the client for a
single monitor spanning the entire primary.

As soon as the guest calls spice_qxl_monitors_config_async once, we set
the red_worker driver_has_monitors_config flag and stop doing this.

This is a problem when the driver gets unloaded, for example after a reboot
or when switching to a text vc with usermode mode-setting under Linux.

To reproduce this start a multi-mon capable Linux guest which uses
usermode mode-setting and then once X has started switch to a text vc. Note
how the client window does not only not resize, if you try to resize it
manually you always keep blackborders since the aspect is wrong.

This patch is the spice-server side of fixing this, it adds a new
spice_qxl_driver_unload method which clears the driver_has_monitors_config
flag.

The other patch needed to fix this is in qemu, and will calls this new method
from qxl_enter_vga_mode.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2013-04-24 09:31:27 +02:00
Marc-André Lureau
069270f641 server: add "port" channel support
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, with a few additional messages.

See the description of the channel protocol in spice-common history.
2012-12-05 11:46:28 +01:00
Alon Levy
4e7d25a7ac Revert "server: add websockets support via libwebsockets"
This reverts commit 63bb37276e.
2012-11-04 13:48:42 +02:00
Alon Levy
63bb37276e server: add websockets support via libwebsockets
New API: spice_server_set_ws_ports

This adds an optional dependency on libwebsockets. You need to get my
patched 0.0.3 version here:
 git://people.freedesktop.org/~alon/libwebsockets

There is no qemu patches yet, to test change in reds.c the default value
of spice_ws_port to 5959 (for the default of spice-html5).

For testing there is an online client at
 http://spice-space.org/spice-html5/spice.html

Known issues:
 1. The tester (server/tests/test_display_no_ssl) gets into dropping all
  data after a few seconds, I think it's an issue with the implemented
  watches, but haven't figured it out.

 2. libwebsocket's read interface is inverted to what our code expects,
 i.e. there is no libwebsocket_read, so there is an additional copy
 involved (see RedsWebSocket). This can be fixed.

 3. Listening on a separate port. Since the headers are different, we
 could listen on the same port (first three bytes RED/GET). I don't know
 if we want to?

Todos:
 1. SSL not implemented yet. Needs some thought as to how.

 2. Serve spice-html5 when accessed as a http server. Nice to have.
2012-10-25 12:33:02 +02:00
Alon Levy
124984a171 server/spice-server.syms: add missing global labels
Although global is the default, this makes the file more consistent.
2012-09-13 16:43:01 +03:00
Jeremy White
5819976c7e Implement spice_server_set_exit_on_disconnect to enable an option whereby the spice server shuts down on client disconnect. 2012-09-05 19:18:34 +03:00
Yonit Halperin
92f3ee6ed8 bump version to 0.11.2
New api entries:
    spice_server_vm_start
    spice_server_vm_stop
    spice_server_set_seamless_migration
2012-08-27 09:04:52 +03:00
Alon Levy
0acea04d71 server: add monitors_config support
a SpiceMsgDisplayMonitorsConfig is sent on two occasions:
 * as a result of a spice_qxl_monitors_config_async
 * whenever a client connects and there is a previously set monitors
   config

Sending the new message is protected by a new cap,
SPICE_DISPLAY_CAP_MONITORS_CONFIG

More elaborately:
spice_qxl_monitors_config_async receives a QXLPHYSICAL address of a
QXLMonitorsConfig struct and reads it, caching it in the RedWorker, and
sending it to all clients. Whenever a new client connects it receives
a SpiceMsgDisplayMonitorsConfig message as well.
2012-07-22 13:50:49 +03:00
Alon Levy
5dd5b70223 server: export spice_server_is_server_mouse predicate
To be used by qemu query-spice / info spice commands.
2012-03-26 14:41:03 +02:00
Nahum Shalman
198ffb92d4 server: listen on a pre-opened file descriptor
Allow applications to pre-open a file descriptor and have spice listen
on it.

Thanks to Daniel Berrange for his comments
2012-03-12 12:33:20 +01:00
Marc-André Lureau
36d8da6283 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-05 18:19:07 +01:00
Daniel P. Berrange
d55b68b6b4 Add APIs for injecting a client connection socket
Allow applications to pass a pre-accepted client socket file
descriptor in. The new APIs are spice_server_add_ssl_client
and spice_server_add_client

* server/reds.c: Implement new APIs
* server/spice.h: Define new APIs

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-01-09 18:57:57 +01:00
Alon Levy
1b8a8b2517 server/spice-server.syms: fix 0.8 compatibility
spice_server_migrate_connect is in 0.8.3 in the released 0.8 branch,
and so should not be changed in 0.10. This doesn't break the 0.9.1
release which didn't contain this symbol at all, only 0.9.2 release
that hopefully no one actually packaged.
2011-11-08 17:10:47 +02:00
Yonit Halperin
aefe01c02c Release 0.9.2 2011-11-02 11:30:33 +02:00
Alon Levy
0410cccde3 server: add public spice_server_get_num_clients 2011-08-23 18:29:21 +03:00
Alon Levy
2a4d97fb78 server: add QXLWorker.flush_surfaces_async for S3/S4 support
This does the following, all to remove any referenced memory on the pci bars:
    flush_all_qxl_commands(worker);
    flush_all_surfaces(worker);
    red_wait_outgoing_item((RedChannel *)worker->display_channel);
    red_wait_outgoing_item((RedChannel *)worker->cursor_channel);

The added api is specifically async, i.e. it calls async_complete
when done.
2011-07-20 16:00:19 +03:00
Alon Levy
096f49afbf server: add async io support
The new _ASYNC io's in qxl_dev listed at the end get six new api
functions, and an additional callback function "async_complete". When
the async version of a specific io is used, completion is notified by
calling async_complete, and no READY message is written or expected by
the dispatcher.

update_area has been changed to push QXLRects to the worker thread, where
the conversion to SpiceRect takes place.

A cookie has been added to each async call to QXLWorker, and is passed back via
async_complete.

Added api:

QXLWorker:
    update_area_async
    add_memslot_async
    destroy_surfaces_async
    destroy_primary_surface_async
    create_primary_surface_async
    destroy_surface_wait_async

QXLInterface:
    async_complete
2011-07-20 16:00:19 +03:00
Alon Levy
c04d60631e server: api: add spice_qxl_* calls based on QXLWorker contents
For each callback in QXLWorker, for example QXLWorker::update_area, add
a direct call named spice_qxl_update_area.

This will (a) remove the pointless indirection and (b) make shared
library versioning alot easier as we'll get new linker symbols which
we can tag with the version they appeared in the shared library.
2011-07-20 16:00:17 +03:00
Alon Levy
f4ba39fe0f server: spice-server.syms: move sasl symbols to 0.8.2 2011-07-20 11:08:37 +03:00
Gerd Hoffmann
7013561462 server: add symbol versioning to the spice server shared library.
This patch adds symbol versions to the spice server library.  Each
symbol which is exported by libspice-server gets tagged with the
(stable) version where it appeared first.  This way the linker and rpm
are able to figure which version of the spice-server libary is required
by a particular qemu binary/package.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-19 14:39:28 +02:00