From 9b0db2aa4349817a2064e8593790ce45bedba613 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Mon, 23 Jan 2023 15:49:32 +0000 Subject: ipa: raspberrypi: Add lens position to DeviceStatus Add the current frame's lens position (in dioptres) to the DeviceStatus structure. This value is obtained from the AfAlgorithm::getLensPosition() member function. Return this lens position back to the pipeline handler to store in the metadata field of the request. As a drive-by, fixup some inaccurate comments in the DeviceStatus structure. Signed-off-by: Naushir Patuck Reviewed-by: David Plowman Reviewed-by: Nick Hollinghurst nick.hollinghurst@raspberrypi.com Signed-off-by: Kieran Bingham --- src/ipa/raspberrypi/raspberrypi.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/ipa/raspberrypi/raspberrypi.cpp') diff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp index fbace14b..5f7397e2 100644 --- a/src/ipa/raspberrypi/raspberrypi.cpp +++ b/src/ipa/raspberrypi/raspberrypi.cpp @@ -586,6 +586,8 @@ void IPARPi::reportMetadata(unsigned int ipaContext) helper_->exposure(deviceStatus->frameLength, deviceStatus->lineLength).get()); if (deviceStatus->sensorTemperature) libcameraMetadata_.set(controls::SensorTemperature, *deviceStatus->sensorTemperature); + if (deviceStatus->lensPosition) + libcameraMetadata_.set(controls::LensPosition, *deviceStatus->lensPosition); } AgcStatus *agcStatus = rpiMetadata.getLocked("agc.status"); @@ -1352,6 +1354,11 @@ void IPARPi::fillDeviceStatus(const ControlList &sensorControls, unsigned int ip deviceStatus.analogueGain = helper_->gain(gainCode); deviceStatus.frameLength = mode_.height + vblank; + RPiController::AfAlgorithm *af = dynamic_cast( + controller_.getAlgorithm("af")); + if (af) + deviceStatus.lensPosition = af->getLensPosition(); + LOG(IPARPI, Debug) << "Metadata - " << deviceStatus; rpiMetadata_[ipaContext].set("device.status", deviceStatus); -- cgit v1.2.1