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>
This commit is contained in:
parent
b2ada6f3ec
commit
dc03440cb5
3 changed files with 10 additions and 14 deletions
|
@ -18,20 +18,18 @@ pycamera_sources = files([
|
||||||
'py_main.cpp',
|
'py_main.cpp',
|
||||||
])
|
])
|
||||||
|
|
||||||
gen_input_files = files([
|
gen_py_control_enums_input_files = files([
|
||||||
'../../libcamera/control_ids.yaml',
|
'../../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')
|
gen_py_control_enums = files('gen-py-control-enums.py')
|
||||||
|
|
||||||
generated_sources = custom_target('py_gen_controls',
|
pycamera_sources += custom_target('py_gen_controls',
|
||||||
input : gen_input_files,
|
input : gen_py_control_enums_input_files,
|
||||||
output : ['py_enums_generated.cpp'],
|
output : ['py_control_enums_generated.cpp'],
|
||||||
command : [gen_py_control_enums, '-o', '@OUTPUT@', '@INPUT@'])
|
command : [gen_py_control_enums, '-o', '@OUTPUT@', '@INPUT@'])
|
||||||
|
|
||||||
pycamera_sources += generated_sources
|
|
||||||
|
|
||||||
pycamera_deps = [
|
pycamera_deps = [
|
||||||
libcamera_public,
|
libcamera_public,
|
||||||
py3_dep,
|
py3_dep,
|
||||||
|
|
|
@ -2,20 +2,18 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2022, Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
|
* 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.
|
* This file is auto-generated. Do not edit.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <libcamera/libcamera.h>
|
#include <libcamera/control_ids.h>
|
||||||
|
|
||||||
#include <pybind11/smart_holder.h>
|
#include <pybind11/smart_holder.h>
|
||||||
|
|
||||||
namespace py = pybind11;
|
namespace py = pybind11;
|
||||||
|
|
||||||
using namespace libcamera;
|
void init_py_control_enums_generated(py::module& m)
|
||||||
|
|
||||||
void init_py_enums_generated(py::module& m)
|
|
||||||
{
|
{
|
||||||
${enums}
|
${enums}
|
||||||
}
|
}
|
|
@ -131,13 +131,13 @@ static void handleRequestCompleted(Request *req)
|
||||||
}
|
}
|
||||||
|
|
||||||
void init_py_enums(py::module &m);
|
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);
|
void init_py_geometry(py::module &m);
|
||||||
|
|
||||||
PYBIND11_MODULE(_libcamera, m)
|
PYBIND11_MODULE(_libcamera, m)
|
||||||
{
|
{
|
||||||
init_py_enums(m);
|
init_py_enums(m);
|
||||||
init_py_enums_generated(m);
|
init_py_control_enums_generated(m);
|
||||||
init_py_geometry(m);
|
init_py_geometry(m);
|
||||||
|
|
||||||
/* Forward declarations */
|
/* Forward declarations */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue