libcamera: controls: Index ControlList by unsigned int

In preparation for serialization, index the ControlList by unsigned int.
This will allow deserializing a ControlList without requiring external
information.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
This commit is contained in:
Laurent Pinchart
2019-11-20 21:47:33 +02:00
parent c27b7c103a
commit e89c2b2295
8 changed files with 60 additions and 64 deletions
+2 -2
View File
@@ -44,10 +44,10 @@ const std::string &CameraControlValidator::name() const
* \param[in] id The control ID
* \return True if the control is valid, false otherwise
*/
bool CameraControlValidator::validate(const ControlId &id) const
bool CameraControlValidator::validate(unsigned int id) const
{
const ControlInfoMap &controls = camera_->controls();
return controls.find(&id) != controls.end();
return controls.find(id) != controls.end();
}
} /* namespace libcamera */