[RFC,v1,3/5] apps: cam: sdl_sink: Use `SDLTexture1Plane` for `YUYV`
diff mbox series

Message ID 20250421155109.175930-4-barnabas.pocze@ideasonboard.com
State New
Headers show
Series
  • apps: cam: Support {RGB,BGR}888 format
Related show

Commit Message

Barnabás Pőcze April 21, 2025, 3:51 p.m. UTC
`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@ideasonboard.com>
---
 src/apps/cam/sdl_sink.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Patch
diff mbox series

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 "