From 2506fbabd0fc6d182eb74374096c903fe05b17f4 Mon Sep 17 00:00:00 2001 From: Mirko Vogt Date: Tue, 8 Sep 2026 13:49:23 +0000 Subject: [PATCH] ffmpeg: define sunxi AFBC formats for the V4L2 Request API The cedrus AFBC capture fourccs are downstream kernel additions missing from the sanitised toolchain headers, so 10-bit HEVC found no DRM_PRIME capture format and silently fell back to software decoding. Define them locally when the headers lack them. Assisted-By: Claude Fable 5.1 Signed-off-by: Mirko Vogt --- ...l2-request-define-sunxi-afbc-formats.patch | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 multimedia/ffmpeg/patches/150-v4l2-request-define-sunxi-afbc-formats.patch diff --git a/multimedia/ffmpeg/patches/150-v4l2-request-define-sunxi-afbc-formats.patch b/multimedia/ffmpeg/patches/150-v4l2-request-define-sunxi-afbc-formats.patch new file mode 100644 index 0000000000..c7dd0db32d --- /dev/null +++ b/multimedia/ffmpeg/patches/150-v4l2-request-define-sunxi-afbc-formats.patch @@ -0,0 +1,39 @@ +From fba60d8c2f9f4ef62bb7a641db1b8e9fc9871ecd Mon Sep 17 00:00:00 2001 +From: Mirko Vogt +Date: Sat, 1 Aug 2026 02:30:00 +0000 +Subject: [PATCH] v4l2-request: define sunxi AFBC pixelformats when the headers lack them + +The cedrus 8-bit/10-bit AFBC capture formats +(V4L2_PIX_FMT_YUV420_{8,10}_AFBC_16X16_SPLIT) are downstream additions, not +in mainline videodev2.h. OpenWrt packages build against the sanitized +toolchain kernel-headers, which therefore lack these fourccs, so the table +entries guarded by "#if defined(...)" are compiled out and 10-bit HEVC never +gets a DRM_PRIME capture format (hwaccel init fails, ffmpeg silently falls +back to software decoding). + +Define the fourccs in this translation unit when the headers do not; the +values match the kernel UAPI (drivers/staging/media/sunxi/cedrus). + +Signed-off-by: Mirko Vogt +--- +--- a/libavutil/hwcontext_v4l2request.c ++++ b/libavutil/hwcontext_v4l2request.c +@@ -34,6 +34,18 @@ + #include "hwcontext_v4l2request_internal.h" + #include "mem.h" + ++/* The sunxi/cedrus AFBC pixelformats are downstream additions (not in ++ * mainline videodev2.h), so sanitized toolchain kernel-headers lack them and ++ * the capture format table below would be compiled without them. Define them ++ * when absent; the values must match the kernel UAPI. */ ++#ifndef V4L2_PIX_FMT_YUV420_8_AFBC_16X16_SPLIT ++#define V4L2_PIX_FMT_YUV420_8_AFBC_16X16_SPLIT v4l2_fourcc('A', 'S', '1', '2') ++#endif ++ ++#ifndef V4L2_PIX_FMT_YUV420_10_AFBC_16X16_SPLIT ++#define V4L2_PIX_FMT_YUV420_10_AFBC_16X16_SPLIT v4l2_fourcc('A', 'S', '0', '1') ++#endif ++ + typedef struct V4L2RequestVideoDecoder { + dev_t media_dev; + dev_t video_dev;