[RFC PATCH v1 3/5] apps: cam: sdl_sink: Use `SDLTexture1Plane` for `YUYV`
Barnabás Pőcze
barnabas.pocze at ideasonboard.com
Mon Apr 21 17:51:07 CEST 2025
`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 <barnabas.pocze at ideasonboard.com>
---
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<SDLTextureYUYV>(rect_, cfg.stride);
+ texture_ = std::make_unique<SDLTexture1Plane>(rect_, SDL_PIXELFORMAT_YUY2, cfg.stride);
break;
default:
std::cerr << "Unsupported pixel format "
--
2.49.0
More information about the libcamera-devel
mailing list