[RFC,8/9] dw100: fixup
diff mbox series

Message ID 20240717100913.16640-9-jacopo.mondi@ideasonboard.com
State Superseded
Headers show
Series
  • Handle Converter features differently
Related show

Commit Message

Jacopo Mondi July 17, 2024, 10:09 a.m. UTC
Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
---
 .../libcamera/internal/converter/converter_dw100.h    |  2 +-
 src/libcamera/converter/converter_dw100.cpp           | 11 +++++++++--
 2 files changed, 10 insertions(+), 3 deletions(-)

Comments

Umang Jain July 17, 2024, 12:50 p.m. UTC | #1
On 17/07/24 3:39 pm, Jacopo Mondi wrote:
> Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
> ---
>   .../libcamera/internal/converter/converter_dw100.h    |  2 +-
>   src/libcamera/converter/converter_dw100.cpp           | 11 +++++++++--
>   2 files changed, 10 insertions(+), 3 deletions(-)
>
> diff --git a/include/libcamera/internal/converter/converter_dw100.h b/include/libcamera/internal/converter/converter_dw100.h
> index dc41f365b5c7..ee82b99e8d9d 100644
> --- a/include/libcamera/internal/converter/converter_dw100.h
> +++ b/include/libcamera/internal/converter/converter_dw100.h
> @@ -18,7 +18,7 @@ class Stream;
>   class ConverterDW100 : public V4L2M2MConverter
>   {
>   public:
> -	ConverterDW100(std::shared_ptr<MediaDevice> media);
> +	ConverterDW100(MediaDevice *media, Converter::Features features);
>   };
>   
>   } /* namespace libcamera */
> diff --git a/src/libcamera/converter/converter_dw100.cpp b/src/libcamera/converter/converter_dw100.cpp
> index 3061fc71dd80..09ede8d0c216 100644
> --- a/src/libcamera/converter/converter_dw100.cpp
> +++ b/src/libcamera/converter/converter_dw100.cpp
> @@ -29,9 +29,16 @@ LOG_DECLARE_CATEGORY(Converter)
>    * \brief Construct a ConverterDW100 instance
>    * \param[in] media The media device implementing the converter
>    */
> -ConverterDW100::ConverterDW100(std::shared_ptr<MediaDevice> media)
> -	: V4L2M2MConverter(media.get(), Feature::Crop)
> +ConverterDW100::ConverterDW100(MediaDevice *media, Converter::Features features)
> +	: V4L2M2MConverter(media, features)
>   {
>   }
>   
> +static std::initializer_list<std::string> compatibles = {
> +	"dw100",
> +};

What I was thinking here is to have

+	"dw100", Converter::Feature::Crop
....

Here it doesn't makes much sense, but I think looking at 
v4l2_m2m_converter(s), I think each compatible string needs to have its 
own set of features, no ?
> +
> +REGISTER_CONVERTER("dw100", ConverterDW100, compatibles,
> +		   Converter::Feature::Crop)
> +
>   } /* namespace libcamera */

Patch
diff mbox series

diff --git a/include/libcamera/internal/converter/converter_dw100.h b/include/libcamera/internal/converter/converter_dw100.h
index dc41f365b5c7..ee82b99e8d9d 100644
--- a/include/libcamera/internal/converter/converter_dw100.h
+++ b/include/libcamera/internal/converter/converter_dw100.h
@@ -18,7 +18,7 @@  class Stream;
 class ConverterDW100 : public V4L2M2MConverter
 {
 public:
-	ConverterDW100(std::shared_ptr<MediaDevice> media);
+	ConverterDW100(MediaDevice *media, Converter::Features features);
 };
 
 } /* namespace libcamera */
diff --git a/src/libcamera/converter/converter_dw100.cpp b/src/libcamera/converter/converter_dw100.cpp
index 3061fc71dd80..09ede8d0c216 100644
--- a/src/libcamera/converter/converter_dw100.cpp
+++ b/src/libcamera/converter/converter_dw100.cpp
@@ -29,9 +29,16 @@  LOG_DECLARE_CATEGORY(Converter)
  * \brief Construct a ConverterDW100 instance
  * \param[in] media The media device implementing the converter
  */
-ConverterDW100::ConverterDW100(std::shared_ptr<MediaDevice> media)
-	: V4L2M2MConverter(media.get(), Feature::Crop)
+ConverterDW100::ConverterDW100(MediaDevice *media, Converter::Features features)
+	: V4L2M2MConverter(media, features)
 {
 }
 
+static std::initializer_list<std::string> compatibles = {
+	"dw100",
+};
+
+REGISTER_CONVERTER("dw100", ConverterDW100, compatibles,
+		   Converter::Feature::Crop)
+
 } /* namespace libcamera */