[RFC PATCH v1 5/5] apps: cam: sdl_sink: Support `{RGB,BGR}888`
Barnabás Pőcze
barnabas.pocze at ideasonboard.com
Mon Apr 21 17:51:09 CEST 2025
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 <barnabas.pocze at ideasonboard.com>
---
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<SDLTexture1Plane>(rect_, SDL_PIXELFORMAT_YUY2, cfg.stride);
break;
+ case libcamera::formats::RGB888:
+ texture_ = std::make_unique<SDLTexture1Plane>(rect_, SDL_PIXELFORMAT_RGB24, cfg.stride);
+ break;
+ case libcamera::formats::BGR888:
+ texture_ = std::make_unique<SDLTexture1Plane>(rect_, SDL_PIXELFORMAT_BGR24, cfg.stride);
+ break;
default:
std::cerr << "Unsupported pixel format "
<< cfg.pixelFormat.toString() << std::endl;
--
2.49.0
More information about the libcamera-devel
mailing list