From patchwork Sat Jun 3 07:56:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 18685 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 D7E9FC3200 for ; Sat, 3 Jun 2023 07:57:11 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id CA6366278F; Sat, 3 Jun 2023 09:57:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1685779030; bh=MHI9BSSzxV80I2mE2M+eKAKk0M5h+oUdUvzGAlSAP9A=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=oPYHC0s/NFPn/Sjf4Atn441sgXoc3hCKdwG2Vp1eE3/cSPxfe4gcNo+DQKz2qYrE6 ncucvckB1ySH8R4ak7LzezBi2OGg4zAkmH9GA99TiYEinQm6z4SbupWJU1ai5BiEWU FuMGPjRjJev+J6NJKMbxvFd+e9A+0yjrDITCfPfYJRUA4oTRrcOvDs6+Dv9Emkyr3Q Tt2kZAa2eYJH3CuRVnIHmCkbaBImoOe2GFXk8e40cjNoTKORIe5jHMfiDhJaL2B7Ga UdIvxIEKgmX6UUJu9Jxw5NKTxY/7An5la/rEKIualX9k1PjMndXeO26EM6oCvUeCxm u/xrVF0fi5d0g== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id D03086038F for ; Sat, 3 Jun 2023 09:57:08 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="RHa9tKMl"; dkim-atps=neutral Received: from desky.lan (91-154-35-171.elisa-laajakaista.fi [91.154.35.171]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 21A18468; Sat, 3 Jun 2023 09:56:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1685779005; bh=MHI9BSSzxV80I2mE2M+eKAKk0M5h+oUdUvzGAlSAP9A=; h=From:To:Cc:Subject:Date:From; b=RHa9tKMlIzB5D/F4Y9+oznyQT5xLTHyIikH8Cybs8inymdFECHos6ALNz1vnBobqG HDCyGL/wIOnKVbBmCQiJG1PqSgyQvdf/4LW1Kfv+aDJEU7WuqFu+3iYjaLtCcvujXX n/Z996NEAlF1GHJxNq6SVay+usf7FhTVP7GuxMcE= To: libcamera-devel@lists.libcamera.org Date: Sat, 3 Jun 2023 10:56:02 +0300 Message-Id: <20230603075615.20663-1-tomi.valkeinen@ideasonboard.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v5 00/13] py: New 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, Here's v5. Rebased on top of latest master, which includes a few of the patches that were present in the v4. The main change in this version is how the Camera events are enabled or disabled. We now have the following methods in the Camera class: get_camera_event_enabled(CameraEventType) enable_camera_event(CameraEventType) disable_camera_event(CameraEventType) In other words, the user can now enable and disable events per camera using the CameraEventType enum. RequestCompleted is enabled by default, whereas BufferCompleted and Disconnect need to be explicitly enabled. Tomi Tomi Valkeinen (13): subprojects: Drop pybind11 from gitignore py: Fix code formatting py: New event handling py: cam.py: Use new events support py: unittests.py: Use new events support py: simple-capture.py: Use new events support py: simple-continuous-capture.py: Use new events support py: simple-cam.py: Use new events support py: Drop get_ready_requests() py: Add hotplug-monitor.py py: unittests.py: Add test for refs & keep-alives py: unittests.py: Fix type checker warnings py: Improve stub type generation for PyCameraEvent Documentation/python-bindings.rst | 24 +- src/py/cam/cam.py | 27 +- src/py/examples/hotplug-monitor.py | 39 +++ src/py/examples/simple-cam.py | 19 +- src/py/examples/simple-capture.py | 15 +- src/py/examples/simple-continuous-capture.py | 17 +- src/py/libcamera/py_camera_manager.cpp | 263 +++++++++++++++++-- src/py/libcamera/py_camera_manager.h | 72 ++++- src/py/libcamera/py_main.cpp | 61 ++++- subprojects/.gitignore | 1 - test/py/unittests.py | 144 +++++++++- 11 files changed, 597 insertions(+), 85 deletions(-) create mode 100755 src/py/examples/hotplug-monitor.py