[v4,06/20] libcamera: converter_v4l2_m2m: Add missing override specifier
diff mbox series

Message ID 20241216154124.203650-7-stefan.klug@ideasonboard.com
State Accepted
Headers show
Series
  • rkisp1: Fix aspect ratio and ScalerCrop
Related show

Commit Message

Stefan Klug Dec. 16, 2024, 3:40 p.m. UTC
In preparation to adding new functions and overrides to the
V4L2M2MDevice class add an override specifier to all overridden
functions in the class. This prevents -Winconsistent-missing-override
warnings.

Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>

---

Changes in v4:
- Added this patch
---
 .../internal/converter/converter_v4l2_m2m.h   | 25 ++++++++++---------
 1 file changed, 13 insertions(+), 12 deletions(-)

Comments

Jacopo Mondi Dec. 16, 2024, 5:48 p.m. UTC | #1
Hi Stefan

On Mon, Dec 16, 2024 at 04:40:46PM +0100, Stefan Klug wrote:
> In preparation to adding new functions and overrides to the
> V4L2M2MDevice class add an override specifier to all overridden
> functions in the class. This prevents -Winconsistent-missing-override
> warnings.
>
> Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
>

Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>

Thanks
  j

> ---
>
> Changes in v4:
> - Added this patch
> ---
>  .../internal/converter/converter_v4l2_m2m.h   | 25 ++++++++++---------
>  1 file changed, 13 insertions(+), 12 deletions(-)
>
> diff --git a/include/libcamera/internal/converter/converter_v4l2_m2m.h b/include/libcamera/internal/converter/converter_v4l2_m2m.h
> index 0bc0d053e2c4..9b8e43ff0b91 100644
> --- a/include/libcamera/internal/converter/converter_v4l2_m2m.h
> +++ b/include/libcamera/internal/converter/converter_v4l2_m2m.h
> @@ -38,28 +38,29 @@ class V4L2M2MConverter : public Converter
>  public:
>  	V4L2M2MConverter(MediaDevice *media);
>
> -	int loadConfiguration([[maybe_unused]] const std::string &filename) { return 0; }
> -	bool isValid() const { return m2m_ != nullptr; }
> +	int loadConfiguration([[maybe_unused]] const std::string &filename) override { return 0; }
> +	bool isValid() const override { return m2m_ != nullptr; }
>
> -	std::vector<PixelFormat> formats(PixelFormat input);
> -	SizeRange sizes(const Size &input);
> +	std::vector<PixelFormat> formats(PixelFormat input) override;
> +	SizeRange sizes(const Size &input) override;
>
>  	std::tuple<unsigned int, unsigned int>
> -	strideAndFrameSize(const PixelFormat &pixelFormat, const Size &size);
> +	strideAndFrameSize(const PixelFormat &pixelFormat, const Size &size) override;
>
>  	int configure(const StreamConfiguration &inputCfg,
> -		      const std::vector<std::reference_wrapper<StreamConfiguration>> &outputCfg);
> +		      const std::vector<std::reference_wrapper<StreamConfiguration>>
> +		      &outputCfg) override;
>  	int exportBuffers(const Stream *stream, unsigned int count,
> -			  std::vector<std::unique_ptr<FrameBuffer>> *buffers);
> +			  std::vector<std::unique_ptr<FrameBuffer>> *buffers) override;
>
> -	int start();
> -	void stop();
> +	int start() override;
> +	void stop() override;
>
>  	int queueBuffers(FrameBuffer *input,
> -			 const std::map<const Stream *, FrameBuffer *> &outputs);
> +			 const std::map<const Stream *, FrameBuffer *> &outputs) override;
>
> -	int setInputCrop(const Stream *stream, Rectangle *rect);
> -	std::pair<Rectangle, Rectangle> inputCropBounds(const Stream *stream);
> +	int setInputCrop(const Stream *stream, Rectangle *rect) override;
> +	std::pair<Rectangle, Rectangle> inputCropBounds(const Stream *stream) override;
>
>  private:
>  	class V4L2M2MStream : protected Loggable
> --
> 2.43.0
>
Paul Elder Dec. 17, 2024, 3:32 a.m. UTC | #2
On Mon, Dec 16, 2024 at 04:40:46PM +0100, Stefan Klug wrote:
> In preparation to adding new functions and overrides to the

s/In preparation to/In preparation for/

> V4L2M2MDevice class add an override specifier to all overridden

s/ add/, add/

> functions in the class. This prevents -Winconsistent-missing-override
> warnings.
> 
> Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>

Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>

> 
> ---
> 
> Changes in v4:
> - Added this patch
> ---
>  .../internal/converter/converter_v4l2_m2m.h   | 25 ++++++++++---------
>  1 file changed, 13 insertions(+), 12 deletions(-)
> 
> diff --git a/include/libcamera/internal/converter/converter_v4l2_m2m.h b/include/libcamera/internal/converter/converter_v4l2_m2m.h
> index 0bc0d053e2c4..9b8e43ff0b91 100644
> --- a/include/libcamera/internal/converter/converter_v4l2_m2m.h
> +++ b/include/libcamera/internal/converter/converter_v4l2_m2m.h
> @@ -38,28 +38,29 @@ class V4L2M2MConverter : public Converter
>  public:
>  	V4L2M2MConverter(MediaDevice *media);
>  
> -	int loadConfiguration([[maybe_unused]] const std::string &filename) { return 0; }
> -	bool isValid() const { return m2m_ != nullptr; }
> +	int loadConfiguration([[maybe_unused]] const std::string &filename) override { return 0; }
> +	bool isValid() const override { return m2m_ != nullptr; }
>  
> -	std::vector<PixelFormat> formats(PixelFormat input);
> -	SizeRange sizes(const Size &input);
> +	std::vector<PixelFormat> formats(PixelFormat input) override;
> +	SizeRange sizes(const Size &input) override;
>  
>  	std::tuple<unsigned int, unsigned int>
> -	strideAndFrameSize(const PixelFormat &pixelFormat, const Size &size);
> +	strideAndFrameSize(const PixelFormat &pixelFormat, const Size &size) override;
>  
>  	int configure(const StreamConfiguration &inputCfg,
> -		      const std::vector<std::reference_wrapper<StreamConfiguration>> &outputCfg);
> +		      const std::vector<std::reference_wrapper<StreamConfiguration>>
> +		      &outputCfg) override;
>  	int exportBuffers(const Stream *stream, unsigned int count,
> -			  std::vector<std::unique_ptr<FrameBuffer>> *buffers);
> +			  std::vector<std::unique_ptr<FrameBuffer>> *buffers) override;
>  
> -	int start();
> -	void stop();
> +	int start() override;
> +	void stop() override;
>  
>  	int queueBuffers(FrameBuffer *input,
> -			 const std::map<const Stream *, FrameBuffer *> &outputs);
> +			 const std::map<const Stream *, FrameBuffer *> &outputs) override;
>  
> -	int setInputCrop(const Stream *stream, Rectangle *rect);
> -	std::pair<Rectangle, Rectangle> inputCropBounds(const Stream *stream);
> +	int setInputCrop(const Stream *stream, Rectangle *rect) override;
> +	std::pair<Rectangle, Rectangle> inputCropBounds(const Stream *stream) override;
>  
>  private:
>  	class V4L2M2MStream : protected Loggable
> -- 
> 2.43.0
>

Patch
diff mbox series

diff --git a/include/libcamera/internal/converter/converter_v4l2_m2m.h b/include/libcamera/internal/converter/converter_v4l2_m2m.h
index 0bc0d053e2c4..9b8e43ff0b91 100644
--- a/include/libcamera/internal/converter/converter_v4l2_m2m.h
+++ b/include/libcamera/internal/converter/converter_v4l2_m2m.h
@@ -38,28 +38,29 @@  class V4L2M2MConverter : public Converter
 public:
 	V4L2M2MConverter(MediaDevice *media);
 
-	int loadConfiguration([[maybe_unused]] const std::string &filename) { return 0; }
-	bool isValid() const { return m2m_ != nullptr; }
+	int loadConfiguration([[maybe_unused]] const std::string &filename) override { return 0; }
+	bool isValid() const override { return m2m_ != nullptr; }
 
-	std::vector<PixelFormat> formats(PixelFormat input);
-	SizeRange sizes(const Size &input);
+	std::vector<PixelFormat> formats(PixelFormat input) override;
+	SizeRange sizes(const Size &input) override;
 
 	std::tuple<unsigned int, unsigned int>
-	strideAndFrameSize(const PixelFormat &pixelFormat, const Size &size);
+	strideAndFrameSize(const PixelFormat &pixelFormat, const Size &size) override;
 
 	int configure(const StreamConfiguration &inputCfg,
-		      const std::vector<std::reference_wrapper<StreamConfiguration>> &outputCfg);
+		      const std::vector<std::reference_wrapper<StreamConfiguration>>
+		      &outputCfg) override;
 	int exportBuffers(const Stream *stream, unsigned int count,
-			  std::vector<std::unique_ptr<FrameBuffer>> *buffers);
+			  std::vector<std::unique_ptr<FrameBuffer>> *buffers) override;
 
-	int start();
-	void stop();
+	int start() override;
+	void stop() override;
 
 	int queueBuffers(FrameBuffer *input,
-			 const std::map<const Stream *, FrameBuffer *> &outputs);
+			 const std::map<const Stream *, FrameBuffer *> &outputs) override;
 
-	int setInputCrop(const Stream *stream, Rectangle *rect);
-	std::pair<Rectangle, Rectangle> inputCropBounds(const Stream *stream);
+	int setInputCrop(const Stream *stream, Rectangle *rect) override;
+	std::pair<Rectangle, Rectangle> inputCropBounds(const Stream *stream) override;
 
 private:
 	class V4L2M2MStream : protected Loggable