[{"id":30410,"web_url":"https://patchwork.libcamera.org/comment/30410/","msgid":"<172101336005.342030.7981165078644656295@ping.linuxembedded.co.uk>","date":"2024-07-15T03:16:00","subject":"Re: [PATCH v5 1/5] libcamera: converter: Add interface for feature\n\tflags","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Umang Jain (2024-07-09 21:21:47)\n> This patch intends to extend the converter interface to have feature\n> flags, which enables each converter to expose the set of features\n> it supports.\n> \n> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>\n> ---\n>  include/libcamera/internal/converter.h        | 13 ++++++++++-\n>  .../internal/converter/converter_v4l2_m2m.h   |  2 +-\n>  src/libcamera/converter.cpp                   | 22 ++++++++++++++++++-\n>  .../converter/converter_v4l2_m2m.cpp          |  5 +++--\n>  4 files changed, 37 insertions(+), 5 deletions(-)\n> \n> diff --git a/include/libcamera/internal/converter.h b/include/libcamera/internal/converter.h\n> index b51563d7..7e478356 100644\n> --- a/include/libcamera/internal/converter.h\n> +++ b/include/libcamera/internal/converter.h\n> @@ -17,6 +17,7 @@\n>  #include <vector>\n>  \n>  #include <libcamera/base/class.h>\n> +#include <libcamera/base/flags.h>\n>  #include <libcamera/base/signal.h>\n>  \n>  #include <libcamera/geometry.h>\n> @@ -32,7 +33,13 @@ struct StreamConfiguration;\n>  class Converter\n>  {\n>  public:\n> -       Converter(MediaDevice *media);\n> +       enum class Feature {\n> +               None = 0,\n> +       };\n> +\n> +       using Features = Flags<Feature>;\n> +\n> +       Converter(MediaDevice *media, Features features = Feature::None);\n>         virtual ~Converter();\n>  \n>         virtual int loadConfiguration(const std::string &filename) = 0;\n> @@ -61,8 +68,12 @@ public:\n>  \n>         const std::string &deviceNode() const { return deviceNode_; }\n>  \n> +       Features getFeatures() const { return features_; }\n> +\n>  private:\n>         std::string deviceNode_;\n> +\n> +       Features features_;\n>  };\n>  \n>  class ConverterFactoryBase\n> diff --git a/include/libcamera/internal/converter/converter_v4l2_m2m.h b/include/libcamera/internal/converter/converter_v4l2_m2m.h\n> index b9e59899..91701dbe 100644\n> --- a/include/libcamera/internal/converter/converter_v4l2_m2m.h\n> +++ b/include/libcamera/internal/converter/converter_v4l2_m2m.h\n> @@ -35,7 +35,7 @@ class V4L2M2MDevice;\n>  class V4L2M2MConverter : public Converter\n>  {\n>  public:\n> -       V4L2M2MConverter(MediaDevice *media);\n> +       V4L2M2MConverter(MediaDevice *media, Features features = Feature::None);\n>  \n>         int loadConfiguration([[maybe_unused]] const std::string &filename) { return 0; }\n>         bool isValid() const { return m2m_ != nullptr; }\n> diff --git a/src/libcamera/converter.cpp b/src/libcamera/converter.cpp\n> index 2ab46133..2c3da6d4 100644\n> --- a/src/libcamera/converter.cpp\n> +++ b/src/libcamera/converter.cpp\n> @@ -34,14 +34,27 @@ LOG_DEFINE_CATEGORY(Converter)\n>   * parameters from the same input stream.\n>   */\n>  \n> +/**\n> + * \\enum Converter::Feature\n> + * \\brief Specify the features supported by the converter\n> + * \\var Converter::Feature::None\n> + * \\brief No extra features supported by the converter\n> + */\n> +\n> +/**\n> + * \\typedef Converter::Features\n> + * \\brief A bitwise combination of features supported by the converter\n> + */\n> +\n>  /**\n>   * \\brief Construct a Converter instance\n>   * \\param[in] media The media device implementing the converter\n> + * \\param[in] features Features flags representing supported features\n>   *\n>   * This searches for the entity implementing the data streaming function in the\n>   * media graph entities and use its device node as the converter device node.\n>   */\n> -Converter::Converter(MediaDevice *media)\n> +Converter::Converter(MediaDevice *media, Features features)\n>  {\n>         const std::vector<MediaEntity *> &entities = media->entities();\n>         auto it = std::find_if(entities.begin(), entities.end(),\n> @@ -56,6 +69,7 @@ Converter::Converter(MediaDevice *media)\n>         }\n>  \n>         deviceNode_ = (*it)->deviceNode();\n> +       features_ = features;\n>  }\n>  \n>  Converter::~Converter()\n> @@ -163,6 +177,12 @@ Converter::~Converter()\n>   * \\return The converter device node string\n>   */\n>  \n> +/**\n> + * \\fn Converter::getFeatures()\n> + * \\brief Gets the supported features by the converter\n> + * \\return The converter Features flag\n\n/flag/flags/\n\nLets see how it's used...\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n> + */\n> +\n>  /**\n>   * \\class ConverterFactoryBase\n>   * \\brief Base class for converter factories\n> diff --git a/src/libcamera/converter/converter_v4l2_m2m.cpp b/src/libcamera/converter/converter_v4l2_m2m.cpp\n> index 2e77872e..4aeb7dd9 100644\n> --- a/src/libcamera/converter/converter_v4l2_m2m.cpp\n> +++ b/src/libcamera/converter/converter_v4l2_m2m.cpp\n> @@ -191,10 +191,11 @@ void V4L2M2MConverter::V4L2M2MStream::captureBufferReady(FrameBuffer *buffer)\n>   * \\fn V4L2M2MConverter::V4L2M2MConverter\n>   * \\brief Construct a V4L2M2MConverter instance\n>   * \\param[in] media The media device implementing the converter\n> + * \\param[in] features Features flags representing supported features\n>   */\n>  \n> -V4L2M2MConverter::V4L2M2MConverter(MediaDevice *media)\n> -       : Converter(media)\n> +V4L2M2MConverter::V4L2M2MConverter(MediaDevice *media, Features features)\n> +       : Converter(media, features)\n>  {\n>         if (deviceNode().empty())\n>                 return;\n> -- \n> 2.45.2\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 3AFDEBDB1C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 15 Jul 2024 03:16:06 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id BEE5C6336F;\n\tMon, 15 Jul 2024 05:16:04 +0200 (CEST)","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 CF18B619A3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 15 Jul 2024 05:16:02 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 5AAF8496;\n\tMon, 15 Jul 2024 05:15:26 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"hITGENPG\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1721013326;\n\tbh=qgYa2/e8LpB6VUciAfiUZWjXJDgD7WBkEhHhpbmoA4E=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=hITGENPGjOCvHgb4O2X6QVygG1vb4+h/lpqyAdD2lIN3dpZyo6PxgT6THESOwfT+L\n\tozLUfaoj0VlRuUY/5e2BARgXLoYPOc8FQNFnT1/ISA6gAfjMwaptwcnL4Pcz4q/hY5\n\trvjyERW9V6OZFuVFKqVTH1JmTJLuOgAN5H9/XNH4=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20240709202151.152289-2-umang.jain@ideasonboard.com>","References":"<20240709202151.152289-1-umang.jain@ideasonboard.com>\n\t<20240709202151.152289-2-umang.jain@ideasonboard.com>","Subject":"Re: [PATCH v5 1/5] libcamera: converter: Add interface for feature\n\tflags","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Umang Jain <umang.jain@ideasonboard.com>","To":"Umang Jain <umang.jain@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Mon, 15 Jul 2024 04:16:00 +0100","Message-ID":"<172101336005.342030.7981165078644656295@ping.linuxembedded.co.uk>","User-Agent":"alot/0.10","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":30413,"web_url":"https://patchwork.libcamera.org/comment/30413/","msgid":"<Zpd2lSqzrd5-IeTj@pyrite.rasen.tech>","date":"2024-07-17T07:45:25","subject":"Re: [PATCH v5 1/5] libcamera: converter: Add interface for feature\n\tflags","submitter":{"id":17,"url":"https://patchwork.libcamera.org/api/people/17/","name":"Paul Elder","email":"paul.elder@ideasonboard.com"},"content":"On Wed, Jul 10, 2024 at 01:51:47AM +0530, Umang Jain wrote:\n> This patch intends to extend the converter interface to have feature\n> flags, which enables each converter to expose the set of features\n> it supports.\n> \n> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>\n\nReviewed-by: Paul Elder <paul.elder@ideasonboard.com>\n\n> ---\n>  include/libcamera/internal/converter.h        | 13 ++++++++++-\n>  .../internal/converter/converter_v4l2_m2m.h   |  2 +-\n>  src/libcamera/converter.cpp                   | 22 ++++++++++++++++++-\n>  .../converter/converter_v4l2_m2m.cpp          |  5 +++--\n>  4 files changed, 37 insertions(+), 5 deletions(-)\n> \n> diff --git a/include/libcamera/internal/converter.h b/include/libcamera/internal/converter.h\n> index b51563d7..7e478356 100644\n> --- a/include/libcamera/internal/converter.h\n> +++ b/include/libcamera/internal/converter.h\n> @@ -17,6 +17,7 @@\n>  #include <vector>\n>  \n>  #include <libcamera/base/class.h>\n> +#include <libcamera/base/flags.h>\n>  #include <libcamera/base/signal.h>\n>  \n>  #include <libcamera/geometry.h>\n> @@ -32,7 +33,13 @@ struct StreamConfiguration;\n>  class Converter\n>  {\n>  public:\n> -\tConverter(MediaDevice *media);\n> +\tenum class Feature {\n> +\t\tNone = 0,\n> +\t};\n> +\n> +\tusing Features = Flags<Feature>;\n> +\n> +\tConverter(MediaDevice *media, Features features = Feature::None);\n>  \tvirtual ~Converter();\n>  \n>  \tvirtual int loadConfiguration(const std::string &filename) = 0;\n> @@ -61,8 +68,12 @@ public:\n>  \n>  \tconst std::string &deviceNode() const { return deviceNode_; }\n>  \n> +\tFeatures getFeatures() const { return features_; }\n> +\n>  private:\n>  \tstd::string deviceNode_;\n> +\n> +\tFeatures features_;\n>  };\n>  \n>  class ConverterFactoryBase\n> diff --git a/include/libcamera/internal/converter/converter_v4l2_m2m.h b/include/libcamera/internal/converter/converter_v4l2_m2m.h\n> index b9e59899..91701dbe 100644\n> --- a/include/libcamera/internal/converter/converter_v4l2_m2m.h\n> +++ b/include/libcamera/internal/converter/converter_v4l2_m2m.h\n> @@ -35,7 +35,7 @@ class V4L2M2MDevice;\n>  class V4L2M2MConverter : public Converter\n>  {\n>  public:\n> -\tV4L2M2MConverter(MediaDevice *media);\n> +\tV4L2M2MConverter(MediaDevice *media, Features features = Feature::None);\n>  \n>  \tint loadConfiguration([[maybe_unused]] const std::string &filename) { return 0; }\n>  \tbool isValid() const { return m2m_ != nullptr; }\n> diff --git a/src/libcamera/converter.cpp b/src/libcamera/converter.cpp\n> index 2ab46133..2c3da6d4 100644\n> --- a/src/libcamera/converter.cpp\n> +++ b/src/libcamera/converter.cpp\n> @@ -34,14 +34,27 @@ LOG_DEFINE_CATEGORY(Converter)\n>   * parameters from the same input stream.\n>   */\n>  \n> +/**\n> + * \\enum Converter::Feature\n> + * \\brief Specify the features supported by the converter\n> + * \\var Converter::Feature::None\n> + * \\brief No extra features supported by the converter\n> + */\n> +\n> +/**\n> + * \\typedef Converter::Features\n> + * \\brief A bitwise combination of features supported by the converter\n> + */\n> +\n>  /**\n>   * \\brief Construct a Converter instance\n>   * \\param[in] media The media device implementing the converter\n> + * \\param[in] features Features flags representing supported features\n>   *\n>   * This searches for the entity implementing the data streaming function in the\n>   * media graph entities and use its device node as the converter device node.\n>   */\n> -Converter::Converter(MediaDevice *media)\n> +Converter::Converter(MediaDevice *media, Features features)\n>  {\n>  \tconst std::vector<MediaEntity *> &entities = media->entities();\n>  \tauto it = std::find_if(entities.begin(), entities.end(),\n> @@ -56,6 +69,7 @@ Converter::Converter(MediaDevice *media)\n>  \t}\n>  \n>  \tdeviceNode_ = (*it)->deviceNode();\n> +\tfeatures_ = features;\n>  }\n>  \n>  Converter::~Converter()\n> @@ -163,6 +177,12 @@ Converter::~Converter()\n>   * \\return The converter device node string\n>   */\n>  \n> +/**\n> + * \\fn Converter::getFeatures()\n> + * \\brief Gets the supported features by the converter\n> + * \\return The converter Features flag\n> + */\n> +\n>  /**\n>   * \\class ConverterFactoryBase\n>   * \\brief Base class for converter factories\n> diff --git a/src/libcamera/converter/converter_v4l2_m2m.cpp b/src/libcamera/converter/converter_v4l2_m2m.cpp\n> index 2e77872e..4aeb7dd9 100644\n> --- a/src/libcamera/converter/converter_v4l2_m2m.cpp\n> +++ b/src/libcamera/converter/converter_v4l2_m2m.cpp\n> @@ -191,10 +191,11 @@ void V4L2M2MConverter::V4L2M2MStream::captureBufferReady(FrameBuffer *buffer)\n>   * \\fn V4L2M2MConverter::V4L2M2MConverter\n>   * \\brief Construct a V4L2M2MConverter instance\n>   * \\param[in] media The media device implementing the converter\n> + * \\param[in] features Features flags representing supported features\n>   */\n>  \n> -V4L2M2MConverter::V4L2M2MConverter(MediaDevice *media)\n> -\t: Converter(media)\n> +V4L2M2MConverter::V4L2M2MConverter(MediaDevice *media, Features features)\n> +\t: Converter(media, features)\n>  {\n>  \tif (deviceNode().empty())\n>  \t\treturn;\n> -- \n> 2.45.2\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 12563C323E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 17 Jul 2024 07:45:37 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B46326336F;\n\tWed, 17 Jul 2024 09:45:35 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 4BF8D619A7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 17 Jul 2024 09:45:33 +0200 (CEST)","from pyrite.rasen.tech (h175-177-049-156.catv02.itscom.jp\n\t[175.177.49.156])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 62F1A66F;\n\tWed, 17 Jul 2024 09:44:54 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"Kg8DLulz\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1721202295;\n\tbh=oRKK3p0XTw8BMtMk9P42xxK6WoPpHp1fXNdtg7xOeRg=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=Kg8DLulzffn1P3cFywvdAF3db11+tgAB0bzGNIxaSo4emsv5Q5dHtZ7pft1nD12lC\n\tPxIOAgyIzSoDeApM5oEs5v4LyraWeBzB/3Se08NMUBipQBdYSKwkCW6JhFqQvzCzEp\n\t/BDw8Z/tQpnFSIlb4Ltm8Cif4gS+pFSFDxay/6+Q=","Date":"Wed, 17 Jul 2024 16:45:25 +0900","From":"Paul Elder <paul.elder@ideasonboard.com>","To":"Umang Jain <umang.jain@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH v5 1/5] libcamera: converter: Add interface for feature\n\tflags","Message-ID":"<Zpd2lSqzrd5-IeTj@pyrite.rasen.tech>","References":"<20240709202151.152289-1-umang.jain@ideasonboard.com>\n\t<20240709202151.152289-2-umang.jain@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20240709202151.152289-2-umang.jain@ideasonboard.com>","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":30415,"web_url":"https://patchwork.libcamera.org/comment/30415/","msgid":"<xn3wc6hqf5rejq7yrd6mx4bg6o3l7va6ofc2e2avzavzzcqpxw@l4pivqzfkcl5>","date":"2024-07-17T09:54:51","subject":"Re: [PATCH v5 1/5] libcamera: converter: Add interface for feature\n\tflags","submitter":{"id":143,"url":"https://patchwork.libcamera.org/api/people/143/","name":"Jacopo Mondi","email":"jacopo.mondi@ideasonboard.com"},"content":"Hi Umang\n\nOn Wed, Jul 10, 2024 at 01:51:47AM GMT, Umang Jain wrote:\n> This patch intends to extend the converter interface to have feature\n> flags, which enables each converter to expose the set of features\n> it supports.\n>\n> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>\n> ---\n>  include/libcamera/internal/converter.h        | 13 ++++++++++-\n>  .../internal/converter/converter_v4l2_m2m.h   |  2 +-\n>  src/libcamera/converter.cpp                   | 22 ++++++++++++++++++-\n>  .../converter/converter_v4l2_m2m.cpp          |  5 +++--\n>  4 files changed, 37 insertions(+), 5 deletions(-)\n>\n> diff --git a/include/libcamera/internal/converter.h b/include/libcamera/internal/converter.h\n> index b51563d7..7e478356 100644\n> --- a/include/libcamera/internal/converter.h\n> +++ b/include/libcamera/internal/converter.h\n> @@ -17,6 +17,7 @@\n>  #include <vector>\n>\n>  #include <libcamera/base/class.h>\n> +#include <libcamera/base/flags.h>\n>  #include <libcamera/base/signal.h>\n>\n>  #include <libcamera/geometry.h>\n> @@ -32,7 +33,13 @@ struct StreamConfiguration;\n>  class Converter\n>  {\n>  public:\n> -\tConverter(MediaDevice *media);\n> +\tenum class Feature {\n> +\t\tNone = 0,\n> +\t};\n> +\n> +\tusing Features = Flags<Feature>;\n> +\n> +\tConverter(MediaDevice *media, Features features = Feature::None);\n>  \tvirtual ~Converter();\n>\n>  \tvirtual int loadConfiguration(const std::string &filename) = 0;\n> @@ -61,8 +68,12 @@ public:\n>\n>  \tconst std::string &deviceNode() const { return deviceNode_; }\n>\n> +\tFeatures getFeatures() const { return features_; }\n\nno \"get\" in getters\nI know you'll hit a name clash with function arguments, just rename\nthem\n\n> +\n>  private:\n>  \tstd::string deviceNode_;\n> +\n> +\tFeatures features_;\n>  };\n>\n>  class ConverterFactoryBase\n> diff --git a/include/libcamera/internal/converter/converter_v4l2_m2m.h b/include/libcamera/internal/converter/converter_v4l2_m2m.h\n> index b9e59899..91701dbe 100644\n> --- a/include/libcamera/internal/converter/converter_v4l2_m2m.h\n> +++ b/include/libcamera/internal/converter/converter_v4l2_m2m.h\n> @@ -35,7 +35,7 @@ class V4L2M2MDevice;\n>  class V4L2M2MConverter : public Converter\n>  {\n>  public:\n> -\tV4L2M2MConverter(MediaDevice *media);\n> +\tV4L2M2MConverter(MediaDevice *media, Features features = Feature::None);\n\npersonally I feel it would be nicer to be able to do something like\n\n\nREGISTER_CONVERTER(\"dw100\", ConverterDW100, compatibles,\n\t\t   Converter::Feature::Crop)\n\nand specify features at converter registration time.\n\nI have patches for this if you're interested.\n\n>\n>  \tint loadConfiguration([[maybe_unused]] const std::string &filename) { return 0; }\n>  \tbool isValid() const { return m2m_ != nullptr; }\n> diff --git a/src/libcamera/converter.cpp b/src/libcamera/converter.cpp\n> index 2ab46133..2c3da6d4 100644\n> --- a/src/libcamera/converter.cpp\n> +++ b/src/libcamera/converter.cpp\n> @@ -34,14 +34,27 @@ LOG_DEFINE_CATEGORY(Converter)\n>   * parameters from the same input stream.\n>   */\n>\n> +/**\n> + * \\enum Converter::Feature\n> + * \\brief Specify the features supported by the converter\n> + * \\var Converter::Feature::None\n> + * \\brief No extra features supported by the converter\n> + */\n> +\n> +/**\n> + * \\typedef Converter::Features\n> + * \\brief A bitwise combination of features supported by the converter\n> + */\n> +\n>  /**\n>   * \\brief Construct a Converter instance\n>   * \\param[in] media The media device implementing the converter\n> + * \\param[in] features Features flags representing supported features\n>   *\n>   * This searches for the entity implementing the data streaming function in the\n>   * media graph entities and use its device node as the converter device node.\n>   */\n> -Converter::Converter(MediaDevice *media)\n> +Converter::Converter(MediaDevice *media, Features features)\n>  {\n>  \tconst std::vector<MediaEntity *> &entities = media->entities();\n>  \tauto it = std::find_if(entities.begin(), entities.end(),\n> @@ -56,6 +69,7 @@ Converter::Converter(MediaDevice *media)\n>  \t}\n>\n>  \tdeviceNode_ = (*it)->deviceNode();\n> +\tfeatures_ = features;\n>  }\n>\n>  Converter::~Converter()\n> @@ -163,6 +177,12 @@ Converter::~Converter()\n>   * \\return The converter device node string\n>   */\n>\n> +/**\n> + * \\fn Converter::getFeatures()\n> + * \\brief Gets the supported features by the converter\n> + * \\return The converter Features flag\n> + */\n> +\n>  /**\n>   * \\class ConverterFactoryBase\n>   * \\brief Base class for converter factories\n> diff --git a/src/libcamera/converter/converter_v4l2_m2m.cpp b/src/libcamera/converter/converter_v4l2_m2m.cpp\n> index 2e77872e..4aeb7dd9 100644\n> --- a/src/libcamera/converter/converter_v4l2_m2m.cpp\n> +++ b/src/libcamera/converter/converter_v4l2_m2m.cpp\n> @@ -191,10 +191,11 @@ void V4L2M2MConverter::V4L2M2MStream::captureBufferReady(FrameBuffer *buffer)\n>   * \\fn V4L2M2MConverter::V4L2M2MConverter\n>   * \\brief Construct a V4L2M2MConverter instance\n>   * \\param[in] media The media device implementing the converter\n> + * \\param[in] features Features flags representing supported features\n>   */\n>\n> -V4L2M2MConverter::V4L2M2MConverter(MediaDevice *media)\n> -\t: Converter(media)\n> +V4L2M2MConverter::V4L2M2MConverter(MediaDevice *media, Features features)\n> +\t: Converter(media, features)\n>  {\n>  \tif (deviceNode().empty())\n>  \t\treturn;\n> --\n> 2.45.2\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id E2DBABDB1C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 17 Jul 2024 09:54:57 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E45EC63369;\n\tWed, 17 Jul 2024 11:54:56 +0200 (CEST)","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 7F08D619A7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 17 Jul 2024 11:54:54 +0200 (CEST)","from ideasonboard.com (93-61-96-190.ip145.fastwebnet.it\n\t[93.61.96.190])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 77BF566F;\n\tWed, 17 Jul 2024 11:54:16 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"VPGYoaBP\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1721210056;\n\tbh=oTgfCUXnsWsm8JrsEZtJGiBUmaKrb4y0+yhvNPk9mvA=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=VPGYoaBPKy0316sGwTpZaov6v/lK/OYXy1JAZk2EgzcGER5Lc+HYl4Zoaol+hJIgt\n\tIkuwvMvqvB92AR7bEW/px4Vn/2v6O5w6HNK7APvZCFKdJqBCod/gfoXmG2Gxe0aiyi\n\tOqWREjpKdtjzBjRYo6Q9qk3dSXeW+YbYFJ3bN138=","Date":"Wed, 17 Jul 2024 11:54:51 +0200","From":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","To":"Umang Jain <umang.jain@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH v5 1/5] libcamera: converter: Add interface for feature\n\tflags","Message-ID":"<xn3wc6hqf5rejq7yrd6mx4bg6o3l7va6ofc2e2avzavzzcqpxw@l4pivqzfkcl5>","References":"<20240709202151.152289-1-umang.jain@ideasonboard.com>\n\t<20240709202151.152289-2-umang.jain@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20240709202151.152289-2-umang.jain@ideasonboard.com>","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":30418,"web_url":"https://patchwork.libcamera.org/comment/30418/","msgid":"<8ebc1c3f-733e-43c2-9531-2ffaca991a89@ideasonboard.com>","date":"2024-07-17T10:54:18","subject":"Re: [PATCH v5 1/5] libcamera: converter: Add interface for feature\n\tflags","submitter":{"id":86,"url":"https://patchwork.libcamera.org/api/people/86/","name":"Umang Jain","email":"umang.jain@ideasonboard.com"},"content":"Hi Jacopo,\n\nOn 17/07/24 3:24 pm, Jacopo Mondi wrote:\n> Hi Umang\n>\n> On Wed, Jul 10, 2024 at 01:51:47AM GMT, Umang Jain wrote:\n>> This patch intends to extend the converter interface to have feature\n>> flags, which enables each converter to expose the set of features\n>> it supports.\n>>\n>> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>\n>> ---\n>>   include/libcamera/internal/converter.h        | 13 ++++++++++-\n>>   .../internal/converter/converter_v4l2_m2m.h   |  2 +-\n>>   src/libcamera/converter.cpp                   | 22 ++++++++++++++++++-\n>>   .../converter/converter_v4l2_m2m.cpp          |  5 +++--\n>>   4 files changed, 37 insertions(+), 5 deletions(-)\n>>\n>> diff --git a/include/libcamera/internal/converter.h b/include/libcamera/internal/converter.h\n>> index b51563d7..7e478356 100644\n>> --- a/include/libcamera/internal/converter.h\n>> +++ b/include/libcamera/internal/converter.h\n>> @@ -17,6 +17,7 @@\n>>   #include <vector>\n>>\n>>   #include <libcamera/base/class.h>\n>> +#include <libcamera/base/flags.h>\n>>   #include <libcamera/base/signal.h>\n>>\n>>   #include <libcamera/geometry.h>\n>> @@ -32,7 +33,13 @@ struct StreamConfiguration;\n>>   class Converter\n>>   {\n>>   public:\n>> -\tConverter(MediaDevice *media);\n>> +\tenum class Feature {\n>> +\t\tNone = 0,\n>> +\t};\n>> +\n>> +\tusing Features = Flags<Feature>;\n>> +\n>> +\tConverter(MediaDevice *media, Features features = Feature::None);\n>>   \tvirtual ~Converter();\n>>\n>>   \tvirtual int loadConfiguration(const std::string &filename) = 0;\n>> @@ -61,8 +68,12 @@ public:\n>>\n>>   \tconst std::string &deviceNode() const { return deviceNode_; }\n>>\n>> +\tFeatures getFeatures() const { return features_; }\n> no \"get\" in getters\n> I know you'll hit a name clash with function arguments, just rename\n> them\n>\n>> +\n>>   private:\n>>   \tstd::string deviceNode_;\n>> +\n>> +\tFeatures features_;\n>>   };\n>>\n>>   class ConverterFactoryBase\n>> diff --git a/include/libcamera/internal/converter/converter_v4l2_m2m.h b/include/libcamera/internal/converter/converter_v4l2_m2m.h\n>> index b9e59899..91701dbe 100644\n>> --- a/include/libcamera/internal/converter/converter_v4l2_m2m.h\n>> +++ b/include/libcamera/internal/converter/converter_v4l2_m2m.h\n>> @@ -35,7 +35,7 @@ class V4L2M2MDevice;\n>>   class V4L2M2MConverter : public Converter\n>>   {\n>>   public:\n>> -\tV4L2M2MConverter(MediaDevice *media);\n>> +\tV4L2M2MConverter(MediaDevice *media, Features features = Feature::None);\n> personally I feel it would be nicer to be able to do something like\n>\n>\n> REGISTER_CONVERTER(\"dw100\", ConverterDW100, compatibles,\n> \t\t   Converter::Feature::Crop)\n>\n> and specify features at converter registration time.\n>\n> I have patches for this if you're interested.\n\ndefinitively looks on the right path. For now, I left out the \nREGISTER_CONVERTER parts (since I don't have the test setup yet for this.)\n\nIdeally, a YUV sensor with i.MX8MP ISI and dw100 as converter. And I \ndon't have a YUV sensor yet - which can be used with simple pipeline \nhandler.\n\n>\n>>   \tint loadConfiguration([[maybe_unused]] const std::string &filename) { return 0; }\n>>   \tbool isValid() const { return m2m_ != nullptr; }\n>> diff --git a/src/libcamera/converter.cpp b/src/libcamera/converter.cpp\n>> index 2ab46133..2c3da6d4 100644\n>> --- a/src/libcamera/converter.cpp\n>> +++ b/src/libcamera/converter.cpp\n>> @@ -34,14 +34,27 @@ LOG_DEFINE_CATEGORY(Converter)\n>>    * parameters from the same input stream.\n>>    */\n>>\n>> +/**\n>> + * \\enum Converter::Feature\n>> + * \\brief Specify the features supported by the converter\n>> + * \\var Converter::Feature::None\n>> + * \\brief No extra features supported by the converter\n>> + */\n>> +\n>> +/**\n>> + * \\typedef Converter::Features\n>> + * \\brief A bitwise combination of features supported by the converter\n>> + */\n>> +\n>>   /**\n>>    * \\brief Construct a Converter instance\n>>    * \\param[in] media The media device implementing the converter\n>> + * \\param[in] features Features flags representing supported features\n>>    *\n>>    * This searches for the entity implementing the data streaming function in the\n>>    * media graph entities and use its device node as the converter device node.\n>>    */\n>> -Converter::Converter(MediaDevice *media)\n>> +Converter::Converter(MediaDevice *media, Features features)\n>>   {\n>>   \tconst std::vector<MediaEntity *> &entities = media->entities();\n>>   \tauto it = std::find_if(entities.begin(), entities.end(),\n>> @@ -56,6 +69,7 @@ Converter::Converter(MediaDevice *media)\n>>   \t}\n>>\n>>   \tdeviceNode_ = (*it)->deviceNode();\n>> +\tfeatures_ = features;\n>>   }\n>>\n>>   Converter::~Converter()\n>> @@ -163,6 +177,12 @@ Converter::~Converter()\n>>    * \\return The converter device node string\n>>    */\n>>\n>> +/**\n>> + * \\fn Converter::getFeatures()\n>> + * \\brief Gets the supported features by the converter\n>> + * \\return The converter Features flag\n>> + */\n>> +\n>>   /**\n>>    * \\class ConverterFactoryBase\n>>    * \\brief Base class for converter factories\n>> diff --git a/src/libcamera/converter/converter_v4l2_m2m.cpp b/src/libcamera/converter/converter_v4l2_m2m.cpp\n>> index 2e77872e..4aeb7dd9 100644\n>> --- a/src/libcamera/converter/converter_v4l2_m2m.cpp\n>> +++ b/src/libcamera/converter/converter_v4l2_m2m.cpp\n>> @@ -191,10 +191,11 @@ void V4L2M2MConverter::V4L2M2MStream::captureBufferReady(FrameBuffer *buffer)\n>>    * \\fn V4L2M2MConverter::V4L2M2MConverter\n>>    * \\brief Construct a V4L2M2MConverter instance\n>>    * \\param[in] media The media device implementing the converter\n>> + * \\param[in] features Features flags representing supported features\n>>    */\n>>\n>> -V4L2M2MConverter::V4L2M2MConverter(MediaDevice *media)\n>> -\t: Converter(media)\n>> +V4L2M2MConverter::V4L2M2MConverter(MediaDevice *media, Features features)\n>> +\t: Converter(media, features)\n>>   {\n>>   \tif (deviceNode().empty())\n>>   \t\treturn;\n>> --\n>> 2.45.2\n>>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id C8920C323E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 17 Jul 2024 10:54:26 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8E0AE6336F;\n\tWed, 17 Jul 2024 12:54:25 +0200 (CEST)","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 52732619AB\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 17 Jul 2024 12:54:23 +0200 (CEST)","from [IPV6:2405:201:2015:f873:55d7:c02e:b2eb:ee3f] (unknown\n\t[IPv6:2405:201:2015:f873:55d7:c02e:b2eb:ee3f])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id B7EFC836;\n\tWed, 17 Jul 2024 12:53:44 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"SxPpWbYb\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1721213625;\n\tbh=PapmZ62fQddZO8YaSTjxt8X6/4Y5IYiKeuoOf+glpro=;\n\th=Date:Subject:To:Cc:References:From:In-Reply-To:From;\n\tb=SxPpWbYbTpptFna2oxomyQpmv3Q6nVwvi7+UuFpqW7g/t7ti+1xU5bOrVc++o2pZB\n\tztPbynRLc74t8iGQwS+7bwcHjwH19vPji8CQ7dj+XI9MOc9b+qyxKtRvvmK9LMTxp8\n\tLXUz086HOCEKLuv/XOKV9NvU8fDy9bTV09ZNdAU0=","Message-ID":"<8ebc1c3f-733e-43c2-9531-2ffaca991a89@ideasonboard.com>","Date":"Wed, 17 Jul 2024 16:24:18 +0530","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH v5 1/5] libcamera: converter: Add interface for feature\n\tflags","To":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","References":"<20240709202151.152289-1-umang.jain@ideasonboard.com>\n\t<20240709202151.152289-2-umang.jain@ideasonboard.com>\n\t<xn3wc6hqf5rejq7yrd6mx4bg6o3l7va6ofc2e2avzavzzcqpxw@l4pivqzfkcl5>","Content-Language":"en-US","From":"Umang Jain <umang.jain@ideasonboard.com>","In-Reply-To":"<xn3wc6hqf5rejq7yrd6mx4bg6o3l7va6ofc2e2avzavzzcqpxw@l4pivqzfkcl5>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"7bit","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]