On Fri, Apr 18, 2025 at 01:29:46PM +0200, Dietmar Maurer wrote: > This patch implements H264 support for VNC. The RFB protocol > extension is defined in: > > https://github.com/rfbproto/rfbproto/blob/master/rfbproto.rst#open-h-264-encoding > > Currently the Gstreamer x264enc plugin (software encoder) is used > to encode the video stream. > > The gstreamer pipe is: > > appsrc -> videoconvert -> x264enc -> appsink > > Note: videoconvert is required for RGBx to YUV420 conversion. > > The code still use the VNC server framebuffer change detection, > and only encodes and sends video frames if there are changes. > > Signed-off-by: Dietmar Maurer <diet...@proxmox.com> > --- > ui/meson.build | 1 + > ui/vnc-enc-h264.c | 282 ++++++++++++++++++++++++++++++++++++++++++++++ > ui/vnc-jobs.c | 49 +++++--- > ui/vnc.c | 21 ++++ > ui/vnc.h | 21 ++++ > 5 files changed, 359 insertions(+), 15 deletions(-) > create mode 100644 ui/vnc-enc-h264.c > > diff --git a/ui/meson.build b/ui/meson.build > index 35fb04cadf..34f1f33699 100644 > --- a/ui/meson.build > +++ b/ui/meson.build > @@ -46,6 +46,7 @@ vnc_ss.add(files( > )) > vnc_ss.add(zlib, jpeg) > vnc_ss.add(when: sasl, if_true: files('vnc-auth-sasl.c')) > +vnc_ss.add(when: gstreamer, if_true: files('vnc-enc-h264.c')) > system_ss.add_all(when: [vnc, pixman], if_true: vnc_ss) > system_ss.add(when: vnc, if_false: files('vnc-stubs.c')) > > diff --git a/ui/vnc-enc-h264.c b/ui/vnc-enc-h264.c > new file mode 100644 > index 0000000000..3abe6a1528 > --- /dev/null > +++ b/ui/vnc-enc-h264.c > @@ -0,0 +1,282 @@ > +/* > + * QEMU VNC display driver: hextile encoding > + * > + * Copyright (C) 2025 Proxmox Server Solutions GmbH > + * > + * Permission is hereby granted, free of charge, to any person obtaining a > copy > + * of this software and associated documentation files (the "Software"), to > deal > + * in the Software without restriction, including without limitation the > rights > + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell > + * copies of the Software, and to permit persons to whom the Software is > + * furnished to do so, subject to the following conditions: > + * > + * The above copyright notice and this permission notice shall be included in > + * all copies or substantial portions of the Software. > + * > + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR > + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, > + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL > + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER > + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING > FROM, > + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN > + * THE SOFTWARE. > + */
New code is expected to use SPDX-License-Identifier, without this boilerplate text. We'd also expect it to be GPL-2.0-or-later, and if this is not possible for some reason (eg derived from pre-existing code), it should be justified in the commit message. With regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|