Patch Detail
Show a patch.
GET /api/patches/2136/?format=api
{ "id": 2136, "url": "https://patchwork.libcamera.org/api/patches/2136/?format=api", "web_url": "https://patchwork.libcamera.org/patch/2136/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20191007224642.6597-9-laurent.pinchart@ideasonboard.com>", "date": "2019-10-07T22:46:41", "name": "[libcamera-devel,8/9] libcamera: v4l2_controls: Remove V4L2ControlInfo type field", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "682bee370db4809d5bb2be41ce1855657d307a9a", "submitter": { "id": 2, "url": "https://patchwork.libcamera.org/api/people/2/?format=api", "name": "Laurent Pinchart", "email": "laurent.pinchart@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/2136/mbox/", "series": [ { "id": 526, "url": "https://patchwork.libcamera.org/api/series/526/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=526", "date": "2019-10-07T22:46:33", "name": "Use ControlList for both libcamera and V4L2 controls", "version": 1, "mbox": "https://patchwork.libcamera.org/series/526/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/2136/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/2136/checks/", "tags": {}, "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 929826197A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 8 Oct 2019 00:46:58 +0200 (CEST)", "from pendragon.ideasonboard.com\n\t(modemcable118.64-20-96.mc.videotron.ca [96.20.64.118])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id B1FB7B2D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 8 Oct 2019 00:46:57 +0200 (CEST)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1570488418;\n\tbh=qp6YVjF2+RZfNWa91P1S76as2yhZ8jHLX2J/NfMV4uY=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=CkQ59IklX74ECkJGqYA3msc8qSewm3p6bfggbkELUJjO52nX6+6+otTpr+/rvk8dH\n\t4woeYXgRr31SV89k0hzYHSv78GSYLZ01+mT4cCzTgMGp09OobKyJ/ZuuEaKh3SMmW5\n\t5XZiDRpwj4sPYFdg+YUU/TeSJyUy5Wg3IIPp9EQ4=", "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Tue, 8 Oct 2019 01:46:41 +0300", "Message-Id": "<20191007224642.6597-9-laurent.pinchart@ideasonboard.com>", "X-Mailer": "git-send-email 2.21.0", "In-Reply-To": "<20191007224642.6597-1-laurent.pinchart@ideasonboard.com>", "References": "<20191007224642.6597-1-laurent.pinchart@ideasonboard.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH 8/9] libcamera: v4l2_controls: Remove\n\tV4L2ControlInfo type field", "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": "Mon, 07 Oct 2019 22:46:58 -0000" }, "content": "The V4L2ControlInfo type field stores the V4L2 control type. It partly\nduplicates the V4L2ControlInfo id().type() that stores the corresponding\nlibcamera control type. The two fields are not strictly identical, but\nhaving two types doesn't provide us with any extra value. As this is\nconfusing, remove the V4L2ControlInfo type field.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/libcamera/include/v4l2_controls.h | 2 --\n src/libcamera/v4l2_controls.cpp | 7 -------\n src/libcamera/v4l2_device.cpp | 10 +++++-----\n 3 files changed, 5 insertions(+), 14 deletions(-)", "diff": "diff --git a/src/libcamera/include/v4l2_controls.h b/src/libcamera/include/v4l2_controls.h\nindex 1d85ecf9864a..133ab9ec208b 100644\n--- a/src/libcamera/include/v4l2_controls.h\n+++ b/src/libcamera/include/v4l2_controls.h\n@@ -31,14 +31,12 @@ public:\n \tV4L2ControlInfo(const struct v4l2_query_ext_ctrl &ctrl);\n \n \tconst ControlId &id() const { return id_; }\n-\tunsigned int type() const { return type_; }\n \tsize_t size() const { return size_; }\n \n \tconst ControlRange &range() const { return range_; }\n \n private:\n \tV4L2ControlId id_;\n-\tunsigned int type_;\n \tsize_t size_;\n \n \tControlRange range_;\ndiff --git a/src/libcamera/v4l2_controls.cpp b/src/libcamera/v4l2_controls.cpp\nindex 98b2b3fe9d0a..d3f94709e821 100644\n--- a/src/libcamera/v4l2_controls.cpp\n+++ b/src/libcamera/v4l2_controls.cpp\n@@ -127,7 +127,6 @@ V4L2ControlId::V4L2ControlId(const struct v4l2_query_ext_ctrl &ctrl)\n V4L2ControlInfo::V4L2ControlInfo(const struct v4l2_query_ext_ctrl &ctrl)\n \t: id_(ctrl)\n {\n-\ttype_ = ctrl.type;\n \tsize_ = ctrl.elem_size * ctrl.elems;\n \n \tif (ctrl.type == V4L2_CTRL_TYPE_INTEGER64)\n@@ -144,12 +143,6 @@ V4L2ControlInfo::V4L2ControlInfo(const struct v4l2_query_ext_ctrl &ctrl)\n * \\return The V4L2 control ID\n */\n \n-/**\n- * \\fn V4L2ControlInfo::type()\n- * \\brief Retrieve the control type as defined by V4L2_CTRL_TYPE_*\n- * \\return The V4L2 control type\n- */\n-\n /**\n * \\fn V4L2ControlInfo::size()\n * \\brief Retrieve the control value data size (in bytes)\ndiff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp\nindex 50616571dcef..b64e5068a671 100644\n--- a/src/libcamera/v4l2_device.cpp\n+++ b/src/libcamera/v4l2_device.cpp\n@@ -269,8 +269,8 @@ int V4L2Device::setControls(ControlList *ctrls)\n \n \t\t/* Set the v4l2_ext_control value for the write operation. */\n \t\tconst ControlValue &value = ctrl.second;\n-\t\tswitch (info->type()) {\n-\t\tcase V4L2_CTRL_TYPE_INTEGER64:\n+\t\tswitch (info->id().type()) {\n+\t\tcase ControlTypeInteger64:\n \t\t\tv4l2Ctrls[i].value64 = value.get<int64_t>();\n \t\t\tbreak;\n \t\tdefault:\n@@ -278,7 +278,7 @@ int V4L2Device::setControls(ControlList *ctrls)\n \t\t\t * \\todo To be changed when support for string and\n \t\t\t * compound controls will be added.\n \t\t\t */\n-\t\t\tv4l2Ctrls[i].value64 = value.get<int32_t>();\n+\t\t\tv4l2Ctrls[i].value = value.get<int32_t>();\n \t\t\tbreak;\n \t\t}\n \n@@ -402,8 +402,8 @@ void V4L2Device::updateControls(ControlList *ctrls,\n \t\tconst V4L2ControlInfo *info = controlInfo[i];\n \t\tControlValue &value = ctrl.second;\n \n-\t\tswitch (info->type()) {\n-\t\tcase V4L2_CTRL_TYPE_INTEGER64:\n+\t\tswitch (info->id().type()) {\n+\t\tcase ControlTypeInteger64:\n \t\t\tvalue.set<int64_t>(v4l2Ctrl->value64);\n \t\t\tbreak;\n \t\tdefault:\n", "prefixes": [ "libcamera-devel", "8/9" ] }