summaryrefslogtreecommitdiff
path: root/src/ipa/raspberrypi/controller
diff options
context:
space:
mode:
Diffstat (limited to 'src/ipa/raspberrypi/controller')
-rw-r--r--src/ipa/raspberrypi/controller/agc_algorithm.hpp7
-rw-r--r--src/ipa/raspberrypi/controller/rpi/agc.cpp13
-rw-r--r--src/ipa/raspberrypi/controller/rpi/agc.hpp6
3 files changed, 14 insertions, 12 deletions
diff --git a/src/ipa/raspberrypi/controller/agc_algorithm.hpp b/src/ipa/raspberrypi/controller/agc_algorithm.hpp
index f97deb0f..134bbcda 100644
--- a/src/ipa/raspberrypi/controller/agc_algorithm.hpp
+++ b/src/ipa/raspberrypi/controller/agc_algorithm.hpp
@@ -6,6 +6,7 @@
*/
#pragma once
+#include "libcamera/internal/utils.h"
#include "algorithm.hpp"
namespace RPiController {
@@ -17,9 +18,9 @@ public:
// An AGC algorithm must provide the following:
virtual unsigned int GetConvergenceFrames() const = 0;
virtual void SetEv(double ev) = 0;
- virtual void SetFlickerPeriod(double flicker_period) = 0;
- virtual void SetFixedShutter(double fixed_shutter) = 0; // microseconds
- virtual void SetMaxShutter(double max_shutter) = 0; // microseconds
+ virtual void SetFlickerPeriod(libcamera::utils::Duration flicker_period) = 0;
+ virtual void SetFixedShutter(libcamera::utils::Duration fixed_shutter) = 0;
+ virtual void SetMaxShutter(libcamera::utils::Duration max_shutter) = 0;
virtual void SetFixedAnalogueGain(double fixed_analogue_gain) = 0;
virtual void SetMeteringMode(std::string const &metering_mode_name) = 0;
virtual void SetExposureMode(std::string const &exposure_mode_name) = 0;
diff --git a/src/ipa/raspberrypi/controller/rpi/agc.cpp b/src/ipa/raspberrypi/controller/rpi/agc.cpp
index f4cd5d26..fd3359a7 100644
--- a/src/ipa/raspberrypi/controller/rpi/agc.cpp
+++ b/src/ipa/raspberrypi/controller/rpi/agc.cpp
@@ -21,6 +21,7 @@
using namespace RPiController;
using namespace libcamera;
+using libcamera::utils::Duration;
LOG_DEFINE_CATEGORY(RPiAgc)
@@ -222,19 +223,19 @@ void Agc::SetEv(double ev)
ev_ = ev;
}
-void Agc::SetFlickerPeriod(double flicker_period)
+void Agc::SetFlickerPeriod(Duration flicker_period)
{
- flicker_period_ = flicker_period;
+ flicker_period_ = flicker_period.get<std::micro>();
}
-void Agc::SetMaxShutter(double max_shutter)
+void Agc::SetMaxShutter(Duration max_shutter)
{
- max_shutter_ = max_shutter;
+ max_shutter_ = max_shutter.get<std::micro>();
}
-void Agc::SetFixedShutter(double fixed_shutter)
+void Agc::SetFixedShutter(Duration fixed_shutter)
{
- fixed_shutter_ = fixed_shutter;
+ fixed_shutter_ = fixed_shutter.get<std::micro>();
// Set this in case someone calls Pause() straight after.
status_.shutter_time = clipShutter(fixed_shutter_);
}
diff --git a/src/ipa/raspberrypi/controller/rpi/agc.hpp b/src/ipa/raspberrypi/controller/rpi/agc.hpp
index 0427fb59..b52aaa23 100644
--- a/src/ipa/raspberrypi/controller/rpi/agc.hpp
+++ b/src/ipa/raspberrypi/controller/rpi/agc.hpp
@@ -77,9 +77,9 @@ public:
void Resume() override;
unsigned int GetConvergenceFrames() const override;
void SetEv(double ev) override;
- void SetFlickerPeriod(double flicker_period) override;
- void SetMaxShutter(double max_shutter) override; // microseconds
- void SetFixedShutter(double fixed_shutter) override; // microseconds
+ void SetFlickerPeriod(libcamera::utils::Duration flicker_period) override;
+ void SetMaxShutter(libcamera::utils::Duration max_shutter) override;
+ void SetFixedShutter(libcamera::utils::Duration fixed_shutter) override;
void SetFixedAnalogueGain(double fixed_analogue_gain) override;
void SetMeteringMode(std::string const &metering_mode_name) override;
void SetExposureMode(std::string const &exposure_mode_name) override;