From 78f49d5e348814ae8d7c6bd0c2686112f790ca88 Mon Sep 17 00:00:00 2001 From: Paul Elder Date: Thu, 28 Jan 2021 17:45:44 +0900 Subject: android: camera_device: Fix exposure time tag in exif and android MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The ExposureTime libcamera control is in microseconds while android and our exif component use nanoseconds. Convert it appropriately. CTS also expects the ExposureTime exif tag to match the ExposureTime set in the android result metadata. Fix it. Signed-off-by: Paul Elder Reviewed-by: Jacopo Mondi Reviewed-by: Laurent Pinchart Reviewed-by: Niklas Söderlund --- src/android/jpeg/post_processor_jpeg.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/android/jpeg') diff --git a/src/android/jpeg/post_processor_jpeg.cpp b/src/android/jpeg/post_processor_jpeg.cpp index cac0087b..1cbab30c 100644 --- a/src/android/jpeg/post_processor_jpeg.cpp +++ b/src/android/jpeg/post_processor_jpeg.cpp @@ -112,8 +112,8 @@ int PostProcessorJpeg::process(const FrameBuffer &source, */ exif.setTimestamp(std::time(nullptr), 0ms); - /* \todo Get this information from libcamera::Request::metadata */ - exif.setExposureTime(0); + ret = resultMetadata->getEntry(ANDROID_SENSOR_EXPOSURE_TIME, &entry); + exif.setExposureTime(ret ? *entry.data.i64 : 0); ret = requestMetadata.getEntry(ANDROID_LENS_APERTURE, &entry); if (ret) exif.setAperture(*entry.data.f); -- cgit v1.2.1