{"id":16507,"url":"https://patchwork.libcamera.org/api/1.1/patches/16507/?format=json","web_url":"https://patchwork.libcamera.org/patch/16507/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/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":"<20220701084521.31831-16-tomi.valkeinen@ideasonboard.com>","date":"2022-07-01T08:45:19","name":"[libcamera-devel,v3,15/17] py: simple-continuous-capture.py: Use new events support","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"c29a87f3c696a89aaedd354492c31ccd03ff5802","submitter":{"id":109,"url":"https://patchwork.libcamera.org/api/1.1/people/109/?format=json","name":"Tomi Valkeinen","email":"tomi.valkeinen@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/16507/mbox/","series":[{"id":3241,"url":"https://patchwork.libcamera.org/api/1.1/series/3241/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3241","date":"2022-07-01T08:45:04","name":"Python bindings event handling","version":3,"mbox":"https://patchwork.libcamera.org/series/3241/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/16507/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/16507/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 22E26BD808\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  1 Jul 2022 08:45:58 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C85AA656A3;\n\tFri,  1 Jul 2022 10:45:57 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id BE6FC65699\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  1 Jul 2022 10:45:47 +0200 (CEST)","from deskari.lan (91-158-154-79.elisa-laajakaista.fi\n\t[91.158.154.79])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 3F3D725C;\n\tFri,  1 Jul 2022 10:45:47 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1656665157;\n\tbh=n1EnkpCAgGEuZsOraHgImGNrEvdPLQ6ff6kaFNZgqxg=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=0X3hQixHN/ydE43+/aopk4Cyz+gVvMYcuVx66Qv9NCToE28KPAd8J7JRKUPf9AuS3\n\tuujJ6bDX+N+1DZfzbzvOaRW7tUuwliuNTZNoCbcKSVP4LMNlqX9ak+fRabPtOaMsHr\n\tTrv7lcI2mPHH+7eQLhygHXBSFt6wvPLVnrOC/mf0pWS07edLyYZ/8rpy/fp8fPLt9G\n\tt5SrUoI5qzD+QAmOML3dC4GyutYP3GOhhBoTh8V0QC4120UyhsowOndViO8CqGihi3\n\t4zGc84EDW+lxA2rfW685b6NkgPBCbmOeWFSxpAiZM0tXhNCzp2nyIXX/7heL0RFLri\n\t8Ng74G3Racv1w==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1656665147;\n\tbh=n1EnkpCAgGEuZsOraHgImGNrEvdPLQ6ff6kaFNZgqxg=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=s4paU6GeshDR9ZMZ99XcIsDHBf04vO0bJPVP49N0rvrKgXl7d3uR/R8O9kbdGSgGn\n\tXNvR1m+9heTxNimTsWFL+hyM4wwCWxr2o/PtSrHeKI1nrJf79s7E7aLHModAigXwF1\n\tJZAu2lIUktTtIOGT/BO2Sj/n8cC++3xey/QVAwr0="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"s4paU6Ge\"; dkim-atps=neutral","To":"libcamera-devel@lists.libcamera.org,\n\tDavid Plowman <david.plowman@raspberrypi.com>,\n\tKieran Bingham <kieran.bingham@ideasonboard.com>,\n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tJacopo Mondi <jacopo@jmondi.org>","Date":"Fri,  1 Jul 2022 11:45:19 +0300","Message-Id":"<20220701084521.31831-16-tomi.valkeinen@ideasonboard.com>","X-Mailer":"git-send-email 2.34.1","In-Reply-To":"<20220701084521.31831-1-tomi.valkeinen@ideasonboard.com>","References":"<20220701084521.31831-1-tomi.valkeinen@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v3 15/17] py:\n\tsimple-continuous-capture.py: Use new 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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>\n---\n src/py/examples/simple-continuous-capture.py | 17 +++++++++--------\n 1 file changed, 9 insertions(+), 8 deletions(-)","diff":"diff --git a/src/py/examples/simple-continuous-capture.py b/src/py/examples/simple-continuous-capture.py\nindex e1cb931e..7bc9df10 100755\n--- a/src/py/examples/simple-continuous-capture.py\n+++ b/src/py/examples/simple-continuous-capture.py\n@@ -83,16 +83,17 @@ class CaptureContext:\n     camera_contexts: list[CameraCaptureContext] = []\n \n     def handle_camera_event(self):\n-        # cm.get_ready_requests() returns the ready requests, which in our case\n-        # should almost always return a single Request, but in some cases there\n-        # could be multiple or none.\n+        # cm.get_events() returns the ready events, which in our case should\n+        # almost always return a single RequestCompleted event, but in some\n+        # cases there could be multiple or none.\n \n-        reqs = self.cm.get_ready_requests()\n+        for ev in self.cm.get_events():\n+            # We are only interested in RequestCompleted events\n+            if ev.type != libcam.Event.Type.RequestCompleted:\n+                continue\n \n-        # Process the captured frames\n-\n-        for req in reqs:\n-            self.handle_request(req)\n+            # Process the captured frames\n+            self.handle_request(ev.request)\n \n         return True\n \n","prefixes":["libcamera-devel","v3","15/17"]}