summaryrefslogtreecommitdiff
path: root/include/libcamera/control_ids.h.in
diff options
context:
space:
mode:
Diffstat (limited to 'include/libcamera/control_ids.h.in')
-rw-r--r--include/libcamera/control_ids.h.in42
1 files changed, 33 insertions, 9 deletions
diff --git a/include/libcamera/control_ids.h.in b/include/libcamera/control_ids.h.in
index 293ba966..858ef872 100644
--- a/include/libcamera/control_ids.h.in
+++ b/include/libcamera/control_ids.h.in
@@ -2,7 +2,7 @@
/*
* Copyright (C) 2019, Google Inc.
*
- * Control ID list
+ * {{mode|capitalize}} ID list
*
* This file is auto-generated. Do not edit.
*/
@@ -18,18 +18,42 @@
namespace libcamera {
-namespace controls {
+namespace {{mode}} {
-enum {
-${ids}
-};
+extern const ControlIdMap {{mode}};
+
+{%- for vendor, ctrls in controls -%}
-${controls}
+{% if vendor != 'libcamera' %}
+namespace {{vendor}} {
-extern const ControlIdMap controls;
+#define LIBCAMERA_HAS_{{vendor|upper}}_VENDOR_{{mode|upper}}
+{%- endif %}
-${vendor_controls}
+enum {
+{%- for ctrl in ctrls %}
+ {{ctrl.name|snake_case|upper}} = {{ctrl.id}},
+{%- endfor %}
+};
-} /* namespace controls */
+{% for ctrl in ctrls -%}
+{% if ctrl.is_enum -%}
+enum {{ctrl.name}}Enum {
+{%- for enum in ctrl.enum_values %}
+ {{enum.name}} = {{enum.value}},
+{%- endfor %}
+};
+extern const std::array<const ControlValue, {{ctrl.enum_values_count}}> {{ctrl.name}}Values;
+extern const std::map<std::string, {{ctrl.type}}> {{ctrl.name}}NameValueMap;
+{% endif -%}
+extern const Control<{{ctrl.type}}> {{ctrl.name}};
+{% endfor -%}
+
+{% if vendor != 'libcamera' %}
+} /* namespace {{vendor}} */
+{% endif -%}
+
+{% endfor %}
+} /* namespace {{mode}} */
} /* namespace libcamera */