From b40a8d4b454008aeab4c0eb1f63a07083d7d7c74 Mon Sep 17 00:00:00 2001
From: Naushir Patuck <naush@raspberrypi.com>
Date: Thu, 22 Jul 2021 12:57:42 +0100
Subject: ipa: raspberrypi: Return controls::FrameDuration from the IPA

Return controls::FrameDuration through the per-frame Request metadata.
The frame duration is obtained by either the value in DelayedControls,
or (preferably) the value parsed from the embedded data buffer.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 src/ipa/raspberrypi/raspberrypi.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp
index 5cd33304..b08602f4 100644
--- a/src/ipa/raspberrypi/raspberrypi.cpp
+++ b/src/ipa/raspberrypi/raspberrypi.cpp
@@ -465,6 +465,8 @@ void IPARPi::reportMetadata()
 		libcameraMetadata_.set(controls::ExposureTime,
 				       deviceStatus->shutter_speed.get<std::micro>());
 		libcameraMetadata_.set(controls::AnalogueGain, deviceStatus->analogue_gain);
+		libcameraMetadata_.set(controls::FrameDuration,
+				       helper_->Exposure(deviceStatus->frame_length).get<std::micro>());
 	}
 
 	AgcStatus *agcStatus = rpiMetadata_.GetLocked<AgcStatus>("agc.status");
-- 
cgit v1.2.1