{"id":23271,"url":"https://patchwork.libcamera.org/api/patches/23271/?format=json","web_url":"https://patchwork.libcamera.org/patch/23271/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20250428084418.1251085-5-barnabas.pocze@ideasonboard.com>","date":"2025-04-28T08:44:18","name":"[v3,4/4] apps: cam: sdl_sink: Support more single-plane formats","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"ecef3e2628a7f5c5b52e4aebd16f398f9d922155","submitter":{"id":216,"url":"https://patchwork.libcamera.org/api/people/216/?format=json","name":"Barnabás Pőcze","email":"barnabas.pocze@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/23271/mbox/","series":[{"id":5147,"url":"https://patchwork.libcamera.org/api/series/5147/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=5147","date":"2025-04-28T08:44:14","name":"apps: cam: sdl_sink: Support more RGB and YUV formats","version":3,"mbox":"https://patchwork.libcamera.org/series/5147/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/23271/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/23271/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 60913C331F\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 28 Apr 2025 08:44:37 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id F2DD668ADE;\n\tMon, 28 Apr 2025 10:44:32 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 2D84268AD3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 28 Apr 2025 10:44:23 +0200 (CEST)","from pb-laptop.local (185.221.141.190.nat.pool.zt.hu\n\t[185.221.141.190])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 4BAA2928;\n\tMon, 28 Apr 2025 10:44:18 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"VPpLEZvv\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1745829858;\n\tbh=j44uNdu4cjeVtARUSfOQEjr77hYmbBanj0kP4K4I30Y=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=VPpLEZvvlN9cYOU6UlA6OswwFgnou5HkXg5MWPsk8R2XC3HsLJsLGw3Gl+vkuoA1v\n\tBSQkzOiYhqxX01rOy2l2UErZr7tHjG/ggIEUxBjtI0r8VsUeFNES0XpcsdgSEQppaR\n\tHPuFgJpCFUb6YMNOdx4dS364DB4BStkrSRNqS5Fs=","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Cc":"Kieran Bingham <kieran.bingham@ideasonboard.com>,\n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>","Subject":"[PATCH v3 4/4] apps: cam: sdl_sink: Support more single-plane\n\tformats","Date":"Mon, 28 Apr 2025 10:44:18 +0200","Message-ID":"<20250428084418.1251085-5-barnabas.pocze@ideasonboard.com>","X-Mailer":"git-send-email 2.49.0","In-Reply-To":"<20250428084418.1251085-1-barnabas.pocze@ideasonboard.com>","References":"<20250428084418.1251085-1-barnabas.pocze@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"With the newly introduced `SDLTexture1Plane` it is easy to handle\nany single-plane format that has an SDL equivalent. So use it for\nmore YUV and RGB formats.\n\nThe mapping of RGB formats is not entirely straightforward because\n`SDL_PIXELFORMAT_ZZZ...888...` defines a format where the order of\nthe components is endian dependent, while libcamera's `ZZZ...888...`\nformats are derived from the matching DRM formats, and the RGB formats\nin question are defined to be little-endian there. So the\nendian-independent `SDL_PIXELFORMAT_{ZZZ24,ZZZZ32}` are used.\n\nSigned-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/apps/cam/sdl_sink.cpp | 36 ++++++++++++++++++++++++++++++++++++\n 1 file changed, 36 insertions(+)","diff":"diff --git a/src/apps/cam/sdl_sink.cpp b/src/apps/cam/sdl_sink.cpp\nindex b295675dc..2edbb523d 100644\n--- a/src/apps/cam/sdl_sink.cpp\n+++ b/src/apps/cam/sdl_sink.cpp\n@@ -77,6 +77,42 @@ int SDLSink::configure(const libcamera::CameraConfiguration &config)\n \tcase libcamera::formats::YUYV:\n \t\ttexture_ = std::make_unique<SDLTexture1Plane>(rect_, SDL_PIXELFORMAT_YUY2, cfg.stride);\n \t\tbreak;\n+\tcase libcamera::formats::UYVY:\n+\t\ttexture_ = std::make_unique<SDLTexture1Plane>(rect_, SDL_PIXELFORMAT_UYVY, cfg.stride);\n+\t\tbreak;\n+\tcase libcamera::formats::YVYU:\n+\t\ttexture_ = std::make_unique<SDLTexture1Plane>(rect_, SDL_PIXELFORMAT_YVYU, cfg.stride);\n+\t\tbreak;\n+\tcase libcamera::formats::ARGB8888:\n+\t\ttexture_ = std::make_unique<SDLTexture1Plane>(rect_, SDL_PIXELFORMAT_BGRA32, cfg.stride);\n+\t\tbreak;\n+\tcase libcamera::formats::XRGB8888:\n+\t\ttexture_ = std::make_unique<SDLTexture1Plane>(rect_, SDL_PIXELFORMAT_BGRX32, cfg.stride);\n+\t\tbreak;\n+\tcase libcamera::formats::RGBA8888:\n+\t\ttexture_ = std::make_unique<SDLTexture1Plane>(rect_, SDL_PIXELFORMAT_ABGR32, cfg.stride);\n+\t\tbreak;\n+\tcase libcamera::formats::RGBX8888:\n+\t\ttexture_ = std::make_unique<SDLTexture1Plane>(rect_, SDL_PIXELFORMAT_XBGR32, cfg.stride);\n+\t\tbreak;\n+\tcase libcamera::formats::ABGR8888:\n+\t\ttexture_ = std::make_unique<SDLTexture1Plane>(rect_, SDL_PIXELFORMAT_RGBA32, cfg.stride);\n+\t\tbreak;\n+\tcase libcamera::formats::XBGR8888:\n+\t\ttexture_ = std::make_unique<SDLTexture1Plane>(rect_, SDL_PIXELFORMAT_RGBX32, cfg.stride);\n+\t\tbreak;\n+\tcase libcamera::formats::BGRA8888:\n+\t\ttexture_ = std::make_unique<SDLTexture1Plane>(rect_, SDL_PIXELFORMAT_ARGB32, cfg.stride);\n+\t\tbreak;\n+\tcase libcamera::formats::BGRX8888:\n+\t\ttexture_ = std::make_unique<SDLTexture1Plane>(rect_, SDL_PIXELFORMAT_XRGB32, cfg.stride);\n+\t\tbreak;\n+\tcase libcamera::formats::RGB888:\n+\t\ttexture_ = std::make_unique<SDLTexture1Plane>(rect_, SDL_PIXELFORMAT_BGR24, cfg.stride);\n+\t\tbreak;\n+\tcase libcamera::formats::BGR888:\n+\t\ttexture_ = std::make_unique<SDLTexture1Plane>(rect_, SDL_PIXELFORMAT_RGB24, cfg.stride);\n+\t\tbreak;\n \tdefault:\n \t\tstd::cerr << \"Unsupported pixel format \"\n \t\t\t  << cfg.pixelFormat.toString() << std::endl;\n","prefixes":["v3","4/4"]}