pipewire: Apply patch to fix RGB mappings in libcamera [YOCIMX-8411]

This is fixed in 1.0.6

Signed-off-by: Flora Hu <flora.hu@nxp.com>
This commit is contained in:
Flora Hu 2024-10-15 13:54:59 +08:00
parent acc7b0708a
commit 82e454bcdc
2 changed files with 58 additions and 0 deletions

View File

@ -0,0 +1,54 @@
From 60deeb25558a794e6e664bb832318b87958c18ea Mon Sep 17 00:00:00 2001
From: Robert Mader <robert.mader@collabora.com>
Date: Sun, 5 May 2024 10:35:57 +0200
Subject: [PATCH] spa: libcamera: fix RGB mappings
Libcamera formats are generally little-endian, matching DMA DRM
fourccs, while PW ones are big-endian. Thus we have to invert the
order.
Only RGB and BGR where tested, as these are the formats currently
supported by the software ISP. This fixes inverted red and blue in
Snapshot on the Librem5 and Pinephone (OG).
See also gstlibcamera-utils.cpp in libcamera.
Upstream-Status: Backport [https://gitlab.freedesktop.org/pipewire/pipewire/commit/60deeb25558a794e6e664bb832318b87958c18ea]
---
spa/plugins/libcamera/libcamera-utils.cpp | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/spa/plugins/libcamera/libcamera-utils.cpp b/spa/plugins/libcamera/libcamera-utils.cpp
index 4604f0000..970bbd4f9 100644
--- a/spa/plugins/libcamera/libcamera-utils.cpp
+++ b/spa/plugins/libcamera/libcamera-utils.cpp
@@ -165,16 +165,16 @@ static const struct format_info format_info[] = {
/* RGB formats */
MAKE_FMT(formats::RGB565, RGB16, video, raw),
MAKE_FMT(formats::RGB565_BE, RGB16, video, raw),
- MAKE_FMT(formats::RGB888, RGB, video, raw),
- MAKE_FMT(formats::BGR888, BGR, video, raw),
- MAKE_FMT(formats::XRGB8888, xRGB, video, raw),
- MAKE_FMT(formats::XBGR8888, xBGR, video, raw),
- MAKE_FMT(formats::RGBX8888, RGBx, video, raw),
- MAKE_FMT(formats::BGRX8888, BGRx, video, raw),
- MAKE_FMT(formats::ARGB8888, ARGB, video, raw),
- MAKE_FMT(formats::ABGR8888, ABGR, video, raw),
- MAKE_FMT(formats::RGBA8888, RGBA, video, raw),
- MAKE_FMT(formats::BGRA8888, BGRA, video, raw),
+ MAKE_FMT(formats::RGB888, BGR, video, raw),
+ MAKE_FMT(formats::BGR888, RGB, video, raw),
+ MAKE_FMT(formats::XRGB8888, BGRx, video, raw),
+ MAKE_FMT(formats::XBGR8888, RGBx, video, raw),
+ MAKE_FMT(formats::RGBX8888, xBGR, video, raw),
+ MAKE_FMT(formats::BGRX8888, xRGB, video, raw),
+ MAKE_FMT(formats::ARGB8888, BGRA, video, raw),
+ MAKE_FMT(formats::ABGR8888, RGBA, video, raw),
+ MAKE_FMT(formats::RGBA8888, ABGR, video, raw),
+ MAKE_FMT(formats::BGRA8888, ARGB, video, raw),
MAKE_FMT(formats::YUYV, YUY2, video, raw),
MAKE_FMT(formats::YVYU, YVYU, video, raw),
--
2.25.1

View File

@ -1,3 +1,7 @@
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
SRC_URI:append = " file://0001-spa-libcamera-fix-RGB-mappings.patch"
# Disable pipewire-v4l2 on 32-bit to avoid Y2038 bug
PACKAGECONFIG:append = " ${PACKAGECONFIG_PIPEWIRE_V4L2}"
PACKAGECONFIG_PIPEWIRE_V4L2 = "pipewire-v4l2"