[{"id":12325,"web_url":"https://patchwork.libcamera.org/comment/12325/","msgid":"<20200905223007.GP6319@pendragon.ideasonboard.com>","date":"2020-09-05T22:30:07","subject":"Re: [libcamera-devel] [PATCH v7 2/8] libcamera: Allow access to\n\tv4l2_query_ext_ctrl structure for a V4L2 control","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi David,\n\nThank you for the patch.\n\nOn Fri, Sep 04, 2020 at 11:30:36AM +0100, David Plowman wrote:\n> The V4L2Device::controlInfo method simply returns a pointer to the\n> v4l2_query_ext_ctrl structure for the given control, which has already\n> been retrieved and stored.\n> \n> Signed-off-by: David Plowman <david.plowman@raspberrypi.com>\n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> ---\n>  include/libcamera/internal/v4l2_device.h |  2 ++\n>  src/libcamera/v4l2_device.cpp            | 15 +++++++++++++++\n>  2 files changed, 17 insertions(+)\n> \n> diff --git a/include/libcamera/internal/v4l2_device.h b/include/libcamera/internal/v4l2_device.h\n> index 3b605aa..722fb72 100644\n> --- a/include/libcamera/internal/v4l2_device.h\n> +++ b/include/libcamera/internal/v4l2_device.h\n> @@ -29,6 +29,8 @@ public:\n>  \tControlList getControls(const std::vector<uint32_t> &ids);\n>  \tint setControls(ControlList *ctrls);\n>  \n> +\tconst struct v4l2_query_ext_ctrl *controlInfo(uint32_t id) const;\n> +\n>  \tconst std::string &deviceNode() const { return deviceNode_; }\n>  \tstd::string devicePath() const;\n>  \n> diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp\n> index 65830d4..e8399c4 100644\n> --- a/src/libcamera/v4l2_device.cpp\n> +++ b/src/libcamera/v4l2_device.cpp\n> @@ -353,6 +353,21 @@ int V4L2Device::setControls(ControlList *ctrls)\n>  \treturn ret;\n>  }\n>  \n> +/**\n> + * \\brief Return the v4l2_query_ext_ctrl information for the given control.\n\ns/Return/Retrieve/\ns/.$//\n\n> + * \\param[in] id The V4L2 control id\n> + * \\return A pointer to the v4l2_query_ext_ctrl structure for the given\n> + * control, or a null pointer if not found\n> + */\n> +const struct v4l2_query_ext_ctrl *V4L2Device::controlInfo(uint32_t id) const\n> +{\n> +\tconst auto it = controlInfo_.find(id);\n> +\tif (it == controlInfo_.end())\n> +\t\treturn nullptr;\n> +\n> +\treturn &it->second;\n> +}\n> +\n>  /**\n>   * \\brief Retrieve the device path in sysfs\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 71322BDB1C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSat,  5 Sep 2020 22:30:38 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id DBEA362B5B;\n\tSun,  6 Sep 2020 00:30:37 +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 0FBCF60599\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun,  6 Sep 2020 00:30:37 +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 3C169335;\n\tSun,  6 Sep 2020 00:30:31 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"XmS8z8uj\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1599345031;\n\tbh=ForVqgB0mNfxjVE22m+KSta2YZ7O9LwwdX9/nanQXjI=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=XmS8z8ujYhJhSKVlQTHjDGizCHTQfUj/2+LpqGdZIAINQDxSJX7go58/NAg2ew7+N\n\txkG6+hY2WQQcqxo7iB3VMIm0NN9gFgaXCZdWL7VGX121K5yfNHSIjL/TOoSrYZ7HU3\n\tn3fPHJMpMuwnzB+CpemjFC+kBFB80tRHTE4SYgc4=","Date":"Sun, 6 Sep 2020 01:30:07 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"David Plowman <david.plowman@raspberrypi.com>","Message-ID":"<20200905223007.GP6319@pendragon.ideasonboard.com>","References":"<20200904103042.1593-1-david.plowman@raspberrypi.com>\n\t<20200904103042.1593-3-david.plowman@raspberrypi.com>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20200904103042.1593-3-david.plowman@raspberrypi.com>","Subject":"Re: [libcamera-devel] [PATCH v7 2/8] libcamera: Allow access to\n\tv4l2_query_ext_ctrl structure for a V4L2 control","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","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]