Patch Detail
Show a patch.
GET /api/patches/2192/?format=api
{ "id": 2192, "url": "https://patchwork.libcamera.org/api/patches/2192/?format=api", "web_url": "https://patchwork.libcamera.org/patch/2192/", "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": "<20191013233314.4434-1-laurent.pinchart@ideasonboard.com>", "date": "2019-10-13T23:33:14", "name": "[libcamera-devel,10/10] libcamera: v4l2_controls: Remove V4L2ControlList class", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "bb8fcab65308fc0ca3df9bc98de0088365d43682", "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/2192/mbox/", "series": [ { "id": 534, "url": "https://patchwork.libcamera.org/api/series/534/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=534", "date": "2019-10-13T23:27:46", "name": "Merge V4L2ControlInfoMap and ControlInfoMap", "version": 1, "mbox": "https://patchwork.libcamera.org/series/534/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/2192/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/2192/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 8631961563\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 14 Oct 2019 01:33:21 +0200 (CEST)", "from pendragon.bb.dnainternet.fi\n\t(dfj612yhrgyx302h3jwwy-3.rev.dnainternet.fi\n\t[IPv6:2001:14ba:21f5:5b00:ce28:277f:58d7:3ca4])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 0C81C33A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 14 Oct 2019 01:33:20 +0200 (CEST)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1571009601;\n\tbh=BPWhUKkkGasKdBMhZF2Tha1m7WZpEfLt4jka6PbfKeQ=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=WgBKv4qS3UfPULkTtsCvTRIueVZJKTGRQCjrYukqBtczI/56bpOeNzfFsV28jK57L\n\tVYeZy0dZLpLygTMfzVheHSMi+VrKy3bUZV1X29AYqpg6oRxozG12GOAIvhT17+lZ+H\n\tmgUQ3VMAtFRAPPOVKlGj+E3aLoNNjlNLC55B2mho=", "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Mon, 14 Oct 2019 02:33:14 +0300", "Message-Id": "<20191013233314.4434-1-laurent.pinchart@ideasonboard.com>", "X-Mailer": "git-send-email 2.21.0", "In-Reply-To": "<20191013232755.3292-1-laurent.pinchart@ideasonboard.com>", "References": "<20191013232755.3292-1-laurent.pinchart@ideasonboard.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH 10/10] libcamera: v4l2_controls: Remove\n\tV4L2ControlList class", "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": "Sun, 13 Oct 2019 23:33:21 -0000" }, "content": "The V4L2ControlList class only provides a convenience constructor for\nthe ControlList, which can easily be moved to the ControlList class and\nmay benefit it later (to construct a ControlList from controls supported\nby a camera). Move the constructor and remove V4L2ControlList.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n include/libcamera/controls.h | 1 +\n src/ipa/rkisp1/rkisp1.cpp | 2 +-\n src/libcamera/controls.cpp | 10 ++++++++++\n src/libcamera/include/v4l2_controls.h | 14 --------------\n src/libcamera/pipeline/ipu3/ipu3.cpp | 2 +-\n src/libcamera/pipeline/uvcvideo.cpp | 2 +-\n src/libcamera/pipeline/vimc.cpp | 2 +-\n src/libcamera/v4l2_controls.cpp | 20 --------------------\n test/v4l2_videodevice/controls.cpp | 2 +-\n 9 files changed, 16 insertions(+), 39 deletions(-)", "diff": "diff --git a/include/libcamera/controls.h b/include/libcamera/controls.h\nindex 80414c6f0748..0d279d508dcc 100644\n--- a/include/libcamera/controls.h\n+++ b/include/libcamera/controls.h\n@@ -170,6 +170,7 @@ private:\n \n public:\n \tControlList(const ControlIdMap &idmap, ControlValidator *validator = nullptr);\n+\tControlList(const ControlInfoMap &info, ControlValidator *validator = nullptr);\n \n \tusing iterator = ControlListMap::iterator;\n \tusing const_iterator = ControlListMap::const_iterator;\ndiff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp\nindex bd703898c523..570145ce71b2 100644\n--- a/src/ipa/rkisp1/rkisp1.cpp\n+++ b/src/ipa/rkisp1/rkisp1.cpp\n@@ -212,7 +212,7 @@ void IPARkISP1::setControls(unsigned int frame)\n \tIPAOperationData op;\n \top.operation = RKISP1_IPA_ACTION_V4L2_SET;\n \n-\tV4L2ControlList ctrls(ctrls_);\n+\tControlList ctrls(ctrls_);\n \tctrls.set(V4L2_CID_EXPOSURE, static_cast<int32_t>(exposure_));\n \tctrls.set(V4L2_CID_ANALOGUE_GAIN, static_cast<int32_t>(gain_));\n \top.controls.push_back(ctrls);\ndiff --git a/src/libcamera/controls.cpp b/src/libcamera/controls.cpp\nindex bf7634aab470..93ad2fc6a276 100644\n--- a/src/libcamera/controls.cpp\n+++ b/src/libcamera/controls.cpp\n@@ -561,6 +561,16 @@ ControlList::ControlList(const ControlIdMap &idmap, ControlValidator *validator)\n {\n }\n \n+/**\n+ * \\brief Construct a ControlList with the idmap of a control info map\n+ * \\param[in] info The ControlInfoMap for the control list target object\n+ * \\param[in] validator The validator (may be null)\n+ */\n+ControlList::ControlList(const ControlInfoMap &info, ControlValidator *validator)\n+\t: validator_(validator), idmap_(&info.idmap())\n+{\n+}\n+\n /**\n * \\typedef ControlList::iterator\n * \\brief Iterator for the controls contained within the list\ndiff --git a/src/libcamera/include/v4l2_controls.h b/src/libcamera/include/v4l2_controls.h\nindex e16c4957f9d1..882546a89340 100644\n--- a/src/libcamera/include/v4l2_controls.h\n+++ b/src/libcamera/include/v4l2_controls.h\n@@ -8,11 +8,6 @@\n #ifndef __LIBCAMERA_V4L2_CONTROLS_H__\n #define __LIBCAMERA_V4L2_CONTROLS_H__\n \n-#include <map>\n-#include <stdint.h>\n-#include <string>\n-#include <vector>\n-\n #include <linux/videodev2.h>\n \n #include <libcamera/controls.h>\n@@ -31,15 +26,6 @@ public:\n \tV4L2ControlRange(const struct v4l2_query_ext_ctrl &ctrl);\n };\n \n-class V4L2ControlList : public ControlList\n-{\n-public:\n-\tV4L2ControlList(const ControlInfoMap &info)\n-\t\t: ControlList(info.idmap())\n-\t{\n-\t}\n-};\n-\n } /* namespace libcamera */\n \n #endif /* __LIBCAMERA_V4L2_CONTROLS_H__ */\ndiff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\nindex 9776b36b88cd..8d3ad568d16e 100644\n--- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n@@ -604,7 +604,7 @@ int PipelineHandlerIPU3::configure(Camera *camera, CameraConfiguration *c)\n \t\treturn ret;\n \n \t/* Apply the \"pipe_mode\" control to the ImgU subdevice. */\n-\tV4L2ControlList ctrls(imgu->imgu_->controls());\n+\tControlList ctrls(imgu->imgu_->controls());\n \tctrls.set(V4L2_CID_IPU3_PIPE_MODE,\n \t\t static_cast<int32_t>(vfStream->active_ ? IPU3PipeModeVideo :\n \t\t\t\t IPU3PipeModeStillCapture));\ndiff --git a/src/libcamera/pipeline/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo.cpp\nindex a64e1af4c550..fae0ffc4de30 100644\n--- a/src/libcamera/pipeline/uvcvideo.cpp\n+++ b/src/libcamera/pipeline/uvcvideo.cpp\n@@ -228,7 +228,7 @@ void PipelineHandlerUVC::stop(Camera *camera)\n \n int PipelineHandlerUVC::processControls(UVCCameraData *data, Request *request)\n {\n-\tV4L2ControlList controls(data->video_->controls());\n+\tControlList controls(data->video_->controls());\n \n \tfor (auto it : request->controls()) {\n \t\tconst ControlId &id = *it.first;\ndiff --git a/src/libcamera/pipeline/vimc.cpp b/src/libcamera/pipeline/vimc.cpp\nindex 6a4244119dc5..dcdaef120ad1 100644\n--- a/src/libcamera/pipeline/vimc.cpp\n+++ b/src/libcamera/pipeline/vimc.cpp\n@@ -279,7 +279,7 @@ void PipelineHandlerVimc::stop(Camera *camera)\n \n int PipelineHandlerVimc::processControls(VimcCameraData *data, Request *request)\n {\n-\tV4L2ControlList controls(data->sensor_->controls());\n+\tControlList controls(data->sensor_->controls());\n \n \tfor (auto it : request->controls()) {\n \t\tconst ControlId &id = *it.first;\ndiff --git a/src/libcamera/v4l2_controls.cpp b/src/libcamera/v4l2_controls.cpp\nindex bd5e18590b76..83ac7b0dc666 100644\n--- a/src/libcamera/v4l2_controls.cpp\n+++ b/src/libcamera/v4l2_controls.cpp\n@@ -134,24 +134,4 @@ V4L2ControlRange::V4L2ControlRange(const struct v4l2_query_ext_ctrl &ctrl)\n \t\t\t\t\t\t static_cast<int32_t>(ctrl.maximum)));\n }\n \n-/**\n- * \\class V4L2ControlList\n- * \\brief A list of controls for a V4L2 device\n- *\n- * This class specialises the ControList class for use with V4L2 devices. It\n- * offers a convenience API to create a ControlList from a ControlInfoMap.\n- *\n- * V4L2ControlList allows easy construction of a ControlList containing V4L2\n- * controls for a device. It can be used to construct the list of controls\n- * passed to the V4L2Device::getControls() and V4L2Device::setControls()\n- * methods. The class should however not be used in place of ControlList in\n- * APIs.\n- */\n-\n-/**\n- * \\fn V4L2ControlList::V4L2ControlList(const ControlInfoMap &info)\n- * \\brief Construct a V4L2ControlList associated with a V4L2 device\n- * \\param[in] info The V4L2 device control info map\n- */\n-\n } /* namespace libcamera */\ndiff --git a/test/v4l2_videodevice/controls.cpp b/test/v4l2_videodevice/controls.cpp\nindex 31879b794ed0..975c852b8cbf 100644\n--- a/test/v4l2_videodevice/controls.cpp\n+++ b/test/v4l2_videodevice/controls.cpp\n@@ -46,7 +46,7 @@ protected:\n \t\tconst ControlRange &saturation = info.find(V4L2_CID_SATURATION)->second;\n \n \t\t/* Test getting controls. */\n-\t\tV4L2ControlList ctrls(info);\n+\t\tControlList ctrls(info);\n \t\tctrls.set(V4L2_CID_BRIGHTNESS, -1);\n \t\tctrls.set(V4L2_CID_CONTRAST, -1);\n \t\tctrls.set(V4L2_CID_SATURATION, -1);\n", "prefixes": [ "libcamera-devel", "10/10" ] }