Sunday, May 17, 2026

firefox: let webrtc/screen sharing use XShm 1.2

Hi, robert@ made a quick diff to webrtc to make it use the XShm 1.2 extention, rather than legacy 1.1. I've adapted it to Firefox. XShm 1.2 doesn't use the SysV shmget() syscall and can thus be used in a pledge(2) process, allowing it to work with firefox (and chrome). I think the Mozilla people should have done this years ago (and not only for OpenBSD, other systems could benefit from it too. anyways, I think this is better than falling back to XImage. Tested with Big Blue Button and Jitsi web conference servers. Comments ? ok ? Index: Makefile =================================================================== RCS file: /cvs/OpenBSD/ports/www/mozilla-firefox/Makefile,v diff -u -p -u -r1.683 Makefile --- Makefile 16 May 2026 07:24:44 -0000 1.683 +++ Makefile 17 May 2026 09:00:40 -0000 @@ -8,7 +8,7 @@ MOZILLA_BRANCH = release MOZILLA_PROJECT = firefox MOZILLA_CODENAME = browser -REVISION = 0 +REVISION = 1 WRKDIST = ${WRKDIR}/${MOZILLA_DIST}-${MOZILLA_DIST_VERSION:C/b[0-9]*//} HOMEPAGE = https://www.mozilla.org/firefox/ Index: patches/patch-third_party_libwebrtc_modules_desktop_capture_linux_x11_x_server_pixel_buffer_cc =================================================================== RCS file: /cvs/OpenBSD/ports/www/mozilla-firefox/patches/patch-third_party_libwebrtc_modules_desktop_capture_linux_x11_x_server_pixel_buffer_cc,v diff -u -p -u -r1.1 patch-third_party_libwebrtc_modules_desktop_capture_linux_x11_x_server_pixel_buffer_cc --- patches/patch-third_party_libwebrtc_modules_desktop_capture_linux_x11_x_server_pixel_buffer_cc 16 May 2026 07:24:44 -0000 1.1 +++ patches/patch-third_party_libwebrtc_modules_desktop_capture_linux_x11_x_server_pixel_buffer_cc 17 May 2026 09:00:40 -0000 @@ -1,17 +1,118 @@ +Add XShm 1.2 support + Index: third_party/libwebrtc/modules/desktop_capture/linux/x11/x_server_pixel_buffer.cc --- third_party/libwebrtc/modules/desktop_capture/linux/x11/x_server_pixel_buffer.cc.orig +++ third_party/libwebrtc/modules/desktop_capture/linux/x11/x_server_pixel_buffer.cc -@@ -212,7 +212,12 @@ bool XServerPixelBuffer::Init(XAtomCache* cache, Windo +@@ -17,6 +17,13 @@ + #include <sys/ipc.h> + #include <sys/shm.h> + ++#if defined(__OpenBSD__) ++#include <X11/Xlib-xcb.h> ++#include <xcb/shm.h> ++#include <sys/mman.h> ++#include <unistd.h> ++

No comments:

Post a Comment