summaryrefslogtreecommitdiff
path: root/src/py
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ideasonboard.com>2022-05-18 16:13:27 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2022-05-18 17:52:32 +0300
commitdc03440cb56b17a677f7ac00279db2ede364b3a0 (patch)
tree6b046d544cad9873785bbfe644fc7019f4bf1298 /src/py
parentb2ada6f3ec64dc97e7facdc32d99fbe7b76e0982 (diff)
py: Clean up control enums generation
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 <tomi.valkeinen@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/py')
-rw-r--r--src/py/libcamera/meson.build12
-rw-r--r--src/py/libcamera/py_control_enums_generated.cpp.in (renamed from src/py/libcamera/py_enums_generated.cpp.in)8
-rw-r--r--src/py/libcamera/py_main.cpp4
3 files changed, 10 insertions, 14 deletions
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
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 <tomi.valkeinen@ideasonboard.com>
*
- * Python bindings - Auto-generated enums
+ * Python bindings - Auto-generated control enums
*
* This file is auto-generated. Do not edit.
*/
-#include <libcamera/libcamera.h>
+#include <libcamera/control_ids.h>
#include <pybind11/smart_holder.h>
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 */