From patchwork Tue Oct 13 15:33:44 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alen Karnil X-Patchwork-Id: 28443 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 B20B5C32F4 for ; Tue, 13 Oct 2026 15:34:09 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id B1AD568D7C; Tue, 13 Oct 2026 17:34:08 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="VYh2isLe"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 3CEE76849B for ; Tue, 13 Oct 2026 17:34:07 +0200 (CEST) Received: from [127.0.1.1] (cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 428A04E6; Tue, 13 Oct 2026 17:32:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1791905525; bh=uJTGcw06fb7+47ruRERXpBrZ4bYm2AqNX/AklWRCDSw=; h=From:Date:Subject:To:Cc:From; b=VYh2isLeEKnwhUZ9l9D82LOgbqxVeYSj01YmCHab75efeuSEM8FRJqqYzaiFW/ix+ jbx4R1aE+PfHf4eb9J92sOUWzHEm5Yck21SwnqF5C4kyvPm5ayP1sive/dfpOc9j06 f3awQ1EkTf7YE81nOUNpSXN0j04hAaAaek6LR22E= From: Alen Karnil Date: Tue, 13 Oct 2026 16:33:44 +0100 Subject: [PATCH] py: Add ability to manually generate CameraConfiguration MIME-Version: 1.0 Message-Id: <20261013-py-bindings-v1-1-fcba4e00c60c@ideasonboard.com> X-B4-Tracking: v=1; b=H4sIAAAAAAAC/yXMTQ5AMBBA4avIrDVR4vcqYqE6ZSxKOghp3F2x/ BbveWB0hAxN5MHhQUyLDZBxBMPU2xEF6WBIk7SQiczEeglFVpMdWcjSlFmljapzA6FYHRo6v1v b/eZdzThs7wLu+wGD/JzQbwAAAA== X-Change-ID: 20261013-py-bindings-17f738dfb95f To: libcamera-devel@lists.libcamera.org Cc: Alen Karnil X-Mailer: b4 0.16.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 bindings to instantiate StreamConfiguration objects and add them CameraConfiguration by exposing addConfiguration() Signed-off-by: Alen Karnil --- Example: config = camera.generate_configuration([]) sc = libcam.StreamConfiguration() sc.pixel_format = libcam.PixelFormat('SBGGR8') config.add_configuration(sc) --- src/py/libcamera/py_main.cpp | 2 ++ 1 file changed, 2 insertions(+) --- base-commit: 279d355ef8f7a4f98bb0a3004c0f788387814506 change-id: 20261013-py-bindings-17f738dfb95f Best regards, -- Alen Karnil diff --git a/src/py/libcamera/py_main.cpp b/src/py/libcamera/py_main.cpp index 1815f5929..a2e34734f 100644 --- a/src/py/libcamera/py_main.cpp +++ b/src/py/libcamera/py_main.cpp @@ -324,6 +324,7 @@ PYBIND11_MODULE(_libcamera, m) return self.size(); }) .def("validate", &CameraConfiguration::validate) + .def("add_configuration", &CameraConfiguration::addConfiguration) .def("at", py::overload_cast(&CameraConfiguration::at), py::return_value_policy::reference_internal) .def_property_readonly("size", &CameraConfiguration::size) @@ -337,6 +338,7 @@ PYBIND11_MODULE(_libcamera, m) .value("Invalid", CameraConfiguration::Invalid); pyStreamConfiguration + .def(py::init<>()) .def("__str__", &StreamConfiguration::toString) .def_property_readonly("stream", &StreamConfiguration::stream, py::return_value_policy::reference_internal)