From patchwork Tue May 24 11:45:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 16006 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 46B9BBD161 for ; Tue, 24 May 2022 11:46:33 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 484F36566A; Tue, 24 May 2022 13:46:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1653392792; bh=2Q1T6sdqoSsEUGV90vDmswWzHGAF4dQ92EMWfssz96M=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=P+NeMKYu7etUAne4euU1zURT/+r+qPCbss36dcBVxRHiuMdwbKWhCWLD2C+l9/T02 lwT7Kg2xJjKoTxaMUDvVAs2fVziZ0pwKfSp2AMvicKNr1CJri+OdxC/JuTu3MKjK5r De1A4v1MFEJP6SQuXeiFTmI0ZmrlT/EeUprJIhiN++oJ5yktGs/eVG7AApNtLXHIAF 73G8U5bPbz9lgOQ2T5UYzTUQIhFS/ze+wNzUq+rz+t+6LJh8JA7E24Q88XuvvrqLU6 QQOuVfZOif5sL7HNWsE+cb9o6ONXdktiSJEqEZzImGvTR+rkxklh0Afr8X1U3LbmpE irGw7B/OWcL0w== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 6BEB860422 for ; Tue, 24 May 2022 13:46:30 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="BhdqKlWQ"; dkim-atps=neutral Received: from deskari.lan (91-156-85-209.elisa-laajakaista.fi [91.156.85.209]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 68B9B4A8; Tue, 24 May 2022 13:46:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1653392789; bh=2Q1T6sdqoSsEUGV90vDmswWzHGAF4dQ92EMWfssz96M=; h=From:To:Cc:Subject:Date:From; b=BhdqKlWQdx7ZCESjuFOysIRQIY/0tUK8XTjTT42HeD2AEnH7h/Y/reI4dLL5yQtdZ ySzzunFm7xWvbhlz/Q3ycJ7jR1hLyI44ZNTjg5ZYm9eUoER+3gld2ajwh1RW7kqaS4 V6pw3Pvq3yj3mjgve1yc8CtEcRjGasQLSS3a7U30= To: libcamera-devel@lists.libcamera.org, David Plowman , Kieran Bingham , Laurent Pinchart , Jacopo Mondi Date: Tue, 24 May 2022 14:45:51 +0300 Message-Id: <20220524114610.41848-1-tomi.valkeinen@ideasonboard.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 00/19] More misc Python patches 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, v2 of the series. Or more like a new series, but as the previous patches haven't been merged yet, I have them included here. The only changes to the patches that were in v1 are: - Drop the change to WA_ShowWithoutActivating (separated to a new patch) - Split "class PyFormats {};" to multiple lines The rest of the patches are new. I think the controls and properties are much better after this series. However, they're still not quite the same to the C++ version, and I'm not sure if we need to change them further. I do find the controls C++ API somewhat confusing so I might be making wrong assumptioons on how they're used. Also, I think we don't want to expose ControlValue directly but rather just implicitly convert between Python types to ControlValue and vice versa. Tomi Tomi Valkeinen (19): py: Generate pixel formats list py: cam_qt: Use libcamera.formats py: cam: Cleanups py: Fix SceneFlicker enum values py: Fix None value in ControlType enum py: Add CameraManager.read_event() py: Move MappedFrameBuffer to libcamera.utils py: MappedFrameBuffer: Add type hints & docs py: cam: Drop WA_ShowWithoutActivating py: examples: Add simple-capture.py py: examples: Add simple-continuous-capture.py py: examples: Add itest.py py: cam: Convert ctx and state to classes py: Add README.md py: Re-implement controls geneneration py: Re-structure the controls API py: Rename 'efd' to 'event_fd' py: Generate bindings for properties py: Use ln --relative to create symlinks src/py/README.md | 61 ++ src/py/cam/cam.py | 587 +++++++++--------- src/py/cam/cam_kms.py | 14 +- src/py/cam/cam_null.py | 10 +- src/py/cam/cam_qt.py | 59 +- src/py/cam/cam_qtgl.py | 32 +- src/py/examples/itest.py | 197 ++++++ src/py/examples/simple-capture.py | 153 +++++ src/py/examples/simple-continuous-capture.py | 179 ++++++ src/py/libcamera/__init__.py | 80 --- ...py-control-enums.py => gen-py-controls.py} | 44 +- src/py/libcamera/gen-py-formats.py | 56 ++ src/py/libcamera/meson.build | 46 +- ...ed.cpp.in => py_controls_generated.cpp.in} | 17 +- src/py/libcamera/py_enums.cpp | 2 +- ...ted.cpp.in => py_formats_generated.cpp.in} | 14 +- src/py/libcamera/py_main.cpp | 117 ++-- .../libcamera/py_properties_generated.cpp.in | 30 + .../MappedFrameBuffer.py} | 19 +- src/py/libcamera/utils/__init__.py | 4 + test/py/unittests.py | 5 +- 21 files changed, 1200 insertions(+), 526 deletions(-) create mode 100644 src/py/README.md create mode 100755 src/py/examples/itest.py create mode 100755 src/py/examples/simple-capture.py create mode 100755 src/py/examples/simple-continuous-capture.py rename src/py/libcamera/{gen-py-control-enums.py => gen-py-controls.py} (60%) create mode 100755 src/py/libcamera/gen-py-formats.py copy src/py/libcamera/{py_control_enums_generated.cpp.in => py_controls_generated.cpp.in} (50%) rename src/py/libcamera/{py_control_enums_generated.cpp.in => py_formats_generated.cpp.in} (56%) create mode 100644 src/py/libcamera/py_properties_generated.cpp.in copy src/py/libcamera/{__init__.py => utils/MappedFrameBuffer.py} (88%) create mode 100644 src/py/libcamera/utils/__init__.py