[{"id":4879,"web_url":"https://patchwork.libcamera.org/comment/4879/","msgid":"<20200521012313.GJ25474@pendragon.ideasonboard.com>","date":"2020-05-21T01:23:13","subject":"Re: [libcamera-devel] [PATCH v3 2/2] libcamera: camera_sensor:\n\tUpdate properties parsing","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Jacopo,\n\nThank you for the patch.\n\nOn Wed, May 20, 2020 at 01:48:12PM +0200, Jacopo Mondi wrote:\n> Update the properties parsing routine in the CameraSensor class to use\n> the newly defined V4L2 control V4L2_CID_CAMERA_ORIENTATION in place of\n> the downstream V4L2_CID_CAMERA_SENSOR_LOCATION which has now been\n> removed.\n> \n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> ---\n>  src/libcamera/camera_sensor.cpp | 17 ++++++++---------\n>  1 file changed, 8 insertions(+), 9 deletions(-)\n> \n> diff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp\n> index 174df17cfaef..b14b4051dca6 100644\n> --- a/src/libcamera/camera_sensor.cpp\n> +++ b/src/libcamera/camera_sensor.cpp\n> @@ -210,24 +210,23 @@ int CameraSensor::init()\n>  \tint32_t propertyValue;\n>  \n>  \t/* Camera Location: default is front location. */\n> -\tconst auto &locationControl = controls.find(V4L2_CID_CAMERA_SENSOR_LOCATION);\n> -\tif (locationControl != controls.end()) {\n> -\t\tint32_t v4l2Location =\n> -\t\t\tlocationControl->second.def().get<int32_t>();\n> +\tconst auto &orientation = controls.find(V4L2_CID_CAMERA_ORIENTATION);\n> +\tif (orientation != controls.end()) {\n> +\t\tint32_t v4l2Orientation = orientation->second.def().get<int32_t>();\n>  \n> -\t\tswitch (v4l2Location) {\n> +\t\tswitch (v4l2Orientation) {\n>  \t\tdefault:\n>  \t\t\tLOG(CameraSensor, Warning)\n>  \t\t\t\t<< \"Unsupported camera location \"\n> -\t\t\t\t<< v4l2Location << \", setting to Front\";\n> +\t\t\t\t<< v4l2Orientation << \", setting to Front\";\n>  \t\t\t/* Fall-through */\n> -\t\tcase V4L2_LOCATION_FRONT:\n> +\t\tcase V4L2_CAMERA_ORIENTATION_FRONT:\n>  \t\t\tpropertyValue = properties::CameraLocationFront;\n>  \t\t\tbreak;\n> -\t\tcase V4L2_LOCATION_BACK:\n> +\t\tcase V4L2_CAMERA_ORIENTATION_BACK:\n>  \t\t\tpropertyValue = properties::CameraLocationBack;\n>  \t\t\tbreak;\n> -\t\tcase V4L2_LOCATION_EXTERNAL:\n> +\t\tcase V4L2_CAMERA_ORIENTATION_EXTERNAL:\n>  \t\t\tpropertyValue = properties::CameraLocationExternal;\n>  \t\t\tbreak;\n>  \t\t}","headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1E642603D4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 21 May 2020 03:23:25 +0200 (CEST)","from pendragon.ideasonboard.com (81-175-216-236.bb.dnainternet.fi\n\t[81.175.216.236])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 9C44524D;\n\tThu, 21 May 2020 03:23:24 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"hdjQB1H4\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1590024204;\n\tbh=aPT1jdkvZs/tXmQcVLjQv7xL1f5Jw5eOGWrir8kfOxY=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=hdjQB1H4+X9t3qrBGFpnLE20u1q9hup58YiH/wYl/GuvaxZ5uxFDIRIb36712dRtJ\n\tVxop2DYP1QWbt8I4hYlzUxAv/kD/KiyHy2Q0VpolWLiSajkszIX9RYjyRhgsJbZucM\n\tYsa3IUgimvKUT1yRLdyyiZ6IDgOeJzp55tBYZ4S0=","Date":"Thu, 21 May 2020 04:23:13 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20200521012313.GJ25474@pendragon.ideasonboard.com>","References":"<20200520114812.440695-1-jacopo@jmondi.org>\n\t<20200520114812.440695-2-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20200520114812.440695-2-jacopo@jmondi.org>","Subject":"Re: [libcamera-devel] [PATCH v3 2/2] libcamera: camera_sensor:\n\tUpdate properties parsing","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>","X-List-Received-Date":"Thu, 21 May 2020 01:23:25 -0000"}}]