pipeline: raspberrypi: Advertise ScalerCrop from the pipeline handler

The ScalerCrop control is handled directly by the pipeline handler. Remove the
control from the IPA's static ControlInfoMap, and let the pipeline handler add
it to the ControlInfoMap advertised to the application, ensuring the limits
are set appropriately based on the current sensor mode.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
Naushir Patuck 2022-06-22 11:20:47 +01:00 committed by Kieran Bingham
parent ac955c425d
commit 9dacde0d65

View file

@ -941,7 +941,15 @@ int PipelineHandlerRPi::configure(Camera *camera, CameraConfiguration *config)
data->properties_.set(properties::SensorSensitivity, result.modeSensitivity); data->properties_.set(properties::SensorSensitivity, result.modeSensitivity);
/* Update the controls that the Raspberry Pi IPA can handle. */ /* Update the controls that the Raspberry Pi IPA can handle. */
data->controlInfo_ = result.controlInfo; ControlInfoMap::Map ctrlMap;
for (auto const &c : result.controlInfo)
ctrlMap.emplace(c.first, c.second);
/* Add the ScalerCrop control limits based on the current mode. */
ctrlMap.emplace(&controls::ScalerCrop,
ControlInfo(Rectangle(data->ispMinCropSize_), Rectangle(data->sensorInfo_.outputSize)));
data->controlInfo_ = ControlInfoMap(std::move(ctrlMap), result.controlInfo.idmap());
/* Setup the Video Mux/Bridge entities. */ /* Setup the Video Mux/Bridge entities. */
for (auto &[device, link] : data->bridgeDevices_) { for (auto &[device, link] : data->bridgeDevices_) {