diff options
author | David Plowman <david.plowman@raspberrypi.com> | 2022-04-21 16:11:17 +0100 |
---|---|---|
committer | Kieran Bingham <kieran.bingham@ideasonboard.com> | 2022-05-10 14:24:45 +0100 |
commit | 065a9e6c050c7b4e922e4ac17a6d36097520e5e8 (patch) | |
tree | 7b9894a893a219d47edd257516eee42712ca8d5c /src/libcamera/pipeline/raspberrypi | |
parent | 998d23c0a2255de092d6297d12600ffa1bfa3295 (diff) |
libcamera: raspberrypi: Fetch correct value for SensorSensitivity
These changes retrieve the correct value for sensitivity of the mode
selected for the sensor. This value is known to the CamHelper which
passes it across to the pipeline handler so that it can be set
correctly in the camera properties.
Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src/libcamera/pipeline/raspberrypi')
-rw-r--r-- | src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp index e2ee7f1a..2636acb7 100644 --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp @@ -200,7 +200,7 @@ public: void frameStarted(uint32_t sequence); int loadIPA(ipa::RPi::SensorConfig *sensorConfig); - int configureIPA(const CameraConfiguration *config); + int configureIPA(const CameraConfiguration *config, ipa::RPi::IPAConfigResult *result); void enumerateVideoDevices(MediaLink *link); @@ -898,7 +898,8 @@ int PipelineHandlerRPi::configure(Camera *camera, CameraConfiguration *config) data->isp_[Isp::Input].dev()->setSelection(V4L2_SEL_TGT_CROP, &crop); - ret = data->configureIPA(config); + ipa::RPi::IPAConfigResult result; + ret = data->configureIPA(config, &result); if (ret) LOG(RPI, Error) << "Failed to configure the IPA: " << ret; @@ -937,6 +938,9 @@ int PipelineHandlerRPi::configure(Camera *camera, CameraConfiguration *config) */ data->properties_.set(properties::ScalerCropMaximum, data->sensorInfo_.analogCrop); + /* Store the mode sensitivity for the application. */ + data->properties_.set(properties::SensorSensitivity, result.modeSensitivity); + /* Setup the Video Mux/Bridge entities. */ for (auto &[device, link] : data->bridgeDevices_) { /* @@ -1528,7 +1532,7 @@ int RPiCameraData::loadIPA(ipa::RPi::SensorConfig *sensorConfig) return ipa_->init(settings, sensorConfig); } -int RPiCameraData::configureIPA(const CameraConfiguration *config) +int RPiCameraData::configureIPA(const CameraConfiguration *config, ipa::RPi::IPAConfigResult *result) { std::map<unsigned int, IPAStream> streamConfig; std::map<unsigned int, ControlInfoMap> entityControls; @@ -1574,7 +1578,7 @@ int RPiCameraData::configureIPA(const CameraConfiguration *config) /* Ready the IPA - it must know about the sensor resolution. */ ControlList controls; ret = ipa_->configure(sensorInfo_, streamConfig, entityControls, ipaConfig, - &controls); + &controls, result); if (ret < 0) { LOG(RPI, Error) << "IPA configuration failed!"; return -EPIPE; |