summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/libcamera/control_ids.h.in42
-rw-r--r--include/libcamera/meson.build2
-rw-r--r--include/libcamera/property_ids.h.in34
3 files changed, 34 insertions, 44 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 */
diff --git a/include/libcamera/meson.build b/include/libcamera/meson.build
index 87b9a941..d90a8615 100644
--- a/include/libcamera/meson.build
+++ b/include/libcamera/meson.build
@@ -80,7 +80,7 @@ foreach mode, entry : controls_map
properties_files_names += files_list
endif
- template_file = files(outfile + '.in')
+ template_file = files('control_ids.h.in')
ranges_file = files('../../src/libcamera/control_ranges.yaml')
control_headers += custom_target(header + '_h',
input : input_files,
diff --git a/include/libcamera/property_ids.h.in b/include/libcamera/property_ids.h.in
deleted file mode 100644
index e6edabca..00000000
--- a/include/libcamera/property_ids.h.in
+++ /dev/null
@@ -1,34 +0,0 @@
-/* SPDX-License-Identifier: LGPL-2.1-or-later */
-/*
- * Copyright (C) 2019, Google Inc.
- *
- * Property ID list
- *
- * This file is auto-generated. Do not edit.
- */
-
-#pragma once
-
-#include <map>
-#include <stdint.h>
-#include <string>
-
-#include <libcamera/controls.h>
-
-namespace libcamera {
-
-namespace properties {
-
-enum {
-${ids}
-};
-
-${controls}
-
-extern const ControlIdMap properties;
-
-${vendor_controls}
-
-} /* namespace properties */
-
-} /* namespace libcamera */