@@ -615,6 +615,8 @@ int AgcAlgorithm::init(const ValueNode &tuningData, CameraSensorHelper *sensor,
if (ret)
return ret;
+ tuning_.hasExposureModes = !agcConfig.exposureModeHelpers.empty();
+
addFallbacks(agcConfig);
impl_.emplace<AgcMeanLuminance>(std::move(agcConfig));
@@ -784,6 +786,16 @@ int AgcAlgorithm::configure(agc::Session &session, agc::ActiveState &state,
state.minFrameDuration = std::clamp(
utils::Duration(1.0s / 30),
session.minFrameDuration, session.maxFrameDuration);
+
+ if (!tuning_.hasExposureModes) {
+ /*
+ * By default do not run slower than 15fps
+ * if no exposure modes are defined.
+ */
+ state.maxFrameDuration = std::clamp(
+ utils::Duration(1.0s / 15),
+ state.minFrameDuration, session.maxFrameDuration);
+ }
}
/* \todo Move this to the `Camera` class. */
@@ -163,6 +163,10 @@ private:
std::variant<AgcMSV, AgcMeanLuminance> impl_;
CameraSensorHelper *sensor_ = nullptr;
+
+ struct {
+ bool hasExposureModes = false;
+ } tuning_;
};
} /* namespace ipa */