[libcamera-devel,v1] android: Hardcode lens focus range in result metadata
diff mbox series

Message ID 20211221045340.2571544-1-paul.elder@ideasonboard.com
State New
Delegated to: Paul Elder
Headers show
Series
  • [libcamera-devel,v1] android: Hardcode lens focus range in result metadata
Related show

Commit Message

Paul Elder Dec. 21, 2021, 4:53 a.m. UTC
Hardcode the lens focus range in result metadata. As our lens focus
distance calibration is hardcoded to uncalibrated, and our minimum focus
distance is zero, we hardcode the lens focus range to [0, 0].

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

Comments

Kieran Bingham Dec. 21, 2021, 12:04 p.m. UTC | #1
Quoting Paul Elder (2021-12-21 04:53:40)
> Hardcode the lens focus range in result metadata. As our lens focus
> distance calibration is hardcoded to uncalibrated, and our minimum focus
> distance is zero, we hardcode the lens focus range to [0, 0].
> 
> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>

Given we don't yet have a libcamera control to return something else,
this is probably ok - but we should make sure we remember to get this
updated when the controls go in.


Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

> ---
>  src/android/camera_device.cpp | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
> index 6c2ea61f..8861447d 100644
> --- a/src/android/camera_device.cpp
> +++ b/src/android/camera_device.cpp
> @@ -1650,6 +1650,9 @@ CameraDevice::getResultMetadata(const Camera3RequestDescriptor &descriptor) cons
>                                          testPatternMode);
>         }
>  
> +       std::vector<float> focusRange = { 0.0f, 0.0f };
> +       resultMetadata->addEntry(ANDROID_LENS_FOCUS_RANGE, focusRange);
> +
>         /*
>          * Return the result metadata pack even is not valid: get() will return
>          * nullptr.
> -- 
> 2.27.0
>
David Plowman Dec. 21, 2021, 12:12 p.m. UTC | #2
Hi Paul

On Tue, 21 Dec 2021 at 12:04, Kieran Bingham
<kieran.bingham@ideasonboard.com> wrote:
>
> Quoting Paul Elder (2021-12-21 04:53:40)
> > Hardcode the lens focus range in result metadata. As our lens focus
> > distance calibration is hardcoded to uncalibrated, and our minimum focus
> > distance is zero, we hardcode the lens focus range to [0, 0].

Just a little question on this - I thought 0 was supposed to mean
"infinite" and close focus distances should get larger numbers. So is
[0, 0] the right thing? Sorry if I've misunderstood!

Thanks
David

> >
> > Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
>
> Given we don't yet have a libcamera control to return something else,
> this is probably ok - but we should make sure we remember to get this
> updated when the controls go in.
>
>
> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
>
> > ---
> >  src/android/camera_device.cpp | 3 +++
> >  1 file changed, 3 insertions(+)
> >
> > diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
> > index 6c2ea61f..8861447d 100644
> > --- a/src/android/camera_device.cpp
> > +++ b/src/android/camera_device.cpp
> > @@ -1650,6 +1650,9 @@ CameraDevice::getResultMetadata(const Camera3RequestDescriptor &descriptor) cons
> >                                          testPatternMode);
> >         }
> >
> > +       std::vector<float> focusRange = { 0.0f, 0.0f };
> > +       resultMetadata->addEntry(ANDROID_LENS_FOCUS_RANGE, focusRange);
> > +
> >         /*
> >          * Return the result metadata pack even is not valid: get() will return
> >          * nullptr.
> > --
> > 2.27.0
> >
Laurent Pinchart Dec. 21, 2021, 4:40 p.m. UTC | #3
Hi David,

On Tue, Dec 21, 2021 at 12:12:19PM +0000, David Plowman wrote:
> On Tue, 21 Dec 2021 at 12:04, Kieran Bingham wrote:
> > Quoting Paul Elder (2021-12-21 04:53:40)
> > > Hardcode the lens focus range in result metadata. As our lens focus
> > > distance calibration is hardcoded to uncalibrated, and our minimum focus
> > > distance is zero, we hardcode the lens focus range to [0, 0].
> 
> Just a little question on this - I thought 0 was supposed to mean
> "infinite" and close focus distances should get larger numbers. So is
> [0, 0] the right thing? Sorry if I've misunderstood!

You're right, 0 means infinity, so the commit message should probably be
reworded.

> > > Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
> >
> > Given we don't yet have a libcamera control to return something else,
> > this is probably ok - but we should make sure we remember to get this
> > updated when the controls go in.
> >
> > Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
> >
> > > ---
> > >  src/android/camera_device.cpp | 3 +++
> > >  1 file changed, 3 insertions(+)
> > >
> > > diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
> > > index 6c2ea61f..8861447d 100644
> > > --- a/src/android/camera_device.cpp
> > > +++ b/src/android/camera_device.cpp
> > > @@ -1650,6 +1650,9 @@ CameraDevice::getResultMetadata(const Camera3RequestDescriptor &descriptor) cons
> > >                                          testPatternMode);
> > >         }
> > >
> > > +       std::vector<float> focusRange = { 0.0f, 0.0f };
> > > +       resultMetadata->addEntry(ANDROID_LENS_FOCUS_RANGE, focusRange);
> > > +
> > >         /*
> > >          * Return the result metadata pack even is not valid: get() will return
> > >          * nullptr.

Patch
diff mbox series

diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
index 6c2ea61f..8861447d 100644
--- a/src/android/camera_device.cpp
+++ b/src/android/camera_device.cpp
@@ -1650,6 +1650,9 @@  CameraDevice::getResultMetadata(const Camera3RequestDescriptor &descriptor) cons
 					 testPatternMode);
 	}
 
+	std::vector<float> focusRange = { 0.0f, 0.0f };
+	resultMetadata->addEntry(ANDROID_LENS_FOCUS_RANGE, focusRange);
+
 	/*
 	 * Return the result metadata pack even is not valid: get() will return
 	 * nullptr.