[{"id":2756,"web_url":"https://patchwork.libcamera.org/comment/2756/","msgid":"<20191003193710.GK1322@bigcity.dyn.berto.se>","date":"2019-10-03T19:37:10","subject":"Re: [libcamera-devel] [PATCH v2 08/13] libcamera: controls: Rename\n\tControlInfo to ControlRange","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:49 +0300, Laurent Pinchart wrote:\n> The ControlInfo class stores a range of valid values for a control. Its\n> name is vague, as \"info\" has multiple meanings. Rename it to\n> ControlRange.\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                  |  8 +++---\n>  src/libcamera/controls.cpp                    | 28 +++++++++----------\n>  .../{control_info.cpp => control_range.cpp}   | 14 +++++-----\n>  test/controls/meson.build                     |  2 +-\n>  4 files changed, 26 insertions(+), 26 deletions(-)\n>  rename test/controls/{control_info.cpp => control_range.cpp} (75%)\n> \n> diff --git a/include/libcamera/controls.h b/include/libcamera/controls.h\n> index 854ea3b84267..d3eea643c0ec 100644\n> --- a/include/libcamera/controls.h\n> +++ b/include/libcamera/controls.h\n> @@ -95,11 +95,11 @@ private:\n>  \tControl &operator=(const Control &) = delete;\n>  };\n>  \n> -class ControlInfo\n> +class ControlRange\n>  {\n>  public:\n> -\texplicit ControlInfo(const ControlValue &min = 0,\n> -\t\t\t     const ControlValue &max = 0);\n> +\texplicit ControlRange(const ControlValue &min = 0,\n> +\t\t\t      const ControlValue &max = 0);\n>  \n>  \tconst ControlValue &min() const { return min_; }\n>  \tconst ControlValue &max() const { return max_; }\n> @@ -111,7 +111,7 @@ private:\n>  \tControlValue max_;\n>  };\n>  \n> -using ControlInfoMap = std::unordered_map<const ControlId *, ControlInfo>;\n> +using ControlInfoMap = std::unordered_map<const ControlId *, ControlRange>;\n>  \n>  class ControlList\n>  {\n> diff --git a/src/libcamera/controls.cpp b/src/libcamera/controls.cpp\n> index 526b7755b390..a7e9d069b31a 100644\n> --- a/src/libcamera/controls.cpp\n> +++ b/src/libcamera/controls.cpp\n> @@ -312,42 +312,42 @@ Control<int64_t>::Control(unsigned int id, const char *name)\n>  #endif /* __DOXYGEN__ */\n>  \n>  /**\n> - * \\class ControlInfo\n> - * \\brief Describe the information and capabilities of a Control\n> + * \\class ControlRange\n> + * \\brief Describe the limits of valid values for a Control\n>   *\n> - * The ControlInfo represents control specific meta-data which is constant on a\n> - * per camera basis. ControlInfo classes are constructed by pipeline handlers\n> - * to expose the controls they support and the metadata needed to utilise those\n> - * controls.\n> + * The ControlRange expresses the constraints on valid values for a control.\n> + * The constraints depend on the object the control applies to, and are\n> + * constant for the lifetime of that object. They are typically constructed by\n> + * pipeline handlers to describe the controls they support.\n>   */\n>  \n>  /**\n> - * \\brief Construct a ControlInfo with minimum and maximum range parameters\n> + * \\brief Construct a ControlRange with minimum and maximum range parameters\n>   * \\param[in] min The control minimum value\n>   * \\param[in] max The control maximum value\n>   */\n> -ControlInfo::ControlInfo(const ControlValue &min,\n> -\t\t\t const ControlValue &max)\n> +ControlRange::ControlRange(const ControlValue &min,\n> +\t\t\t   const ControlValue &max)\n>  \t: min_(min), max_(max)\n>  {\n>  }\n>  \n>  /**\n> - * \\fn ControlInfo::min()\n> + * \\fn ControlRange::min()\n>   * \\brief Retrieve the minimum value of the control\n>   * \\return A ControlValue with the minimum value for the control\n>   */\n>  \n>  /**\n> - * \\fn ControlInfo::max()\n> + * \\fn ControlRange::max()\n>   * \\brief Retrieve the maximum value of the control\n>   * \\return A ControlValue with the maximum value for the control\n>   */\n>  \n>  /**\n> - * \\brief Provide a string representation of the ControlInfo\n> + * \\brief Provide a string representation of the ControlRange\n>   */\n> -std::string ControlInfo::toString() const\n> +std::string ControlRange::toString() const\n>  {\n>  \tstd::stringstream ss;\n>  \n> @@ -358,7 +358,7 @@ std::string ControlInfo::toString() const\n>  \n>  /**\n>   * \\typedef ControlInfoMap\n> - * \\brief A map of ControlId to ControlInfo\n> + * \\brief A map of ControlId to ControlRange\n>   */\n>  \n>  /**\n> diff --git a/test/controls/control_info.cpp b/test/controls/control_range.cpp\n> similarity index 75%\n> rename from test/controls/control_info.cpp\n> rename to test/controls/control_range.cpp\n> index 9cf59185e459..06ec3506ee62 100644\n> --- a/test/controls/control_info.cpp\n> +++ b/test/controls/control_range.cpp\n> @@ -2,7 +2,7 @@\n>  /*\n>   * Copyright (C) 2019, Google Inc.\n>   *\n> - * control_info.cpp - ControlInfo tests\n> + * control_range.cpp - ControlRange tests\n>   */\n>  \n>  #include <iostream>\n> @@ -15,16 +15,16 @@\n>  using namespace std;\n>  using namespace libcamera;\n>  \n> -class ControlInfoTest : public Test\n> +class ControlRangeTest : public Test\n>  {\n>  protected:\n>  \tint run()\n>  \t{\n>  \t\t/*\n> -\t\t * Test information retrieval from a control with no minimum\n> -\t\t * and maximum.\n> +\t\t * Test information retrieval from a range with no minimum and\n> +\t\t * maximum.\n>  \t\t */\n> -\t\tControlInfo brightness;\n> +\t\tControlRange brightness;\n>  \n>  \t\tif (brightness.min().get<int32_t>() != 0 ||\n>  \t\t    brightness.max().get<int32_t>() != 0) {\n> @@ -36,7 +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(10, 200);\n> +\t\tControlRange contrast(10, 200);\n>  \n>  \t\tif (contrast.min().get<int32_t>() != 10 ||\n>  \t\t    contrast.max().get<int32_t>() != 200) {\n> @@ -48,4 +48,4 @@ protected:\n>  \t}\n>  };\n>  \n> -TEST_REGISTER(ControlInfoTest)\n> +TEST_REGISTER(ControlRangeTest)\n> diff --git a/test/controls/meson.build b/test/controls/meson.build\n> index f4fc7b947dd9..9f0f005a2759 100644\n> --- a/test/controls/meson.build\n> +++ b/test/controls/meson.build\n> @@ -1,6 +1,6 @@\n>  control_tests = [\n> -    [ 'control_info',   'control_info.cpp' ],\n>      [ 'control_list',   'control_list.cpp' ],\n> +    [ 'control_range',  'control_range.cpp' ],\n>      [ 'control_value',  'control_value.cpp' ],\n>  ]\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-x132.google.com (mail-lf1-x132.google.com\n\t[IPv6:2a00:1450:4864:20::132])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id EEB4060BE8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  3 Oct 2019 21:37:11 +0200 (CEST)","by mail-lf1-x132.google.com with SMTP id q11so2714834lfc.11\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 03 Oct 2019 12:37:11 -0700 (PDT)","from localhost (h-93-159.A463.priv.bahnhof.se. [46.59.93.159])\n\tby smtp.gmail.com with ESMTPSA id\n\tq24sm713600ljj.6.2019.10.03.12.37.10\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 03 Oct 2019 12:37:10 -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=p/l5JAtqa5qkCAsZpv8pIJFzB/W/uCb0TTDFdW5Trv8=;\n\tb=s1FvDYS/j7imEiofNkOgrZ1RlyMkDLzFqypJBiCnYA/JFzlk7XrNTbJqyT0hJKm659\n\tI5dANkxfVoiTmpRb95yLtEIq7Ux4r5qSek1qq/JFOMRbAQbmZO7XJbDFmGXgkzyCIU4I\n\tiL2AVZ/my9hqxho9Ur9KgrSOKxrXYX+miNqoU+e+29HlvYrdPpipd6N3ABj60sD/KPix\n\t8Nv4moechPoUjjoCiozcIUjcBOzf8me/RTOMi1bvhLipczymN/fmUeL2cF78SWS5VAcv\n\t2vXuiuyL53zNW04JCW3JG6fD+HuPOvrHwqvmQ8lmqaroMPIGijBJPsPL+jzgIFHLrQRR\n\tAywA==","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=p/l5JAtqa5qkCAsZpv8pIJFzB/W/uCb0TTDFdW5Trv8=;\n\tb=dkZwYOr6aXNMSvaOT3f3j257TtcwL79DWY5KGA5sR5dDZCDW67QG6MlTXPWWAiHBu7\n\tGDRPVwrAebvzi1y/UoVJxcyZuj4Hppjaqh3C9JMzVntZf3kFHcQm4PinXe3z11M8JvjJ\n\t+P/2ovJrVWVUVnM1dIjhM2sRVIudqZhvrrm14ny1e6BOToyMEpsQdMi03uaylwI1gxh4\n\tOAI/fhev9OTUvnN4s4gJPMYBAWCNl2qfaqzCDIVlVvrC2+26C7SIz63R14ArpQLQZR34\n\tWwvwuS+Rp3tvW90/NfvgzBgQNGjrDbYZVMBPdfcw/YRHPW4hNduoiJFYrLliXH/SgaM/\n\taETg==","X-Gm-Message-State":"APjAAAVRpSWZVzH8k7TIJmCgVFbF8qDw/k0k0lXhaXwKZHzjZtpsNRZ1\n\tUIeWbjJIyorAnO8ZYgEA27hPR/3Gvfg=","X-Google-Smtp-Source":"APXvYqz8R502UXAUSAIHnPF8P7Jz+8USuhiwVw6F0ag8cLQt2W7tC1Cyg0LyDQ6mPmX1qtS073KgeQ==","X-Received":"by 2002:a19:c80b:: with SMTP id\n\ty11mr7037184lff.184.1570131431258; \n\tThu, 03 Oct 2019 12:37:11 -0700 (PDT)","Date":"Thu, 3 Oct 2019 21:37:10 +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":"<20191003193710.GK1322@bigcity.dyn.berto.se>","References":"<20190929190254.18920-1-laurent.pinchart@ideasonboard.com>\n\t<20190929190254.18920-9-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-9-laurent.pinchart@ideasonboard.com>","User-Agent":"Mutt/1.12.1 (2019-06-15)","Subject":"Re: [libcamera-devel] [PATCH v2 08/13] libcamera: controls: Rename\n\tControlInfo to ControlRange","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:37:12 -0000"}}]