[libcamera-devel] [PATCH v1] android: Hardcode lens focus range in result metadata

Laurent Pinchart laurent.pinchart at ideasonboard.com
Tue Dec 21 17:40:47 CET 2021


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 at 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 at 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.

-- 
Regards,

Laurent Pinchart


More information about the libcamera-devel mailing list