summaryrefslogtreecommitdiff
path: root/src/android
diff options
context:
space:
mode:
authorPaul Elder <paul.elder@ideasonboard.com>2021-01-28 17:45:44 +0900
committerPaul Elder <paul.elder@ideasonboard.com>2021-02-01 09:41:40 +0900
commit78f49d5e348814ae8d7c6bd0c2686112f790ca88 (patch)
tree875015da4b84899bd078b2055e5d81e350cd3088 /src/android
parentc763ae023d9b64e7910c2dfc849f6c1f5081f657 (diff)
android: camera_device: Fix exposure time tag in exif and android
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 <paul.elder@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Diffstat (limited to 'src/android')
-rw-r--r--src/android/camera_device.cpp2
-rw-r--r--src/android/jpeg/post_processor_jpeg.cpp4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
index 741dc8cf..c1025e81 100644
--- a/src/android/camera_device.cpp
+++ b/src/android/camera_device.cpp
@@ -2058,7 +2058,7 @@ CameraDevice::getResultMetadata(Camera3RequestDescriptor *descriptor,
}
if (metadata.contains(controls::ExposureTime)) {
- int32_t exposure = metadata.get(controls::ExposureTime);
+ int64_t exposure = metadata.get(controls::ExposureTime) * 1000ULL;
resultMetadata->addEntry(ANDROID_SENSOR_EXPOSURE_TIME,
&exposure, 1);
}
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);