{"id":2062,"url":"https://patchwork.libcamera.org/api/patches/2062/?format=json","web_url":"https://patchwork.libcamera.org/patch/2062/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20190929190254.18920-8-laurent.pinchart@ideasonboard.com>","date":"2019-09-29T19:02:48","name":"[libcamera-devel,v2,07/13] libcamera: controls: Remove ControlInfo::id","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"29f347a77a3a26f3c19d8f7ac7194d9a5be90e60","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/?format=json","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/2062/mbox/","series":[{"id":512,"url":"https://patchwork.libcamera.org/api/series/512/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=512","date":"2019-09-29T19:02:41","name":"Improve the application-facing controls API","version":2,"mbox":"https://patchwork.libcamera.org/series/512/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/2062/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/2062/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 A1E086165A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 29 Sep 2019 21:03:13 +0200 (CEST)","from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi\n\t[81.175.216.236])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 4CC9F813\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 29 Sep 2019 21:03:13 +0200 (CEST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1569783793;\n\tbh=GhSM4t5wSxG2WSohu5R5J4gcN4xOlJpdKYlGXScBytE=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=lXVymg0/3wcKU0YZnTyEFg2GWWtX+daupFCyt/m5N71VkWCeX1pCtLlH5usf9fI9S\n\tXQ8UkeqtlZp46rC7weKIFih8b7esol6B9J/PI7IweutwDUTIoWaWmnNRJC+Lv90qMa\n\tM+0hjIsI/13fHo3jYbWQvvhpYHjdP1NyIhxAvfnk=","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Sun, 29 Sep 2019 22:02:48 +0300","Message-Id":"<20190929190254.18920-8-laurent.pinchart@ideasonboard.com>","X-Mailer":"git-send-email 2.21.0","In-Reply-To":"<20190929190254.18920-1-laurent.pinchart@ideasonboard.com>","References":"<20190929190254.18920-1-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v2 07/13] libcamera: controls: Remove\n\tControlInfo::id","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, 29 Sep 2019 19:03:15 -0000"},"content":"The ControlInfo id member is only used in the toString() method of the\nclass, and nowhere else externally. The same way that ControlValue\ndoesn't store a ControlId, ControlInfo shouldn't. Remove it.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\nReviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n include/libcamera/controls.h        |  4 +---\n src/libcamera/controls.cpp          | 13 +++----------\n src/libcamera/pipeline/uvcvideo.cpp |  2 +-\n src/libcamera/pipeline/vimc.cpp     |  2 +-\n test/controls/control_info.cpp      | 18 ++----------------\n 5 files changed, 8 insertions(+), 31 deletions(-)","diff":"diff --git a/include/libcamera/controls.h b/include/libcamera/controls.h\nindex d4a74ada1b6a..854ea3b84267 100644\n--- a/include/libcamera/controls.h\n+++ b/include/libcamera/controls.h\n@@ -98,17 +98,15 @@ private:\n class ControlInfo\n {\n public:\n-\texplicit ControlInfo(const ControlId &id, const ControlValue &min = 0,\n+\texplicit ControlInfo(const ControlValue &min = 0,\n \t\t\t     const ControlValue &max = 0);\n \n-\tconst ControlId &id() const { return id_; }\n \tconst ControlValue &min() const { return min_; }\n \tconst ControlValue &max() const { return max_; }\n \n \tstd::string toString() const;\n \n private:\n-\tconst ControlId &id_;\n \tControlValue min_;\n \tControlValue max_;\n };\ndiff --git a/src/libcamera/controls.cpp b/src/libcamera/controls.cpp\nindex 5e8b3a9b5184..526b7755b390 100644\n--- a/src/libcamera/controls.cpp\n+++ b/src/libcamera/controls.cpp\n@@ -323,22 +323,15 @@ Control<int64_t>::Control(unsigned int id, const char *name)\n \n /**\n  * \\brief Construct a ControlInfo with minimum and maximum range parameters\n- * \\param[in] id The control ID\n  * \\param[in] min The control minimum value\n  * \\param[in] max The control maximum value\n  */\n-ControlInfo::ControlInfo(const ControlId &id, const ControlValue &min,\n+ControlInfo::ControlInfo(const ControlValue &min,\n \t\t\t const ControlValue &max)\n-\t: id_(id), min_(min), max_(max)\n+\t: min_(min), max_(max)\n {\n }\n \n-/**\n- * \\fn ControlInfo::id()\n- * \\brief Retrieve the control ID\n- * \\return The control ID\n- */\n-\n /**\n  * \\fn ControlInfo::min()\n  * \\brief Retrieve the minimum value of the control\n@@ -358,7 +351,7 @@ std::string ControlInfo::toString() const\n {\n \tstd::stringstream ss;\n \n-\tss << id_.name() << \"[\" << min_.toString() << \"..\" << max_.toString() << \"]\";\n+\tss << \"[\" << min_.toString() << \"..\" << max_.toString() << \"]\";\n \n \treturn ss.str();\n }\ndiff --git a/src/libcamera/pipeline/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo.cpp\nindex d5d30932870a..2ac582d77801 100644\n--- a/src/libcamera/pipeline/uvcvideo.cpp\n+++ b/src/libcamera/pipeline/uvcvideo.cpp\n@@ -364,7 +364,7 @@ int UVCCameraData::init(MediaEntity *entity)\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(*id, info.min(), info.max()));\n+\t\t\t\t     std::forward_as_tuple(info.min(), info.max()));\n \t}\n \n \treturn 0;\ndiff --git a/src/libcamera/pipeline/vimc.cpp b/src/libcamera/pipeline/vimc.cpp\nindex 608a47aecf76..ec9c1cd2d484 100644\n--- a/src/libcamera/pipeline/vimc.cpp\n+++ b/src/libcamera/pipeline/vimc.cpp\n@@ -437,7 +437,7 @@ int VimcCameraData::init(MediaDevice *media)\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(*id, info.min(), info.max()));\n+\t\t\t\t     std::forward_as_tuple(info.min(), info.max()));\n \t}\n \n \treturn 0;\ndiff --git a/test/controls/control_info.cpp b/test/controls/control_info.cpp\nindex dbc43df8e3d3..9cf59185e459 100644\n--- a/test/controls/control_info.cpp\n+++ b/test/controls/control_info.cpp\n@@ -24,14 +24,7 @@ protected:\n \t\t * Test information retrieval from a control with no minimum\n \t\t * and maximum.\n \t\t */\n-\t\tControlInfo brightness(controls::Brightness);\n-\n-\t\tif (brightness.id() != controls::Brightness ||\n-\t\t    brightness.id().type() != ControlTypeInteger32 ||\n-\t\t    brightness.id().name() != std::string(\"Brightness\")) {\n-\t\t\tcout << \"Invalid control identification for Brightness\" << endl;\n-\t\t\treturn TestFail;\n-\t\t}\n+\t\tControlInfo brightness;\n \n \t\tif (brightness.min().get<int32_t>() != 0 ||\n \t\t    brightness.max().get<int32_t>() != 0) {\n@@ -43,14 +36,7 @@ protected:\n \t\t * Test information retrieval from a control with a minimum and\n \t\t * a maximum value.\n \t\t */\n-\t\tControlInfo contrast(controls::Contrast, 10, 200);\n-\n-\t\tif (contrast.id() != controls::Contrast ||\n-\t\t    contrast.id().type() != ControlTypeInteger32 ||\n-\t\t    contrast.id().name() != std::string(\"Contrast\")) {\n-\t\t\tcout << \"Invalid control identification for Contrast\" << endl;\n-\t\t\treturn TestFail;\n-\t\t}\n+\t\tControlInfo contrast(10, 200);\n \n \t\tif (contrast.min().get<int32_t>() != 10 ||\n \t\t    contrast.max().get<int32_t>() != 200) {\n","prefixes":["libcamera-devel","v2","07/13"]}