controls: Split FrameDurations into FrameDuration and FrameDurationLimits

We need a separate control to report the nominal frame duration, but
it's also useful to report the min/max frame duration values that will
be used. Split the FrameDurations control into FrameDuration and
FrameDurationLimits respectively to support both of these.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
This commit is contained in:
Paul Elder 2021-05-24 18:37:14 +09:00
parent c0a9768a9b
commit 19772ffe10
5 changed files with 16 additions and 8 deletions

View file

@ -859,7 +859,7 @@ void IPARPi::queueRequest(const ControlList &controls)
break;
}
case controls::FRAME_DURATIONS: {
case controls::FRAME_DURATION_LIMITS: {
auto frameDurations = ctrl.second.get<Span<const int64_t>>();
applyFrameDurations(frameDurations[0], frameDurations[1]);
break;
@ -1074,7 +1074,7 @@ void IPARPi::applyFrameDurations(double minFrameDuration, double maxFrameDuratio
maxFrameDuration_ = std::max(maxFrameDuration_, minFrameDuration_);
/* Return the validated limits via metadata. */
libcameraMetadata_.set(controls::FrameDurations,
libcameraMetadata_.set(controls::FrameDurationLimits,
{ static_cast<int64_t>(minFrameDuration_),
static_cast<int64_t>(maxFrameDuration_) });