[libcamera-devel,1/2] ipa: raspberrypi: Make CamHelper exposure methods virtual
diff mbox series

Message ID 20210324114415.19866-2-david.plowman@raspberrypi.com
State Superseded
Headers show
Series
  • Raspberry Pi: handle sensors more flexibly
Related show

Commit Message

David Plowman March 24, 2021, 11:44 a.m. UTC
This allows derived classes to override them if they have any special
behaviours to implement. For instance if a particular camera mode
produces a different signal level to other modes, you might choose to
address that in the gain or exposure methods.

Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
---
 src/ipa/raspberrypi/cam_helper.hpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Naushir Patuck April 7, 2021, 10:29 a.m. UTC | #1
Hi David,

Thank you for your patch.

On Wed, 24 Mar 2021 at 11:44, David Plowman <david.plowman@raspberrypi.com>
wrote:

> This allows derived classes to override them if they have any special
> behaviours to implement. For instance if a particular camera mode
> produces a different signal level to other modes, you might choose to
> address that in the gain or exposure methods.
>
> Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
>

Reviewed-by: Naushir Patuck <naush@raspberrypi.com>


> ---
>  src/ipa/raspberrypi/cam_helper.hpp | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/ipa/raspberrypi/cam_helper.hpp
> b/src/ipa/raspberrypi/cam_helper.hpp
> index 1b2d6eec..4053a870 100644
> --- a/src/ipa/raspberrypi/cam_helper.hpp
> +++ b/src/ipa/raspberrypi/cam_helper.hpp
> @@ -66,8 +66,8 @@ public:
>         virtual ~CamHelper();
>         void SetCameraMode(const CameraMode &mode);
>         MdParser &Parser() const { return *parser_; }
> -       uint32_t ExposureLines(double exposure_us) const;
> -       double Exposure(uint32_t exposure_lines) const; // in us
> +       virtual uint32_t ExposureLines(double exposure_us) const;
> +       virtual double Exposure(uint32_t exposure_lines) const; // in us
>         virtual uint32_t GetVBlanking(double &exposure_us, double
> minFrameDuration,
>                                       double maxFrameDuration) const;
>         virtual uint32_t GainCode(double gain) const = 0;
> --
> 2.20.1
>
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel@lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel
>

Patch
diff mbox series

diff --git a/src/ipa/raspberrypi/cam_helper.hpp b/src/ipa/raspberrypi/cam_helper.hpp
index 1b2d6eec..4053a870 100644
--- a/src/ipa/raspberrypi/cam_helper.hpp
+++ b/src/ipa/raspberrypi/cam_helper.hpp
@@ -66,8 +66,8 @@  public:
 	virtual ~CamHelper();
 	void SetCameraMode(const CameraMode &mode);
 	MdParser &Parser() const { return *parser_; }
-	uint32_t ExposureLines(double exposure_us) const;
-	double Exposure(uint32_t exposure_lines) const; // in us
+	virtual uint32_t ExposureLines(double exposure_us) const;
+	virtual double Exposure(uint32_t exposure_lines) const; // in us
 	virtual uint32_t GetVBlanking(double &exposure_us, double minFrameDuration,
 				      double maxFrameDuration) const;
 	virtual uint32_t GainCode(double gain) const = 0;