firefox-fourier: flatten patches to top-level (makepkg has no subdir support)

Follow-up to #10. The subdir layout I assumed worked turned out to not
work — per 'man PKGBUILD':

  The filename in the array must NOT include any path components like ./

makepkg's source-staging only honors basenames; the patches/ subdir
references staged the files but the basename-lookup at apply time
failed with the same 'not found in build directory' error that #9 hit.

I copied the chromium-fourier convention thinking it was proven, but
chromium-fourier has no CI either and likely has the same latent
breakage (separate issue, not in this PR's scope).

The actually-working pattern is the mpv-fourier one: patches at the
top level next to the PKGBUILD. mpv-fourier iter2 just built green
on CI (#92) with that layout.

This commit:
- Moves all 8 patches (5 fourier + 3 arch upstream) from patches/
  to arch/firefox-fourier/ via git mv (preserves blame).
- Removes the now-empty patches/ subdir.
- Strips 'patches/' prefix from source array entries.
- Strips '/patches' from prepare() patch -i paths.

No semantic change to the patch content or apply order.

pkgrel 3 -> 4.
This commit is contained in:
2026-05-15 08:00:27 +00:00
parent 9041c1bf51
commit 109858eae5
9 changed files with 17 additions and 17 deletions
@@ -0,0 +1,52 @@
From: Markus Fritsche <mfritsche@reauktion.de>
Subject: [PATCH 2/4] dom/media/platforms/ffmpeg: wrap
av_hwdevice_ctx_create
Date: 2026-04-27
Background
----------
`FFmpegLibWrapper` already wraps `av_hwdevice_ctx_alloc` (no device
path) and `av_hwdevice_ctx_init`, used by the VAAPI codepath which
discovers the DRM device implicitly. The v4l2_request hwaccel needs
the *path-aware* constructor `av_hwdevice_ctx_create`, which lets the
caller pass `"/dev/dri/renderD128"` (or similar) directly when
creating an `AV_HWDEVICE_TYPE_DRM` context. libavcodec then binds the
v4l2_request hwaccel internally based on the codec's `hw_configs`.
This patch adds the function pointer + the `AV_FUNC_OPTION_SILENT`
registration. Same versioning as the other `av_hwdevice_ctx_*`
wrappers (libavutil 5862). No callers yet — patch 3/4
(FFmpegVideoDecoder routing) consumes it.
Bug 1969297.
diff --git a/dom/media/platforms/ffmpeg/FFmpegLibWrapper.h b/dom/media/platforms/ffmpeg/FFmpegLibWrapper.h
--- a/dom/media/platforms/ffmpeg/FFmpegLibWrapper.h
+++ b/dom/media/platforms/ffmpeg/FFmpegLibWrapper.h
@@ -177,6 +177,11 @@
// libavutil >= 58
AVBufferRef* (*av_hwdevice_ctx_alloc)(int);
int (*av_hwdevice_ctx_init)(AVBufferRef* ref);
+ // firefox-fourier: device-path-aware constructor needed to bind a
+ // DRM hwdevice (AV_HWDEVICE_TYPE_DRM) to /dev/dri/renderD* for the
+ // libavcodec v4l2_request hwaccel.
+ int (*av_hwdevice_ctx_create)(AVBufferRef** device_ctx, int type,
+ const char* device, void* opts, int flags);
AVBufferRef* (*av_hwframe_ctx_alloc)(AVBufferRef* device_ctx);
int (*av_hwframe_ctx_init)(AVBufferRef* ref);
AVBufferRef* (*av_buffer_ref)(AVBufferRef* buf);
diff --git a/dom/media/platforms/ffmpeg/FFmpegLibWrapper.cpp b/dom/media/platforms/ffmpeg/FFmpegLibWrapper.cpp
--- a/dom/media/platforms/ffmpeg/FFmpegLibWrapper.cpp
+++ b/dom/media/platforms/ffmpeg/FFmpegLibWrapper.cpp
@@ -293,6 +293,11 @@ FFmpegLibWrapper::LinkResult FFmpegLibWrapper::Link() {
AV_FUNC_AVUTIL_58 | AV_FUNC_AVUTIL_59 |
AV_FUNC_AVUTIL_60 | AV_FUNC_AVUTIL_61 |
AV_FUNC_AVUTIL_62)
+ // firefox-fourier: see comment in FFmpegLibWrapper.h
+ AV_FUNC_OPTION_SILENT(av_hwdevice_ctx_create,
+ AV_FUNC_AVUTIL_58 | AV_FUNC_AVUTIL_59 |
+ AV_FUNC_AVUTIL_60 | AV_FUNC_AVUTIL_61 |
+ AV_FUNC_AVUTIL_62)
AV_FUNC_OPTION_SILENT(
av_buffer_ref, AV_FUNC_AVUTIL_58 | AV_FUNC_AVUTIL_59 | AV_FUNC_AVUTIL_60 |
AV_FUNC_AVUTIL_61 | AV_FUNC_AVUTIL_62)