diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/libcamera/control_serializer.cpp | 4 | ||||
-rw-r--r-- | src/libcamera/controls.cpp | 24 | ||||
-rw-r--r-- | src/libcamera/ipa_controls.cpp | 2 | ||||
-rw-r--r-- | src/libcamera/v4l2_device.cpp | 2 |
4 files changed, 24 insertions, 8 deletions
diff --git a/src/libcamera/control_serializer.cpp b/src/libcamera/control_serializer.cpp index 0cf719bd..b9ed1eea 100644 --- a/src/libcamera/control_serializer.cpp +++ b/src/libcamera/control_serializer.cpp @@ -281,6 +281,7 @@ int ControlSerializer::serialize(const ControlInfoMap &infoMap, entry.id = id->id(); entry.type = id->type(); entry.offset = values.offset(); + entry.required = id->required(); entries.write(&entry); store(info, values); @@ -498,7 +499,8 @@ ControlInfoMap ControlSerializer::deserialize<ControlInfoMap>(ByteStreamBuffer & * debugging purpose. */ controlIds_.emplace_back(std::make_unique<ControlId>(entry->id, - "", type)); + "", type, + entry->required)); (*localIdMap)[entry->id] = controlIds_.back().get(); } diff --git a/src/libcamera/controls.cpp b/src/libcamera/controls.cpp index b808116c..25f30953 100644 --- a/src/libcamera/controls.cpp +++ b/src/libcamera/controls.cpp @@ -378,18 +378,19 @@ void ControlValue::reserve(ControlType type, bool isArray, std::size_t numElemen * \class ControlId * \brief Control static metadata * - * The ControlId class stores a control ID, name and data type. It provides - * unique identification of a control, but without support for compile-time - * type deduction that the derived template Control class supports. See the - * Control class for more information. + * The ControlId class stores a control ID, name, data type and a boolean + * 'required' flag. It provides unique identification of a control, but without + * support for compile-time type deduction that the derived template Control + * class supports. See the Control class for more information. */ /** - * \fn ControlId::ControlId(unsigned int id, const std::string &name, ControlType type) + * \fn ControlId::ControlId(unsigned int id, const std::string &name, ControlType type, bool required) * \brief Construct a ControlId instance * \param[in] id The control numerical ID * \param[in] name The control name * \param[in] type The control data type + * \param[in] required Boolean flag that determine if the control is required */ /** @@ -411,6 +412,16 @@ void ControlValue::reserve(ControlType type, bool isArray, std::size_t numElemen */ /** + * \fn bool ControlId::required() const + * \brief Determine if the control is required or not + * + * A control is 'required' if it is mandatory for a Camera to support it to + * comply with the libcamera API specification. + * + * \return True if the control is required, false otherwise + */ + +/** * \fn bool operator==(unsigned int lhs, const ControlId &rhs) * \brief Compare a ControlId with a control numerical ID * \param[in] lhs Left-hand side numerical ID @@ -456,10 +467,11 @@ void ControlValue::reserve(ControlType type, bool isArray, std::size_t numElemen */ /** - * \fn Control::Control(unsigned int id, const char *name) + * \fn Control::Control(unsigned int id, const char *name, bool required) * \brief Construct a Control instance * \param[in] id The control numerical ID * \param[in] name The control name + * \param[in] required Boolean flag that determine if a control is required * * The control data type is automatically deduced from the template type T. */ diff --git a/src/libcamera/ipa_controls.cpp b/src/libcamera/ipa_controls.cpp index 870a443b..2376cbd9 100644 --- a/src/libcamera/ipa_controls.cpp +++ b/src/libcamera/ipa_controls.cpp @@ -220,6 +220,8 @@ static_assert(sizeof(ipa_control_value_entry) == 16, * \var ipa_control_info_entry::offset * The offset in bytes from the beginning of the data section to the control * info data (shall be a multiple of 8 bytes) + * \var ipa_control_info_entry::required + * Boolean flag that determines if the controls is required or not * \var ipa_control_info_entry::padding * Padding bytes (shall be set to 0) */ diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp index 24d208ef..b055d14c 100644 --- a/src/libcamera/v4l2_device.cpp +++ b/src/libcamera/v4l2_device.cpp @@ -522,7 +522,7 @@ std::unique_ptr<ControlId> V4L2Device::v4l2ControlId(const v4l2_query_ext_ctrl & const std::string name(static_cast<const char *>(ctrl.name), len); const ControlType type = v4l2CtrlType(ctrl.type); - return std::make_unique<ControlId>(ctrl.id, name, type); + return std::make_unique<ControlId>(ctrl.id, name, type, false); } /** |