[{"id":24672,"web_url":"https://patchwork.libcamera.org/comment/24672/","msgid":"<20220818155140.ktdngeqwgxqs7btr@uno.localdomain>","date":"2022-08-18T15:51:40","subject":"Re: [libcamera-devel] [PATCH v3 14/17] py: simple-capture.py: Use\n\tnew events support","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Tomi\n\nWe usually add a commit message, even if a simple one.\n\nOn Fri, Jul 01, 2022 at 11:45:18AM +0300, Tomi Valkeinen wrote:\n> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>\n\nReviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n\nThanks\n   j\n\n> ---\n>  src/py/examples/simple-capture.py | 10 +++++++---\n>  1 file changed, 7 insertions(+), 3 deletions(-)\n>\n> diff --git a/src/py/examples/simple-capture.py b/src/py/examples/simple-capture.py\n> index 4b85408f..c26e638b 100755\n> --- a/src/py/examples/simple-capture.py\n> +++ b/src/py/examples/simple-capture.py\n> @@ -107,7 +107,7 @@ def main():\n>      sel.register(cm.event_fd, selectors.EVENT_READ)\n>\n>      while frames_done < TOTAL_FRAMES:\n> -        # cm.get_ready_requests() does not block, so we use a Selector to wait\n> +        # cm.get_events() does not block, so we use a Selector to wait\n>          # for a camera event. Here we should almost always get a single\n>          # Request, but in some cases there could be multiple or none.\n>\n> @@ -115,9 +115,13 @@ def main():\n>          if not events:\n>              continue\n>\n> -        reqs = cm.get_ready_requests()\n> +        for ev in cm.get_events():\n> +            # We are only interested in RequestCompleted events\n> +            if ev.type != libcam.Event.Type.RequestCompleted:\n> +                continue\n> +\n> +            req = ev.request\n>\n> -        for req in reqs:\n>              frames_done += 1\n>\n>              buffers = req.buffers\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 88720BE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 18 Aug 2022 15:51:46 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E9EBD61FC0;\n\tThu, 18 Aug 2022 17:51:45 +0200 (CEST)","from relay11.mail.gandi.net (relay11.mail.gandi.net\n\t[217.70.178.231])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 4E0C961FA7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 18 Aug 2022 17:51:44 +0200 (CEST)","(Authenticated sender: jacopo@jmondi.org)\n\tby mail.gandi.net (Postfix) with ESMTPSA id 925D6100006;\n\tThu, 18 Aug 2022 15:51:42 +0000 (UTC)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1660837905;\n\tbh=Z1+5nuDjvmUKaHJs3bPzcHeHf36yx9ruCkyxwKDThcc=;\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=FXSY4J6MjE+e1H8uTFoy2amIQD686k34Joxu7s9/vQmrMX5EhEjalcT+R9gYTj9Nb\n\t/lC7Hi1MCdjjXqGaWQR/6xI62u88vatst6AtTEE4Xcy2ovJC/N3EYmJdYWpJLPgdh2\n\tI6ry8LYVMIUHysajWMW3wMNbxFyh/QXEPg505tvadpdTObAYd05zUlwGyBnMSU6Njz\n\tkXeBImG1Xbfdzm/avtnspT+5lTC6YZknT0GUtTaiBpOJ/QO1XgBsqENQXmix+6tw+V\n\tmdOMPkCtsVy1FimHVE8Lowk6BSe3YZBUK6RYD2BkzTvRwJQvaut91TRhQ0FUpf3kPR\n\tMN+QGMsuTYftQ==","Date":"Thu, 18 Aug 2022 17:51:40 +0200","To":"Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>","Message-ID":"<20220818155140.ktdngeqwgxqs7btr@uno.localdomain>","References":"<20220701084521.31831-1-tomi.valkeinen@ideasonboard.com>\n\t<20220701084521.31831-15-tomi.valkeinen@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20220701084521.31831-15-tomi.valkeinen@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH v3 14/17] py: simple-capture.py: Use\n\tnew events support","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":"Jacopo Mondi via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Jacopo Mondi <jacopo@jmondi.org>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":24689,"web_url":"https://patchwork.libcamera.org/comment/24689/","msgid":"<Yv6pPcMV/ww00c9o@pendragon.ideasonboard.com>","date":"2022-08-18T21:03:57","subject":"Re: [libcamera-devel] [PATCH v3 14/17] py: simple-capture.py: Use\n\tnew events support","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Tomi,\n\nThank you for the patch.\n\nOn Fri, Jul 01, 2022 at 11:45:18AM +0300, Tomi Valkeinen wrote:\n\nA commit message would be nice here too.\n\n> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>\n> ---\n>  src/py/examples/simple-capture.py | 10 +++++++---\n>  1 file changed, 7 insertions(+), 3 deletions(-)\n> \n> diff --git a/src/py/examples/simple-capture.py b/src/py/examples/simple-capture.py\n> index 4b85408f..c26e638b 100755\n> --- a/src/py/examples/simple-capture.py\n> +++ b/src/py/examples/simple-capture.py\n> @@ -107,7 +107,7 @@ def main():\n>      sel.register(cm.event_fd, selectors.EVENT_READ)\n>  \n>      while frames_done < TOTAL_FRAMES:\n> -        # cm.get_ready_requests() does not block, so we use a Selector to wait\n> +        # cm.get_events() does not block, so we use a Selector to wait\n>          # for a camera event. Here we should almost always get a single\n>          # Request, but in some cases there could be multiple or none.\n\n\"Here we should almost always get a single request completion event, but\nin some cases there could be multiple ones, other events, or no events\nat all.\"\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n>  \n> @@ -115,9 +115,13 @@ def main():\n>          if not events:\n>              continue\n>  \n> -        reqs = cm.get_ready_requests()\n> +        for ev in cm.get_events():\n> +            # We are only interested in RequestCompleted events\n> +            if ev.type != libcam.Event.Type.RequestCompleted:\n> +                continue\n> +\n> +            req = ev.request\n>  \n> -        for req in reqs:\n>              frames_done += 1\n>  \n>              buffers = req.buffers","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 BD3CABE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 18 Aug 2022 21:04:02 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 19E8261FC0;\n\tThu, 18 Aug 2022 23:04:02 +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 4888561FA7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 18 Aug 2022 23:04:01 +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 8C2448B;\n\tThu, 18 Aug 2022 23:04:00 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1660856642;\n\tbh=ysS1L69jprT7MGn8SxfKNDU3JGHuaRNjlRtKKP/HjsM=;\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=ucqQDd4worhBTrNVo1bbPbwXbx52Bbp6DyB/3mQUTFLlwutVMM3+0VGNpc0jpxh4/\n\tS8J2lwtaq5/l/7Ow9uiiBURZDXcnPrEr0iodZ6y7U8DH1iJhukXIdA9gpOIFn4SwYV\n\tajVs9yPIgSFy7qVtYkL4n04JA9y1DwXbi06svta35NgcYmFgO5ZirS4C7iRcnDNUVx\n\tWzXP2dvL7D/ECxLKlJunC3k7mGYcB/JeYBCJqi/IVsC1d9KsIUkl2B1fr0sdm4nXxd\n\tpvnrEPqpxAOOY6YHNfeH82I1ikeLsUK1J9BOuZVwSy7Cgre/xYtxJy6y7FVlci7zUz\n\tgss5mMWtJujFQ==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1660856640;\n\tbh=ysS1L69jprT7MGn8SxfKNDU3JGHuaRNjlRtKKP/HjsM=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=Qk77f77fDZ5v1NMDdkdcVFoMvrwWJAnOiynw+nZnYT9DOausmjwj+SIFMEjo3vIsN\n\txAZ2l9/7NtSIJb6/uuduTEBq084wGYwH7V5lvP0aqcW9eppc0sKuxAKgKKypH+81yV\n\thuOgN4OjIIxyLVby5L/Dj8tupd1hU9BNbKNUX+40="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"Qk77f77f\"; dkim-atps=neutral","Date":"Fri, 19 Aug 2022 00:03:57 +0300","To":"Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>","Message-ID":"<Yv6pPcMV/ww00c9o@pendragon.ideasonboard.com>","References":"<20220701084521.31831-1-tomi.valkeinen@ideasonboard.com>\n\t<20220701084521.31831-15-tomi.valkeinen@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20220701084521.31831-15-tomi.valkeinen@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH v3 14/17] py: simple-capture.py: Use\n\tnew events support","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":24794,"web_url":"https://patchwork.libcamera.org/comment/24794/","msgid":"<a0ec7a96-9967-04b7-5a66-c926f83969a5@ideasonboard.com>","date":"2022-08-26T12:37:36","subject":"Re: [libcamera-devel] [PATCH v3 14/17] py: simple-capture.py: Use\n\tnew events support","submitter":{"id":109,"url":"https://patchwork.libcamera.org/api/people/109/","name":"Tomi Valkeinen","email":"tomi.valkeinen@ideasonboard.com"},"content":"On 19/08/2022 00:03, Laurent Pinchart wrote:\n> Hi Tomi,\n> \n> Thank you for the patch.\n> \n> On Fri, Jul 01, 2022 at 11:45:18AM +0300, Tomi Valkeinen wrote:\n> \n> A commit message would be nice here too.\n> \n>> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>\n>> ---\n>>   src/py/examples/simple-capture.py | 10 +++++++---\n>>   1 file changed, 7 insertions(+), 3 deletions(-)\n>>\n>> diff --git a/src/py/examples/simple-capture.py b/src/py/examples/simple-capture.py\n>> index 4b85408f..c26e638b 100755\n>> --- a/src/py/examples/simple-capture.py\n>> +++ b/src/py/examples/simple-capture.py\n>> @@ -107,7 +107,7 @@ def main():\n>>       sel.register(cm.event_fd, selectors.EVENT_READ)\n>>   \n>>       while frames_done < TOTAL_FRAMES:\n>> -        # cm.get_ready_requests() does not block, so we use a Selector to wait\n>> +        # cm.get_events() does not block, so we use a Selector to wait\n>>           # for a camera event. Here we should almost always get a single\n>>           # Request, but in some cases there could be multiple or none.\n> \n> \"Here we should almost always get a single request completion event, but\n> in some cases there could be multiple ones, other events, or no events\n> at all.\"\n\nThanks, that is indeed a bit clearer.\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 0C48CC3272\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 26 Aug 2022 12:37:41 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 68D2F61FC0;\n\tFri, 26 Aug 2022 14:37:40 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 61AF561FA2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 26 Aug 2022 14:37:39 +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 775E32B3;\n\tFri, 26 Aug 2022 14:37:38 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1661517460;\n\tbh=l5YJTPICsdmg08kC5x4jpVWzEQ3FrAhrf6/yGOiAmIM=;\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=e/fJe+dOmPxIlMyMu2FcNQjGFEORNaGDeZtpb83gRvf9p9DIDj/4a+fbaBT0JhVba\n\tkSonDeNKcBUt7RTNDBvPw8Sbbb5NU7PuEx8E3FEcAa4mhKMZt5nw20biIzH1YjYQHs\n\tiAUy5CDoZ9miHB28u1+vm0Kd97KQJ19oCcOom+obRziLjsRavYyFCtDjNrsOK0dvhv\n\t2ExpC8jstpauoYxEQ+Rt7Js97KZ6WAGjV4l/Y/SMHKCE0e0eZyFsESR+wOZJr698Ml\n\tyZ7F+8x6us1zy/ID0F0G/9PMYgw7qJjHlQACwu1UnDYoDg/MirRT3xi3Nwo9Ng7JAg\n\tHCHIUDLoxxjCQ==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1661517458;\n\tbh=l5YJTPICsdmg08kC5x4jpVWzEQ3FrAhrf6/yGOiAmIM=;\n\th=Date:Subject:To:Cc:References:From:In-Reply-To:From;\n\tb=qnbNTdB1Ui6R04RV6tcivkoLAUZQHWpigVqFroMVwh9Z7Y5nLFcFA4rd4mI1Mr5tc\n\tqlr7VSeHEckAbZ4dc1IDrGDHci7GRPx71ZoDn5EXM4QRC9i0opxSvLN1DaYOXyKuMg\n\tm/ZI8WTc+Bmx3ASFSt5Q+M3MP6DRbZXCDCelpdoI="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"qnbNTdB1\"; dkim-atps=neutral","Message-ID":"<a0ec7a96-9967-04b7-5a66-c926f83969a5@ideasonboard.com>","Date":"Fri, 26 Aug 2022 15:37:36 +0300","MIME-Version":"1.0","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101\n\tThunderbird/91.11.0","Content-Language":"en-US","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","References":"<20220701084521.31831-1-tomi.valkeinen@ideasonboard.com>\n\t<20220701084521.31831-15-tomi.valkeinen@ideasonboard.com>\n\t<Yv6pPcMV/ww00c9o@pendragon.ideasonboard.com>","In-Reply-To":"<Yv6pPcMV/ww00c9o@pendragon.ideasonboard.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"7bit","Subject":"Re: [libcamera-devel] [PATCH v3 14/17] py: simple-capture.py: Use\n\tnew events support","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>"}}]