summaryrefslogtreecommitdiffstats
path: root/multimedia/ffmpeg/patches/151-v4l2-request-define-Raspberry-Pi-SAND128-formats.patch
blob: d52ee6a1bd3e69d76ceb6f98a1a9c2316d0f8d9e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
From e22ff2a19e49219d60395d6033dc5962e30091f1 Mon Sep 17 00:00:00 2001
From: Daniel Golle <daniel@makrotopia.org>
Date: Sun, 8 Nov 2026 22:26:27 +0000
Subject: [PATCH] v4l2-request: define the Raspberry Pi SAND128 pixelformats

The capture format table maps the Raspberry Pi HEVC decoder's
NV12MT_COL128 and NV12MT_10_COL128 formats to DRM SAND128 frames only
where linux/videodev2.h defines them. Both are Raspberry Pi kernel
additions that the mainline kernel headers of a cross toolchain lack,
so the table is built without them, the hwaccel finds no capture
format it supports on rpi-hevc-dec, and HEVC falls back to software
decoding. Define them when absent, with the values of the Raspberry Pi
kernel UAPI.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
---
 libavutil/hwcontext_v4l2request.c | 8 ++++++++
 1 file changed, 8 insertions(+)

--- a/libavutil/hwcontext_v4l2request.c
+++ b/libavutil/hwcontext_v4l2request.c
@@ -46,6 +46,14 @@
 #define V4L2_PIX_FMT_YUV420_10_AFBC_16X16_SPLIT v4l2_fourcc('A', 'S', '0', '1')
 #endif
 
+#ifndef V4L2_PIX_FMT_NV12MT_COL128
+#define V4L2_PIX_FMT_NV12MT_COL128              v4l2_fourcc('N', 'c', '1', '2')
+#endif
+
+#ifndef V4L2_PIX_FMT_NV12MT_10_COL128
+#define V4L2_PIX_FMT_NV12MT_10_COL128           v4l2_fourcc('N', 'c', '3', '0')
+#endif
+
 typedef struct V4L2RequestVideoDecoder {
     dev_t media_dev;
     dev_t video_dev;