@@ -127,14 +127,30 @@ ExposureModeHelper::ExposureModeHelper(const Span<std::pair<utils::Duration, dou
void ExposureModeHelper::configure(const SensorConfiguration &sensorConfig,
const CameraSensorHelper *sensorHelper)
{
+ ASSERT(sensorHelper);
+
sensor_ = sensorConfig;
sensorHelper_ = sensorHelper;
/* Initialize run-time limits with sensor's default. */
- minExposureTime_ = sensor_.minExposureTime_;
- maxExposureTime_ = sensor_.maxExposureTime_;
minGain_ = sensor_.minGain_;
maxGain_ = sensor_.maxGain_;
+
+ minExposureTime_ = sensor_.minExposureTime_;
+
+ /*
+ * Compute the maximum shutter time.
+ *
+ * If maxExposureTime is equal to minExposureTime then we use them
+ * to fix the exposure time.
+ *
+ * Otherwise, if the exposure can range between a min and max delegate
+ * the maximum shutter time calculation to the sensor helper.
+ */
+ maxExposureTime_ = minExposureTime_ != sensorConfig.maxExposureTime_
+ ? sensorHelper_->maxShutterTime(sensorConfig.maxFrameDuration_,
+ sensorConfig.lineDuration_)
+ : minExposureTime_;
}
/**
The maximum shutter time the AGC algorithm can achieve is, by definition, limited by the maximum programmed frame duration. When configuring the AGC algorithm, use the frame duration to calculate the maximum shutter time by using the CameraSensorHelper::maxShutterTime() function, unless the IPA has asked for a fixed exposure by setting min == max. Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> --- src/ipa/libipa/exposure_mode_helper.cpp | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-)