[libcamera-devel,RFC,v2,04/12] android: jpeg: get ISO from SENSOR_SENSITIVITY
diff mbox series

Message ID 20210422094102.371772-5-paul.elder@ideasonboard.com
State Superseded
Delegated to: Paul Elder
Headers show
Series
  • FULL hardware level fixes
Related show

Commit Message

Paul Elder April 22, 2021, 9:40 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>

---
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(-)

Comments

Laurent Pinchart April 27, 2021, 4:32 a.m. UTC | #1
Hi Paul,

Thank you for the patch.

On Thu, Apr 22, 2021 at 06:40:54PM +0900, Paul Elder wrote:
> 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>

> 
> ---
> 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(-)
> 
> diff --git a/src/android/jpeg/post_processor_jpeg.cpp b/src/android/jpeg/post_processor_jpeg.cpp
> index 3bf16996..237fb318 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);
>
Jacopo Mondi April 27, 2021, 7:47 a.m. UTC | #2
On Thu, Apr 22, 2021 at 06:40:54PM +0900, Paul Elder wrote:
> The data for the exif ISO tag needs to come from SENSOR_SENSITIVITY. Set
> it.
>
> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
>
> ---
> 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(-)
>
> diff --git a/src/android/jpeg/post_processor_jpeg.cpp b/src/android/jpeg/post_processor_jpeg.cpp
> index 3bf16996..237fb318 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);

I don't see this tag being filled in the result metadata...

> +	exif.setISO(ret ? *entry.data.i32 : 100);
> +
>  	exif.setFlash(Exif::Flash::FlashNotPresent);
>  	exif.setWhiteBalance(Exif::WhiteBalance::Auto);
>
> --
> 2.27.0
>
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel@lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel
Paul Elder April 28, 2021, 10:03 a.m. UTC | #3
On Tue, Apr 27, 2021 at 09:47:09AM +0200, Jacopo Mondi wrote:
> On Thu, Apr 22, 2021 at 06:40:54PM +0900, Paul Elder wrote:
> > The data for the exif ISO tag needs to come from SENSOR_SENSITIVITY. Set
> > it.
> >
> > Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
> >
> > ---
> > 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(-)
> >
> > diff --git a/src/android/jpeg/post_processor_jpeg.cpp b/src/android/jpeg/post_processor_jpeg.cpp
> > index 3bf16996..237fb318 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);
> 
> I don't see this tag being filled in the result metadata...

It will be later :)


Paul

> > +	exif.setISO(ret ? *entry.data.i32 : 100);
> > +
> >  	exif.setFlash(Exif::Flash::FlashNotPresent);
> >  	exif.setWhiteBalance(Exif::WhiteBalance::Auto);
> >
> > --
> > 2.27.0
> >
> > _______________________________________________
> > libcamera-devel mailing list
> > libcamera-devel@lists.libcamera.org
> > https://lists.libcamera.org/listinfo/libcamera-devel

Patch
diff mbox series

diff --git a/src/android/jpeg/post_processor_jpeg.cpp b/src/android/jpeg/post_processor_jpeg.cpp
index 3bf16996..237fb318 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);