[Spice-devel] [PATCH v2 0/5] dcc: Create a stream for non-gl/remote clients that want to use dmabuf (v2)
Vivek Kasireddy
vivek.kasireddy at intel.com
Sat Sep 9 01:48:38 UTC 2023
For clients that cannot accept a dmabuf fd directly (such as those
running on a remote system), this patch series provides a way for
the Spice server to stream the gl/dmabuf data/buffer instead. This
is mostly done by enabling the creation of Gst memory using a dmabuf
fd as the source. This ability is useful given that dmabuf is the
standard mechanism for sharing buffers between various drivers and
userspace in many Graphics and Media usecases. Currently, this is
tested with Qemu and remote-viewer using the x264enc/avdec_h264
and msdkh264enc/dec plugins to stream the Guest/VM desktop but it
can be easily extended to other plugins and applications.
Here is roughly how things work:
- The application (e.g, Qemu) chooses its preferred codec (a Gstreamer
one) and calls gl_scanout (to update the fd) followed by gl_draw.
- In response, the Spice server checks to see if the client is capable
of accepting a dmabuf fd directly or not. If yes, the fd is forwarded
directly to the client; otherwise, a new stream is created.
- The Spice server then sends the dmabuf fd to the Gstreamer encoder
which uses it as an input for creating an encoded buffer which is then
sent to the client.
- Once the encoding process is done, an async completion cookie is sent
to the application.
Here is a link to the previous version that used a drawable to share
the dmabuf fd with the Gstreamer encoder:
https://lists.freedesktop.org/archives/spice-devel/2023-January/052948.html
v2:
- Update all patches to address review comments from Frediano
- Tested this series with msdkh264enc/dec plugins that will be added
in another patch series
Cc: Frediano Ziglio <freddy77 at gmail.com>
Cc: Gerd Hoffmann <kraxel at redhat.com>
Cc: Marc-André Lureau <marcandre.lureau at redhat.com>
Cc: Dongwon Kim <dongwon.kim at intel.com>
Vivek Kasireddy (5):
dcc: Check to see if the client supports multiple codecs (v2)
dcc: Create a stream associated with gl_draw for non-gl clients (v2)
dcc-send: Encode and send gl_draw stream data to the remote client
(v2)
gstreamer-encoder: Add an encoder function that takes dmabuf fd as
input (v2)
video-stream: Don't stop a stream associated with gl_draw (v2)
meson.build | 2 +-
server/dcc-send.cpp | 152 ++++++++++++++++++++++------
server/dcc.cpp | 31 ++++--
server/dcc.h | 6 ++
server/display-channel-private.h | 1 +
server/display-channel.cpp | 1 +
server/gstreamer-encoder.c | 164 +++++++++++++++++++++++++------
server/video-encoder.h | 13 +++
server/video-stream.cpp | 120 +++++++++++++++-------
server/video-stream.h | 2 +
10 files changed, 389 insertions(+), 103 deletions(-)
--
2.39.2
More information about the Spice-devel
mailing list