Epoch: 1 Name: chromium-nvdec Version: 1.0 Release: 3%{?dist} License: GPL-3.0 Summary: L4S Chromium integration: Fedora Chromium with Tegra NVDEC hardware video decoding # Fedora's chromium links the system ffmpeg (libavcodec-free), which on L4S ships # the nvv4l2 NVIDIA V4L2 decoders registered ahead of the software ones, so # chromium gets hardware video decode for free. The only extra needed is to run # chromium with --no-sandbox so the renderer can open /dev/nvhost-nvdec (the # sandbox otherwise blocks that device, falling back to software decode). Requires: chromium %if 0%{?fedora} >= 45 Requires: libavcodec-free >= 1:9.0.2 %else Requires: libavcodec-free >= 1:8.1.3 %endif # /dev/nvhost-nvdec + the libv4l2 nvvideocodec plugins come from the BSP/configs Requires: nvidia-l4t-bsp BuildArch: noarch BuildRequires: chromium BuildRequires: python3 BuildRequires: desktop-file-utils Source1: google-chrome.svg Source2: chrome-remote-desktop.svg Source3: chromium-streaming-action.desktop Source4: chromium-desktop.sh Source5: add-streaming-action.py Source6: l4s-chromium-streaming %description %{summary}. This package turns Fedora's Chromium into the L4S hardware-accelerated browser: it enables NVDEC video decode (via the nvv4l2 system ffmpeg) by disabling the Chromium sandbox so the GPU process can reach /dev/nvhost-nvdec, and adds the optional "Streaming mode" desktop action (Chrome OS user-agent) for cloud gaming. Streaming mode uses its own profile so it works while normal Chromium is running. %prep %install mkdir -p %{buildroot}%{_datadir}/icons install -p -m0644 %{SOURCE1} %{SOURCE2} %{buildroot}%{_datadir}/icons/ mkdir -p %{buildroot}%{_datadir}/l4s/applications python3 %{SOURCE5} %{_datadir}/applications/chromium-browser.desktop %{SOURCE3} %{buildroot}%{_datadir}/l4s/applications/chromium-browser.desktop desktop-file-validate %{buildroot}%{_datadir}/l4s/applications/chromium-browser.desktop install -Dpm0644 %{SOURCE4} %{buildroot}%{_sysconfdir}/profile.d/l4s-chromium.sh install -Dpm0755 %{SOURCE6} %{buildroot}%{_bindir}/l4s-chromium-streaming %post # nvv4l2 HW decode needs --no-sandbox so the renderer can open /dev/nvhost-nvdec. CONF=/etc/chromium/chromium.conf if [ -f "$CONF" ] && ! grep -q "L4S nvv4l2 HW decode" "$CONF"; then printf '%s\n' 'CHROMIUM_FLAGS="${CHROMIUM_FLAGS} --no-sandbox" # L4S nvv4l2 HW decode' >> "$CONF" fi # libnvbuf_utils initializes EGL on load; keep it off Mesa's Wayland/zink path. if [ -f "$CONF" ] && ! grep -q "L4S nvbuf EGL" "$CONF"; then printf '%s\n' 'export EGL_PLATFORM=surfaceless # L4S nvbuf EGL' >> "$CONF" fi %postun if [ "$1" = 0 ]; then sed -i '/L4S nvv4l2 HW decode/d;/L4S nvbuf EGL/d' /etc/chromium/chromium.conf 2>/dev/null || : fi %files %{_datadir}/icons/google-chrome.svg %{_datadir}/icons/chrome-remote-desktop.svg %{_datadir}/l4s/applications/chromium-browser.desktop %config(noreplace) %{_sysconfdir}/profile.d/l4s-chromium.sh %{_bindir}/l4s-chromium-streaming %changelog %{autochangelog}