summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJacopo Mondi <jacopo.mondi@ideasonboard.com>2023-12-21 11:12:33 +0100
committerJacopo Mondi <jacopo.mondi@ideasonboard.com>2023-12-29 11:33:29 +0100
commita4e6a5085b465216546b802e6bb9d55ecf278c63 (patch)
treed884cbe4c584d4f09626c3b0ba4359eefc333216 /include
parent89289ceeb487fa305025802277222a0f21e9307e (diff)
libcamera: Add 'required' property to controls
Add to the ControlId class a 'required' boolean flag that determine if the control (or property) is mandatory to be supported by a Camera in order to comply with the libcamera API specification. Add support for a 'required' field to the controls and properties yaml file definition and control generation scripts. Also plumb support for the flag in the control serializer component to allow pass the information across IPC borders. Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Diffstat (limited to 'include')
-rw-r--r--include/libcamera/controls.h10
-rw-r--r--include/libcamera/ipa/ipa_controls.h3
2 files changed, 8 insertions, 5 deletions
diff --git a/include/libcamera/controls.h b/include/libcamera/controls.h
index cf942055..01821191 100644
--- a/include/libcamera/controls.h
+++ b/include/libcamera/controls.h
@@ -213,14 +213,15 @@ private:
class ControlId
{
public:
- ControlId(unsigned int id, const std::string &name, ControlType type)
- : id_(id), name_(name), type_(type)
+ ControlId(unsigned int id, const std::string &name, ControlType type, bool required)
+ : id_(id), name_(name), type_(type), required_(required)
{
}
unsigned int id() const { return id_; }
const std::string &name() const { return name_; }
ControlType type() const { return type_; }
+ bool required() const { return required_; }
private:
LIBCAMERA_DISABLE_COPY_AND_MOVE(ControlId)
@@ -228,6 +229,7 @@ private:
unsigned int id_;
std::string name_;
ControlType type_;
+ bool required_;
};
static inline bool operator==(unsigned int lhs, const ControlId &rhs)
@@ -256,8 +258,8 @@ class Control : public ControlId
public:
using type = T;
- Control(unsigned int id, const char *name)
- : ControlId(id, name, details::control_type<std::remove_cv_t<T>>::value)
+ Control(unsigned int id, const char *name, bool required)
+ : ControlId(id, name, details::control_type<std::remove_cv_t<T>>::value, required)
{
}
diff --git a/include/libcamera/ipa/ipa_controls.h b/include/libcamera/ipa/ipa_controls.h
index e5da1946..5268b0a8 100644
--- a/include/libcamera/ipa/ipa_controls.h
+++ b/include/libcamera/ipa/ipa_controls.h
@@ -46,7 +46,8 @@ struct ipa_control_info_entry {
uint32_t id;
uint32_t type;
uint32_t offset;
- uint32_t padding[1];
+ uint8_t required;
+ uint8_t padding[3];
};
#ifdef __cplusplus