Files
Pierre Kisters fd97347e18 Jellyfin: hardware video decoding (jellyfin.hardwareDecoding)
Jellyfin Desktop hard-sets mpv's hwdec=auto-copy, whose probe list leaves
out V4L2 M2M, and the Flatpak can't see the Frame's V4L2 decoder. An
LD_PRELOAD shim (preloaded straight from the store, only that path exposed
read-only) rewrites hwdec to v4l2m2m-copy,auto-copy; devices=all makes the
decoder visible. Overrides via nix-flatpak, or a home-manager-owned override
file without it.
2026-09-28 05:50:47 +02:00

10 lines
503 B
Nix

# The mpv hwdec shim (mpv-hwdec-shim.c) as lib/mpv-hwdec-shim.so. It runs
# against the Flatpak runtime's glibc, so it links only libc (no rpath) and
# must not need symbols newer than GLIBC_2.34 (dlsym's version; see check.nix).
{ runCommandCC, patchelf }:
runCommandCC "mpv-hwdec-shim" { nativeBuildInputs = [ patchelf ]; } ''
mkdir -p $out/lib
$CC -shared -fPIC -O2 -Wall -Wextra -Werror -o $out/lib/mpv-hwdec-shim.so ${./mpv-hwdec-shim.c}
patchelf --remove-rpath $out/lib/mpv-hwdec-shim.so
''