From patchwork Mon Mar 14 15:46:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Dufresne via libcamera-devel X-Patchwork-Id: 15444 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 1BF8DBF415 for ; Mon, 14 Mar 2022 15:46:59 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 6547A610F8; Mon, 14 Mar 2022 16:46:58 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1647272818; bh=1oGmDWHDtTvvwhwM/BHqB32bASE9XMdKSPI8YtsP/cI=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=dKAZTAg/aBWe0r2NIs4cnpE/KLsKMvLdeEWhFwv5NatIJXCYYwKmTflncUO8tKmhw KudUpxgjgG0xIv8bM244AYdtNj+kX/SK9dqnRE/O/qZD0IejqkUS/p8FMtvbkqxHcn mz8hImttg509JUshvxzv6nfSfrK0oBWcjv07sfhecj3xmpR5UxoSL6CYb2uzGoAo4f 3dQ3Dz7HJgYXa2aioqUAEhPrQpp1lbYCo79jeYOcQpHNnl/r9djIteu2oK4xBMWuUW /j8wi5BCsOq2BMCAkM3Ceu9lWk3aBJZ8NT+hXEmzkjZp/degF0XukOgd99FCnY/JfK EBqgKaNstkzIw== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id DF211604E6 for ; Mon, 14 Mar 2022 16:46:56 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="Q4bi2KjQ"; 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 175CD2E0; Mon, 14 Mar 2022 16:46:56 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1647272816; bh=1oGmDWHDtTvvwhwM/BHqB32bASE9XMdKSPI8YtsP/cI=; h=From:To:Cc:Subject:Date:From; b=Q4bi2KjQRdJotZKic4riPicz6wW6QAueu3fZYuW3WYc8Fq2j6MQ8a7o681HgLmfse 9aD7aQsPFMadplSDYB8yDaxfyXMZSFs8lLvWHsZw0Pbi9Ay5gIun08XuA5xnB62J6/ 2lu5n4oMdlfxhcqDAeOpWZuY8TLEko8iGxBhcSsQ= To: libcamera-devel@lists.libcamera.org, David Plowman , Kieran Bingham , Laurent Pinchart Date: Mon, 14 Mar 2022 17:46:30 +0200 Message-Id: <20220314154633.506026-1-tomi.valkeinen@ideasonboard.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v5 0/3] 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: Nicolas Dufresne via libcamera-devel Reply-To: Tomi Valkeinen Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Hi, This is v5 of the series. The changes to v4: - Changed to pybind11 'smart_holders' branch which allows us to drop the HACK for Camera public destructor - Changed Request.set_control() so that we can drop the HACK for exposing Camera from Request - Moved Python enum defs to a separate file for clarity - "Forward" declare Python classes to fix docstring issues. The set_control change breaks the current users of that function. Previously you could do this: req.set_control("Brightness", 1) Now you need to do: cid = camera.find_control("Brightness") req.set_control(cid, 1) Tomi Tomi Valkeinen (3): Add Python bindings py: add unittests.py py: Add cam.py meson.build | 1 + meson_options.txt | 5 + src/meson.build | 1 + src/py/cam/cam.py | 461 +++++++++++++++++++++++++++++++++++ src/py/cam/cam_kms.py | 183 ++++++++++++++ src/py/cam/cam_null.py | 46 ++++ src/py/cam/cam_qt.py | 355 +++++++++++++++++++++++++++ src/py/cam/cam_qtgl.py | 386 +++++++++++++++++++++++++++++ src/py/cam/gl_helpers.py | 67 +++++ src/py/libcamera/__init__.py | 10 + src/py/libcamera/meson.build | 43 ++++ src/py/libcamera/pyenums.cpp | 53 ++++ src/py/libcamera/pymain.cpp | 453 ++++++++++++++++++++++++++++++++++ src/py/meson.build | 1 + src/py/test/unittests.py | 364 +++++++++++++++++++++++++++ subprojects/.gitignore | 3 +- subprojects/pybind11.wrap | 6 + 17 files changed, 2437 insertions(+), 1 deletion(-) 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 100644 src/py/libcamera/meson.build create mode 100644 src/py/libcamera/pyenums.cpp create mode 100644 src/py/libcamera/pymain.cpp create mode 100644 src/py/meson.build create mode 100755 src/py/test/unittests.py create mode 100644 subprojects/pybind11.wrap