pipeline: raspberrypi: Fix incorrect advertising of ScalerCrop

The controls::ScalerCrop in the ControlInfoMap was advertised based on
the ISP output Rectangle. This is incorrect, it needs to be set based on
the sensor analogue crop Rectangle. Fix this.

Additionally, do not use emplace to be consistent with the other
controls set in the ControlInfoMap.

Fixes: 9dacde0d65 (pipeline: raspberrypi: Advertise ScalerCrop from the pipeline handler)
Reported-by: David Plowman <david.plowman@raspberrypi.com>
Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
Tested-by: David Plowman <david.plowman@raspberrypi.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
Naushir Patuck 2022-07-05 14:59:56 +01:00 committed by Laurent Pinchart
parent 9a2fd76ef1
commit 090ac69416

View file

@ -946,8 +946,9 @@ int PipelineHandlerRPi::configure(Camera *camera, CameraConfiguration *config)
ctrlMap.emplace(c.first, c.second); ctrlMap.emplace(c.first, c.second);
/* Add the ScalerCrop control limits based on the current mode. */ /* Add the ScalerCrop control limits based on the current mode. */
ctrlMap.emplace(&controls::ScalerCrop, Rectangle ispMinCrop(data->ispMinCropSize_);
ControlInfo(Rectangle(data->ispMinCropSize_), Rectangle(data->sensorInfo_.outputSize))); ispMinCrop.scaleBy(data->sensorInfo_.analogCrop.size(), data->sensorInfo_.outputSize);
ctrlMap[&controls::ScalerCrop] = ControlInfo(ispMinCrop, Rectangle(data->sensorInfo_.analogCrop.size()));
data->controlInfo_ = ControlInfoMap(std::move(ctrlMap), result.controlInfo.idmap()); data->controlInfo_ = ControlInfoMap(std::move(ctrlMap), result.controlInfo.idmap());