From patchwork Fri Apr 25 10:47:00 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= X-Patchwork-Id: 23264 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 5BFCFC327D for ; Fri, 25 Apr 2025 10:47:17 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 7477F68ACD; Fri, 25 Apr 2025 12:47:12 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="Y4N0XlGu"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id A3409617E5 for ; Fri, 25 Apr 2025 12:47:07 +0200 (CEST) Received: from pb-laptop.local (185.221.143.16.nat.pool.zt.hu [185.221.143.16]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id A43AB122C; Fri, 25 Apr 2025 12:47:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1745578024; bh=DpcBFJg/diSKeE+LbbPiu2Sl2vArC1y/MXNmaxKdKBw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Y4N0XlGuq4MDlfNCWOAMUUCjM6JP9R1ewuYG3xDxPe+kV2LZ++GSG2ZKaodqQ1UU3 etg0Lw031y929V+y8o+ZVFXXQXuWPdI8KIa/ZKGqlOvWE+gSK7J5bplzTMg+QhbP91 OclbGHRqE0IwdRodm6QcTuDKoJYevfusm8k0eLVM= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Cc: Laurent Pinchart Subject: [PATCH v2 1/4] apps: cam: sdl_texture: Take list of buffers in span Date: Fri, 25 Apr 2025 12:47:00 +0200 Message-ID: <20250425104703.805170-2-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250425104703.805170-1-barnabas.pocze@ideasonboard.com> References: <20250425104703.805170-1-barnabas.pocze@ideasonboard.com> MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" A non-owning span is sufficient, so use that instead of a vector. Signed-off-by: Barnabás Pőcze Reviewed-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- src/apps/cam/sdl_texture.h | 4 ++-- src/apps/cam/sdl_texture_mjpg.cpp | 2 +- src/apps/cam/sdl_texture_mjpg.h | 2 +- src/apps/cam/sdl_texture_yuv.cpp | 4 ++-- src/apps/cam/sdl_texture_yuv.h | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/apps/cam/sdl_texture.h b/src/apps/cam/sdl_texture.h index 990f83b6e..39e1c7b38 100644 --- a/src/apps/cam/sdl_texture.h +++ b/src/apps/cam/sdl_texture.h @@ -7,7 +7,7 @@ #pragma once -#include +#include #include @@ -19,7 +19,7 @@ public: SDLTexture(const SDL_Rect &rect, uint32_t pixelFormat, const int stride); virtual ~SDLTexture(); int create(SDL_Renderer *renderer); - virtual void update(const std::vector> &data) = 0; + virtual void update(libcamera::Span> data) = 0; SDL_Texture *get() const { return ptr_; } protected: diff --git a/src/apps/cam/sdl_texture_mjpg.cpp b/src/apps/cam/sdl_texture_mjpg.cpp index cace18fc6..ca49a1142 100644 --- a/src/apps/cam/sdl_texture_mjpg.cpp +++ b/src/apps/cam/sdl_texture_mjpg.cpp @@ -76,7 +76,7 @@ int SDLTextureMJPG::decompress(Span data) return 0; } -void SDLTextureMJPG::update(const std::vector> &data) +void SDLTextureMJPG::update(libcamera::Span> data) { decompress(data[0]); SDL_UpdateTexture(ptr_, nullptr, rgb_.get(), stride_); diff --git a/src/apps/cam/sdl_texture_mjpg.h b/src/apps/cam/sdl_texture_mjpg.h index 37bed5f0e..be8a55fe7 100644 --- a/src/apps/cam/sdl_texture_mjpg.h +++ b/src/apps/cam/sdl_texture_mjpg.h @@ -14,7 +14,7 @@ class SDLTextureMJPG : public SDLTexture public: SDLTextureMJPG(const SDL_Rect &rect); - void update(const std::vector> &data) override; + void update(libcamera::Span> data) override; private: int decompress(libcamera::Span data); diff --git a/src/apps/cam/sdl_texture_yuv.cpp b/src/apps/cam/sdl_texture_yuv.cpp index 480d7a379..80a5ec05d 100644 --- a/src/apps/cam/sdl_texture_yuv.cpp +++ b/src/apps/cam/sdl_texture_yuv.cpp @@ -15,7 +15,7 @@ SDLTextureNV12::SDLTextureNV12(const SDL_Rect &rect, unsigned int stride) { } -void SDLTextureNV12::update(const std::vector> &data) +void SDLTextureNV12::update(libcamera::Span> data) { SDL_UpdateNVTexture(ptr_, &rect_, data[0].data(), stride_, data[1].data(), stride_); @@ -27,7 +27,7 @@ SDLTextureYUYV::SDLTextureYUYV(const SDL_Rect &rect, unsigned int stride) { } -void SDLTextureYUYV::update(const std::vector> &data) +void SDLTextureYUYV::update(libcamera::Span> data) { SDL_UpdateTexture(ptr_, &rect_, data[0].data(), stride_); } diff --git a/src/apps/cam/sdl_texture_yuv.h b/src/apps/cam/sdl_texture_yuv.h index 29c756e77..db877f503 100644 --- a/src/apps/cam/sdl_texture_yuv.h +++ b/src/apps/cam/sdl_texture_yuv.h @@ -14,7 +14,7 @@ class SDLTextureNV12 : public SDLTexture { public: SDLTextureNV12(const SDL_Rect &rect, unsigned int stride); - void update(const std::vector> &data) override; + void update(libcamera::Span> data) override; }; #endif @@ -22,5 +22,5 @@ class SDLTextureYUYV : public SDLTexture { public: SDLTextureYUYV(const SDL_Rect &rect, unsigned int stride); - void update(const std::vector> &data) override; + void update(libcamera::Span> data) override; }; From patchwork Fri Apr 25 10:47:01 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= X-Patchwork-Id: 23263 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 166B5C32A2 for ; Fri, 25 Apr 2025 10:47:14 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id D020D68AD8; Fri, 25 Apr 2025 12:47:10 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="gnSsj8LO"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id C041668ACB for ; Fri, 25 Apr 2025 12:47:07 +0200 (CEST) Received: from pb-laptop.local (185.221.143.16.nat.pool.zt.hu [185.221.143.16]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id EE8A2124E for ; Fri, 25 Apr 2025 12:47:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1745578025; bh=YhNNqglt/zGP3v8gtTaQBRpgzFQHtZfic8dywdGJx/0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=gnSsj8LOb9qmWLX3Pq6PhhXhBl0k78Ha+0RJPs5tqRAsDrWbshZ5vruR77q63mQrU f3ktpMw18lLse1e1r5E7b3i9+apKd1PK5F0Gaodif45fADj77HwFcSS42QfB63y4BP 1aQbvUETtnusyKHGx7AEspQQryh5tXBhcBC0t+Cc= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Subject: [PATCH v2 2/4] apps: cam: sdl_texture: Drop `&rect_` from `SDL_Update{NV, }Texture()` call Date: Fri, 25 Apr 2025 12:47:01 +0200 Message-ID: <20250425104703.805170-3-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250425104703.805170-1-barnabas.pocze@ideasonboard.com> References: <20250425104703.805170-1-barnabas.pocze@ideasonboard.com> MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" If the entire texture is to be updated, there is no need to specify the target area explicitly. Signed-off-by: Barnabás Pőcze Reviewed-by: Kieran Bingham Reviewed-by: Laurent Pinchart --- src/apps/cam/sdl_texture_yuv.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/apps/cam/sdl_texture_yuv.cpp b/src/apps/cam/sdl_texture_yuv.cpp index 80a5ec05d..7e2ce3f49 100644 --- a/src/apps/cam/sdl_texture_yuv.cpp +++ b/src/apps/cam/sdl_texture_yuv.cpp @@ -17,7 +17,7 @@ SDLTextureNV12::SDLTextureNV12(const SDL_Rect &rect, unsigned int stride) void SDLTextureNV12::update(libcamera::Span> data) { - SDL_UpdateNVTexture(ptr_, &rect_, data[0].data(), stride_, + SDL_UpdateNVTexture(ptr_, nullptr, data[0].data(), stride_, data[1].data(), stride_); } #endif @@ -29,5 +29,5 @@ SDLTextureYUYV::SDLTextureYUYV(const SDL_Rect &rect, unsigned int stride) void SDLTextureYUYV::update(libcamera::Span> data) { - SDL_UpdateTexture(ptr_, &rect_, data[0].data(), stride_); + SDL_UpdateTexture(ptr_, nullptr, data[0].data(), stride_); } From patchwork Fri Apr 25 10:47:02 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= X-Patchwork-Id: 23265 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id A89A6C331E for ; Fri, 25 Apr 2025 10:47:18 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id D634A617E5; Fri, 25 Apr 2025 12:47:14 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="CA29u1+b"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id E7CBA68ACD for ; Fri, 25 Apr 2025 12:47:07 +0200 (CEST) Received: from pb-laptop.local (185.221.143.16.nat.pool.zt.hu [185.221.143.16]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 385A8EE4 for ; Fri, 25 Apr 2025 12:47:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1745578025; bh=9yvaa7+kuJ1B1agIK06NBu6qtRQUiFt/K/cDGmCs+Sg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=CA29u1+bgd3ej+lyKnLYDa3ylvwD18UMLbJCNc6RC6EYtlFiALs+3nsSO+VgJ0wX6 ugfX51VIQvWrBcVq8nqOaThtpQYABoW/rWwyl7eQM+okEnGZ65FcDNoIC5mcILnUgK 1f5/R1DpHsKNBMFulkOmToZ0nQ5XrwfWyJEC0CQk= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Subject: [PATCH v2 3/4] apps: cam: sdl_texture: Add `SDLTexture1Plane` Date: Fri, 25 Apr 2025 12:47:02 +0200 Message-ID: <20250425104703.805170-4-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250425104703.805170-1-barnabas.pocze@ideasonboard.com> References: <20250425104703.805170-1-barnabas.pocze@ideasonboard.com> MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" `SDLTextureYUYV` uses `SDL_PIXELFORMAT_YUY2`, which is a single plane format. To support other single plane formats, replace `SDLTextureYUYV` with `SDLTexture1Plane` that can be instantiated with an arbitrary SDL pixel format and that uses `SDL_UpdateTexture()` to update the texture using exactly a single plane. Signed-off-by: Barnabás Pőcze Reviewed-by: Kieran Bingham Reviewed-by: Laurent Pinchart --- src/apps/cam/sdl_sink.cpp | 3 ++- src/apps/cam/sdl_texture_1plane.h | 18 ++++++++++++++++++ src/apps/cam/sdl_texture_yuv.cpp | 10 ---------- src/apps/cam/sdl_texture_yuv.h | 7 ------- 4 files changed, 20 insertions(+), 18 deletions(-) create mode 100644 src/apps/cam/sdl_texture_1plane.h diff --git a/src/apps/cam/sdl_sink.cpp b/src/apps/cam/sdl_sink.cpp index 8355dd5ed..b295675dc 100644 --- a/src/apps/cam/sdl_sink.cpp +++ b/src/apps/cam/sdl_sink.cpp @@ -22,6 +22,7 @@ #include "../common/event_loop.h" #include "../common/image.h" +#include "sdl_texture_1plane.h" #ifdef HAVE_LIBJPEG #include "sdl_texture_mjpg.h" #endif @@ -74,7 +75,7 @@ int SDLSink::configure(const libcamera::CameraConfiguration &config) break; #endif case libcamera::formats::YUYV: - texture_ = std::make_unique(rect_, cfg.stride); + texture_ = std::make_unique(rect_, SDL_PIXELFORMAT_YUY2, cfg.stride); break; default: std::cerr << "Unsupported pixel format " diff --git a/src/apps/cam/sdl_texture_1plane.h b/src/apps/cam/sdl_texture_1plane.h new file mode 100644 index 000000000..ded35c589 --- /dev/null +++ b/src/apps/cam/sdl_texture_1plane.h @@ -0,0 +1,18 @@ +#pragma once + +#include + +#include "sdl_texture.h" + +class SDLTexture1Plane final : public SDLTexture +{ +public: + using SDLTexture::SDLTexture; + + void update(libcamera::Span> data) override + { + assert(data.size() == 1); + assert(data[0].size_bytes() == std::size_t(rect_.h * stride_)); + SDL_UpdateTexture(ptr_, nullptr, data[0].data(), stride_); + } +}; diff --git a/src/apps/cam/sdl_texture_yuv.cpp b/src/apps/cam/sdl_texture_yuv.cpp index 7e2ce3f49..bed297d28 100644 --- a/src/apps/cam/sdl_texture_yuv.cpp +++ b/src/apps/cam/sdl_texture_yuv.cpp @@ -21,13 +21,3 @@ void SDLTextureNV12::update(libcamera::Span data[1].data(), stride_); } #endif - -SDLTextureYUYV::SDLTextureYUYV(const SDL_Rect &rect, unsigned int stride) - : SDLTexture(rect, SDL_PIXELFORMAT_YUY2, stride) -{ -} - -void SDLTextureYUYV::update(libcamera::Span> data) -{ - SDL_UpdateTexture(ptr_, nullptr, data[0].data(), stride_); -} diff --git a/src/apps/cam/sdl_texture_yuv.h b/src/apps/cam/sdl_texture_yuv.h index db877f503..c271f901b 100644 --- a/src/apps/cam/sdl_texture_yuv.h +++ b/src/apps/cam/sdl_texture_yuv.h @@ -17,10 +17,3 @@ public: void update(libcamera::Span> data) override; }; #endif - -class SDLTextureYUYV : public SDLTexture -{ -public: - SDLTextureYUYV(const SDL_Rect &rect, unsigned int stride); - void update(libcamera::Span> data) override; -}; From patchwork Fri Apr 25 10:47:03 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= X-Patchwork-Id: 23266 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 23383C331F for ; Fri, 25 Apr 2025 10:47:19 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id B02F468AD3; Fri, 25 Apr 2025 12:47:15 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="DYoTwrIO"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 2D0C568ACE for ; Fri, 25 Apr 2025 12:47:08 +0200 (CEST) Received: from pb-laptop.local (185.221.143.16.nat.pool.zt.hu [185.221.143.16]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 77ED5124E for ; Fri, 25 Apr 2025 12:47:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1745578025; bh=+zO/B1gEf8pl4/U+0u2UElF0OJjS0wJydIY08B5o+ek=; h=From:To:Subject:Date:In-Reply-To:References:From; b=DYoTwrIO9Xe2p1hQoxrkJZAWbHsmr4cHY4+T7uvI8chL0B/5lADoTxpOyOW/8CdlT FmM2YCtnCAoCr035JJhTnKR22kR8IsqZYEVDN0CBlnoFkv9BuWqgZpsaeUypNAUozp kR3gRnAGL0Za8awcoJlqzoqlgScJjFCD4w7xTop0= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Subject: [PATCH v2 4/4] apps: cam: sdl_sink: Support more single-plane formats Date: Fri, 25 Apr 2025 12:47:03 +0200 Message-ID: <20250425104703.805170-5-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250425104703.805170-1-barnabas.pocze@ideasonboard.com> References: <20250425104703.805170-1-barnabas.pocze@ideasonboard.com> MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" With the newly introduced `SDLTexture1Plane` it is easy to handle any single-plane format that has an SDL equivalent. So use it for more YUV and RGB formats. The mapping of RGB formats is not entirely straightforward because `SDL_PIXELFORMAT_ZZZ...888...` defines a format where the order of the components is endian dependent, while libcamera's `ZZZ...888...` formats are derived from the matching DRM formats, and the RGB formats in question are defined to be little-endian there. So the endian-independent `SDL_PIXELFORMAT_{ZZZ24,ZZZZ32}` are used. Signed-off-by: Barnabás Pőcze Reviewed-by: Kieran Bingham Reviewed-by: Laurent Pinchart --- src/apps/cam/sdl_sink.cpp | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/src/apps/cam/sdl_sink.cpp b/src/apps/cam/sdl_sink.cpp index b295675dc..2edbb523d 100644 --- a/src/apps/cam/sdl_sink.cpp +++ b/src/apps/cam/sdl_sink.cpp @@ -77,6 +77,42 @@ int SDLSink::configure(const libcamera::CameraConfiguration &config) case libcamera::formats::YUYV: texture_ = std::make_unique(rect_, SDL_PIXELFORMAT_YUY2, cfg.stride); break; + case libcamera::formats::UYVY: + texture_ = std::make_unique(rect_, SDL_PIXELFORMAT_UYVY, cfg.stride); + break; + case libcamera::formats::YVYU: + texture_ = std::make_unique(rect_, SDL_PIXELFORMAT_YVYU, cfg.stride); + break; + case libcamera::formats::ARGB8888: + texture_ = std::make_unique(rect_, SDL_PIXELFORMAT_BGRA32, cfg.stride); + break; + case libcamera::formats::XRGB8888: + texture_ = std::make_unique(rect_, SDL_PIXELFORMAT_BGRX32, cfg.stride); + break; + case libcamera::formats::RGBA8888: + texture_ = std::make_unique(rect_, SDL_PIXELFORMAT_ABGR32, cfg.stride); + break; + case libcamera::formats::RGBX8888: + texture_ = std::make_unique(rect_, SDL_PIXELFORMAT_XBGR32, cfg.stride); + break; + case libcamera::formats::ABGR8888: + texture_ = std::make_unique(rect_, SDL_PIXELFORMAT_RGBA32, cfg.stride); + break; + case libcamera::formats::XBGR8888: + texture_ = std::make_unique(rect_, SDL_PIXELFORMAT_RGBX32, cfg.stride); + break; + case libcamera::formats::BGRA8888: + texture_ = std::make_unique(rect_, SDL_PIXELFORMAT_ARGB32, cfg.stride); + break; + case libcamera::formats::BGRX8888: + texture_ = std::make_unique(rect_, SDL_PIXELFORMAT_XRGB32, cfg.stride); + break; + case libcamera::formats::RGB888: + texture_ = std::make_unique(rect_, SDL_PIXELFORMAT_BGR24, cfg.stride); + break; + case libcamera::formats::BGR888: + texture_ = std::make_unique(rect_, SDL_PIXELFORMAT_RGB24, cfg.stride); + break; default: std::cerr << "Unsupported pixel format " << cfg.pixelFormat.toString() << std::endl;