From patchwork Mon Apr 21 15:51:05 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: 23197 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 1A156BE08B for ; Mon, 21 Apr 2025 15:51:19 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 128BF68AD5; Mon, 21 Apr 2025 17:51:18 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="L0w4sRqf"; 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 A32E068AC7 for ; Mon, 21 Apr 2025 17:51:13 +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 EF8046D6 for ; Mon, 21 Apr 2025 17:49:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1745250547; bh=2m6zsR/ZqfDdDyqs07oqupDdrD4S9VTLuvva1t5W4Q4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=L0w4sRqfmvBcCKU2ow1DU2YBjXQ1ThEbNvEjkiaxgDt9UlzRG/mN0PDaxFI7eygBE l4+3pCptN8JPcNVpsN+EzR42OjTpqDbTVbiRYVLjUo+TnYreBxVO1ZQGcKevrcXC1m mWcZbz3oI7JF5Dduk1iWRgWc51cJrLt/6GLuCg1c= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Subject: [RFC PATCH v1 1/5] apps: cam: sdl_texture: Take list of buffers in span Date: Mon, 21 Apr 2025 17:51:05 +0200 Message-ID: <20250421155109.175930-2-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250421155109.175930-1-barnabas.pocze@ideasonboard.com> References: <20250421155109.175930-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" Signed-off-by: Barnabás Pőcze --- 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 Mon Apr 21 15:51:06 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: 23198 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 1B939BE08B for ; Mon, 21 Apr 2025 15:51:21 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id E314068AD8; Mon, 21 Apr 2025 17:51:18 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="FG398I6m"; 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 D3AC668AC8 for ; Mon, 21 Apr 2025 17:51:13 +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 3F4E573E for ; Mon, 21 Apr 2025 17:49:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1745250547; bh=lJE/4kEA7lmIZSAwvqMDjkj9Hk0V14jzAaUalEQYcvI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=FG398I6m+Dc5r+UaeX2b7KfHj9ES2ezCmVSBBfvc2xH27LMWeCyoPiMy1ZmCziqQG +NkHbPvMjlA6B9fiZCyLFpxjxfihXjkWcV9Aw/gssK2B9/gOgh+zHJ1BtwFyoD/+YL fwpCXA6FaFLiXVFaskVYiyQ2Md768Qp6r5l/vB2g= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Subject: [RFC PATCH v1 2/5] apps: cam: sdl_texture: Add single plane generic texture Date: Mon, 21 Apr 2025 17:51:06 +0200 Message-ID: <20250421155109.175930-3-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250421155109.175930-1-barnabas.pocze@ideasonboard.com> References: <20250421155109.175930-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" Add the `SDLTexture1Plane` type 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 --- src/apps/cam/sdl_texture_1plane.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/apps/cam/sdl_texture_1plane.h 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_); + } +}; From patchwork Mon Apr 21 15:51:07 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: 23199 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 8DB61C32A2 for ; Mon, 21 Apr 2025 15:51:22 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id C7F7968ACE; Mon, 21 Apr 2025 17:51:20 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="kce19Pup"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 1BB3A68AC9 for ; Mon, 21 Apr 2025 17:51:14 +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 807106D5 for ; Mon, 21 Apr 2025 17:49:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1745250547; bh=pG1DWR4OnmESyZHGPwuSWeqD/CJsRUp1cV2it43awvc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=kce19PupTX4aj6oAVNp58cOnMXVzAdVQRbBkTBHcaAj36hDqBLz1KTFIqWMCLnsTM 2BA385Ob11JIve5iaio+DVvg/XEtfuKU7hf2fvj47CBAQrEyGjt4P/D14grB/uAU+D NvoVTLRqpxgBNTFP4GiZB2DzK4VT2o64jSgkpvNY= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Subject: [RFC PATCH v1 3/5] apps: cam: sdl_sink: Use `SDLTexture1Plane` for `YUYV` Date: Mon, 21 Apr 2025 17:51:07 +0200 Message-ID: <20250421155109.175930-4-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250421155109.175930-1-barnabas.pocze@ideasonboard.com> References: <20250421155109.175930-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" `SDL_PIXELFORMAT_YUY2` designates a pixel foramt with a single plane, so use the generic `SDLTexture1Plan` to handle it. Signed-off-by: Barnabás Pőcze --- src/apps/cam/sdl_sink.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 " From patchwork Mon Apr 21 15:51:08 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: 23200 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 8D226BE08B for ; Mon, 21 Apr 2025 15:51:23 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 5EF2C68AD3; Mon, 21 Apr 2025 17:51:22 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="lM3WDAmn"; 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 6141468ACA for ; Mon, 21 Apr 2025 17:51:14 +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 C45EC6D6 for ; Mon, 21 Apr 2025 17:49:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1745250547; bh=QQN+H6cpr47i93cbHUB51sQg105xgwrgaEUaS5YrBKQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=lM3WDAmnFatm5C8TD4Jnb+yuWffuSyyBCSsrSqLY71tjaDbWByghGvfikcUrPJBKO EStyj7dR3erNk2gMBvKV3M3IA4l3F/rNfunqSzOe4LAFEho9CdFtBZp+65HVkLHX9H Pq5hnig4xxl76OrpfPOgrO3x9hIi5Xi+vnHlv4kg= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Subject: [RFC PATCH v1 4/5] apps: cam: sdl_texture: Remove `SDLTextureYUYV` Date: Mon, 21 Apr 2025 17:51:08 +0200 Message-ID: <20250421155109.175930-5-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250421155109.175930-1-barnabas.pocze@ideasonboard.com> References: <20250421155109.175930-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" It became unused, so remove it. Signed-off-by: Barnabás Pőcze --- src/apps/cam/sdl_texture_yuv.cpp | 10 ---------- src/apps/cam/sdl_texture_yuv.h | 7 ------- 2 files changed, 17 deletions(-) diff --git a/src/apps/cam/sdl_texture_yuv.cpp b/src/apps/cam/sdl_texture_yuv.cpp index 80a5ec05d..ba7bd57f8 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_, &rect_, 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 Mon Apr 21 15:51:09 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: 23201 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 7B221C331E for ; Mon, 21 Apr 2025 15:51:24 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 255DD68AD8; Mon, 21 Apr 2025 17:51:23 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="apEizoY3"; 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 ACA2A68AC3 for ; Mon, 21 Apr 2025 17:51:14 +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 1AF966D5 for ; Mon, 21 Apr 2025 17:49:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1745250548; bh=qilTFUMYiT0u0a0gF9NFLhvjVqE9yf0FqqheIQRhkG0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=apEizoY3cfHXpNnztj4L7cgsvv/q8jDCQA5whoWKo25LQKn8krZU69yemJzz0oDRj kk/jRbN4hZ2HNi4ZTnxsfVfM8xeaJPMJd0Yb/CjOn+W+As1d/jts0DdIX1JC5soZh5 T8PtbotH034K8Iwo2VKjmkm9U5HEYcJbt6ATf7hE= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Subject: [RFC PATCH v1 5/5] apps: cam: sdl_sink: Support `{RGB,BGR}888` Date: Mon, 21 Apr 2025 17:51:09 +0200 Message-ID: <20250421155109.175930-6-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250421155109.175930-1-barnabas.pocze@ideasonboard.com> References: <20250421155109.175930-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" These two formats map to `SDL_PIXELFORMAT_{RGB,BGR}24`, respectively; use the generic `SDLTexture1Plane` to handle them. Signed-off-by: Barnabás Pőcze --- src/apps/cam/sdl_sink.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/apps/cam/sdl_sink.cpp b/src/apps/cam/sdl_sink.cpp index b295675dc..51c8cfb52 100644 --- a/src/apps/cam/sdl_sink.cpp +++ b/src/apps/cam/sdl_sink.cpp @@ -77,6 +77,12 @@ 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::RGB888: + texture_ = std::make_unique(rect_, SDL_PIXELFORMAT_RGB24, cfg.stride); + break; + case libcamera::formats::BGR888: + texture_ = std::make_unique(rect_, SDL_PIXELFORMAT_BGR24, cfg.stride); + break; default: std::cerr << "Unsupported pixel format " << cfg.pixelFormat.toString() << std::endl;