forked from marfrit/marfrit-packages
ffmpeg-v4l2-request-git: libudev bypass for sandboxed callers
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:
@@ -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}"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user