From abd96336ed0f4e4a109d9742ee5f39388654ef22 Mon Sep 17 00:00:00 2001 From: Jacopo Mondi Date: Mon, 30 Dec 2019 18:03:29 +0100 Subject: libcamera: controls: Add a 'size' yaml property Add a 'size' property to the control yaml description, to convey the size constraints of array controls. The semantics of the property contents is currently unspecified, but its presence triggers the generation of an array control (Control>). Example: - BayerGains: type: float description: Gains to apply to the four Bayer colour components for white balance size: [4] Signed-off-by: Jacopo Mondi Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- src/libcamera/gen-controls.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/libcamera/gen-controls.py b/src/libcamera/gen-controls.py index 6f020a32..ff8bda6b 100755 --- a/src/libcamera/gen-controls.py +++ b/src/libcamera/gen-controls.py @@ -42,9 +42,14 @@ ${description} name, ctrl = ctrl.popitem() id_name = snake_case(name).upper() + if ctrl.get('size'): + ctrl_type = 'Span' % ctrl['type'] + else: + ctrl_type = ctrl['type'] + info = { 'name': name, - 'type': ctrl['type'], + 'type': ctrl_type, 'description': format_description(ctrl['description']), 'id_name': id_name, } @@ -92,9 +97,14 @@ def generate_h(controls): ids.append('\t' + id_name + ' = ' + str(id_value) + ',') + if ctrl.get('size'): + ctrl_type = 'Span' % ctrl['type'] + else: + ctrl_type = ctrl['type'] + info = { 'name': name, - 'type': ctrl['type'], + 'type': ctrl_type, } enum = ctrl.get('enum') -- cgit v1.2.1