From patchwork Thu Dec 9 09:29:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 15084 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 72AC8BF415 for ; Thu, 9 Dec 2021 09:29:45 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 887BA6088E; Thu, 9 Dec 2021 10:29:44 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="QTYA6J27"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 0EAD260224 for ; Thu, 9 Dec 2021 10:29:43 +0100 (CET) Received: from deskari.lan (91-156-85-209.elisa-laajakaista.fi [91.156.85.209]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 755EF501; Thu, 9 Dec 2021 10:29:42 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1639042182; bh=S7jILXP0Zd99IAenHrDXZ+6U23I0SDz31j10lZU+uPY=; h=From:To:Cc:Subject:Date:From; b=QTYA6J27Lruj/PVYEdPovlA/hzn2+bGmwG/01yuSdNPahgCYWnWFG1BWpBPGyYs5V s/IPFrtnDojwTCWjUZg4uzbprKMA+Iwp4r2h4xHpl73P7qGhdBYfMafZSRj+RJnPZ/ DY6wnQNLsMCsv5L4U97RsSEDqn78hXIPC6DyIcjY= From: Tomi Valkeinen To: libcamera-devel@lists.libcamera.org Date: Thu, 9 Dec 2021 11:29:01 +0200 Message-Id: <20211209092906.37303-1-tomi.valkeinen@ideasonboard.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [libcamera-devel] [RFC v3 0/5] 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Hi, Third RFC of the python bindings. I believe it's over a year since the last version, and I've been tinkering with the bindings every now and then. This version includes cam.py, which mimics 'cam' tool. The idea is not to try to replace 'cam', but to test the bindings in a real use case, rather than artificial tests. There are a few clear items that should be done to make this more usable: - Fix the ControlValue handling, as arrays are not handled at all. Possibly other types are not handled correctly. - Add ControlList parameter to Camera.start() - Add Transform Tomi Tomi Valkeinen (5): HACK: Camera public destructor libcamera: Request: expose Camera from Request gitignore: add .cache Add Python bindings py: Add cam.py .gitignore | 2 + include/libcamera/camera.h | 2 +- include/libcamera/request.h | 2 + meson.build | 1 + meson_options.txt | 5 + src/libcamera/request.cpp | 5 + src/meson.build | 1 + src/py/meson.build | 1 + src/py/pycamera/__init__.py | 10 + src/py/pycamera/meson.build | 43 ++++ src/py/pycamera/pymain.cpp | 424 ++++++++++++++++++++++++++++++++ src/py/test/cam.py | 464 ++++++++++++++++++++++++++++++++++++ src/py/test/cam_kms.py | 185 ++++++++++++++ src/py/test/cam_null.py | 46 ++++ src/py/test/cam_qt.py | 355 +++++++++++++++++++++++++++ src/py/test/cam_qtgl.py | 385 ++++++++++++++++++++++++++++++ src/py/test/gl_helpers.py | 67 ++++++ subprojects/pybind11.wrap | 12 + 18 files changed, 2009 insertions(+), 1 deletion(-) create mode 100644 src/py/meson.build create mode 100644 src/py/pycamera/__init__.py create mode 100644 src/py/pycamera/meson.build create mode 100644 src/py/pycamera/pymain.cpp create mode 100755 src/py/test/cam.py create mode 100644 src/py/test/cam_kms.py create mode 100644 src/py/test/cam_null.py create mode 100644 src/py/test/cam_qt.py create mode 100644 src/py/test/cam_qtgl.py create mode 100644 src/py/test/gl_helpers.py create mode 100644 subprojects/pybind11.wrap Tested-by: David Plowman