[{"id":33982,"web_url":"https://patchwork.libcamera.org/comment/33982/","msgid":"<2797a405-0973-4b13-a5e0-a96cfb9ca044@ideasonboard.com>","date":"2025-04-22T09:38:41","subject":"Re: [RFC PATCH v1 5/5] apps: cam: sdl_sink: Support `{RGB,BGR}888`","submitter":{"id":216,"url":"https://patchwork.libcamera.org/api/people/216/","name":"Barnabás Pőcze","email":"barnabas.pocze@ideasonboard.com"},"content":"2025. 04. 21. 17:51 keltezéssel, Barnabás Pőcze írta:\n> These two formats map to `SDL_PIXELFORMAT_{RGB,BGR}24`, respectively;\n> use the generic `SDLTexture1Plane` to handle them.\n> \n> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n> ---\n>   src/apps/cam/sdl_sink.cpp | 6 ++++++\n>   1 file changed, 6 insertions(+)\n> \n> diff --git a/src/apps/cam/sdl_sink.cpp b/src/apps/cam/sdl_sink.cpp\n> index b295675dc..51c8cfb52 100644\n> --- a/src/apps/cam/sdl_sink.cpp\n> +++ b/src/apps/cam/sdl_sink.cpp\n> @@ -77,6 +77,12 @@ 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::RGB888:\n> +\t\ttexture_ = std::make_unique<SDLTexture1Plane>(rect_, SDL_PIXELFORMAT_RGB24, cfg.stride);\n> +\t\tbreak;\n> +\tcase libcamera::formats::BGR888:\n> +\t\ttexture_ = std::make_unique<SDLTexture1Plane>(rect_, SDL_PIXELFORMAT_BGR24, cfg.stride);\n> +\t\tbreak;\n\nOops... the mapping to SDL formats should be the other way around.\n\n\nRegards,\nBarnabás Pőcze\n\n\n>   \tdefault:\n>   \t\tstd::cerr << \"Unsupported pixel format \"\n>   \t\t\t  << cfg.pixelFormat.toString() << std::endl;","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 78F2BC327D\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 22 Apr 2025 09:38:47 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A549B68AC7;\n\tTue, 22 Apr 2025 11:38:46 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 57A62617E3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 22 Apr 2025 11:38:45 +0200 (CEST)","from [192.168.33.21] (185.221.143.16.nat.pool.zt.hu\n\t[185.221.143.16])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 0DDB1666\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 22 Apr 2025 11:36:37 +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=\"AijBq9WU\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1745314598;\n\tbh=XBqFcyGuJUfUniQG8cRDJUYcX0Riir8fJFxV2/A5WTM=;\n\th=Date:Subject:To:References:From:In-Reply-To:From;\n\tb=AijBq9WU9HWC7RJqH4uaDpiehUzkMojDVH/Qn3lnqPe+ZRVeQ4D12JRMCA7BS8qq0\n\tUCQKq5hx2lI5QrQtqij/pzycyig1MbJ7yWNLgW19yJcXc2EOnOk+s4zaYcv9uO3FW4\n\t2W3HeMxLeK4d0Vc/zD6ASS3BC8A5zIGLEqo998xo=","Message-ID":"<2797a405-0973-4b13-a5e0-a96cfb9ca044@ideasonboard.com>","Date":"Tue, 22 Apr 2025 11:38:41 +0200","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [RFC PATCH v1 5/5] apps: cam: sdl_sink: Support `{RGB,BGR}888`","To":"libcamera-devel@lists.libcamera.org","References":"<20250421155109.175930-1-barnabas.pocze@ideasonboard.com>\n\t<20250421155109.175930-6-barnabas.pocze@ideasonboard.com>","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Content-Language":"en-US, hu-HU","In-Reply-To":"<20250421155109.175930-6-barnabas.pocze@ideasonboard.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","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>"}},{"id":34004,"web_url":"https://patchwork.libcamera.org/comment/34004/","msgid":"<20250422234159.GB17813@pendragon.ideasonboard.com>","date":"2025-04-22T23:41:59","subject":"Re: [RFC PATCH v1 5/5] apps: cam: sdl_sink: Support `{RGB,BGR}888`","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Tue, Apr 22, 2025 at 11:38:41AM +0200, Barnabás Pőcze wrote:\n> 2025. 04. 21. 17:51 keltezéssel, Barnabás Pőcze írta:\n> > These two formats map to `SDL_PIXELFORMAT_{RGB,BGR}24`, respectively;\n> > use the generic `SDLTexture1Plane` to handle them.\n> > \n> > Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n> > ---\n> >   src/apps/cam/sdl_sink.cpp | 6 ++++++\n> >   1 file changed, 6 insertions(+)\n> > \n> > diff --git a/src/apps/cam/sdl_sink.cpp b/src/apps/cam/sdl_sink.cpp\n> > index b295675dc..51c8cfb52 100644\n> > --- a/src/apps/cam/sdl_sink.cpp\n> > +++ b/src/apps/cam/sdl_sink.cpp\n> > @@ -77,6 +77,12 @@ 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::RGB888:\n> > +\t\ttexture_ = std::make_unique<SDLTexture1Plane>(rect_, SDL_PIXELFORMAT_RGB24, cfg.stride);\n> > +\t\tbreak;\n> > +\tcase libcamera::formats::BGR888:\n> > +\t\ttexture_ = std::make_unique<SDLTexture1Plane>(rect_, SDL_PIXELFORMAT_BGR24, cfg.stride);\n> > +\t\tbreak;\n> \n> Oops... the mapping to SDL formats should be the other way around.\n\nWith the order fixed (in the code and in the commit message), this looks\ngood to me.\n\n> >   \tdefault:\n> >   \t\tstd::cerr << \"Unsupported pixel format \"\n> >   \t\t\t  << cfg.pixelFormat.toString() << std::endl;","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 7ABCEBE08B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 22 Apr 2025 23:42:05 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 982C968AD4;\n\tWed, 23 Apr 2025 01:42:04 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id EE33368ACA\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 23 Apr 2025 01:42:02 +0200 (CEST)","from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi\n\t[81.175.209.231])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id B1BB0EFF;\n\tWed, 23 Apr 2025 01:42:01 +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=\"af7YAppF\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1745365321;\n\tbh=pnc9YjY0IcKenPW0mCFPSK+5cgW5q3lhec/nW2K8vKc=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=af7YAppFkWBy1IXxWnAhs+1ex6LLUeyIPyf3SpfDe2w58b3f68XO+CasFGJRxa+Yo\n\tz77IOVMARyWmKEsKptqaVucG5EBOayuIFdNNwmhalvE4Dy/15ZBj/jMqjGHWhD0sL6\n\tJAK2TzFW+UhzBHapmXAQJKc20zrY1iggocnLnBU4=","Date":"Wed, 23 Apr 2025 02:41:59 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [RFC PATCH v1 5/5] apps: cam: sdl_sink: Support `{RGB,BGR}888`","Message-ID":"<20250422234159.GB17813@pendragon.ideasonboard.com>","References":"<20250421155109.175930-1-barnabas.pocze@ideasonboard.com>\n\t<20250421155109.175930-6-barnabas.pocze@ideasonboard.com>\n\t<2797a405-0973-4b13-a5e0-a96cfb9ca044@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<2797a405-0973-4b13-a5e0-a96cfb9ca044@ideasonboard.com>","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>"}}]