[libcamera-devel,v6,4/9] android: jpeg: get ISO from SENSOR_SENSITIVITY
diff mbox series

Message ID 20210730103536.81117-5-paul.elder@ideasonboard.com
State Accepted
Headers show
Series
  • android: Support capability and hardware level detection
Related show

Commit Message

Paul Elder July 30, 2021, 10:35 a.m. UTC
The data for the exif ISO tag needs to come from SENSOR_SENSITIVITY. Set
it.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>

---
This on its own doesn't fix any CTS tests, but it prevents a test
failure later on when we add the proper static metadata for the FULL
hardware level.
---
 src/android/jpeg/post_processor_jpeg.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Patch
diff mbox series

diff --git a/src/android/jpeg/post_processor_jpeg.cpp b/src/android/jpeg/post_processor_jpeg.cpp
index 0e93f365..3160a784 100644
--- a/src/android/jpeg/post_processor_jpeg.cpp
+++ b/src/android/jpeg/post_processor_jpeg.cpp
@@ -119,7 +119,10 @@  int PostProcessorJpeg::process(const FrameBuffer &source,
 	ret = requestMetadata.getEntry(ANDROID_LENS_APERTURE, &entry);
 	if (ret)
 		exif.setAperture(*entry.data.f);
-	exif.setISO(100);
+
+	ret = resultMetadata->getEntry(ANDROID_SENSOR_SENSITIVITY, &entry);
+	exif.setISO(ret ? *entry.data.i32 : 100);
+
 	exif.setFlash(Exif::Flash::FlashNotPresent);
 	exif.setWhiteBalance(Exif::WhiteBalance::Auto);