mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-19 02:15:05 +03:00
libcamera: controls: Suppress error message from ControlList::get()
Now that ControlList::get() returns a std::optional<T> to handle missing
controls, the error log message in the call to ControlList::find() is
unnecessary and likely invalid.
Fix this by avoiding the call to ControlList::find() from
ControlList::get() and replacing with a call to the underlying
std::unordered_map::find().
Fixes: 1c4d480185
("libcamera: controls: Use std::optional to handle invalid control values")
Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
parent
4d22621ec1
commit
8b02645845
1 changed files with 4 additions and 3 deletions
|
@ -375,11 +375,12 @@ public:
|
|||
template<typename T>
|
||||
std::optional<T> get(const Control<T> &ctrl) const
|
||||
{
|
||||
const ControlValue *val = find(ctrl.id());
|
||||
if (!val)
|
||||
const auto entry = controls_.find(ctrl.id());
|
||||
if (entry == controls_.end())
|
||||
return std::nullopt;
|
||||
|
||||
return val->get<T>();
|
||||
const ControlValue &val = entry->second;
|
||||
return val.get<T>();
|
||||
}
|
||||
|
||||
template<typename T, typename V>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue