[{"id":23562,"web_url":"https://patchwork.libcamera.org/comment/23562/","msgid":"<165605843323.1149771.13246858213557317939@Monstersaurus>","date":"2022-06-24T08:13:53","subject":"Re: [libcamera-devel] [RFC v1 1/7] py: cam.py: Fix multi camera\n\tcapture without -C","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Tomi Valkeinen (2022-06-23 15:47:30)\n> -C flag is supposed to affect only the camera that was previously\n> defined in the arguments. That's not the case, and, e.g.:\n> \n> cam.py -c2 -C -c3\n> \n> causes camera 3 to start capturing, but it stops after the initial\n> Requests have been completed.\n> \n> Fix the issue by filtering out camera contexts that do not have -C\n> defined.\n> \n> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>\n> ---\n>  src/py/cam/cam.py | 2 ++\n>  1 file changed, 2 insertions(+)\n> \n> diff --git a/src/py/cam/cam.py b/src/py/cam/cam.py\n> index 2ae89fa8..733e9ae5 100755\n> --- a/src/py/cam/cam.py\n> +++ b/src/py/cam/cam.py\n> @@ -434,6 +434,8 @@ def main():\n>          if args.info:\n>              ctx.do_cmd_info()\n>  \n\nAs the tools are often used for reference or guidance to newcomers it\nmight be helpful to clarify this with a comment. Maybe the filtering is\nmore clear to someone who writes a lot more python ... but from a C\nperspective it takes me a minute to identify what this line really\ndoes.\n\n       # Filter out contexts which don't need to run a capture\n> +    contexts = [ctx for ctx in contexts if ctx.opt_capture > 0]\n> +\n>      if args.capture:\n\nShould this be done on a per-context basis? - Can cam.py already capture\nfrom multiple cameras at the same time?\nMaybe the rest is in the code below that I haven't read yet.\n\nBut the filtering itself sounds fine independently:\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n>          state = CaptureState(cm, contexts)\n>  \n> -- \n> 2.34.1\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 5E265BD808\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 24 Jun 2022 08:13:57 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B17C665635;\n\tFri, 24 Jun 2022 10:13:56 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 169D165631\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 24 Jun 2022 10:13:56 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 8306BDD;\n\tFri, 24 Jun 2022 10:13:55 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1656058436;\n\tbh=+lb+lmyW0JH/9JOv/XyNE27m/FyM5aoN7N+DKB6zQUA=;\n\th=In-Reply-To:References:To:Date:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=tqEO1XrlO7j+BlYowKsMjTCfGVbVeh3blM0oey7AgJhQvs+KmOey9wY6/3IFs0xXh\n\tbmAEEp0lPYuIS/9+vgfgVtnKZzRKE/eKiNu6CgTNuy0OsURLrWS2Q4kkGvHSBh1J+S\n\tvx/+2kvDfw+ZG5S7ug7xka9o5430ZAWbwk4K2FB/hocv+2ffJDYmD21ib4Bp3G0yqh\n\tCm+rJSZ+QgK9U1M614c6eDOZF+7xPPErk47yUzZQb46wyeYkWR7KIh9MCxp0Ga8QXw\n\tG+11LaHDq9jQOGspGCZzd8twcdzQv/gPFNo22KIeGHyOjlCBLp1uz1iH4hgObMkDD9\n\tpXBtSiyVgeKeg==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1656058435;\n\tbh=+lb+lmyW0JH/9JOv/XyNE27m/FyM5aoN7N+DKB6zQUA=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=wpOhGFBd9WYuAAmoI7azt2BBImiTGOXCuAxCztnU32aaVe+VB1L0wHM6p8oCc9cfn\n\tpwkYRzvNtlSa3eRWyq7bolmXHeUs52d1Mcg5y2WMiSwty7MA7TCE8Ewrx88VXLYo9W\n\tHO/d0p9fhOH40DF7elbq4xRvZ5LCwmQjK7DgmO/Q="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"wpOhGFBd\"; dkim-atps=neutral","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20220623144736.78537-2-tomi.valkeinen@ideasonboard.com>","References":"<20220623144736.78537-1-tomi.valkeinen@ideasonboard.com>\n\t<20220623144736.78537-2-tomi.valkeinen@ideasonboard.com>","To":"David Plowman <david.plowman@raspberrypi.com>,\n\tJacopo Mondi <jacopo@jmondi.org>,\n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tTomi Valkeinen <tomi.valkeinen@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Fri, 24 Jun 2022 09:13:53 +0100","Message-ID":"<165605843323.1149771.13246858213557317939@Monstersaurus>","User-Agent":"alot/0.10","Subject":"Re: [libcamera-devel] [RFC v1 1/7] py: cam.py: Fix multi camera\n\tcapture without -C","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>","From":"Kieran Bingham via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":23565,"web_url":"https://patchwork.libcamera.org/comment/23565/","msgid":"<YrV1vq6pXRPQesxB@pendragon.ideasonboard.com>","date":"2022-06-24T08:28:46","subject":"Re: [libcamera-devel] [RFC v1 1/7] py: cam.py: Fix multi camera\n\tcapture without -C","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Fri, Jun 24, 2022 at 09:13:53AM +0100, Kieran Bingham wrote:\n> Quoting Tomi Valkeinen (2022-06-23 15:47:30)\n> > -C flag is supposed to affect only the camera that was previously\n> > defined in the arguments. That's not the case, and, e.g.:\n> > \n> > cam.py -c2 -C -c3\n> > \n> > causes camera 3 to start capturing, but it stops after the initial\n> > Requests have been completed.\n> > \n> > Fix the issue by filtering out camera contexts that do not have -C\n> > defined.\n> > \n> > Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>\n> > ---\n> >  src/py/cam/cam.py | 2 ++\n> >  1 file changed, 2 insertions(+)\n> > \n> > diff --git a/src/py/cam/cam.py b/src/py/cam/cam.py\n> > index 2ae89fa8..733e9ae5 100755\n> > --- a/src/py/cam/cam.py\n> > +++ b/src/py/cam/cam.py\n> > @@ -434,6 +434,8 @@ def main():\n> >          if args.info:\n> >              ctx.do_cmd_info()\n> \n> As the tools are often used for reference or guidance to newcomers it\n> might be helpful to clarify this with a comment. Maybe the filtering is\n> more clear to someone who writes a lot more python ... but from a C\n> perspective it takes me a minute to identify what this line really\n> does.\n> \n>        # Filter out contexts which don't need to run a capture\n> > +    contexts = [ctx for ctx in contexts if ctx.opt_capture > 0]\n> > +\n> >      if args.capture:\n\nMaybe\n\n    if contexts:\n\nwould be clearer ?\n\n> Should this be done on a per-context basis? - Can cam.py already capture\n> from multiple cameras at the same time?\n> Maybe the rest is in the code below that I haven't read yet.\n> \n> But the filtering itself sounds fine independently:\n> \n> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> >          state = CaptureState(cm, contexts)\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 28176BD808\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 24 Jun 2022 08:29:05 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8F20B65631;\n\tFri, 24 Jun 2022 10:29:04 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 3AD5265631\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 24 Jun 2022 10:29:03 +0200 (CEST)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 49D0F47C;\n\tFri, 24 Jun 2022 10:29:02 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1656059344;\n\tbh=4pZqUEUAd/ligWh0PJgYcDRdhg5UgUxet+//LhTiJpo=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=iEdak9BF1uNQulJq+/ubeHaad1S/YffTTypB9kB6TPv/AdAkSaSh/idddtYACnOfh\n\tJycrZwcVeH9Mx72PuwngGxVRNPgxpHFavo4UEXbeBJQyy81Crp/aHg0QOvSLVmy9sG\n\tXfu1MoM56wcVJ4J3nkyvkhXNvHYurBihr8VlkNCp4hY2AHZ1k6/Dwzway6QyOAg3i2\n\tNEblpOOCvDNAdxGqcFux6tJogWPPwYr3AhDr6WQFvXPL464zUvh851WOOd1VRFXJnE\n\tUwI2ActCP0EWDSfG+opBVqSwq9LDKKAe17JQ36Ik2p+Tz2UdQvss3vC6JUSFyQi0r0\n\t+DywrWTE5dL+g==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1656059342;\n\tbh=4pZqUEUAd/ligWh0PJgYcDRdhg5UgUxet+//LhTiJpo=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=sfp9G75hf9EkrTBB+YfHPu6hF++BJe1U5b7B0/T7JmWwb2VSp2Y8kIrST/hoIVBMy\n\tq+tFcl4UMeL3uR++hFyOo4GqDzs4ffdhLYNXYO5PIyuY9PZgX5iv0BpSgbL+DVqB/F\n\tQUE3BQO3ohfGoU4caF1ysEcJyJjXAyPFgmi+mE0w="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"sfp9G75h\"; dkim-atps=neutral","Date":"Fri, 24 Jun 2022 11:28:46 +0300","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Message-ID":"<YrV1vq6pXRPQesxB@pendragon.ideasonboard.com>","References":"<20220623144736.78537-1-tomi.valkeinen@ideasonboard.com>\n\t<20220623144736.78537-2-tomi.valkeinen@ideasonboard.com>\n\t<165605843323.1149771.13246858213557317939@Monstersaurus>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<165605843323.1149771.13246858213557317939@Monstersaurus>","Subject":"Re: [libcamera-devel] [RFC v1 1/7] py: cam.py: Fix multi camera\n\tcapture without -C","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>","From":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":23585,"web_url":"https://patchwork.libcamera.org/comment/23585/","msgid":"<9cc2fb4b-5633-34fa-40a9-af15e326c280@ideasonboard.com>","date":"2022-06-27T06:42:15","subject":"Re: [libcamera-devel] [RFC v1 1/7] py: cam.py: Fix multi camera\n\tcapture without -C","submitter":{"id":109,"url":"https://patchwork.libcamera.org/api/people/109/","name":"Tomi Valkeinen","email":"tomi.valkeinen@ideasonboard.com"},"content":"On 24/06/2022 11:13, Kieran Bingham wrote:\n> Quoting Tomi Valkeinen (2022-06-23 15:47:30)\n>> -C flag is supposed to affect only the camera that was previously\n>> defined in the arguments. That's not the case, and, e.g.:\n>>\n>> cam.py -c2 -C -c3\n>>\n>> causes camera 3 to start capturing, but it stops after the initial\n>> Requests have been completed.\n>>\n>> Fix the issue by filtering out camera contexts that do not have -C\n>> defined.\n>>\n>> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>\n>> ---\n>>   src/py/cam/cam.py | 2 ++\n>>   1 file changed, 2 insertions(+)\n>>\n>> diff --git a/src/py/cam/cam.py b/src/py/cam/cam.py\n>> index 2ae89fa8..733e9ae5 100755\n>> --- a/src/py/cam/cam.py\n>> +++ b/src/py/cam/cam.py\n>> @@ -434,6 +434,8 @@ def main():\n>>           if args.info:\n>>               ctx.do_cmd_info()\n>>   \n> \n> As the tools are often used for reference or guidance to newcomers it\n> might be helpful to clarify this with a comment. Maybe the filtering is\n> more clear to someone who writes a lot more python ... but from a C\n> perspective it takes me a minute to identify what this line really\n> does.\n\nOk, I'll add a comment.\n\n>         # Filter out contexts which don't need to run a capture\n>> +    contexts = [ctx for ctx in contexts if ctx.opt_capture > 0]\n>> +\n>>       if args.capture:\n> \n> Should this be done on a per-context basis? - Can cam.py already capture\n\nThis \"if\" just checks if there's any capturing to be done. The above \nworks as args.capture is a dict of the capture parameters, but as \nLaurent commented, it's perhaps clearer to do \"if contexts\".\n\n> from multiple cameras at the same time?\n\nYes, you can capture from multiple cameras and streams.\n\n> Maybe the rest is in the code below that I haven't read yet.\n> \n> But the filtering itself sounds fine independently:\n> \n> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> \n>>           state = CaptureState(cm, contexts)\n>>   \n>> -- \n>> 2.34.1\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 66919BD808\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 27 Jun 2022 06:42:21 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 70E6465635;\n\tMon, 27 Jun 2022 08:42:20 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0C2686054A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 27 Jun 2022 08:42:19 +0200 (CEST)","from [192.168.1.111] (91-158-154-79.elisa-laajakaista.fi\n\t[91.158.154.79])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 20C7D47C;\n\tMon, 27 Jun 2022 08:42:18 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1656312140;\n\tbh=zeyuECJKgNsGasKOJ4LbEmQg7Vn9VSo93nALJ2pC/tk=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=2+BXO3iy0N4nKcwZmFPy1TfzlfcYFQAv9/iagraxYOGpTSjcq3D+iOlcK41GxsXyB\n\tdwAFrIbLzQuKWVjKlIYyzBq+2hadcJavXUVF+pzMR1yfxSbOGToC5OYHoIUdCWv53d\n\tvDoWwCnNZAgd3/4B39CnNcOU/Umbxy5IdpetzBLS+MvLJ09PomdhvRSvRMloJPN7GD\n\tRkyftWe65TffxadgOGPFC3gOSAf7GKTq+tJbyZHTbGUQ04ejVb/rBfdLMPaCnYy+zV\n\tRvh/kbdDS+QOy13/WILBFYs7veNV3N7r2FvyulqdWzqyrVkgR9hVfhU4XUpCt50fWR\n\tDdgQD88Rw4RWw==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1656312138;\n\tbh=zeyuECJKgNsGasKOJ4LbEmQg7Vn9VSo93nALJ2pC/tk=;\n\th=Date:Subject:To:References:From:In-Reply-To:From;\n\tb=fUWN0RYmTlxpSZvcmNgMYA6c7XEcLNs2B+m/19uUs1NxF4LFepkqHZXb+Cb6+01u0\n\tJ8fpba30hPM3i70Tg8/Ur0efJbq/k+sZOdYonorloeFH4ntuAQH6dhkMPH7XnES3ni\n\tnAJlFhV1ujhwmKdlL1s2cEmMGOf2ODsrjJvldd1U="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"fUWN0RYm\"; dkim-atps=neutral","Message-ID":"<9cc2fb4b-5633-34fa-40a9-af15e326c280@ideasonboard.com>","Date":"Mon, 27 Jun 2022 09:42:15 +0300","MIME-Version":"1.0","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101\n\tThunderbird/91.9.1","Content-Language":"en-US","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>,\n\tDavid Plowman <david.plowman@raspberrypi.com>,\n\tJacopo Mondi <jacopo@jmondi.org>,\n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20220623144736.78537-1-tomi.valkeinen@ideasonboard.com>\n\t<20220623144736.78537-2-tomi.valkeinen@ideasonboard.com>\n\t<165605843323.1149771.13246858213557317939@Monstersaurus>","In-Reply-To":"<165605843323.1149771.13246858213557317939@Monstersaurus>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"7bit","Subject":"Re: [libcamera-devel] [RFC v1 1/7] py: cam.py: Fix multi camera\n\tcapture without -C","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>","From":"Tomi Valkeinen via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":23586,"web_url":"https://patchwork.libcamera.org/comment/23586/","msgid":"<bbede858-5be4-4e29-07d4-c84789d8eaf2@ideasonboard.com>","date":"2022-06-27T06:44:17","subject":"Re: [libcamera-devel] [RFC v1 1/7] py: cam.py: Fix multi camera\n\tcapture without -C","submitter":{"id":109,"url":"https://patchwork.libcamera.org/api/people/109/","name":"Tomi Valkeinen","email":"tomi.valkeinen@ideasonboard.com"},"content":"On 24/06/2022 11:28, Laurent Pinchart wrote:\n> On Fri, Jun 24, 2022 at 09:13:53AM +0100, Kieran Bingham wrote:\n>> Quoting Tomi Valkeinen (2022-06-23 15:47:30)\n>>> -C flag is supposed to affect only the camera that was previously\n>>> defined in the arguments. That's not the case, and, e.g.:\n>>>\n>>> cam.py -c2 -C -c3\n>>>\n>>> causes camera 3 to start capturing, but it stops after the initial\n>>> Requests have been completed.\n>>>\n>>> Fix the issue by filtering out camera contexts that do not have -C\n>>> defined.\n>>>\n>>> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>\n>>> ---\n>>>   src/py/cam/cam.py | 2 ++\n>>>   1 file changed, 2 insertions(+)\n>>>\n>>> diff --git a/src/py/cam/cam.py b/src/py/cam/cam.py\n>>> index 2ae89fa8..733e9ae5 100755\n>>> --- a/src/py/cam/cam.py\n>>> +++ b/src/py/cam/cam.py\n>>> @@ -434,6 +434,8 @@ def main():\n>>>           if args.info:\n>>>               ctx.do_cmd_info()\n>>\n>> As the tools are often used for reference or guidance to newcomers it\n>> might be helpful to clarify this with a comment. Maybe the filtering is\n>> more clear to someone who writes a lot more python ... but from a C\n>> perspective it takes me a minute to identify what this line really\n>> does.\n>>\n>>         # Filter out contexts which don't need to run a capture\n>>> +    contexts = [ctx for ctx in contexts if ctx.opt_capture > 0]\n>>> +\n>>>       if args.capture:\n> \n> Maybe\n> \n>      if contexts:\n> \n> would be clearer ?\n\nYes, indeed.\n\n>> Should this be done on a per-context basis? - Can cam.py already capture\n>> from multiple cameras at the same time?\n>> Maybe the rest is in the code below that I haven't read yet.\n>>\n>> But the filtering itself sounds fine independently:\n>>\n>> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> \n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nThanks!\n\n  Tomi","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 5CF02BE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 27 Jun 2022 06:44:23 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id ADECF65635;\n\tMon, 27 Jun 2022 08:44:22 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 407B06054A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 27 Jun 2022 08:44:21 +0200 (CEST)","from [192.168.1.111] (91-158-154-79.elisa-laajakaista.fi\n\t[91.158.154.79])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 54D2447C;\n\tMon, 27 Jun 2022 08:44:20 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1656312262;\n\tbh=t+ngLNLH/FWGaNga9O3K3YWOhdmu/rrrIiBIY1lURe4=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=lNitcK19kQZT/ZyuPXqcL74ifzysrDQxWwyO8rbVbGhyJgmKsLHcGbgTHin3ebCiT\n\tBafnfhv6FDBQcYxmIFk+ZuGD7udAIPJ43vPf/ZYYPDNERtNGD9hqM6tjm3qMynLnSz\n\tpMWPC1/v4ew+0yBm5P7REB+l2uidQGJYBTGQVqtACKwSwQoYemDL9a3n/KFosIvH2N\n\t5ciWBgixIiX5G4SKlO6lL09V09xBqCGV46LD1nmV+W+UGo0X//EFcGP0DGsxgCZQRx\n\touVTxKgRxhvKnijCWpBl/muAk1NnuXWMQYUB6FmxLhCxVw+LgNYVNFHa2LbwZb2+nD\n\txmdlWwbAolU1g==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1656312260;\n\tbh=t+ngLNLH/FWGaNga9O3K3YWOhdmu/rrrIiBIY1lURe4=;\n\th=Date:Subject:To:Cc:References:From:In-Reply-To:From;\n\tb=EEcr/eduFQJ0VXqXhrIYpUhCtYzQzTs7c2FntQUXNEPKGkYbhM9MOcDRckaJ0UTFv\n\thmk5dLrvqpOEG0j180hDdXtXgNJr4zSRY5bLhBKZHTKxKVdu0QWnTEhR8R5/nMitmH\n\tqrgln89ao1HwptXZCRiqMg23yavLKVzaJuZYceKc="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"EEcr/edu\"; dkim-atps=neutral","Message-ID":"<bbede858-5be4-4e29-07d4-c84789d8eaf2@ideasonboard.com>","Date":"Mon, 27 Jun 2022 09:44:17 +0300","MIME-Version":"1.0","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101\n\tThunderbird/91.9.1","Content-Language":"en-US","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tKieran Bingham <kieran.bingham@ideasonboard.com>","References":"<20220623144736.78537-1-tomi.valkeinen@ideasonboard.com>\n\t<20220623144736.78537-2-tomi.valkeinen@ideasonboard.com>\n\t<165605843323.1149771.13246858213557317939@Monstersaurus>\n\t<YrV1vq6pXRPQesxB@pendragon.ideasonboard.com>","In-Reply-To":"<YrV1vq6pXRPQesxB@pendragon.ideasonboard.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"7bit","Subject":"Re: [libcamera-devel] [RFC v1 1/7] py: cam.py: Fix multi camera\n\tcapture without -C","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>","From":"Tomi Valkeinen via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]