ffmpeg-v4l2-request-git: libudev bypass for sandboxed callers
build and publish packages / distcc-avahi-aarch64 (push) Failing after 19s
build and publish packages / lmcp-debian (push) Has been skipped
build and publish packages / lmcp-any (push) Has been skipped
build and publish packages / claude-his-any (push) Has been skipped
build and publish packages / ffmpeg-v4l2-request-aarch64 (push) Has been skipped
build and publish packages / claude-his-debian (push) Has been skipped

Adds a brute-force fallback to v4l2request_open_decoder() that
enumerates /dev/media[0..15] and /dev/video[0..63] directly when
udev_enumerate_scan_devices() returns an error. The fallback uses
absolute paths only (no fd-relative openat), which is what makes it
work inside firefox's RDD seccomp+broker sandbox where Mozilla's
OpenAtTrap rejects fd-relative paths used by systemd's chase()
symlink resolver.

Same approach Chromium uses in media/gpu/v4l2/stateless/ on ChromeOS,
where the sandbox similarly forbids libudev's chase pattern.

No regression: the libudev path runs first and the brute-force path
only activates on its failure. AV_LOG_INFO line announces the
fallback so it's visible in MOZ_LOG=FFmpegLib:5.

Validated on RK3399 / Pinebook Pro / rkvdec:
  libudev probe failed (-2), falling back to brute-force /dev/media*
  Using V4L2 media driver rkvdec (brute-force) for S264
  Reinit context to 1920x1088, pix_fmt: drm_prime
  RDD CPU = 4.9%

Bumps pkgrel=2. Worth submitting to Kwiboo's fork upstream.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-29 17:58:36 +00:00
parent d0190e2c05
commit 052a692668
2 changed files with 176 additions and 4 deletions
+10 -4
View File
@@ -23,8 +23,8 @@ pkgname=ffmpeg-v4l2-request-git
_srcname=FFmpeg
_version='8.1'
_commit='b57fbbe50c9b2656fad86a1a7eeabfd2b2a50935' # v4l2-request-n8.1 tip 2026-04-24
pkgver=8.1.r0.b57fbbe
pkgrel=1
pkgver=8.1.r123329.b57fbbe
pkgrel=2
epoch=2
pkgdesc='FFmpeg with V4L2 Request API hwaccel (Rockchip / Allwinner stateless decode)'
arch=('aarch64')
@@ -76,8 +76,9 @@ provides=(
ffmpeg
)
conflicts=(ffmpeg)
source=("git+https://github.com/Kwiboo/FFmpeg.git#commit=${_commit}")
sha256sums=('SKIP')
source=("git+https://github.com/Kwiboo/FFmpeg.git#commit=${_commit}"
'0001-libudev-bypass-fallback.patch')
sha256sums=('SKIP' 'SKIP')
pkgver() {
cd "${_srcname}"
@@ -86,6 +87,11 @@ pkgver() {
"$(git rev-parse --short=7 HEAD)"
}
prepare() {
cd "${_srcname}"
patch -Np1 -i "${srcdir}/0001-libudev-bypass-fallback.patch"
}
build() {
cd "${_srcname}"