ipa: rkisp1: Fix algorithm controls vanish after configure

std::unordered_map::merge(source) has the side effect of actually moving items
from source to target. In this case the controls were removed from the source
maps on the first call to updateControls() and on the second call to
updateControls() they were missing in the source maps and therefore also
removed from the camera. Fix this by using insert() instead of merge(). This is
most likely cheaper than copy-contructing the source map.

Fixes: 4c5152843a ("ipa: rkisp1: Derive rkisp1::algorithms::Agc from AgcMeanLuminance")
Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
This commit is contained in:
Stefan Klug 2024-05-22 15:31:51 +02:00
parent 294ead848c
commit acfd602767

View file

@ -427,7 +427,7 @@ void IPARkISP1::updateControls(const IPACameraSensorInfo &sensorInfo,
frameDurations[1], frameDurations[1],
frameDurations[2]); frameDurations[2]);
ctrlMap.merge(context_.ctrlMap); ctrlMap.insert(context_.ctrlMap.begin(), context_.ctrlMap.end());
*ipaControls = ControlInfoMap(std::move(ctrlMap), controls::controls); *ipaControls = ControlInfoMap(std::move(ctrlMap), controls::controls);
} }