[libcamera-devel] [PATCH v2 2/3] android: camera_device: Fix sensor frame duration

Paul Elder paul.elder at ideasonboard.com
Mon May 24 11:41:22 CEST 2021


The sensor frame duration should be set by IPA. Get the information for
the result metadata from libcamera.

Signed-off-by: Paul Elder <paul.elder at ideasonboard.com>
---
 src/android/camera_device.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
index 0eea2b95..70173424 100644
--- a/src/android/camera_device.cpp
+++ b/src/android/camera_device.cpp
@@ -2252,6 +2252,12 @@ CameraDevice::getResultMetadata(const Camera3RequestDescriptor &descriptor) cons
 		resultMetadata->addEntry(ANDROID_SENSOR_EXPOSURE_TIME, exposure);
 	}
 
+	if (metadata.contains(controls::FrameDuration)) {
+		int64_t duration = metadata.get(controls::FrameDuration) * 1000;
+		resultMetadata->addEntry(ANDROID_SENSOR_FRAME_DURATION,
+					 duration);
+	}
+
 	if (metadata.contains(controls::ScalerCrop)) {
 		Rectangle crop = metadata.get(controls::ScalerCrop);
 		int32_t cropRect[] = {
-- 
2.27.0



More information about the libcamera-devel mailing list