From patchwork Thu Oct 10 09:02:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 21584 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 7CE15C32E0 for ; Thu, 10 Oct 2024 09:02:28 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4044463536; Thu, 10 Oct 2024 11:02:27 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="GIfk9hmT"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 47CD663536 for ; Thu, 10 Oct 2024 11:02:25 +0200 (CEST) Received: from neptunite.flets-east.jp (unknown [IPv6:2404:7a81:160:2100:c738:203:8807:bdb1]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 7F61F4D4; Thu, 10 Oct 2024 11:00:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1728550847; bh=QIxxY6DHfbq2/gVLKO0zOSQthH0/76NsN2Pc4b8ghWs=; h=From:To:Cc:Subject:Date:From; b=GIfk9hmT0EuXcjkOv7mvJmI/SqAF/IXmhHFWzf1/WxIKDP6ZHcLfwbwrtYWUmCKAG hWaFHcdSG4Wn9/J9680Q5qPGsGTw8TB66JBXN5qWRJUgrOcrAjI3lKs1XTxjgZ5S4j d+Pdxq+16RBBjliw7UhrGGuNXH6clsJMuagWtNp8= From: Paul Elder To: libcamera-devel@lists.libcamera.org Cc: Paul Elder Subject: [PATCH] py: Add bindings for ControlId array information Date: Thu, 10 Oct 2024 18:02:10 +0900 Message-Id: <20241010090210.757093-1-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 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" Add python bindings for querying whether or not a ControlId is an array type, and the size. Example usage: >>> cid libcamera.ControlId(28, FrameDurationLimits, ControlType.Integer64) >>> cid.isArray True >>> cid.size 2 Signed-off-by: Paul Elder --- src/py/libcamera/py_main.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/py/libcamera/py_main.cpp b/src/py/libcamera/py_main.cpp index 983b76f6e998..898ef319dc69 100644 --- a/src/py/libcamera/py_main.cpp +++ b/src/py/libcamera/py_main.cpp @@ -400,6 +400,8 @@ PYBIND11_MODULE(_libcamera, m) .def_property_readonly("id", &ControlId::id) .def_property_readonly("name", &ControlId::name) .def_property_readonly("type", &ControlId::type) + .def_property_readonly("isArray", &ControlId::isArray) + .def_property_readonly("size", &ControlId::size) .def("__str__", [](const ControlId &self) { return self.name(); }) .def("__repr__", [](const ControlId &self) { return py::str("libcamera.ControlId({}, {}, {})")