From patchwork Thu May 5 10:40: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: 15783 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 D8B45C0F2A for ; Thu, 5 May 2022 10:41:28 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 20B6C65643; Thu, 5 May 2022 12:41:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1651747288; bh=myPB7cntswCJNNdosCm+ZNhxqOuxxfqBllCZxfggpdI=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=Jc8mrkwiu+UMZ84LsF6otp105e5aDiaf/SXNDc+rygI18BDH0NfYMbOzVozNsO1qS XrfwiOFCSyEexJho9+51YwRYnIn9Rs9E4/IPHQD/JfV4oaS7Qi4HehMZsVpKQ4Jvu0 CI2+vHBXU7TJMhjQTDVUDgy2VAQt/rAwZtek22upoClIj+ml2nGWoUU2aK4mklK7Xx FtQbuvXcFqv7YWFeTO8rCjgsjjt8Uoq6PYZnnLdKaZp/mlR62p80nkI/zzar6LNUSF M3P+x48uxfzrhnQCQpqP+fISyPGoXx87rMjLESsLRF+p9ybbcGr44gNUwhyz91LRzb J2y3r7mjy82Wg== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id BE9DD603AB for ; Thu, 5 May 2022 12:41:25 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="kQScIU8M"; 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 B22A3492; Thu, 5 May 2022 12:41:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1651747285; bh=myPB7cntswCJNNdosCm+ZNhxqOuxxfqBllCZxfggpdI=; h=From:To:Cc:Subject:Date:From; b=kQScIU8M9th/DUsMQ1zyGBFTT45CEKOBqOOVAx9qcvL9hf0r+TmVLQ8ST2iaUv/RW QEZTFcBUIyOSDdSmjXXMlPw/htbyzMqs+itFdCY8LIg44WVuilxQhh7UEmO/oP+3Ru 0I3ns9UX+jEP12xs2hTfweEgth+5rHw1NCCDQwwU= To: libcamera-devel@lists.libcamera.org, David Plowman , Kieran Bingham , Laurent Pinchart , Jacopo Mondi Date: Thu, 5 May 2022 13:40:51 +0300 Message-Id: <20220505104104.70841-1-tomi.valkeinen@ideasonboard.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v7 00/13] Python bindings 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, v7 of the Python Bindings series. Changes to v6: - I updated the minimum required meson version to 0.56 to get the 'patch_directory' feature for wraps. That's actually in 0.55, but 0.56 brings in meson.project_source_root and meson.project_build_root, so I thought to go to 0.56 right away. - The pybind11 subproject no longer fetches the branch from my github repo, but uses the official pybind11 repo, from which it takes the smart_holder branch. To enable meson build, I use the meson's overlay feature to provide a meson.build, located in subprojects/packagefiles/pybind11/meson.build. - I added multiple patches on top, taken from raspberrypi's picamera2 branch. A few are almost unchanged, some I changed quite a bit, and the fb mmap change I implemented in a totally different way (MappedFrameBuffer). These are as separate patches, but could be squashed. Tomi David Plowman (3): py: add support for the ColorSpace py: support controls in the start method py: add support for setting Rectangle and Size controls Tomi Valkeinen (10): meson: require meson 0.56+ meson: use new project_*_root() functions meson: add 'check: true' for run_command() calls Add Python bindings py: generate control enums from yaml py: add unittests.py py: Add cam.py py: support setting array-controls py: add Transform py: implement MappedFrameBuffer Documentation/meson.build | 4 +- README.rst | 4 +- include/libcamera/ipa/meson.build | 8 +- meson.build | 17 +- meson_options.txt | 5 + src/libcamera/meson.build | 4 +- src/meson.build | 1 + src/py/cam/cam.py | 484 ++++++++++++++ src/py/cam/cam_kms.py | 183 ++++++ src/py/cam/cam_null.py | 47 ++ src/py/cam/cam_qt.py | 354 ++++++++++ src/py/cam/cam_qtgl.py | 385 +++++++++++ src/py/cam/gl_helpers.py | 74 +++ src/py/libcamera/__init__.py | 80 +++ src/py/libcamera/gen-py-control-enums.py | 95 +++ src/py/libcamera/meson.build | 53 ++ src/py/libcamera/pyenums.cpp | 53 ++ src/py/libcamera/pyenums_generated.cpp.in | 21 + src/py/libcamera/pymain.cpp | 608 ++++++++++++++++++ src/py/meson.build | 1 + subprojects/.gitignore | 3 +- subprojects/packagefiles/pybind11/meson.build | 8 + subprojects/pybind11.wrap | 8 + test/meson.build | 1 + test/py/meson.build | 17 + test/py/unittests.py | 368 +++++++++++ .../include/libcamera/ipa/meson.build | 4 +- 27 files changed, 2867 insertions(+), 23 deletions(-) create mode 100755 src/py/cam/cam.py create mode 100644 src/py/cam/cam_kms.py create mode 100644 src/py/cam/cam_null.py create mode 100644 src/py/cam/cam_qt.py create mode 100644 src/py/cam/cam_qtgl.py create mode 100644 src/py/cam/gl_helpers.py create mode 100644 src/py/libcamera/__init__.py create mode 100755 src/py/libcamera/gen-py-control-enums.py create mode 100644 src/py/libcamera/meson.build create mode 100644 src/py/libcamera/pyenums.cpp create mode 100644 src/py/libcamera/pyenums_generated.cpp.in create mode 100644 src/py/libcamera/pymain.cpp create mode 100644 src/py/meson.build create mode 100644 subprojects/packagefiles/pybind11/meson.build create mode 100644 subprojects/pybind11.wrap create mode 100644 test/py/meson.build create mode 100755 test/py/unittests.py