[{"id":2754,"web_url":"https://patchwork.libcamera.org/comment/2754/","msgid":"<20191003193241.GI1322@bigcity.dyn.berto.se>","date":"2019-10-03T19:32:41","subject":"Re: [libcamera-devel] [PATCH v2 06/13] libcamera: controls: Remove\n\tthe unused ControlList::update() method","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/people/5/","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"content":"Hi Laurent,\n\nThanks for your work.\n\nOn 2019-09-29 22:02:47 +0300, Laurent Pinchart wrote:\n> The ControlList::update() method is unused. While it is meant to fulfil\n> a need of applications, having no user means that it is most probably\n> not correctly designed. Remove the method, we will add it back later if\n> needed.\n> \n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n\nReviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n\n> ---\n>  include/libcamera/controls.h   |  2 --\n>  src/libcamera/controls.cpp     | 28 ----------------------\n>  test/controls/control_list.cpp | 43 ----------------------------------\n>  3 files changed, 73 deletions(-)\n> \n> diff --git a/include/libcamera/controls.h b/include/libcamera/controls.h\n> index 9698bd1dd383..d4a74ada1b6a 100644\n> --- a/include/libcamera/controls.h\n> +++ b/include/libcamera/controls.h\n> @@ -158,8 +158,6 @@ public:\n>  \t\tval->set<T>(value);\n>  \t}\n>  \n> -\tvoid update(const ControlList &list);\n> -\n>  private:\n>  \tconst ControlValue *find(const ControlId &id) const;\n>  \tControlValue *find(const ControlId &id);\n> diff --git a/src/libcamera/controls.cpp b/src/libcamera/controls.cpp\n> index a34af588fc7e..5e8b3a9b5184 100644\n> --- a/src/libcamera/controls.cpp\n> +++ b/src/libcamera/controls.cpp\n> @@ -512,32 +512,4 @@ ControlValue *ControlList::find(const ControlId &id)\n>  \treturn &controls_[&id];\n>  }\n>  \n> -/**\n> - * \\brief Update the list with a union of itself and \\a other\n> - * \\param other The other list\n> - *\n> - * Update the control list to include all values from the \\a other list.\n> - * Elements in the list whose control IDs are contained in \\a other are updated\n> - * with the value from \\a other. Elements in the \\a other list that have no\n> - * corresponding element in the list are added to the list with their value.\n> - *\n> - * The behaviour is undefined if the two lists refer to different Camera\n> - * instances.\n> - */\n> -void ControlList::update(const ControlList &other)\n> -{\n> -\tif (other.camera_ != camera_) {\n> -\t\tLOG(Controls, Error)\n> -\t\t\t<< \"Can't update ControlList from a different camera\";\n> -\t\treturn;\n> -\t}\n> -\n> -\tfor (auto it : other) {\n> -\t\tconst ControlId *id = it.first;\n> -\t\tconst ControlValue &value = it.second;\n> -\n> -\t\tcontrols_[id] = value;\n> -\t}\n> -}\n> -\n>  } /* namespace libcamera */\n> diff --git a/test/controls/control_list.cpp b/test/controls/control_list.cpp\n> index 053696814b67..8469ecf09439 100644\n> --- a/test/controls/control_list.cpp\n> +++ b/test/controls/control_list.cpp\n> @@ -141,49 +141,6 @@ protected:\n>  \t\t\treturn TestFail;\n>  \t\t}\n>  \n> -\t\t/*\n> -\t\t * Test list merging. Create a new list, add two controls with\n> -\t\t * one overlapping the existing list, merge the lists and clear\n> -\t\t * the old list. Verify that the new list is empty and that the\n> -\t\t * new list contains the expected items and values.\n> -\t\t */\n> -\t\tControlList newList(camera_.get());\n> -\n> -\t\tnewList.set(controls::Brightness, 128);\n> -\t\tnewList.set(controls::Saturation, 255);\n> -\t\tnewList.update(list);\n> -\n> -\t\tlist.clear();\n> -\n> -\t\tif (list.size() != 0) {\n> -\t\t\tcout << \"Old List should contain zero items\" << endl;\n> -\t\t\treturn TestFail;\n> -\t\t}\n> -\n> -\t\tif (!list.empty()) {\n> -\t\t\tcout << \"Old List should be empty\" << endl;\n> -\t\t\treturn TestFail;\n> -\t\t}\n> -\n> -\t\tif (newList.size() != 3) {\n> -\t\t\tcout << \"New list has incorrect size\" << endl;\n> -\t\t\treturn TestFail;\n> -\t\t}\n> -\n> -\t\tif (!newList.contains(controls::Brightness) ||\n> -\t\t    !newList.contains(controls::Contrast) ||\n> -\t\t    !newList.contains(controls::Saturation)) {\n> -\t\t\tcout << \"New list contains incorrect items\" << endl;\n> -\t\t\treturn TestFail;\n> -\t\t}\n> -\n> -\t\tif (newList.get(controls::Brightness) != 10 ||\n> -\t\t    newList.get(controls::Contrast) != 20 ||\n> -\t\t    newList.get(controls::Saturation) != 255) {\n> -\t\t\tcout << \"New list contains incorrect values\" << endl;\n> -\t\t\treturn TestFail;\n> -\t\t}\n> -\n>  \t\treturn TestPass;\n>  \t}\n>  \n> -- \n> Regards,\n> \n> Laurent Pinchart\n> \n> _______________________________________________\n> libcamera-devel mailing list\n> libcamera-devel@lists.libcamera.org\n> https://lists.libcamera.org/listinfo/libcamera-devel","headers":{"Return-Path":"<niklas.soderlund@ragnatech.se>","Received":["from mail-lf1-x136.google.com (mail-lf1-x136.google.com\n\t[IPv6:2a00:1450:4864:20::136])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 5C61860BE8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  3 Oct 2019 21:32:43 +0200 (CEST)","by mail-lf1-x136.google.com with SMTP id r22so2744195lfm.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 03 Oct 2019 12:32:43 -0700 (PDT)","from localhost (h-93-159.A463.priv.bahnhof.se. [46.59.93.159])\n\tby smtp.gmail.com with ESMTPSA id\n\tf21sm771620lfm.90.2019.10.03.12.32.42\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 03 Oct 2019 12:32:42 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=ragnatech-se.20150623.gappssmtp.com; s=20150623;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:content-transfer-encoding:in-reply-to\n\t:user-agent; bh=0BNOAOV8hFuQ6G/azl9t7oRmcTG5PZEKzVSjqaPt9Ks=;\n\tb=SQ7VetdLBhE7Xxi4xGIL4ZBVj+Q4r8D052AlafawXX5q9SKEOhOjA/TSXCj6IUxqdc\n\tg/JQeEQX5WnaW7FokOgNmNdjx0/XqK7xmyqn5lBko3Vv6Jd6XTAyT3RvqKn1PukM032f\n\t5/MZkqJIA+f/ZA2IpfXCKwAi13+d9IfvYZjqF6Hua0I5J6xQk+nCDyEA3doKxjqYkzNl\n\trPA/OZbiHhgmLpobp8NpcoG0URwheoLvk/OqQI6bZ6PsxBL3H2mdnit45+hptd3s92RH\n\toU8uO7m2ZXXX6JEJkn8faAJPilW4t3Qfmq7rLqEHs+oDawen1rU4vzfFv1u1Ey/UEKyG\n\teOdQ==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:content-transfer-encoding\n\t:in-reply-to:user-agent;\n\tbh=0BNOAOV8hFuQ6G/azl9t7oRmcTG5PZEKzVSjqaPt9Ks=;\n\tb=PHe/OuGzlZBTRf8u2WAhtVnOtvVPIWr9BqXH06hXqxTOkkh6DSVUTq5mSBMKnbEM5L\n\t7+3AGlApyOpeC/TadHP4Pxy1aISjf1XOoJEM4hn+PJwuyDiZBHvMafC5XDGt1q+JKrGW\n\tEacT0JkMXisVrTkzzpOOANzoci3n9Dfm6LS6/THOpPptWgnxTvOJiExa4bBzTwGKVwhJ\n\typkI7psgtet+1Rkn5CZDc9w+OhOxpER8fKM9uEES6bQMofMTEPfm/Ed/7qh2/6y2zQEd\n\tXoBGI1NPlvoiPm2hNL3yZ+F0ToBuKc3YlkayHSzRlTx89XyaufMo1sguZpcjOXRfnxc+\n\tcthA==","X-Gm-Message-State":"APjAAAXAb1Q5XHiCN/frHBJ8phd9dizZSwPEQHIeehVHWgCUQ3Q76/Rl\n\tlFLur4IOzofQPT+dXCFg0rmChQ==","X-Google-Smtp-Source":"APXvYqySHn8R/bM6lY5kgLeIMypWXXPNsUEqW/zhT58nfKimoW5pYdFPC2h8/dvQYaKk3WxStUDuVg==","X-Received":"by 2002:a19:f617:: with SMTP id x23mr6508214lfe.97.1570131162766;\n\tThu, 03 Oct 2019 12:32:42 -0700 (PDT)","Date":"Thu, 3 Oct 2019 21:32:41 +0200","From":"Niklas =?iso-8859-1?q?S=F6derlund?= <niklas.soderlund@ragnatech.se>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20191003193241.GI1322@bigcity.dyn.berto.se>","References":"<20190929190254.18920-1-laurent.pinchart@ideasonboard.com>\n\t<20190929190254.18920-7-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=iso-8859-1","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20190929190254.18920-7-laurent.pinchart@ideasonboard.com>","User-Agent":"Mutt/1.12.1 (2019-06-15)","Subject":"Re: [libcamera-devel] [PATCH v2 06/13] libcamera: controls: Remove\n\tthe unused ControlList::update() method","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":"Thu, 03 Oct 2019 19:32:43 -0000"}}]