From patchwork Wed May 18 13:13:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 15967 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 9DA2BC3275 for ; Wed, 18 May 2022 13:14:11 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 0ED1865671; Wed, 18 May 2022 15:14:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1652879651; bh=BFl081IYvSgCzhZfDzo328VBEKwa3VfS1UaR2JghE1g=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=tyYkEtkLgLBzk9HbufPWtNA0bGF+RK7sdc4r7bL+d2f19ZMTwspotpdo0L7LpP7/X juJ+uDaC7sQb5Zp1MClHLZiAOHzlMUJfSYdMNEzhty4KQdML72SMp7Cu0ylzuAm0b8 /jh8km1HKEfSpwEDQSCDsQOrRoYzHHeCq3MBJO4SxiFe8QGItxfX/q3+i6ug5iZDbT nG3pWcT5RLrT33DGEBmZhNW/RUabfzZ5ppfdQbhJKXrefn/R8iBhYTiW6TF1P0ghSU reIR0VQ3AvdBurfBEUaqnIyCmeBBNIH6bCmFWxG2yOtKRpXbJGJA+Q9Bv3vDi33bLy vL1T+D7Sk0POQ== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 9949B65678 for ; Wed, 18 May 2022 15:13:54 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="tRhFMcy6"; 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 1623D3297; Wed, 18 May 2022 15:13:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1652879634; bh=BFl081IYvSgCzhZfDzo328VBEKwa3VfS1UaR2JghE1g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tRhFMcy6y1WxlOaWdDZaA3pMmYV+1Nzn/m3ktW80JaUvOr6Q/jMOwID3h2FBj7fYi AhjGWdff9Pg2dEkBt3bx06X9Clf4gccXwOLGzdNju+NkcxtpHf8tlQ8SvbdwHPAYGV z+cIqeY2AEOoSbEbqLatcw2epwCll9ZR/qxdacsg= To: libcamera-devel@lists.libcamera.org, David Plowman , Kieran Bingham , Laurent Pinchart , Jacopo Mondi Date: Wed, 18 May 2022 16:13:27 +0300 Message-Id: <20220518131329.66994-17-tomi.valkeinen@ideasonboard.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220518131329.66994-1-tomi.valkeinen@ideasonboard.com> References: <20220518131329.66994-1-tomi.valkeinen@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 16/18] py: clean up control enums generation 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" Try to be more consistent with the names, and include "control" in all the names. Also drop a useless "using namespace libcamera" and only include "control_ids.h". Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- src/py/libcamera/meson.build | 12 +++++------- ...ated.cpp.in => py_control_enums_generated.cpp.in} | 8 +++----- src/py/libcamera/py_main.cpp | 4 ++-- 3 files changed, 10 insertions(+), 14 deletions(-) rename src/py/libcamera/{py_enums_generated.cpp.in => py_control_enums_generated.cpp.in} (63%) diff --git a/src/py/libcamera/meson.build b/src/py/libcamera/meson.build index 55957252..a3388c63 100644 --- a/src/py/libcamera/meson.build +++ b/src/py/libcamera/meson.build @@ -18,20 +18,18 @@ pycamera_sources = files([ 'py_main.cpp', ]) -gen_input_files = files([ +gen_py_control_enums_input_files = files([ '../../libcamera/control_ids.yaml', - 'py_enums_generated.cpp.in', + 'py_control_enums_generated.cpp.in', ]) gen_py_control_enums = files('gen-py-control-enums.py') -generated_sources = custom_target('py_gen_controls', - input : gen_input_files, - output : ['py_enums_generated.cpp'], +pycamera_sources += custom_target('py_gen_controls', + input : gen_py_control_enums_input_files, + output : ['py_control_enums_generated.cpp'], command : [gen_py_control_enums, '-o', '@OUTPUT@', '@INPUT@']) -pycamera_sources += generated_sources - pycamera_deps = [ libcamera_public, py3_dep, diff --git a/src/py/libcamera/py_enums_generated.cpp.in b/src/py/libcamera/py_control_enums_generated.cpp.in similarity index 63% rename from src/py/libcamera/py_enums_generated.cpp.in rename to src/py/libcamera/py_control_enums_generated.cpp.in index 20e07528..ed81fbe7 100644 --- a/src/py/libcamera/py_enums_generated.cpp.in +++ b/src/py/libcamera/py_control_enums_generated.cpp.in @@ -2,20 +2,18 @@ /* * Copyright (C) 2022, Tomi Valkeinen * - * Python bindings - Auto-generated enums + * Python bindings - Auto-generated control enums * * This file is auto-generated. Do not edit. */ -#include +#include #include namespace py = pybind11; -using namespace libcamera; - -void init_py_enums_generated(py::module& m) +void init_py_control_enums_generated(py::module& m) { ${enums} } diff --git a/src/py/libcamera/py_main.cpp b/src/py/libcamera/py_main.cpp index b05bbb22..1d941160 100644 --- a/src/py/libcamera/py_main.cpp +++ b/src/py/libcamera/py_main.cpp @@ -131,13 +131,13 @@ static void handleRequestCompleted(Request *req) } void init_py_enums(py::module &m); -void init_py_enums_generated(py::module &m); +void init_py_control_enums_generated(py::module &m); void init_py_geometry(py::module &m); PYBIND11_MODULE(_libcamera, m) { init_py_enums(m); - init_py_enums_generated(m); + init_py_control_enums_generated(m); init_py_geometry(m); /* Forward declarations */