diff options
author | Naushir Patuck <naush@raspberrypi.com> | 2021-06-08 12:03:33 +0100 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2021-06-08 23:56:15 +0300 |
commit | caa753179c039a0ecbfef595c3179aac4bf044d5 (patch) | |
tree | 8e20435d6aa6cfe597ccdbaf859f50192eec095d /src/ipa/raspberrypi/cam_helper.hpp | |
parent | 5055ca747c4c0d635ed8f2ab272f493748c2f50a (diff) |
ipa: raspberrypi: Switch ipa and cam_helper to use utils::Duration
Switch the ipa and cam_helper code to use libcamera::utils::Duration for
all time based variables. This improves code readability and avoids
possible errors when converting between time bases.
Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/ipa/raspberrypi/cam_helper.hpp')
-rw-r--r-- | src/ipa/raspberrypi/cam_helper.hpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/ipa/raspberrypi/cam_helper.hpp b/src/ipa/raspberrypi/cam_helper.hpp index a52f3f0b..f53f5c39 100644 --- a/src/ipa/raspberrypi/cam_helper.hpp +++ b/src/ipa/raspberrypi/cam_helper.hpp @@ -15,6 +15,7 @@ #include "controller/metadata.hpp" #include "md_parser.hpp" +#include "libcamera/internal/utils.h" #include "libcamera/internal/v4l2_videodevice.h" namespace RPiController { @@ -72,10 +73,11 @@ public: virtual void Prepare(libcamera::Span<const uint8_t> buffer, Metadata &metadata); virtual void Process(StatisticsPtr &stats, Metadata &metadata); - uint32_t ExposureLines(double exposure_us) const; - double Exposure(uint32_t exposure_lines) const; // in us - virtual uint32_t GetVBlanking(double &exposure_us, double minFrameDuration, - double maxFrameDuration) const; + uint32_t ExposureLines(libcamera::utils::Duration exposure) const; + libcamera::utils::Duration Exposure(uint32_t exposure_lines) const; + virtual uint32_t GetVBlanking(libcamera::utils::Duration &exposure, + libcamera::utils::Duration minFrameDuration, + libcamera::utils::Duration maxFrameDuration) const; virtual uint32_t GainCode(double gain) const = 0; virtual double Gain(uint32_t gain_code) const = 0; virtual void GetDelays(int &exposure_delay, int &gain_delay, |