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 "