From patchwork Thu Jun 23 14:47:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 16338 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 1CA1EBD808 for ; Thu, 23 Jun 2022 14:48:00 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id F3F8865639; Thu, 23 Jun 2022 16:47:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1655995679; bh=OK6IYaKsFRxMm45tCAn88BqF6id59nAT/w9tKUEZGR4=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=E4D37iMXeOmtk9tUKf0gOkEnbyLvzkGCPidaKuT8PA+X7pHLE0kfcU/5vZhsSmtt0 UbUtkMknphZiuD0A70uxKag5Uin8k8cHlimKb2f3vpkb9willG7icfvFmJv8kLsbzr oDo9LuKJMAO8HpXyr6HMaLhhNw9ss2V7AHsQWYkPsNr3iaFEjKWJZQWQGrMSgOMZfD 6QK1j7emzBafId3AtejAPc58x9UVnLKHLkE8gnZgmwAOUgMt2kLMptxpsWsjoKpMM3 z6jGc32hag5wI0k+PyA86v2D/mQSEPWYXRkPS6ajp8dIdxTBnGR6wRB2ODDzwFwv4+ loADgay+30Xgw== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id AF2946048F for ; Thu, 23 Jun 2022 16:47:57 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="KaAQ2TWr"; dkim-atps=neutral Received: from deskari.lan (91-158-154-79.elisa-laajakaista.fi [91.158.154.79]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id CCB4DDD; Thu, 23 Jun 2022 16:47:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1655995677; bh=OK6IYaKsFRxMm45tCAn88BqF6id59nAT/w9tKUEZGR4=; h=From:To:Cc:Subject:Date:From; b=KaAQ2TWrFXENcqCgudL2NWda7lwoqMg1bqv7kB8Qu+3bWMmfD2rEeQ16n85yV5lp3 QlF/lP/YBaDI6uZGiI9GDdOnIr6ASPAR6VO+TzOvPm6g7CCmkmqxjdYT6VPqojqGLO H5L5/Mw1qvJXa86JxI+gx+bD/ew2UWLB27LVc02Y= To: libcamera-devel@lists.libcamera.org, David Plowman , Kieran Bingham , Laurent Pinchart , Jacopo Mondi Date: Thu, 23 Jun 2022 17:47:29 +0300 Message-Id: <20220623144736.78537-1-tomi.valkeinen@ideasonboard.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Subject: [libcamera-devel] [RFC v1 0/7] Python bindings event handling X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Tomi Valkeinen via libcamera-devel From: Tomi Valkeinen Reply-To: Tomi Valkeinen Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Hi, I've been working on enabling the rest of the events for the Python bindings. This is an RFC, as it's not quite ready yet, but I wanted to post this before the long weekend to possibly get feedback on the approach. There is one bug with the series: for some reason the camera added/removed events do not work. I was unable to get the Signals properly connected to a lambda or a method, although connecting to a static function works. It compiles but the handler is never called, and my tests seg fault at exit. And this needs documentation... Tomi Tomi Valkeinen (7): py: cam.py: Fix multi camera capture without -C py: Add Python logging category py: Move ControlValue helpers to py_helpers.cpp py: Create PyCameraManager py: Add 'nonblocking' argument to get_ready_requests() py: New event handling py: cam.py: Use new events support src/py/cam/cam.py | 33 ++- src/py/libcamera/meson.build | 2 + src/py/libcamera/py_camera_manager.cpp | 393 +++++++++++++++++++++++++ src/py/libcamera/py_camera_manager.h | 74 +++++ src/py/libcamera/py_helpers.cpp | 98 ++++++ src/py/libcamera/py_helpers.h | 13 + src/py/libcamera/py_main.cpp | 283 +++++++----------- src/py/libcamera/py_main.h | 12 + 8 files changed, 730 insertions(+), 178 deletions(-) create mode 100644 src/py/libcamera/py_camera_manager.cpp create mode 100644 src/py/libcamera/py_camera_manager.h create mode 100644 src/py/libcamera/py_helpers.cpp create mode 100644 src/py/libcamera/py_helpers.h create mode 100644 src/py/libcamera/py_main.h