summaryrefslogtreecommitdiff
path: root/src/py
diff options
context:
space:
mode:
Diffstat (limited to 'src/py')
-rwxr-xr-xsrc/py/libcamera/gen-py-controls.py10
-rw-r--r--src/py/libcamera/meson.build12
2 files changed, 15 insertions, 7 deletions
diff --git a/src/py/libcamera/gen-py-controls.py b/src/py/libcamera/gen-py-controls.py
index cfcfd4d1..8ae8d512 100755
--- a/src/py/libcamera/gen-py-controls.py
+++ b/src/py/libcamera/gen-py-controls.py
@@ -95,7 +95,7 @@ def main(argv):
help='Output file name. Defaults to standard output if not specified.')
parser.add_argument('--template', '-t', type=str, required=True,
help='Template file name.')
- parser.add_argument('input', type=str,
+ parser.add_argument('input', type=str, nargs='+',
help='Input file name.')
args = parser.parse_args(argv[1:])
@@ -103,11 +103,11 @@ def main(argv):
print(f'Invalid mode option "{args.mode}"', file=sys.stderr)
return -1
- data = open(args.input, 'rb').read()
-
controls = {}
- vendor = yaml.safe_load(data)['vendor']
- controls[vendor] = yaml.safe_load(data)['controls']
+ for input in args.input:
+ data = open(input, 'rb').read()
+ vendor = yaml.safe_load(data)['vendor']
+ controls[vendor] = yaml.safe_load(data)['controls']
data = generate_py(controls, args.mode)
diff --git a/src/py/libcamera/meson.build b/src/py/libcamera/meson.build
index 1c3ea184..31af63ec 100644
--- a/src/py/libcamera/meson.build
+++ b/src/py/libcamera/meson.build
@@ -28,11 +28,15 @@ pycamera_sources = files([
# Generate controls
-gen_py_controls_input_files = files('../../libcamera/control_ids.yaml')
+gen_py_controls_input_files = []
gen_py_controls_template = files('py_controls_generated.cpp.in')
gen_py_controls = files('gen-py-controls.py')
+foreach file : controls_files
+ gen_py_controls_input_files += files('../../libcamera/' + file)
+endforeach
+
pycamera_sources += custom_target('py_gen_controls',
input : gen_py_controls_input_files,
output : ['py_controls_generated.cpp'],
@@ -41,9 +45,13 @@ pycamera_sources += custom_target('py_gen_controls',
# Generate properties
-gen_py_property_enums_input_files = files('../../libcamera/property_ids.yaml')
+gen_py_property_enums_input_files = []
gen_py_properties_template = files('py_properties_generated.cpp.in')
+foreach file : properties_files
+ gen_py_property_enums_input_files += files('../../libcamera/' + file)
+endforeach
+
pycamera_sources += custom_target('py_gen_properties',
input : gen_py_property_enums_input_files,
output : ['py_properties_generated.cpp'],