[{"id":19690,"web_url":"https://patchwork.libcamera.org/comment/19690/","msgid":"<YUEvq3uBHSGTDejg@pendragon.ideasonboard.com>","date":"2021-09-14T23:26:35","subject":"Re: [libcamera-devel] [RFC PATCH] android: Plumb lens focus distance","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Paul,\n\nThank you for the patch.\n\nOn Mon, Sep 13, 2021 at 04:31:25PM +0900, Paul Elder wrote:\n> Plumb the controls related to lens focus distance:\n> - LENS_INFO_FOCUS_DISTANCE_CALIBRATION (static)\n> - LENS_INFO_MINIMUM_FOCUS_DISTANCE (static)\n> - LENS_FOCUS_DISTANCE (request, result)\n> \n> Conceptually, the first two controls determine the range of possible\n> values of the third. None of our lenses are calibrated, so hardcode the\n> first to uncalibrated. The valid focus distances are then [0, min].\n> Since we don't yet support variable-focus lenses, hardcode the second to\n> 0.0f, making the range of valid focus distances [0, 0]. Hence, hardcode\n> the focus distance in the result metadata to 0, and ignore the control\n> in the request. Add todos for adding proper controls later, once we have\n> focus support.\n> \n> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>\n> ---\n> This is also on top of my ctsw branch, so it won't apply on master, but\n> I would like comments to confirm the direction and design.\n> ---\n>  src/android/camera_capabilities.cpp | 13 +++++++++++++\n>  src/android/camera_device.cpp       |  4 ++++\n>  2 files changed, 17 insertions(+)\n> \n> diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp\n> index 461c208b..a807712d 100644\n> --- a/src/android/camera_capabilities.cpp\n> +++ b/src/android/camera_capabilities.cpp\n> @@ -717,6 +717,7 @@ int CameraCapabilities::initializeStaticMetadata()\n>  \t\tANDROID_LENS_INFO_AVAILABLE_APERTURES,\n>  \t\tANDROID_LENS_INFO_AVAILABLE_FOCAL_LENGTHS,\n>  \t\tANDROID_LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION,\n> +\t\tANDROID_LENS_INFO_FOCUS_DISTANCE_CALIBRATION,\n>  \t\tANDROID_LENS_INFO_HYPERFOCAL_DISTANCE,\n>  \t\tANDROID_LENS_INFO_MINIMUM_FOCUS_DISTANCE,\n>  \t\tANDROID_NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES,\n> @@ -805,6 +806,7 @@ int CameraCapabilities::initializeStaticMetadata()\n>  \t\tANDROID_JPEG_THUMBNAIL_SIZE,\n>  \t\tANDROID_LENS_APERTURE,\n>  \t\tANDROID_LENS_FOCAL_LENGTH,\n> +\t\tANDROID_LENS_FOCUS_DISTANCE,\n>  \t\tANDROID_LENS_OPTICAL_STABILIZATION_MODE,\n>  \t\tANDROID_LENS_STATE,\n>  \t\tANDROID_NOISE_REDUCTION_MODE,\n> @@ -1247,10 +1249,21 @@ int CameraCapabilities::initializeStaticMetadata()\n>  \tstaticMetadata_->addEntry(ANDROID_LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION,\n>  \t\t\t\t  opticalStabilizations);\n>  \n> +\t/*\n> +\t * Must be populated for FULL, optional for LIMITED. The value doesn't\n> +\t * matter, so just hardcode to uncalibrated. Uncalibrated means that\n> +\t * the max focus distance is zero (= infinite focus) and the min focus\n> +\t * distance is specified in LENS_INFO_MINIMUM_FOCUS_DISTANCE.\n> +\t */\n> +\tint distanceCalibration = ANDROID_LENS_INFO_FOCUS_DISTANCE_CALIBRATION_UNCALIBRATED;\n> +\tstaticMetadata_->addEntry(ANDROID_LENS_INFO_FOCUS_DISTANCE_CALIBRATION,\n> +\t\t\t\t  distanceCalibration);\n> +\n>  \tfloat hypeFocalDistance = 0;\n>  \tstaticMetadata_->addEntry(ANDROID_LENS_INFO_HYPERFOCAL_DISTANCE,\n>  \t\t\t\t  hypeFocalDistance);\n>  \n> +\t/* \\todo Get this from the HAL config. */\n\nOnce we'll have focus support in the libcamera core, I think this will\ncome from libcamera, not the HAL config. The minimum focus distance is\nuseful in general.\n\nWith this todo updated,\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n>  \tfloat minFocusDistance = 0;\n>  \tstaticMetadata_->addEntry(ANDROID_LENS_INFO_MINIMUM_FOCUS_DISTANCE,\n>  \t\t\t\t  minFocusDistance);\n> diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\n> index 373e0f98..cfbb84aa 100644\n> --- a/src/android/camera_device.cpp\n> +++ b/src/android/camera_device.cpp\n> @@ -1396,6 +1396,10 @@ CameraDevice::getResultMetadata(const Camera3RequestDescriptor &descriptor) cons\n>  \tfloat focal_length = 1.0;\n>  \tresultMetadata->addEntry(ANDROID_LENS_FOCAL_LENGTH, focal_length);\n>  \n> +\t/* \\todo Add a libcamera control for this, and plumb it. */\n> +\tfloat focalDistance = 0.0;\n> +\tresultMetadata->addEntry(ANDROID_LENS_FOCUS_DISTANCE, focalDistance);\n> +\n>  \tvalue = ANDROID_LENS_STATE_STATIONARY;\n>  \tresultMetadata->addEntry(ANDROID_LENS_STATE, value);\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 2BB6DBDC71\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 14 Sep 2021 23:27:03 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 480616024C;\n\tWed, 15 Sep 2021 01:27:02 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C8FFC60248\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 15 Sep 2021 01:27:00 +0200 (CEST)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 331C82A5;\n\tWed, 15 Sep 2021 01:27:00 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"usZ5y4I4\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1631662020;\n\tbh=9a9cuu0GtywvUIO1lrQieMlcOiWfwjCVS2fWqaJkknM=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=usZ5y4I4MYalT/RJ9z7kmwjgGBKQqRNRjKCPcQvBredOYjeXFeHHBAzNZtwAV3ZGL\n\tQ2Va0HzUZVxvV5cAOOEWJoK4Qqcgt/n2FUCMa9Wh/vv5AW3CBXAp2+mYa1C7XQYEld\n\tUpf1KiSr2QoigaCZFpvNLmU33hTaBXIZC+sjk9fg=","Date":"Wed, 15 Sep 2021 02:26:35 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Paul Elder <paul.elder@ideasonboard.com>","Message-ID":"<YUEvq3uBHSGTDejg@pendragon.ideasonboard.com>","References":"<20210913073125.1755107-1-paul.elder@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20210913073125.1755107-1-paul.elder@ideasonboard.com>","Subject":"Re: [libcamera-devel] [RFC PATCH] android: Plumb lens focus distance","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":20954,"web_url":"https://patchwork.libcamera.org/comment/20954/","msgid":"<163698547914.2655227.14142295716688236588@Monstersaurus>","date":"2021-11-15T14:11:19","subject":"Re: [libcamera-devel] [RFC PATCH] android: Plumb lens focus distance","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Laurent Pinchart (2021-09-15 00:26:35)\n> Hi Paul,\n> \n> Thank you for the patch.\n> \n> On Mon, Sep 13, 2021 at 04:31:25PM +0900, Paul Elder wrote:\n> > Plumb the controls related to lens focus distance:\n> > - LENS_INFO_FOCUS_DISTANCE_CALIBRATION (static)\n> > - LENS_INFO_MINIMUM_FOCUS_DISTANCE (static)\n> > - LENS_FOCUS_DISTANCE (request, result)\n> > \n> > Conceptually, the first two controls determine the range of possible\n> > values of the third. None of our lenses are calibrated, so hardcode the\n> > first to uncalibrated. The valid focus distances are then [0, min].\n> > Since we don't yet support variable-focus lenses, hardcode the second to\n> > 0.0f, making the range of valid focus distances [0, 0]. Hence, hardcode\n> > the focus distance in the result metadata to 0, and ignore the control\n> > in the request. Add todos for adding proper controls later, once we have\n> > focus support.\n> > \n> > Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>\n> > ---\n> > This is also on top of my ctsw branch, so it won't apply on master, but\n> > I would like comments to confirm the direction and design.\n> > ---\n> >  src/android/camera_capabilities.cpp | 13 +++++++++++++\n> >  src/android/camera_device.cpp       |  4 ++++\n> >  2 files changed, 17 insertions(+)\n> > \n> > diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp\n> > index 461c208b..a807712d 100644\n> > --- a/src/android/camera_capabilities.cpp\n> > +++ b/src/android/camera_capabilities.cpp\n> > @@ -717,6 +717,7 @@ int CameraCapabilities::initializeStaticMetadata()\n> >               ANDROID_LENS_INFO_AVAILABLE_APERTURES,\n> >               ANDROID_LENS_INFO_AVAILABLE_FOCAL_LENGTHS,\n> >               ANDROID_LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION,\n> > +             ANDROID_LENS_INFO_FOCUS_DISTANCE_CALIBRATION,\n> >               ANDROID_LENS_INFO_HYPERFOCAL_DISTANCE,\n> >               ANDROID_LENS_INFO_MINIMUM_FOCUS_DISTANCE,\n> >               ANDROID_NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES,\n> > @@ -805,6 +806,7 @@ int CameraCapabilities::initializeStaticMetadata()\n> >               ANDROID_JPEG_THUMBNAIL_SIZE,\n> >               ANDROID_LENS_APERTURE,\n> >               ANDROID_LENS_FOCAL_LENGTH,\n> > +             ANDROID_LENS_FOCUS_DISTANCE,\n> >               ANDROID_LENS_OPTICAL_STABILIZATION_MODE,\n> >               ANDROID_LENS_STATE,\n> >               ANDROID_NOISE_REDUCTION_MODE,\n> > @@ -1247,10 +1249,21 @@ int CameraCapabilities::initializeStaticMetadata()\n> >       staticMetadata_->addEntry(ANDROID_LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION,\n> >                                 opticalStabilizations);\n> >  \n> > +     /*\n> > +      * Must be populated for FULL, optional for LIMITED. The value doesn't\n> > +      * matter, so just hardcode to uncalibrated. Uncalibrated means that\n> > +      * the max focus distance is zero (= infinite focus) and the min focus\n> > +      * distance is specified in LENS_INFO_MINIMUM_FOCUS_DISTANCE.\n> > +      */\n> > +     int distanceCalibration = ANDROID_LENS_INFO_FOCUS_DISTANCE_CALIBRATION_UNCALIBRATED;\n> > +     staticMetadata_->addEntry(ANDROID_LENS_INFO_FOCUS_DISTANCE_CALIBRATION,\n> > +                               distanceCalibration);\n> > +\n> >       float hypeFocalDistance = 0;\n> >       staticMetadata_->addEntry(ANDROID_LENS_INFO_HYPERFOCAL_DISTANCE,\n> >                                 hypeFocalDistance);\n> >  \n> > +     /* \\todo Get this from the HAL config. */\n> \n> Once we'll have focus support in the libcamera core, I think this will\n> come from libcamera, not the HAL config. The minimum focus distance is\n> useful in general.\n> \n> With this todo updated,\n> \n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> \n> >       float minFocusDistance = 0;\n> >       staticMetadata_->addEntry(ANDROID_LENS_INFO_MINIMUM_FOCUS_DISTANCE,\n> >                                 minFocusDistance);\n> > diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\n> > index 373e0f98..cfbb84aa 100644\n> > --- a/src/android/camera_device.cpp\n> > +++ b/src/android/camera_device.cpp\n> > @@ -1396,6 +1396,10 @@ CameraDevice::getResultMetadata(const Camera3RequestDescriptor &descriptor) cons\n> >       float focal_length = 1.0;\n> >       resultMetadata->addEntry(ANDROID_LENS_FOCAL_LENGTH, focal_length);\n> >  \n> > +     /* \\todo Add a libcamera control for this, and plumb it. */\n\nGiven the discussions at : [0], Perhaps we should start by adding a\ndraft control directly?\n\n[0] https://lists.libcamera.org/pipermail/libcamera-devel/2021-November/026991.html\n\n\n> > +     float focalDistance = 0.0;\n> > +     resultMetadata->addEntry(ANDROID_LENS_FOCUS_DISTANCE, focalDistance);\n\nWill we mandate that metadata is provided in completed requests? (like\nthis one) or will we 'fill in a default' if it's not available.\n\nIf the completed request doesn't report a lens focus distance do we\nsimply not return a value to Android? or return the previous value\nmaybe?\n\n\n\n> > +\n> >       value = ANDROID_LENS_STATE_STATIONARY;\n> >       resultMetadata->addEntry(ANDROID_LENS_STATE, value);\n> >  \n> \n> -- \n> Regards,\n> \n> Laurent Pinchart","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 70DADBDB1C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 15 Nov 2021 14:11:24 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 7D98960368;\n\tMon, 15 Nov 2021 15:11:23 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1D84D6033C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 15 Nov 2021 15:11:22 +0100 (CET)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 9E1779CA;\n\tMon, 15 Nov 2021 15:11:21 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"Kx6MfuA0\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1636985481;\n\tbh=BM/5KweMVMeRhE0HTwHFX+h7uGbKukeyD0AtRykV9Wg=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=Kx6MfuA0gr1rwxKT9s2rQxsCVgVmtn2yf0jFaFUo47SADEg5eUJQA2rvXbUzJF5RY\n\tvAA7pxr2OGoWjmktygIih/5pPF16jbFvok1K+DJ6Abg1aqnaE6IIx/E/4slfv4hzap\n\tf47IBFLzFn+usipHQHRc/XDeedUrCw9Kj8bD6bIk=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<YUEvq3uBHSGTDejg@pendragon.ideasonboard.com>","References":"<20210913073125.1755107-1-paul.elder@ideasonboard.com>\n\t<YUEvq3uBHSGTDejg@pendragon.ideasonboard.com>","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tPaul Elder <paul.elder@ideasonboard.com>,\n\tDavid Plowman <david.plowman@raspberrypi.com>","Date":"Mon, 15 Nov 2021 14:11:19 +0000","Message-ID":"<163698547914.2655227.14142295716688236588@Monstersaurus>","User-Agent":"alot/0.10","Subject":"Re: [libcamera-devel] [RFC PATCH] android: Plumb lens focus distance","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":21109,"web_url":"https://patchwork.libcamera.org/comment/21109/","msgid":"<7420ff57-c805-ee7b-d65e-597afa73a480@ideasonboard.com>","date":"2021-11-23T05:03:43","subject":"Re: [libcamera-devel] [RFC PATCH] android: Plumb lens focus distance","submitter":{"id":86,"url":"https://patchwork.libcamera.org/api/people/86/","name":"Umang Jain","email":"umang.jain@ideasonboard.com"},"content":"Hi Paul\n\nOn 9/13/21 1:01 PM, Paul Elder wrote:\n> Plumb the controls related to lens focus distance:\n> - LENS_INFO_FOCUS_DISTANCE_CALIBRATION (static)\n> - LENS_INFO_MINIMUM_FOCUS_DISTANCE (static)\n> - LENS_FOCUS_DISTANCE (request, result)\n>\n> Conceptually, the first two controls determine the range of possible\n> values of the third. None of our lenses are calibrated, so hardcode the\n> first to uncalibrated. The valid focus distances are then [0, min].\n> Since we don't yet support variable-focus lenses, hardcode the second to\n> 0.0f, making the range of valid focus distances [0, 0]. Hence, hardcode\n> the focus distance in the result metadata to 0, and ignore the control\n> in the request. Add todos for adding proper controls later, once we have\n> focus support.\n>\n> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>\n> ---\n> This is also on top of my ctsw branch, so it won't apply on master, but\n> I would like comments to confirm the direction and design.\n> ---\n>   src/android/camera_capabilities.cpp | 13 +++++++++++++\n>   src/android/camera_device.cpp       |  4 ++++\n>   2 files changed, 17 insertions(+)\n>\n> diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp\n> index 461c208b..a807712d 100644\n> --- a/src/android/camera_capabilities.cpp\n> +++ b/src/android/camera_capabilities.cpp\n> @@ -717,6 +717,7 @@ int CameraCapabilities::initializeStaticMetadata()\n>   \t\tANDROID_LENS_INFO_AVAILABLE_APERTURES,\n>   \t\tANDROID_LENS_INFO_AVAILABLE_FOCAL_LENGTHS,\n>   \t\tANDROID_LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION,\n> +\t\tANDROID_LENS_INFO_FOCUS_DISTANCE_CALIBRATION,\n>   \t\tANDROID_LENS_INFO_HYPERFOCAL_DISTANCE,\n>   \t\tANDROID_LENS_INFO_MINIMUM_FOCUS_DISTANCE,\n>   \t\tANDROID_NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES,\n> @@ -805,6 +806,7 @@ int CameraCapabilities::initializeStaticMetadata()\n>   \t\tANDROID_JPEG_THUMBNAIL_SIZE,\n>   \t\tANDROID_LENS_APERTURE,\n>   \t\tANDROID_LENS_FOCAL_LENGTH,\n> +\t\tANDROID_LENS_FOCUS_DISTANCE,\n>   \t\tANDROID_LENS_OPTICAL_STABILIZATION_MODE,\n>   \t\tANDROID_LENS_STATE,\n>   \t\tANDROID_NOISE_REDUCTION_MODE,\n> @@ -1247,10 +1249,21 @@ int CameraCapabilities::initializeStaticMetadata()\n>   \tstaticMetadata_->addEntry(ANDROID_LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION,\n>   \t\t\t\t  opticalStabilizations);\n>   \n> +\t/*\n> +\t * Must be populated for FULL, optional for LIMITED. The value doesn't\n> +\t * matter, so just hardcode to uncalibrated. Uncalibrated means that\n> +\t * the max focus distance is zero (= infinite focus) and the min focus\n> +\t * distance is specified in LENS_INFO_MINIMUM_FOCUS_DISTANCE.\n> +\t */\n> +\tint distanceCalibration = ANDROID_LENS_INFO_FOCUS_DISTANCE_CALIBRATION_UNCALIBRATED;\n> +\tstaticMetadata_->addEntry(ANDROID_LENS_INFO_FOCUS_DISTANCE_CALIBRATION,\n> +\t\t\t\t  distanceCalibration);\n> +\n>   \tfloat hypeFocalDistance = 0;\n>   \tstaticMetadata_->addEntry(ANDROID_LENS_INFO_HYPERFOCAL_DISTANCE,\n>   \t\t\t\t  hypeFocalDistance);\n>   \n> +\t/* \\todo Get this from the HAL config. */\n>   \tfloat minFocusDistance = 0;\n>   \tstaticMetadata_->addEntry(ANDROID_LENS_INFO_MINIMUM_FOCUS_DISTANCE,\n>   \t\t\t\t  minFocusDistance);\n> diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\n> index 373e0f98..cfbb84aa 100644\n> --- a/src/android/camera_device.cpp\n> +++ b/src/android/camera_device.cpp\n> @@ -1396,6 +1396,10 @@ CameraDevice::getResultMetadata(const Camera3RequestDescriptor &descriptor) cons\n>   \tfloat focal_length = 1.0;\n>   \tresultMetadata->addEntry(ANDROID_LENS_FOCAL_LENGTH, focal_length);\n>   \n> +\t/* \\todo Add a libcamera control for this, and plumb it. */\n\n\nIf I remember the discussion from last week correctly, we agreed to \nintroduce controls to report this metadata right? The setting of the \ncontrol will then be set in the IPA and read here ?\n\nIf that's something you need help with (or if the plans have changed), \nplease let me know. I came here since I was looking at \nhttps://bugs.libcamera.org/show_bug.cgi?id=52\n\n> +\tfloat focalDistance = 0.0;\n> +\tresultMetadata->addEntry(ANDROID_LENS_FOCUS_DISTANCE, focalDistance);\n> +\n>   \tvalue = ANDROID_LENS_STATE_STATIONARY;\n>   \tresultMetadata->addEntry(ANDROID_LENS_STATE, value);\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id BEC6FBDB13\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 23 Nov 2021 05:03:52 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id CEAD86036F;\n\tTue, 23 Nov 2021 06:03:51 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B2F3660227\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 23 Nov 2021 06:03:49 +0100 (CET)","from [192.168.1.106] (unknown [103.251.226.81])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 2DD9AA1B;\n\tTue, 23 Nov 2021 06:03:47 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"mTBgL/p3\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1637643828;\n\tbh=NFm8ts/d7LfV4zzQ5qKNj9NT3eL79hVQKYkznXGDl/w=;\n\th=Subject:To:References:From:Date:In-Reply-To:From;\n\tb=mTBgL/p3xonjyMFQxANrxF1XRJTxdcB+af5yuLLqGz6h1VrmZp+s3hWrm1wHhn5qc\n\tX/OkI6kIYHQsMqD8zg8UWazxtxjViJ/3RVZoUnviKejC60I3xHy9JBEBo+sfamx3fB\n\tfVOlKfRVuiqCTwI2nbh9euXkOVbWj3/Na0EgcugE=","To":"Paul Elder <paul.elder@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20210913073125.1755107-1-paul.elder@ideasonboard.com>","From":"Umang Jain <umang.jain@ideasonboard.com>","Message-ID":"<7420ff57-c805-ee7b-d65e-597afa73a480@ideasonboard.com>","Date":"Tue, 23 Nov 2021 10:33:43 +0530","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101\n\tThunderbird/78.10.2","MIME-Version":"1.0","In-Reply-To":"<20210913073125.1755107-1-paul.elder@ideasonboard.com>","Content-Type":"text/plain; charset=utf-8; format=flowed","Content-Transfer-Encoding":"7bit","Content-Language":"en-US","Subject":"Re: [libcamera-devel] [RFC PATCH] android: Plumb lens focus distance","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]