Patch Detail
Show a patch.
GET /api/patches/2191/?format=api
{ "id": 2191, "url": "https://patchwork.libcamera.org/api/patches/2191/?format=api", "web_url": "https://patchwork.libcamera.org/patch/2191/", "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": "<20191013232755.3292-10-laurent.pinchart@ideasonboard.com>", "date": "2019-10-13T23:27:55", "name": "[libcamera-devel,09/10] libcamera: controls: Merge ControlInfoMap and V4L2ControlInfoMap", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "ee45baf98f1fa28941b86d6634fae892fb09f781", "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/2191/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/2191/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/2191/checks/", "tags": {}, "headers": { "Return-Path": "<laurent.pinchart@ideasonboard.com>", "Received": [ "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 CFA1E6197F\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 14 Oct 2019 01:28:05 +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 6693C33A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 14 Oct 2019 01:28:05 +0200 (CEST)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1571009285;\n\tbh=MDpr4eiKwDRMeXtOsR14gb1dyNY2IM5IeXVqOjFy6Yc=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=rcuCFC+B3zIsJFBcUVs5Mj34IrRfAoCu/T7Rk0b5DeOlhFJJBp5XBZ2Klzy4vdBqg\n\tyjK18njjix4YQnJofM02P18BXz7nArmPwmm6WQgBTfAezEUZq10tYhXwxTh+AhTAwU\n\tbN7jvQ/+thX47yPFxQckbzbEQ51GYlhTP7bPtn2A=", "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Mon, 14 Oct 2019 02:27:55 +0300", "Message-Id": "<20191013232755.3292-10-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 09/10] libcamera: controls: Merge\n\tControlInfoMap and V4L2ControlInfoMap", "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:28:06 -0000" }, "content": "The ControlInfoMap and V4L2ControlInfoMap classes are very similar, with\nthe latter adding convenience accessors based on numerical IDs for the\nformer, as well as a cached idmap. Both features can be useful for\nControlInfoMap in the context of serialisation, and merging the two\nclasses will further simplify the IPA API.\n\nImport all the features of V4L2ControlInfoMap into ControlInfoMap,\nturning the latter into a real class. A few new constructors and\nassignment operators are added for completeness.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n include/ipa/ipa_interface.h | 2 +-\n include/libcamera/controls.h | 45 +++++++-\n src/ipa/ipa_vimc.cpp | 2 +-\n src/ipa/rkisp1/rkisp1.cpp | 6 +-\n src/libcamera/camera_sensor.cpp | 2 +-\n src/libcamera/controls.cpp | 139 ++++++++++++++++++++++-\n src/libcamera/include/camera_sensor.h | 4 +-\n src/libcamera/include/v4l2_controls.h | 36 +-----\n src/libcamera/include/v4l2_device.h | 4 +-\n src/libcamera/pipeline/rkisp1/rkisp1.cpp | 11 +-\n src/libcamera/pipeline/uvcvideo.cpp | 12 +-\n src/libcamera/pipeline/vimc.cpp | 11 +-\n src/libcamera/proxy/ipa_proxy_linux.cpp | 2 +-\n src/libcamera/v4l2_controls.cpp | 94 +--------------\n src/libcamera/v4l2_device.cpp | 2 +-\n test/v4l2_videodevice/controls.cpp | 2 +-\n 16 files changed, 220 insertions(+), 154 deletions(-)", "diff": "diff --git a/include/ipa/ipa_interface.h b/include/ipa/ipa_interface.h\nindex dfb1bcbee516..8fd658af5fdb 100644\n--- a/include/ipa/ipa_interface.h\n+++ b/include/ipa/ipa_interface.h\n@@ -43,7 +43,7 @@ public:\n \tvirtual int init() = 0;\n \n \tvirtual void configure(const std::map<unsigned int, IPAStream> &streamConfig,\n-\t\t\t const std::map<unsigned int, V4L2ControlInfoMap> &entityControls) = 0;\n+\t\t\t const std::map<unsigned int, ControlInfoMap> &entityControls) = 0;\n \n \tvirtual void mapBuffers(const std::vector<IPABuffer> &buffers) = 0;\n \tvirtual void unmapBuffers(const std::vector<unsigned int> &ids) = 0;\ndiff --git a/include/libcamera/controls.h b/include/libcamera/controls.h\nindex 5534a2edb567..80414c6f0748 100644\n--- a/include/libcamera/controls.h\n+++ b/include/libcamera/controls.h\n@@ -118,7 +118,50 @@ private:\n };\n \n using ControlIdMap = std::unordered_map<unsigned int, const ControlId *>;\n-using ControlInfoMap = std::unordered_map<const ControlId *, ControlRange>;\n+\n+class ControlInfoMap : private std::unordered_map<const ControlId *, ControlRange>\n+{\n+public:\n+\tusing Map = std::unordered_map<const ControlId *, ControlRange>;\n+\n+\tControlInfoMap() = default;\n+\tControlInfoMap(const ControlInfoMap &other) = default;\n+\tControlInfoMap(std::initializer_list<Map::value_type> init);\n+\n+\tControlInfoMap &operator=(const ControlInfoMap &other) = default;\n+\tControlInfoMap &operator=(std::initializer_list<Map::value_type> init);\n+\tControlInfoMap &operator=(Map &&info);\n+\n+\tusing Map::key_type;\n+\tusing Map::mapped_type;\n+\tusing Map::value_type;\n+\tusing Map::size_type;\n+\tusing Map::iterator;\n+\tusing Map::const_iterator;\n+\n+\tusing Map::begin;\n+\tusing Map::cbegin;\n+\tusing Map::end;\n+\tusing Map::cend;\n+\tusing Map::at;\n+\tusing Map::empty;\n+\tusing Map::size;\n+\tusing Map::count;\n+\tusing Map::find;\n+\n+\tmapped_type &at(unsigned int key);\n+\tconst mapped_type &at(unsigned int key) const;\n+\tsize_type count(unsigned int key) const;\n+\titerator find(unsigned int key);\n+\tconst_iterator find(unsigned int key) const;\n+\n+\tconst ControlIdMap &idmap() const { return idmap_; }\n+\n+private:\n+\tvoid generateIdmap();\n+\n+\tControlIdMap idmap_;\n+};\n \n class ControlList\n {\ndiff --git a/src/ipa/ipa_vimc.cpp b/src/ipa/ipa_vimc.cpp\nindex 620dc25f456e..63d578b4e2aa 100644\n--- a/src/ipa/ipa_vimc.cpp\n+++ b/src/ipa/ipa_vimc.cpp\n@@ -31,7 +31,7 @@ public:\n \n \tint init() override;\n \tvoid configure(const std::map<unsigned int, IPAStream> &streamConfig,\n-\t\t const std::map<unsigned int, V4L2ControlInfoMap> &entityControls) override {}\n+\t\t const std::map<unsigned int, ControlInfoMap> &entityControls) override {}\n \tvoid mapBuffers(const std::vector<IPABuffer> &buffers) override {}\n \tvoid unmapBuffers(const std::vector<unsigned int> &ids) override {}\n \tvoid processEvent(const IPAOperationData &event) override {}\ndiff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp\nindex d64c334cbf0c..bd703898c523 100644\n--- a/src/ipa/rkisp1/rkisp1.cpp\n+++ b/src/ipa/rkisp1/rkisp1.cpp\n@@ -33,7 +33,7 @@ public:\n \tint init() override { return 0; }\n \n \tvoid configure(const std::map<unsigned int, IPAStream> &streamConfig,\n-\t\t const std::map<unsigned int, V4L2ControlInfoMap> &entityControls) override;\n+\t\t const std::map<unsigned int, ControlInfoMap> &entityControls) override;\n \tvoid mapBuffers(const std::vector<IPABuffer> &buffers) override;\n \tvoid unmapBuffers(const std::vector<unsigned int> &ids) override;\n \tvoid processEvent(const IPAOperationData &event) override;\n@@ -49,7 +49,7 @@ private:\n \n \tstd::map<unsigned int, BufferMemory> bufferInfo_;\n \n-\tV4L2ControlInfoMap ctrls_;\n+\tControlInfoMap ctrls_;\n \n \t/* Camera sensor controls. */\n \tbool autoExposure_;\n@@ -62,7 +62,7 @@ private:\n };\n \n void IPARkISP1::configure(const std::map<unsigned int, IPAStream> &streamConfig,\n-\t\t\t const std::map<unsigned int, V4L2ControlInfoMap> &entityControls)\n+\t\t\t const std::map<unsigned int, ControlInfoMap> &entityControls)\n {\n \tif (entityControls.empty())\n \t\treturn;\ndiff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp\nindex 1b8e8c0e07da..86f0c772861b 100644\n--- a/src/libcamera/camera_sensor.cpp\n+++ b/src/libcamera/camera_sensor.cpp\n@@ -251,7 +251,7 @@ int CameraSensor::setFormat(V4L2SubdeviceFormat *format)\n * \\brief Retrieve the supported V4L2 controls and their information\n * \\return A map of the V4L2 controls supported by the sensor\n */\n-const V4L2ControlInfoMap &CameraSensor::controls() const\n+const ControlInfoMap &CameraSensor::controls() const\n {\n \treturn subdev_->controls();\n }\ndiff --git a/src/libcamera/controls.cpp b/src/libcamera/controls.cpp\nindex 6a0301f3a2ae..bf7634aab470 100644\n--- a/src/libcamera/controls.cpp\n+++ b/src/libcamera/controls.cpp\n@@ -393,10 +393,147 @@ std::string ControlRange::toString() const\n */\n \n /**\n- * \\typedef ControlInfoMap\n+ * \\class ControlInfoMap\n * \\brief A map of ControlId to ControlRange\n+ *\n+ * The ControlInfoMap class describes controls supported by an object as an\n+ * unsorted map of ControlId pointers to ControlRange instances. Unlike the\n+ * standard std::unsorted_map<> class, it is designed the be immutable once\n+ * constructed, and thus only exposes the read accessors of the\n+ * std::unsorted_map<> base class.\n+ *\n+ * In addition to the features of the standard unsorted map, this class also\n+ * provides access to the mapped elements using numerical ID keys. It maintains\n+ * an internal map of numerical ID to ControlId for this purpose, and exposes it\n+ * through the idmap() method to help construction of ControlList instances.\n */\n \n+/**\n+ * \\typedef ControlInfoMap::Map\n+ * \\brief The base std::unsorted_map<> container\n+ */\n+\n+/**\n+ * \\fn ControlInfoMap::ControlInfoMap(const ControlInfoMap &other)\n+ * \\brief Copy constructor, construct a ControlInfoMap from a copy of \\a other\n+ * \\param[in] other The other ControlInfoMap\n+ */\n+\n+/**\n+ * \\brief Construct a ControlInfoMap from an initializer list\n+ * \\param[in] init The initializer list\n+ */\n+ControlInfoMap::ControlInfoMap(std::initializer_list<Map::value_type> init)\n+\t: Map(init)\n+{\n+\tgenerateIdmap();\n+}\n+\n+/**\n+ * \\fn ControlInfoMap &ControlInfoMap::operator=(const ControlInfoMap &other)\n+ * \\brief Copy assignment operator, replace the contents with a copy of \\a other\n+ * \\param[in] other The other ControlInfoMap\n+ * \\return A reference to the ControlInfoMap\n+ */\n+\n+/**\n+ * \\brief Replace the contents with those from the initializer list\n+ * \\param[in] init The initializer list\n+ * \\return A reference to the ControlInfoMap\n+ */\n+ControlInfoMap &ControlInfoMap::operator=(std::initializer_list<Map::value_type> init)\n+{\n+\tMap::operator=(init);\n+\tgenerateIdmap();\n+\treturn *this;\n+}\n+\n+/**\n+ * \\brief Move assignment operator from a plain map\n+ * \\param[in] info The control info plain map\n+ *\n+ * Populate the map by replacing its contents with those of \\a info using move\n+ * semantics. Upon return the \\a info map will be empty.\n+ *\n+ * \\return A reference to the populated ControlInfoMap\n+ */\n+ControlInfoMap &ControlInfoMap::operator=(Map &&info)\n+{\n+\tMap::operator=(std::move(info));\n+\tgenerateIdmap();\n+\treturn *this;\n+}\n+\n+/**\n+ * \\brief Access specified element by numerical ID\n+ * \\param[in] id The numerical ID\n+ * \\return A reference to the element whose ID is equal to \\a id\n+ */\n+ControlInfoMap::mapped_type &ControlInfoMap::at(unsigned int id)\n+{\n+\treturn at(idmap_.at(id));\n+}\n+\n+/**\n+ * \\brief Access specified element by numerical ID\n+ * \\param[in] id The numerical ID\n+ * \\return A const reference to the element whose ID is equal to \\a id\n+ */\n+const ControlInfoMap::mapped_type &ControlInfoMap::at(unsigned int id) const\n+{\n+\treturn at(idmap_.at(id));\n+}\n+\n+/**\n+ * \\brief Count the number of elements matching a numerical ID\n+ * \\param[in] id The numerical ID\n+ * \\return The number of elements matching the numerical \\a id\n+ */\n+ControlInfoMap::size_type ControlInfoMap::count(unsigned int id) const\n+{\n+\treturn count(idmap_.at(id));\n+}\n+\n+/**\n+ * \\brief Find the element matching a numerical ID\n+ * \\param[in] id The numerical ID\n+ * \\return An iterator pointing to the element matching the numerical \\a id, or\n+ * end() if no such element exists\n+ */\n+ControlInfoMap::iterator ControlInfoMap::find(unsigned int id)\n+{\n+\treturn find(idmap_.at(id));\n+}\n+\n+/**\n+ * \\brief Find the element matching a numerical ID\n+ * \\param[in] id The numerical ID\n+ * \\return A const iterator pointing to the element matching the numerical\n+ * \\a id, or end() if no such element exists\n+ */\n+ControlInfoMap::const_iterator ControlInfoMap::find(unsigned int id) const\n+{\n+\treturn find(idmap_.at(id));\n+}\n+\n+/**\n+ * \\fn const ControlIdMap &ControlInfoMap::idmap() const\n+ * \\brief Retrieve the ControlId map\n+ *\n+ * Constructing ControlList instances for V4L2 controls requires a ControlIdMap\n+ * for the V4L2 device that the control list targets. This helper method\n+ * returns a suitable idmap for that purpose.\n+ *\n+ * \\return The ControlId map\n+ */\n+\n+void ControlInfoMap::generateIdmap()\n+{\n+\tidmap_.clear();\n+\tfor (const auto &ctrl : *this)\n+\t\tidmap_[ctrl.first->id()] = ctrl.first;\n+}\n+\n /**\n * \\class ControlList\n * \\brief Associate a list of ControlId with their values for an object\ndiff --git a/src/libcamera/include/camera_sensor.h b/src/libcamera/include/camera_sensor.h\nindex f426e29b84bf..1fb36a4f4951 100644\n--- a/src/libcamera/include/camera_sensor.h\n+++ b/src/libcamera/include/camera_sensor.h\n@@ -16,9 +16,9 @@\n \n namespace libcamera {\n \n+class ControlInfoMap;\n class ControlList;\n class MediaEntity;\n-class V4L2ControlInfoMap;\n class V4L2Subdevice;\n \n struct V4L2SubdeviceFormat;\n@@ -43,7 +43,7 @@ public:\n \t\t\t\t const Size &size) const;\n \tint setFormat(V4L2SubdeviceFormat *format);\n \n-\tconst V4L2ControlInfoMap &controls() const;\n+\tconst ControlInfoMap &controls() const;\n \tint getControls(ControlList *ctrls);\n \tint setControls(ControlList *ctrls);\n \ndiff --git a/src/libcamera/include/v4l2_controls.h b/src/libcamera/include/v4l2_controls.h\nindex c427b845d8b4..e16c4957f9d1 100644\n--- a/src/libcamera/include/v4l2_controls.h\n+++ b/src/libcamera/include/v4l2_controls.h\n@@ -31,44 +31,10 @@ public:\n \tV4L2ControlRange(const struct v4l2_query_ext_ctrl &ctrl);\n };\n \n-class V4L2ControlInfoMap : private ControlInfoMap\n-{\n-public:\n-\tV4L2ControlInfoMap &operator=(ControlInfoMap &&info);\n-\n-\tusing ControlInfoMap::key_type;\n-\tusing ControlInfoMap::mapped_type;\n-\tusing ControlInfoMap::value_type;\n-\tusing ControlInfoMap::size_type;\n-\tusing ControlInfoMap::iterator;\n-\tusing ControlInfoMap::const_iterator;\n-\n-\tusing ControlInfoMap::begin;\n-\tusing ControlInfoMap::cbegin;\n-\tusing ControlInfoMap::end;\n-\tusing ControlInfoMap::cend;\n-\tusing ControlInfoMap::at;\n-\tusing ControlInfoMap::empty;\n-\tusing ControlInfoMap::size;\n-\tusing ControlInfoMap::count;\n-\tusing ControlInfoMap::find;\n-\n-\tmapped_type &at(unsigned int key);\n-\tconst mapped_type &at(unsigned int key) const;\n-\tsize_type count(unsigned int key) const;\n-\titerator find(unsigned int key);\n-\tconst_iterator find(unsigned int key) const;\n-\n-\tconst ControlIdMap &idmap() const { return idmap_; }\n-\n-private:\n-\tControlIdMap idmap_;\n-};\n-\n class V4L2ControlList : public ControlList\n {\n public:\n-\tV4L2ControlList(const V4L2ControlInfoMap &info)\n+\tV4L2ControlList(const ControlInfoMap &info)\n \t\t: ControlList(info.idmap())\n \t{\n \t}\ndiff --git a/src/libcamera/include/v4l2_device.h b/src/libcamera/include/v4l2_device.h\nindex f30b1c2cde34..6bfddefe336c 100644\n--- a/src/libcamera/include/v4l2_device.h\n+++ b/src/libcamera/include/v4l2_device.h\n@@ -24,7 +24,7 @@ public:\n \tvoid close();\n \tbool isOpen() const { return fd_ != -1; }\n \n-\tconst V4L2ControlInfoMap &controls() const { return controls_; }\n+\tconst ControlInfoMap &controls() const { return controls_; }\n \n \tint getControls(ControlList *ctrls);\n \tint setControls(ControlList *ctrls);\n@@ -49,7 +49,7 @@ private:\n \t\t\t unsigned int count);\n \n \tstd::vector<std::unique_ptr<V4L2ControlId>> controlIds_;\n-\tV4L2ControlInfoMap controls_;\n+\tControlInfoMap controls_;\n \tstd::string deviceNode_;\n \tint fd_;\n };\ndiff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\nindex 9b19bde8a274..7a28b03b8d38 100644\n--- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n+++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n@@ -776,7 +776,7 @@ int PipelineHandlerRkISP1::start(Camera *camera)\n \t\t.size = data->stream_.configuration().size,\n \t};\n \n-\tstd::map<unsigned int, V4L2ControlInfoMap> entityControls;\n+\tstd::map<unsigned int, ControlInfoMap> entityControls;\n \tentityControls.emplace(0, data->sensor_->controls());\n \n \tdata->ipa_->configure(streamConfig, entityControls);\n@@ -875,9 +875,12 @@ int PipelineHandlerRkISP1::createCamera(MediaEntity *sensor)\n \tstd::unique_ptr<RkISP1CameraData> data =\n \t\tutils::make_unique<RkISP1CameraData>(this);\n \n-\tdata->controlInfo_.emplace(std::piecewise_construct,\n-\t\t\t\t std::forward_as_tuple(&controls::AeEnable),\n-\t\t\t\t std::forward_as_tuple(false, true));\n+\tControlInfoMap::Map ctrls;\n+\tctrls.emplace(std::piecewise_construct,\n+\t\t std::forward_as_tuple(&controls::AeEnable),\n+\t\t std::forward_as_tuple(false, true));\n+\n+\tdata->controlInfo_ = std::move(ctrls);\n \n \tdata->sensor_ = new CameraSensor(sensor);\n \tret = data->sensor_->init();\ndiff --git a/src/libcamera/pipeline/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo.cpp\nindex 018c7691d263..a64e1af4c550 100644\n--- a/src/libcamera/pipeline/uvcvideo.cpp\n+++ b/src/libcamera/pipeline/uvcvideo.cpp\n@@ -335,7 +335,9 @@ int UVCCameraData::init(MediaEntity *entity)\n \tvideo_->bufferReady.connect(this, &UVCCameraData::bufferReady);\n \n \t/* Initialise the supported controls. */\n-\tconst V4L2ControlInfoMap &controls = video_->controls();\n+\tconst ControlInfoMap &controls = video_->controls();\n+\tControlInfoMap::Map ctrls;\n+\n \tfor (const auto &ctrl : controls) {\n \t\tconst ControlRange &range = ctrl.second;\n \t\tconst ControlId *id;\n@@ -360,11 +362,13 @@ int UVCCameraData::init(MediaEntity *entity)\n \t\t\tcontinue;\n \t\t}\n \n-\t\tcontrolInfo_.emplace(std::piecewise_construct,\n-\t\t\t\t std::forward_as_tuple(id),\n-\t\t\t\t std::forward_as_tuple(range));\n+\t\tctrls.emplace(std::piecewise_construct,\n+\t\t\t std::forward_as_tuple(id),\n+\t\t\t std::forward_as_tuple(range));\n \t}\n \n+\tcontrolInfo_ = std::move(ctrls);\n+\n \treturn 0;\n }\n \ndiff --git a/src/libcamera/pipeline/vimc.cpp b/src/libcamera/pipeline/vimc.cpp\nindex f7f82edc6530..6a4244119dc5 100644\n--- a/src/libcamera/pipeline/vimc.cpp\n+++ b/src/libcamera/pipeline/vimc.cpp\n@@ -411,7 +411,9 @@ int VimcCameraData::init(MediaDevice *media)\n \t\treturn -ENODEV;\n \n \t/* Initialise the supported controls. */\n-\tconst V4L2ControlInfoMap &controls = sensor_->controls();\n+\tconst ControlInfoMap &controls = sensor_->controls();\n+\tControlInfoMap::Map ctrls;\n+\n \tfor (const auto &ctrl : controls) {\n \t\tconst ControlRange &range = ctrl.second;\n \t\tconst ControlId *id;\n@@ -430,11 +432,12 @@ int VimcCameraData::init(MediaDevice *media)\n \t\t\tcontinue;\n \t\t}\n \n-\t\tcontrolInfo_.emplace(std::piecewise_construct,\n-\t\t\t\t std::forward_as_tuple(id),\n-\t\t\t\t std::forward_as_tuple(range));\n+\t\tctrls.emplace(std::piecewise_construct,\n+\t\t\t std::forward_as_tuple(id),\n+\t\t\t std::forward_as_tuple(range));\n \t}\n \n+\tcontrolInfo_ = std::move(ctrls);\n \treturn 0;\n }\n \ndiff --git a/src/libcamera/proxy/ipa_proxy_linux.cpp b/src/libcamera/proxy/ipa_proxy_linux.cpp\nindex 41bd965f0284..4e6fa6899e07 100644\n--- a/src/libcamera/proxy/ipa_proxy_linux.cpp\n+++ b/src/libcamera/proxy/ipa_proxy_linux.cpp\n@@ -28,7 +28,7 @@ public:\n \n \tint init() override { return 0; }\n \tvoid configure(const std::map<unsigned int, IPAStream> &streamConfig,\n-\t\t const std::map<unsigned int, V4L2ControlInfoMap> &entityControls) override {}\n+\t\t const std::map<unsigned int, ControlInfoMap> &entityControls) override {}\n \tvoid mapBuffers(const std::vector<IPABuffer> &buffers) override {}\n \tvoid unmapBuffers(const std::vector<unsigned int> &ids) override {}\n \tvoid processEvent(const IPAOperationData &event) override {}\ndiff --git a/src/libcamera/v4l2_controls.cpp b/src/libcamera/v4l2_controls.cpp\nindex e783457caf94..bd5e18590b76 100644\n--- a/src/libcamera/v4l2_controls.cpp\n+++ b/src/libcamera/v4l2_controls.cpp\n@@ -134,102 +134,12 @@ 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 V4L2ControlInfoMap\n- * \\brief A map of controlID to ControlRange for V4L2 controls\n- */\n-\n-/**\n- * \\brief Move assignment operator from a ControlInfoMap\n- * \\param[in] info The control info map\n- *\n- * Populate the map by replacing its contents with those of \\a info using move\n- * semantics. Upon return the \\a info map will be empty.\n- *\n- * This is the only supported way to populate a V4L2ControlInfoMap.\n- *\n- * \\return The populated V4L2ControlInfoMap\n- */\n-V4L2ControlInfoMap &V4L2ControlInfoMap::operator=(ControlInfoMap &&info)\n-{\n-\tControlInfoMap::operator=(std::move(info));\n-\n-\tidmap_.clear();\n-\tfor (const auto &ctrl : *this)\n-\t\tidmap_[ctrl.first->id()] = ctrl.first;\n-\n-\treturn *this;\n-}\n-\n-/**\n- * \\brief Access specified element by numerical ID\n- * \\param[in] id The numerical ID\n- * \\return A reference to the element whose ID is equal to \\a id\n- */\n-V4L2ControlInfoMap::mapped_type &V4L2ControlInfoMap::at(unsigned int id)\n-{\n-\treturn at(idmap_.at(id));\n-}\n-\n-/**\n- * \\brief Access specified element by numerical ID\n- * \\param[in] id The numerical ID\n- * \\return A const reference to the element whose ID is equal to \\a id\n- */\n-const V4L2ControlInfoMap::mapped_type &V4L2ControlInfoMap::at(unsigned int id) const\n-{\n-\treturn at(idmap_.at(id));\n-}\n-\n-/**\n- * \\brief Count the number of elements matching a numerical ID\n- * \\param[in] id The numerical ID\n- * \\return The number of elements matching the numerical \\a id\n- */\n-V4L2ControlInfoMap::size_type V4L2ControlInfoMap::count(unsigned int id) const\n-{\n-\treturn count(idmap_.at(id));\n-}\n-\n-/**\n- * \\brief Find the element matching a numerical ID\n- * \\param[in] id The numerical ID\n- * \\return An iterator pointing to the element matching the numerical \\a id, or\n- * end() if no such element exists\n- */\n-V4L2ControlInfoMap::iterator V4L2ControlInfoMap::find(unsigned int id)\n-{\n-\treturn find(idmap_.at(id));\n-}\n-\n-/**\n- * \\brief Find the element matching a numerical ID\n- * \\param[in] id The numerical ID\n- * \\return A const iterator pointing to the element matching the numerical\n- * \\a id, or end() if no such element exists\n- */\n-V4L2ControlInfoMap::const_iterator V4L2ControlInfoMap::find(unsigned int id) const\n-{\n-\treturn find(idmap_.at(id));\n-}\n-\n-/**\n- * \\fn const ControlIdMap &V4L2ControlInfoMap::idmap() const\n- * \\brief Retrieve the ControlId map\n- *\n- * Constructing ControlList instances for V4L2 controls requires a ControlIdMap\n- * for the V4L2 device that the control list targets. This helper method\n- * returns a suitable idmap for that purpose.\n- *\n- * \\return The ControlId map\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 V4L2ControlInfoMap.\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@@ -239,7 +149,7 @@ V4L2ControlInfoMap::const_iterator V4L2ControlInfoMap::find(unsigned int id) con\n */\n \n /**\n- * \\fn V4L2ControlList::V4L2ControlList(const V4L2ControlInfoMap &info)\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 */\ndiff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp\nindex 06155eb51c03..a2b0d891b12f 100644\n--- a/src/libcamera/v4l2_device.cpp\n+++ b/src/libcamera/v4l2_device.cpp\n@@ -342,7 +342,7 @@ int V4L2Device::ioctl(unsigned long request, void *argp)\n */\n void V4L2Device::listControls()\n {\n-\tControlInfoMap ctrls;\n+\tControlInfoMap::Map ctrls;\n \tstruct v4l2_query_ext_ctrl ctrl = {};\n \n \t/* \\todo Add support for menu and compound controls. */\ndiff --git a/test/v4l2_videodevice/controls.cpp b/test/v4l2_videodevice/controls.cpp\nindex 182228f3a5b1..31879b794ed0 100644\n--- a/test/v4l2_videodevice/controls.cpp\n+++ b/test/v4l2_videodevice/controls.cpp\n@@ -26,7 +26,7 @@ public:\n protected:\n \tint run()\n \t{\n-\t\tconst V4L2ControlInfoMap &info = capture_->controls();\n+\t\tconst ControlInfoMap &info = capture_->controls();\n \n \t\t/* Test control enumeration. */\n \t\tif (info.empty()) {\n", "prefixes": [ "libcamera-devel", "09/10" ] }