<div dir="ltr"><div dir="ltr">Hi Paul, thank you for the patch.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, May 26, 2021 at 12:47 PM Paul Elder <<a href="mailto:paul.elder@ideasonboard.com">paul.elder@ideasonboard.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">We need a separate control to report the nominal frame duration, but<br>
it's also useful to report the min/max frame duration values that will<br>
be used. Split the FrameDurations control into FrameDuration and<br>
FrameDurationLimits respectively to support both of these.<br>
<br>
Signed-off-by: Paul Elder <<a href="mailto:paul.elder@ideasonboard.com" target="_blank">paul.elder@ideasonboard.com</a>><br>
Reviewed-by: Laurent Pinchart <<a href="mailto:laurent.pinchart@ideasonboard.com" target="_blank">laurent.pinchart@ideasonboard.com</a>><br>
<br></blockquote><div><br></div><div>Reviewed-by: Hirokazu Honda <<a href="mailto:hiroh@chromium.org">hiroh@chromium.org</a>></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
---<br>
Changes in v4:<br>
- set FrameDurationLimits (instead of FrameDuration) in the ipu3<br>
pipeline handler<br>
<br>
Changes in v3:<br>
- mention that the control is meant to be returned in metadata<br>
- s/nominal/instantaneous<br>
---<br>
include/libcamera/ipa/raspberrypi.h | 2 +-<br>
src/android/camera_device.cpp | 2 +-<br>
src/ipa/raspberrypi/raspberrypi.cpp | 4 ++--<br>
src/libcamera/control_ids.yaml | 9 ++++++++-<br>
src/libcamera/pipeline/ipu3/ipu3.cpp | 7 ++++---<br>
5 files changed, 16 insertions(+), 8 deletions(-)<br>
<br>
diff --git a/include/libcamera/ipa/raspberrypi.h b/include/libcamera/ipa/raspberrypi.h<br>
index d10c1733..a8790000 100644<br>
--- a/include/libcamera/ipa/raspberrypi.h<br>
+++ b/include/libcamera/ipa/raspberrypi.h<br>
@@ -44,7 +44,7 @@ static const ControlInfoMap Controls = {<br>
{ &controls::Sharpness, ControlInfo(0.0f, 16.0f, 1.0f) },<br>
{ &controls::ColourCorrectionMatrix, ControlInfo(-16.0f, 16.0f) },<br>
{ &controls::ScalerCrop, ControlInfo(Rectangle{}, Rectangle(65535, 65535, 65535, 65535), Rectangle{}) },<br>
- { &controls::FrameDurations, ControlInfo(INT64_C(1000), INT64_C(1000000000)) },<br>
+ { &controls::FrameDurationLimits, ControlInfo(INT64_C(1000), INT64_C(1000000000)) },<br>
{ &controls::draft::NoiseReductionMode, ControlInfo(controls::draft::NoiseReductionModeValues) },<br>
};<br>
<br>
diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp<br>
index dc0c8f5f..9e267b5f 100644<br>
--- a/src/android/camera_device.cpp<br>
+++ b/src/android/camera_device.cpp<br>
@@ -864,7 +864,7 @@ const camera_metadata_t *CameraDevice::getStaticMetadata()<br>
<br>
int64_t minFrameDurationNsec = -1;<br>
int64_t maxFrameDurationNsec = -1;<br>
- const auto frameDurationsInfo = controlsInfo.find(&controls::FrameDurations);<br>
+ const auto frameDurationsInfo = controlsInfo.find(&controls::FrameDurationLimits);<br>
if (frameDurationsInfo != controlsInfo.end()) {<br>
minFrameDurationNsec = frameDurationsInfo->second.min().get<int64_t>() * 1000;<br>
maxFrameDurationNsec = frameDurationsInfo->second.max().get<int64_t>() * 1000;<br>
diff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp<br>
index e5bb8159..0c4752ec 100644<br>
--- a/src/ipa/raspberrypi/raspberrypi.cpp<br>
+++ b/src/ipa/raspberrypi/raspberrypi.cpp<br>
@@ -859,7 +859,7 @@ void IPARPi::queueRequest(const ControlList &controls)<br>
break;<br>
}<br>
<br>
- case controls::FRAME_DURATIONS: {<br>
+ case controls::FRAME_DURATION_LIMITS: {<br>
auto frameDurations = ctrl.second.get<Span<const int64_t>>();<br>
applyFrameDurations(frameDurations[0], frameDurations[1]);<br>
break;<br>
@@ -1074,7 +1074,7 @@ void IPARPi::applyFrameDurations(double minFrameDuration, double maxFrameDuratio<br>
maxFrameDuration_ = std::max(maxFrameDuration_, minFrameDuration_);<br>
<br>
/* Return the validated limits via metadata. */<br>
- libcameraMetadata_.set(controls::FrameDurations,<br>
+ libcameraMetadata_.set(controls::FrameDurationLimits,<br>
{ static_cast<int64_t>(minFrameDuration_),<br>
static_cast<int64_t>(maxFrameDuration_) });<br>
<br>
diff --git a/src/libcamera/control_ids.yaml b/src/libcamera/control_ids.yaml<br>
index 88d81ac4..f62ade48 100644<br>
--- a/src/libcamera/control_ids.yaml<br>
+++ b/src/libcamera/control_ids.yaml<br>
@@ -323,7 +323,14 @@ controls:<br>
step to respect the received gain factor and shall report<br>
their total value in the request metadata.<br>
<br>
- - FrameDurations:<br>
+ - FrameDuration:<br>
+ type: int64_t<br>
+ description: |<br>
+ The instantaneous frame duration from start of frame exposure to start<br>
+ of next exposure, expressed in microseconds. This control is meant to<br>
+ be returned in metadata.<br>
+<br>
+ - FrameDurationLimits:<br>
type: int64_t<br>
description: |<br>
The minimum and maximum (in that order) frame duration,<br>
diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp<br>
index 25203256..2d15d488 100644<br>
--- a/src/libcamera/pipeline/ipu3/ipu3.cpp<br>
+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp<br>
@@ -983,9 +983,10 @@ int PipelineHandlerIPU3::initControls(IPU3CameraData *data)<br>
frameDurations[i] = frameSize / (sensorInfo.pixelRate / 1000000U);<br>
}<br>
<br>
- controls[&controls::FrameDurations] = ControlInfo(frameDurations[0],<br>
- frameDurations[1],<br>
- frameDurations[2]);<br>
+ controls[&controls::FrameDurationLimits] =<br>
+ ControlInfo(frameDurations[0],<br>
+ frameDurations[1],<br>
+ frameDurations[2]);<br>
<br>
/*<br>
* Compute the scaler crop limits.<br>
-- <br>
2.27.0<br>
<br>
</blockquote></div></div>