[{"id":2725,"web_url":"https://patchwork.libcamera.org/comment/2725/","msgid":"<20190929100636.ajdhg3n2ubwbv63r@uno.localdomain>","date":"2019-09-29T10:06:36","subject":"Re: [libcamera-devel] [PATCH 07/12] libcamera: controls: Rename\n\tControlInfo to ControlRange","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Laurent,\n\nOn Sat, Sep 28, 2019 at 06:22:33PM +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\nDon't want to start discussing names, just pointing out Range applies\nwell as long as this only describes min and max. I expect it to grow\nwith more validation information\n\nAlso, it seems ControlInfoMap stays with the same name, which still\nincludes 'Info'. Is this intended ?\n\nAnwyay\nReviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n\nThanks\n   j\n\n>\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\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 6a3bb353792d..51abb4ea7f6f 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\nto describe the validation criteria/limits of the controls they\nsupport.\n\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":"<jacopo@jmondi.org>","Received":["from relay10.mail.gandi.net (relay10.mail.gandi.net\n\t[217.70.178.230])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 04D4D61654\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 29 Sep 2019 12:04:54 +0200 (CEST)","from uno.localdomain\n\t(host7-199-dynamic.171-212-r.retail.telecomitalia.it [212.171.199.7])\n\t(Authenticated sender: jacopo@jmondi.org)\n\tby relay10.mail.gandi.net (Postfix) with ESMTPSA id 310DB240002;\n\tSun, 29 Sep 2019 10:04:54 +0000 (UTC)"],"Date":"Sun, 29 Sep 2019 12:06:36 +0200","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20190929100636.ajdhg3n2ubwbv63r@uno.localdomain>","References":"<20190928152238.23752-1-laurent.pinchart@ideasonboard.com>\n\t<20190928152238.23752-8-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"multipart/signed; micalg=pgp-sha256;\n\tprotocol=\"application/pgp-signature\"; boundary=\"nldus3nzb2czsl4c\"","Content-Disposition":"inline","In-Reply-To":"<20190928152238.23752-8-laurent.pinchart@ideasonboard.com>","User-Agent":"NeoMutt/20180716","Subject":"Re: [libcamera-devel] [PATCH 07/12] 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":"Sun, 29 Sep 2019 10:04:55 -0000"}},{"id":2733,"web_url":"https://patchwork.libcamera.org/comment/2733/","msgid":"<20190929125522.GE4827@pendragon.ideasonboard.com>","date":"2019-09-29T12:55:22","subject":"Re: [libcamera-devel] [PATCH 07/12] libcamera: controls: Rename\n\tControlInfo to ControlRange","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Jacopo,\n\nOn Sun, Sep 29, 2019 at 12:06:36PM +0200, Jacopo Mondi wrote:\n> On Sat, Sep 28, 2019 at 06:22:33PM +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> Don't want to start discussing names, just pointing out Range applies\n> well as long as this only describes min and max. I expect it to grow\n> with more validation information\n\nI'm aware of that, and we can rename the class then. Hopefully it will\ngive us a bit more time to think about a better name :-)\n\n> Also, it seems ControlInfoMap stays with the same name, which still\n> includes 'Info'. Is this intended ?\n\nI think we'll rename that class eventually. A bit more work is needed in\nthat area.\n\n> Anwyay\n> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n> \n> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\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 6a3bb353792d..51abb4ea7f6f 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> to describe the validation criteria/limits of the controls they\n> support.\n> \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> >","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 CE9BC61654\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 29 Sep 2019 14:55:33 +0200 (CEST)","from pendragon.ideasonboard.com\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 41662320;\n\tSun, 29 Sep 2019 14:55:33 +0200 (CEST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1569761733;\n\tbh=sB0B1ppkR0hIG8ceOpLqX/gV4cDqx1v79HSiOQWTRXo=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=F5LvIV8tjyAef0Jd1X2WOQjLhZgFC0BEteV7KY20IrAC6dkC20TNgfy9lMiJy3YKr\n\txCvMx7w9Fj3SPhHcEfRkx4GgKRyH6HjvIQL/tpqJYUaWmoFH+WT6w6UBK0q/jtQorh\n\tAnddK0Eshzlc4X8OdGV3gutMsHHdcDdrXkPV1mN0=","Date":"Sun, 29 Sep 2019 15:55:22 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20190929125522.GE4827@pendragon.ideasonboard.com>","References":"<20190928152238.23752-1-laurent.pinchart@ideasonboard.com>\n\t<20190928152238.23752-8-laurent.pinchart@ideasonboard.com>\n\t<20190929100636.ajdhg3n2ubwbv63r@uno.localdomain>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20190929100636.ajdhg3n2ubwbv63r@uno.localdomain>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH 07/12] 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":"Sun, 29 Sep 2019 12:55:34 -0000"}}]