[{"id":34851,"web_url":"https://patchwork.libcamera.org/comment/34851/","msgid":"<3cmql5ozravecbdd742kgliq4brnhpo24rcfrruj4y3clkcjde@37rbfv5i7itk>","date":"2025-07-11T05:08:02","subject":"Re: [PATCH v9 05/10] libcamera: simple: Identify requested stream\n\troles","submitter":{"id":232,"url":"https://patchwork.libcamera.org/api/people/232/","name":"Umang Jain","email":"uajain@igalia.com"},"content":"On Mon, Jul 07, 2025 at 05:58:50PM +0200, Milan Zamazal wrote:\n> Currently, raw streams don't work in the simple pipeline and the\n> requested stream roles are ignored.  In order to support raw streams, we\n> now track in SimpleCameraConfiguration whether raw and/or processed\n> streams are requested.  We also check that at most one raw stream is\n> requested, there is no reason to have more.\n> \n> That information will be used in the followup patches.\n> \n> Signed-off-by: Milan Zamazal <mzamazal@redhat.com>\n> ---\n>  src/libcamera/pipeline/simple/simple.cpp | 20 +++++++++++++++++++-\n>  1 file changed, 19 insertions(+), 1 deletion(-)\n> \n> diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp\n> index 1a7474228..6330afeb5 100644\n> --- a/src/libcamera/pipeline/simple/simple.cpp\n> +++ b/src/libcamera/pipeline/simple/simple.cpp\n> @@ -384,6 +384,9 @@ public:\n>  \tbool needConversion() const { return needConversion_; }\n>  \tconst Transform &combinedTransform() const { return combinedTransform_; }\n>  \n> +\tbool processedRequested_;\n> +\tbool rawRequested_;\n> +\n>  private:\n>  \t/*\n>  \t * The SimpleCameraData instance is guaranteed to be valid as long as\n> @@ -1311,12 +1314,27 @@ std::unique_ptr<CameraConfiguration>\n>  SimplePipelineHandler::generateConfiguration(Camera *camera, Span<const StreamRole> roles)\n>  {\n>  \tSimpleCameraData *data = cameraData(camera);\n> -\tstd::unique_ptr<CameraConfiguration> config =\n> +\tstd::unique_ptr<SimpleCameraConfiguration> config =\n>  \t\tstd::make_unique<SimpleCameraConfiguration>(camera, data);\n>  \n> +\tconfig->processedRequested_ = false;\n> +\tconfig->rawRequested_ = false;\n\nShould be defaulted at construction time?\n> +\n>  \tif (roles.empty())\n>  \t\treturn config;\n>  \n> +\tfor (const auto &role : roles)\n> +\t\tif (role == StreamRole::Raw) {\n> +\t\t\tif (config->rawRequested_) {\n> +\t\t\t\tLOG(SimplePipeline, Error)\n> +\t\t\t\t\t<< \"Can't capture multiple raw streams\";\n> +\t\t\t\treturn nullptr;\n\nShould this be a candidate of\nCameraConfiguration::generateConfiguration() instead?  Requesting multiple\nrole=raw streams for a single CameraConfiguration, should be invalid anyway\non all platform (unless I am missing something).\n\n> +\t\t\t}\n> +\t\t\tconfig->rawRequested_ = true;\n\n\n> +\t\t} else {\n> +\t\t\tconfig->processedRequested_ = true;\n> +\t\t}\n> +\n>  \t/* Create the formats map. */\n>  \tstd::map<PixelFormat, std::vector<SizeRange>> formats;\n>  \n> -- \n> 2.50.0\n>","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 3F25EBE175\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 11 Jul 2025 05:08:06 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 476A168F08;\n\tFri, 11 Jul 2025 07:08:05 +0200 (CEST)","from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 916E261517\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 11 Jul 2025 07:08:03 +0200 (CEST)","from [49.43.35.133] (helo=uajain)\n\tby fanzine2.igalia.com with esmtpsa \n\t(Cipher TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256)\n\t(Exim) id 1ua5zO-00FErW-6e; Fri, 11 Jul 2025 07:08:02 +0200"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=igalia.com header.i=@igalia.com\n\theader.b=\"aBUnxCId\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com;\n\ts=20170329;\n\th=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:\n\tSubject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID:\n\tContent-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc\n\t:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe:\n\tList-Post:List-Owner:List-Archive;\n\tbh=qdUaXObGPDpDBQbjzzs3k5sGEiVnA6on1H9ChmFSH8o=;\n\tb=aBUnxCIdHq7vQclZS4XpW9WCf/\n\trdFKUKBUYxM/KUFn3y12ZFVRp+Wf3hV2u7bWYDp1wj6BqLIQHLrww4ngQ8VShWiNeUII9ZXPhmyao\n\tHJ5XSLrCjle22TAeWcPQZiRgbUNur0NsbH4xIDr3Fs2AZO6GD2Ae3pqN1RYG80ALhhMMEeE1+Zt3F\n\t+Cuyt9Zz8YyNsXROeb48L2Y/ZLpAaZMBZsVEboTuX/g3NGWd6ss9mt3CViYIhvduDWNgTHP6YaBl8\n\t9Z1SAgFLPKWFQ0SF+a4cQVLodUldioVFTSxLwugyGgFv9kN9nythMa2K4bsk07+O8awxi8IN6gveS\n\tPKzyl6OQ==;","Date":"Fri, 11 Jul 2025 10:38:02 +0530","From":"Umang Jain <uajain@igalia.com>","To":"Milan Zamazal <mzamazal@redhat.com>","Cc":"libcamera-devel@lists.libcamera.org, Laurent Pinchart\n\t<laurent.pinchart@ideasonboard.com>, Kieran Bingham\n\t<kieran.bingham@ideasonboard.com>, =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?=\n\t<barnabas.pocze@ideasonboard.com>, Paul Elder\n\t<paul.elder@ideasonboard.com>","Subject":"Re: [PATCH v9 05/10] libcamera: simple: Identify requested stream\n\troles","Message-ID":"<3cmql5ozravecbdd742kgliq4brnhpo24rcfrruj4y3clkcjde@37rbfv5i7itk>","References":"<20250707155856.33436-1-mzamazal@redhat.com>\n\t<20250707155856.33436-6-mzamazal@redhat.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20250707155856.33436-6-mzamazal@redhat.com>","User-Agent":"NeoMutt/20250510-dirty","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":34852,"web_url":"https://patchwork.libcamera.org/comment/34852/","msgid":"<nwfydz5z4almveg3dk23znrrx3anphaoptbhfyumkc5tybh67z@j2b2tbt2hdf7>","date":"2025-07-11T06:17:59","subject":"Re: [PATCH v9 05/10] libcamera: simple: Identify requested stream\n\troles","submitter":{"id":232,"url":"https://patchwork.libcamera.org/api/people/232/","name":"Umang Jain","email":"uajain@igalia.com"},"content":"Hi again,\n\nOn Fri, Jul 11, 2025 at 10:38:02AM +0530, Umang Jain wrote:\n> On Mon, Jul 07, 2025 at 05:58:50PM +0200, Milan Zamazal wrote:\n> > Currently, raw streams don't work in the simple pipeline and the\n> > requested stream roles are ignored.  In order to support raw streams, we\n> > now track in SimpleCameraConfiguration whether raw and/or processed\n> > streams are requested.  We also check that at most one raw stream is\n> > requested, there is no reason to have more.\n> > \n> > That information will be used in the followup patches.\n> > \n> > Signed-off-by: Milan Zamazal <mzamazal@redhat.com>\n> > ---\n> >  src/libcamera/pipeline/simple/simple.cpp | 20 +++++++++++++++++++-\n> >  1 file changed, 19 insertions(+), 1 deletion(-)\n> > \n> > diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp\n> > index 1a7474228..6330afeb5 100644\n> > --- a/src/libcamera/pipeline/simple/simple.cpp\n> > +++ b/src/libcamera/pipeline/simple/simple.cpp\n> > @@ -384,6 +384,9 @@ public:\n> >  \tbool needConversion() const { return needConversion_; }\n> >  \tconst Transform &combinedTransform() const { return combinedTransform_; }\n> >  \n> > +\tbool processedRequested_;\n> > +\tbool rawRequested_;\n> > +\n> >  private:\n> >  \t/*\n> >  \t * The SimpleCameraData instance is guaranteed to be valid as long as\n> > @@ -1311,12 +1314,27 @@ std::unique_ptr<CameraConfiguration>\n> >  SimplePipelineHandler::generateConfiguration(Camera *camera, Span<const StreamRole> roles)\n> >  {\n> >  \tSimpleCameraData *data = cameraData(camera);\n> > -\tstd::unique_ptr<CameraConfiguration> config =\n> > +\tstd::unique_ptr<SimpleCameraConfiguration> config =\n> >  \t\tstd::make_unique<SimpleCameraConfiguration>(camera, data);\n> >  \n> > +\tconfig->processedRequested_ = false;\n> > +\tconfig->rawRequested_ = false;\n> \n> Should be defaulted at construction time?\n> > +\n> >  \tif (roles.empty())\n> >  \t\treturn config;\n> >  \n> > +\tfor (const auto &role : roles)\n> > +\t\tif (role == StreamRole::Raw) {\n> > +\t\t\tif (config->rawRequested_) {\n> > +\t\t\t\tLOG(SimplePipeline, Error)\n> > +\t\t\t\t\t<< \"Can't capture multiple raw streams\";\n> > +\t\t\t\treturn nullptr;\n> \n> Should this be a candidate of\n> CameraConfiguration::generateConfiguration() instead?  Requesting multiple\n> role=raw streams for a single CameraConfiguration, should be invalid anyway\n> on all platform (unless I am missing something).\n> \n> > +\t\t\t}\n> > +\t\t\tconfig->rawRequested_ = true;\n> \n> \n> > +\t\t} else {\n> > +\t\t\tconfig->processedRequested_ = true;\n> > +\t\t}\n> > +\n\nI believe these members rawRequested_ and processedRequests_ should be\nset based on streams configuration / pixel formats  requested and not on\nroles passed.\n\nThe application can request an empty CameraConfiguration by not\npassing any role in generateConfiguration() and then pass its desired stream\nconfiguration(s) by CameraConfiguration::addConfiguration(). That would\ncompletely bypass setting of these variables and probably not\nconfigure() things properly.\n\nI would rather inspect the streamConfiguration in validate() ... and set\nrawRequested_ and processedRequestsed_ there. There will be more corner\ncases to deal with (like multiple raw StreamConfiguration added in\nCamera Configuration) which can be easily caught in validate().\n\n> >  \t/* Create the formats map. */\n> >  \tstd::map<PixelFormat, std::vector<SizeRange>> formats;\n> >  \n> > -- \n> > 2.50.0\n> >","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 9DC8BC3237\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 11 Jul 2025 06:17:59 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 95FBC68F09;\n\tFri, 11 Jul 2025 08:17:58 +0200 (CEST)","from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id EFA2261517\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 11 Jul 2025 08:17:56 +0200 (CEST)","from [49.43.35.133] (helo=uajain)\n\tby fanzine2.igalia.com with esmtpsa \n\t(Cipher TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256)\n\t(Exim) id 1ua750-00FFvE-Lh; Fri, 11 Jul 2025 08:17:55 +0200"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=igalia.com header.i=@igalia.com\n\theader.b=\"MdsaOf6x\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com;\n\ts=20170329;\n\th=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:\n\tSubject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID:\n\tContent-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc\n\t:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe:\n\tList-Post:List-Owner:List-Archive;\n\tbh=CZdvcVKRIlnkrmk2gZAEze9BNUU5bWqyQknahtJJBug=;\n\tb=MdsaOf6xddZWobVDXeuF9OTzS7\n\tL/sknlQOhit2AxS6DDrg+OZSuB4r6Sy9Vv0qgMMPh008e+17uR3xMhb78klkSGTYyASABVBUL5m4F\n\t4zsFZDpuIpD14DGIxh6kW4Y5yopKn082Q0o1O88END1FWub3A1IO3umqrzlAkrDbnVoL4sEKxD4na\n\tAufP01zRO9ysCt8HDLOcm+lR0xdw/BlMdeEqaUW8w1EwFkGivvd1jMJyEhACjXHPaOVTgBQz8F0ZI\n\tunH5tNhO3ZUyGf3BgoXlb0vqfkDOVMJOHPA+Mzb7lUZAg+FYJbureYruJCCFY1JhhWEfYpH1IjvKv\n\tPT8hO96A==;","Date":"Fri, 11 Jul 2025 11:47:59 +0530","From":"Umang Jain <uajain@igalia.com>","To":"Milan Zamazal <mzamazal@redhat.com>","Cc":"libcamera-devel@lists.libcamera.org, Laurent Pinchart\n\t<laurent.pinchart@ideasonboard.com>, Kieran Bingham\n\t<kieran.bingham@ideasonboard.com>, =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?=\n\t<barnabas.pocze@ideasonboard.com>, Paul Elder\n\t<paul.elder@ideasonboard.com>","Subject":"Re: [PATCH v9 05/10] libcamera: simple: Identify requested stream\n\troles","Message-ID":"<nwfydz5z4almveg3dk23znrrx3anphaoptbhfyumkc5tybh67z@j2b2tbt2hdf7>","References":"<20250707155856.33436-1-mzamazal@redhat.com>\n\t<20250707155856.33436-6-mzamazal@redhat.com>\n\t<3cmql5ozravecbdd742kgliq4brnhpo24rcfrruj4y3clkcjde@37rbfv5i7itk>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<3cmql5ozravecbdd742kgliq4brnhpo24rcfrruj4y3clkcjde@37rbfv5i7itk>","User-Agent":"NeoMutt/20250510-dirty","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":34855,"web_url":"https://patchwork.libcamera.org/comment/34855/","msgid":"<6ed452d7-6445-4f72-8a1b-ccefbff2bb33@protonmail.com>","date":"2025-07-11T10:07:34","subject":"Re: [PATCH v9 05/10] libcamera: simple: Identify requested stream\n\troles","submitter":{"id":133,"url":"https://patchwork.libcamera.org/api/people/133/","name":"Pőcze Barnabás","email":"pobrn@protonmail.com"},"content":"Hi\n\n2025. 07. 11. 8:17 keltezéssel, Umang Jain írta:\n> Hi again,\n> \n> On Fri, Jul 11, 2025 at 10:38:02AM +0530, Umang Jain wrote:\n>> On Mon, Jul 07, 2025 at 05:58:50PM +0200, Milan Zamazal wrote:\n>>> Currently, raw streams don't work in the simple pipeline and the\n>>> requested stream roles are ignored.  In order to support raw streams, we\n>>> now track in SimpleCameraConfiguration whether raw and/or processed\n>>> streams are requested.  We also check that at most one raw stream is\n>>> requested, there is no reason to have more.\n>>>\n>>> That information will be used in the followup patches.\n>>>\n>>> Signed-off-by: Milan Zamazal <mzamazal@redhat.com>\n>>> ---\n>>>   src/libcamera/pipeline/simple/simple.cpp | 20 +++++++++++++++++++-\n>>>   1 file changed, 19 insertions(+), 1 deletion(-)\n>>>\n>>> diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp\n>>> index 1a7474228..6330afeb5 100644\n>>> --- a/src/libcamera/pipeline/simple/simple.cpp\n>>> +++ b/src/libcamera/pipeline/simple/simple.cpp\n>>> @@ -384,6 +384,9 @@ public:\n>>>   \tbool needConversion() const { return needConversion_; }\n>>>   \tconst Transform &combinedTransform() const { return combinedTransform_; }\n>>>\n>>> +\tbool processedRequested_;\n>>> +\tbool rawRequested_;\n>>> +\n>>>   private:\n>>>   \t/*\n>>>   \t * The SimpleCameraData instance is guaranteed to be valid as long as\n>>> @@ -1311,12 +1314,27 @@ std::unique_ptr<CameraConfiguration>\n>>>   SimplePipelineHandler::generateConfiguration(Camera *camera, Span<const StreamRole> roles)\n>>>   {\n>>>   \tSimpleCameraData *data = cameraData(camera);\n>>> -\tstd::unique_ptr<CameraConfiguration> config =\n>>> +\tstd::unique_ptr<SimpleCameraConfiguration> config =\n>>>   \t\tstd::make_unique<SimpleCameraConfiguration>(camera, data);\n>>>\n>>> +\tconfig->processedRequested_ = false;\n>>> +\tconfig->rawRequested_ = false;\n>>\n>> Should be defaulted at construction time?\n\nI agree, just having ` = false` in the type definition would probably be best.\n\n\n>>> +\n>>>   \tif (roles.empty())\n>>>   \t\treturn config;\n>>>\n>>> +\tfor (const auto &role : roles)\n>>> +\t\tif (role == StreamRole::Raw) {\n>>> +\t\t\tif (config->rawRequested_) {\n>>> +\t\t\t\tLOG(SimplePipeline, Error)\n>>> +\t\t\t\t\t<< \"Can't capture multiple raw streams\";\n>>> +\t\t\t\treturn nullptr;\n>>\n>> Should this be a candidate of\n>> CameraConfiguration::generateConfiguration() instead?  Requesting multiple\n>> role=raw streams for a single CameraConfiguration, should be invalid anyway\n>> on all platform (unless I am missing something).\n>>\n>>> +\t\t\t}\n>>> +\t\t\tconfig->rawRequested_ = true;\n>>\n>>\n>>> +\t\t} else {\n>>> +\t\t\tconfig->processedRequested_ = true;\n>>> +\t\t}\n>>> +\n> \n> I believe these members rawRequested_ and processedRequests_ should be\n> set based on streams configuration / pixel formats  requested and not on\n> roles passed.\n> \n> The application can request an empty CameraConfiguration by not\n> passing any role in generateConfiguration() and then pass its desired stream\n> configuration(s) by CameraConfiguration::addConfiguration(). That would\n> completely bypass setting of these variables and probably not\n> configure() things properly.\n\nI think this is already taken care of, at least in some capacity; these two flags\nare updated in `SimpleCameraConfiguration::validate()` in patch 07.\n\n\nRegards,\nBarnabás Pőcze\n\n\n> \n> I would rather inspect the streamConfiguration in validate() ... and set\n> rawRequested_ and processedRequestsed_ there. There will be more corner\n> cases to deal with (like multiple raw StreamConfiguration added in\n> Camera Configuration) which can be easily caught in validate().\n> \n>>>   \t/* Create the formats map. */\n>>>   \tstd::map<PixelFormat, std::vector<SizeRange>> formats;\n>>>\n>>> --\n>>> 2.50.0\n>>>","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 4A45ABE175\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 11 Jul 2025 10:07:45 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 061FC68F0C;\n\tFri, 11 Jul 2025 12:07:44 +0200 (CEST)","from mail-4316.protonmail.ch (mail-4316.protonmail.ch\n\t[185.70.43.16])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 93AD168E30\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 11 Jul 2025 12:07:42 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=protonmail.com header.i=@protonmail.com\n\theader.b=\"Kw4vQVWH\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com;\n\ts=protonmail3; t=1752228461; x=1752487661;\n\tbh=UXmM6z3Uej8KvKP+yMH1Q2ThwNwIrC04FJ8kPHkDYSE=;\n\th=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References:\n\tFeedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID:\n\tMessage-ID:BIMI-Selector;\n\tb=Kw4vQVWH76Q7sIUuVxoyCg0hmScsb2iREImaUUiljNTqTtk5kOnXFIyvvxVnpSzmT\n\tCZVHvHe54+cGHpllb3cEQLOgBPVhYoLNxU07yuR+3aEJnTlO5uapFwsQ8JAFP0C1a8\n\tssNqSReCIv/Hqo1MlS/NrT/6qH8290lZ7CxDa4D1pTbn7YkTiebNGbW1NzohcP2PMD\n\t4U6OnXRkmvjVTwJprE6vrJKc7HvetUja9n/I3qVbYnuVxEXptU+b+EXxNps7JRlyem\n\tDybRrmjvkIrqUf0UwmKCAg+teDlRJHpKTE9IG1sJVsUcvA0CzNl7Yprn7kU1RQv8NI\n\t2V76cmM12T+Cw==","Date":"Fri, 11 Jul 2025 10:07:34 +0000","To":"Umang Jain <uajain@igalia.com>, Milan Zamazal <mzamazal@redhat.com>","From":"=?utf-8?q?P=C5=91cze_Barnab=C3=A1s?= <pobrn@protonmail.com>","Cc":"libcamera-devel@lists.libcamera.org, Laurent Pinchart\n\t<laurent.pinchart@ideasonboard.com>, Kieran Bingham\n\t<kieran.bingham@ideasonboard.com>, =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?=\n\t<barnabas.pocze@ideasonboard.com>, Paul Elder\n\t<paul.elder@ideasonboard.com>","Subject":"Re: [PATCH v9 05/10] libcamera: simple: Identify requested stream\n\troles","Message-ID":"<6ed452d7-6445-4f72-8a1b-ccefbff2bb33@protonmail.com>","In-Reply-To":"<nwfydz5z4almveg3dk23znrrx3anphaoptbhfyumkc5tybh67z@j2b2tbt2hdf7>","References":"<20250707155856.33436-1-mzamazal@redhat.com>\n\t<20250707155856.33436-6-mzamazal@redhat.com>\n\t<3cmql5ozravecbdd742kgliq4brnhpo24rcfrruj4y3clkcjde@37rbfv5i7itk>\n\t<nwfydz5z4almveg3dk23znrrx3anphaoptbhfyumkc5tybh67z@j2b2tbt2hdf7>","Feedback-ID":"20568564:user:proton","X-Pm-Message-ID":"d950a70511f349f7be9326bf89d1a1df7cf1f36d","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Transfer-Encoding":"quoted-printable","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":34861,"web_url":"https://patchwork.libcamera.org/comment/34861/","msgid":"<85a55ada11.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","date":"2025-07-11T15:25:46","subject":"Re: [PATCH v9 05/10] libcamera: simple: Identify requested stream\n\troles","submitter":{"id":177,"url":"https://patchwork.libcamera.org/api/people/177/","name":"Milan Zamazal","email":"mzamazal@redhat.com"},"content":"Hi,\n\nthank you for reviews.\n\nPőcze Barnabás <pobrn@protonmail.com> writes:\n\n> Hi\n>\n> 2025. 07. 11. 8:17 keltezéssel, Umang Jain írta:\n>> Hi again,\n>> \n>> On Fri, Jul 11, 2025 at 10:38:02AM +0530, Umang Jain wrote:\n>>> On Mon, Jul 07, 2025 at 05:58:50PM +0200, Milan Zamazal wrote:\n>>>> Currently, raw streams don't work in the simple pipeline and the\n>>>> requested stream roles are ignored.  In order to support raw streams, we\n>>>> now track in SimpleCameraConfiguration whether raw and/or processed\n>>>> streams are requested.  We also check that at most one raw stream is\n>>>> requested, there is no reason to have more.\n>>>>\n>>>> That information will be used in the followup patches.\n>>>>\n>>>> Signed-off-by: Milan Zamazal <mzamazal@redhat.com>\n>>>> ---\n>>>>   src/libcamera/pipeline/simple/simple.cpp | 20 +++++++++++++++++++-\n>>>>   1 file changed, 19 insertions(+), 1 deletion(-)\n>>>>\n>>>> diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp\n>>>> index 1a7474228..6330afeb5 100644\n>>>> --- a/src/libcamera/pipeline/simple/simple.cpp\n>>>> +++ b/src/libcamera/pipeline/simple/simple.cpp\n>>>> @@ -384,6 +384,9 @@ public:\n>>>>   \tbool needConversion() const { return needConversion_; }\n>>>>   \tconst Transform &combinedTransform() const { return combinedTransform_; }\n>>>>\n>>>> +\tbool processedRequested_;\n>>>> +\tbool rawRequested_;\n>>>> +\n>>>>   private:\n>>>>   \t/*\n>>>>   \t * The SimpleCameraData instance is guaranteed to be valid as long as\n>>>> @@ -1311,12 +1314,27 @@ std::unique_ptr<CameraConfiguration>\n>>>>   SimplePipelineHandler::generateConfiguration(Camera *camera, Span<const StreamRole> roles)\n>>>>   {\n>>>>   \tSimpleCameraData *data = cameraData(camera);\n>>>> -\tstd::unique_ptr<CameraConfiguration> config =\n>>>> +\tstd::unique_ptr<SimpleCameraConfiguration> config =\n>>>>   \t\tstd::make_unique<SimpleCameraConfiguration>(camera, data);\n>>>>\n>>>> +\tconfig->processedRequested_ = false;\n>>>> +\tconfig->rawRequested_ = false;\n>>>\n>>> Should be defaulted at construction time?\n>\n> I agree, just having ` = false` in the type definition would probably be best.\n>\n>\n>>>> +\n>>>>   \tif (roles.empty())\n>>>>   \t\treturn config;\n>>>>\n>>>> +\tfor (const auto &role : roles)\n>>>> +\t\tif (role == StreamRole::Raw) {\n>>>> +\t\t\tif (config->rawRequested_) {\n>>>> +\t\t\t\tLOG(SimplePipeline, Error)\n>>>> +\t\t\t\t\t<< \"Can't capture multiple raw streams\";\n>>>> +\t\t\t\treturn nullptr;\n>>>\n>>> Should this be a candidate of\n>>> CameraConfiguration::generateConfiguration() instead?  Requesting multiple\n>>> role=raw streams for a single CameraConfiguration, should be invalid anyway\n>>> on all platform (unless I am missing something).\n\nI'm not sure, I think I've seen support for two raw streams in some\npipeline, but I may be mistaken.  Anyway, I wouldn't like to make\nchanges with impact on other pipelines in this series.\n\n>>>> +\t\t\t}\n>>>> +\t\t\tconfig->rawRequested_ = true;\n>>>\n>>>\n>>>> +\t\t} else {\n>>>> +\t\t\tconfig->processedRequested_ = true;\n>>>> +\t\t}\n>>>> +\n>> \n>> I believe these members rawRequested_ and processedRequests_ should be\n>> set based on streams configuration / pixel formats  requested and not on\n>> roles passed.\n\nI think I can drop rawRequested_ and processedRequests_ and set\ncorresponding local variables independently in both\ngenerateConfiguration() and validate().  This should solve the issue you\ndescribe below; the role-based checks in generateConfiguration() should\nremain in place as asking for multiple raw roles or other mismatches\n(like asking for a raw role with a non-raw format) are simply invalid.\n\n>> The application can request an empty CameraConfiguration by not\n>> passing any role in generateConfiguration() and then pass its desired stream\n>> configuration(s) by CameraConfiguration::addConfiguration(). That would\n>> completely bypass setting of these variables and probably not\n>> configure() things properly.\n>\n> I think this is already taken care of, at least in some capacity; these two flags\n> are updated in `SimpleCameraConfiguration::validate()` in patch 07.\n\nIndeed, but a check for multiple raw streams should be added there, will\ndo in v10.\n\n> Regards,\n> Barnabás Pőcze\n>\n>\n>> \n>> I would rather inspect the streamConfiguration in validate() ... and set\n>> rawRequested_ and processedRequestsed_ there. There will be more corner\n>> cases to deal with (like multiple raw StreamConfiguration added in\n>> Camera Configuration) which can be easily caught in validate().\n>> \n>>>>   \t/* Create the formats map. */\n>>>>   \tstd::map<PixelFormat, std::vector<SizeRange>> formats;\n>>>>\n>>>> --\n>>>> 2.50.0\n>>>>","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 8D142BE175\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 11 Jul 2025 15:25:54 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8841D68F12;\n\tFri, 11 Jul 2025 17:25:53 +0200 (CEST)","from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.133.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 70AAC68E30\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 11 Jul 2025 17:25:52 +0200 (CEST)","from mail-ed1-f69.google.com (mail-ed1-f69.google.com\n\t[209.85.208.69]) by relay.mimecast.com with ESMTP with STARTTLS\n\t(version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n\tus-mta-434-8eaSwrPgNBmX2a9QVXZkYQ-1; Fri, 11 Jul 2025 11:25:50 -0400","by mail-ed1-f69.google.com with SMTP id\n\t4fb4d7f45d1cf-606b62ce2d4so2440033a12.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 11 Jul 2025 08:25:49 -0700 (PDT)","from mzamazal-thinkpadp1gen7.tpbc.csb\n\t(ip-77-48-47-2.net.vodafone.cz. [77.48.47.2])\n\tby smtp.gmail.com with ESMTPSA id\n\t4fb4d7f45d1cf-611c976d9f7sm2304170a12.54.2025.07.11.08.25.47\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 11 Jul 2025 08:25:47 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=redhat.com header.i=@redhat.com\n\theader.b=\"BMBM8fjp\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1752247551;\n\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n\tto:to:cc:cc:mime-version:mime-version:content-type:content-type:\n\tcontent-transfer-encoding:content-transfer-encoding:\n\tin-reply-to:in-reply-to:references:references;\n\tbh=qNQNczAvMp207+I+iWDCFnbN4AshaMHstXlV/SGnoKo=;\n\tb=BMBM8fjp0i5UQJ0wTEIN3GsNYT1GddklzMj2nfa7sAY4nE6td69jYdXmIgjJA38IHfJipM\n\tU+B/PX1cuODBlOWwgjzv6b37V4P6zWaPHRRxaLbGsVOndeb8E0K/oKiICy1Uev3CJrk6Jh\n\tr7A+E2nAxPyfZLjIIEk3m4ajJYcDClk=","X-MC-Unique":"8eaSwrPgNBmX2a9QVXZkYQ-1","X-Mimecast-MFC-AGG-ID":"8eaSwrPgNBmX2a9QVXZkYQ_1752247549","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1752247549; x=1752852349;\n\th=content-transfer-encoding:mime-version:user-agent:message-id:date\n\t:references:in-reply-to:subject:cc:to:from:x-gm-message-state:from\n\t:to:cc:subject:date:message-id:reply-to;\n\tbh=62s5C77H+yaP2uFyBT8mqpxrUyjSVZ/zsIPBJBQVw1s=;\n\tb=X8iKTyWx7BCeXuuMhDwatkhJRW7l3A7BQ+XfhtQTf4QG2rMqQ6AXcT0Orgb26Y9Hkv\n\trkNqzPEKMXGXeLgTsrrbMzdXkcJFM7Wv/XbhssIjX4xLF1s7jWKW6cSTb+pNyQKYUbVL\n\tZpvcGSYMhlCmNvbU/VDMddp3s35nF7eDEsxJ2IYjtRk77fhr34Ebexm8OHlkEFZ3NfYm\n\tvjC9hR6iu5zzineSJxtAVjywbynmFWsCNO3v5QDC4+ydlNyyM78DL3IGChrHmRBuc+/i\n\tMi8o5ZMdFnhE3/rI5vf8iae3AY/v4ZlZeJGZseJh59817buot2n/JaEK6HfeMrLzxUJc\n\tO9Aw==","X-Forwarded-Encrypted":"i=1;\n\tAJvYcCUcgrvGmc4N8BUloevcmyFK8ASAddbqXmizjH6tyIAx0nJTQ3Thiy6jMOrykOSbXbmPIop5VtAkiU0H2cpBCu4=@lists.libcamera.org","X-Gm-Message-State":"AOJu0Yz3c5wsGe49NRmCbo2iZTl1/DObxnmF6z9pUY+3V3TWEL8D4Vpn\n\tqE0bumJJdKbnh8JcnG5SNOTAVbP1LxhBISA1mYeFMhSdXjTtA6L5nBPMouNBeLU4ZWNOnc5Xjvs\n\t0vBEjZ1rgQ2J2mZ1LDhjMLtbfFfkWGeNyIWk1oO5oDPbuhvUZy2QlW5+Zg9ZBZigHIfZV2g0iY6\n\tY=","X-Gm-Gg":"ASbGncvOTx7J6dirlnK/wRN1pxV67ybwFi3Z2FiQcjIJujgDIjiLOVpDvuPL261peQk\n\tcFzwHKMwesxQulVrHUkljNvJgdNYOe9+qpkhCUziN7z97mPaFRpE8JX9urTvqsd8eGLYZpK/0YR\n\tdL4DCMgXkw9PUoex9Rumfw1u8UG1/ICQicdOZYIFht7n1lluildJVqbsVvYfNXioCePp8vWPdy6\n\t+vodOvWqf0CCp+mG6xxUrWCfyPgaYE3D6793f+iKax0bOPJf5kW9Cg0Ue9Y2Nm+euazA+jpplp+\n\tQ84I+OpMtlZViTDGP2VDUfJPI/VXE6c8DyrDX6CGR871RkWXMiabCmU2ckHltGCRrRPXn4YdZDm\n\t71FF9m5nzRubFfyTe","X-Received":["by 2002:a05:6402:210b:b0:608:a7a0:48 with SMTP id\n\t4fb4d7f45d1cf-611ed11206dmr3061319a12.28.1752247548691; \n\tFri, 11 Jul 2025 08:25:48 -0700 (PDT)","by 2002:a05:6402:210b:b0:608:a7a0:48 with SMTP id\n\t4fb4d7f45d1cf-611ed11206dmr3061295a12.28.1752247548232; \n\tFri, 11 Jul 2025 08:25:48 -0700 (PDT)"],"X-Google-Smtp-Source":"AGHT+IFY0qBqW1sFQPkqh1Yz+oH9C6MM51hqu/w4Ln+vbZu2gjWG4i9KeH7Zw2AjoTMOGvoyta62jQ==","From":"Milan Zamazal <mzamazal@redhat.com>","To":"Umang Jain <uajain@igalia.com>","Cc":"=?utf-8?q?P=C5=91cze_Barnab=C3=A1s?= <pobrn@protonmail.com>,\n\tlibcamera-devel@lists.libcamera.org, Laurent Pinchart\n\t<laurent.pinchart@ideasonboard.com>,\n\tKieran Bingham <kieran.bingham@ideasonboard.com>, =?utf-8?q?Barnab?=\n\t=?utf-8?b?w6FzIFDFkWN6ZQ==?=\n\t<barnabas.pocze@ideasonboard.com>, Paul Elder\n\t<paul.elder@ideasonboard.com>","Subject":"Re: [PATCH v9 05/10] libcamera: simple: Identify requested stream\n\troles","In-Reply-To":"<6ed452d7-6445-4f72-8a1b-ccefbff2bb33@protonmail.com> (\n\t=?utf-8?b?IlDFkWN6ZQlCYXJuYWLDoXMiJ3M=?= message of \"Fri, 11 Jul\n\t2025 10:07:34 +0000\")","References":"<20250707155856.33436-1-mzamazal@redhat.com>\n\t<20250707155856.33436-6-mzamazal@redhat.com>\n\t<3cmql5ozravecbdd742kgliq4brnhpo24rcfrruj4y3clkcjde@37rbfv5i7itk>\n\t<nwfydz5z4almveg3dk23znrrx3anphaoptbhfyumkc5tybh67z@j2b2tbt2hdf7>\n\t<6ed452d7-6445-4f72-8a1b-ccefbff2bb33@protonmail.com>","Date":"Fri, 11 Jul 2025 17:25:46 +0200","Message-ID":"<85a55ada11.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","User-Agent":"Gnus/5.13 (Gnus v5.13)","MIME-Version":"1.0","X-Mimecast-Spam-Score":"0","X-Mimecast-MFC-PROC-ID":"V1FrOrWTx67SdBxFNinlYJpTXn1hg0uROmKmveThAnA_1752247549","X-Mimecast-Originator":"redhat.com","Content-Type":"text/plain; charset=utf-8","Content-Transfer-Encoding":"quoted-printable","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>"}}]