<div dir="ltr"><div dir="ltr">Hi Paul,<div><br></div><div>Thank you for your work.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, 24 May 2021 at 10:41, 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>
---<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 | 8 +++++++-<br>
src/libcamera/pipeline/ipu3/ipu3.cpp | 6 +++---<br>
5 files changed, 14 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 b32e8be5..0eea2b95 100644<br>
--- a/src/android/camera_device.cpp<br>
+++ b/src/android/camera_device.cpp<br>
@@ -824,7 +824,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 52d91db2..79a327e2 100644<br>
--- a/src/ipa/raspberrypi/raspberrypi.cpp<br>
+++ b/src/ipa/raspberrypi/raspberrypi.cpp<br>
@@ -860,7 +860,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>
@@ -1075,7 +1075,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..338fbdc9 100644<br>
--- a/src/libcamera/control_ids.yaml<br>
+++ b/src/libcamera/control_ids.yaml<br>
@@ -323,7 +323,13 @@ 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 nominal frame duration from start of frame exposure to start of<br>
+ next exposure, expressed in microseconds.<br></blockquote><div><br></div><div>Just a little nit-pick, is nominal the right word here? If this control were to return</div><div>the frame duration between frame N and frame N-1 for every frame, would it be</div><div>better to replace nominal with instantaneous, as the control value would be an</div><div>accurate representation of the inter-frame duration for that particular frame.</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>
+ - 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 8ae47c6d..6e17753f 100644<br>
--- a/src/libcamera/pipeline/ipu3/ipu3.cpp<br>
+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp<br>
@@ -980,9 +980,9 @@ 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::FrameDuration] = 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>