<div dir="ltr"><div dir="ltr">Hi Nicolas,<div><br></div><div>Thank you for your patch.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, 7 Jul 2021 at 15:42, Nícolas F. R. A. Prado <<a href="mailto:nfraprado@collabora.com">nfraprado@collabora.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">The MinNumRequests property reports the bare minimum number of requests<br>
needed in the camera pipeline for capture to be possible. It is equal to<br>
the number of buffers required by the driver. At this quantity, there's<br>
no guarantee that frames won't be dropped or that manual per-frame<br>
controls will apply correctly. The quantity needed for those may be<br>
added as separate properties in the future.<br>
<br>
Signed-off-by: Nícolas F. R. A. Prado <<a href="mailto:nfraprado@collabora.com" target="_blank">nfraprado@collabora.com</a>><br>
---<br>
src/libcamera/pipeline/ipu3/ipu3.cpp | 6 ++++++<br>
src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 6 ++++++<br>
src/libcamera/pipeline/rkisp1/rkisp1.cpp | 2 ++<br>
src/libcamera/pipeline/simple/simple.cpp | 2 ++<br>
src/libcamera/pipeline/uvcvideo/uvcvideo.cpp | 2 ++<br>
src/libcamera/pipeline/vimc/vimc.cpp | 3 +++<br>
src/libcamera/property_ids.yaml | 9 +++++++++<br>
7 files changed, 30 insertions(+)<br>
<br>
diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp<br>
index 76c3bb3d8aa9..017018c845fa 100644<br>
--- a/src/libcamera/pipeline/ipu3/ipu3.cpp<br>
+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp<br>
@@ -1111,6 +1111,12 @@ int PipelineHandlerIPU3::registerCameras()<br>
/* Initialize the camera properties. */<br>
data->properties_ = cio2->sensor()->properties();<br>
<br>
+ /*<br>
+ * \todo Make sure this is correct even after the stream is<br>
+ * configured to CIO2<br>
+ */<br>
+ data->properties_.set(properties::MinNumRequests, 1);<br>
+<br>
ret = initControls(data.get());<br>
if (ret)<br>
continue;<br>
diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp<br>
index 082eb1ee1c23..f99a21de6918 100644<br>
--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp<br>
+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp<br>
@@ -1045,6 +1045,12 @@ bool PipelineHandlerRPi::match(DeviceEnumerator *enumerator)<br>
/* Initialize the camera properties. */<br>
data->properties_ = data->sensor_->properties();<br>
<br>
+ /*<br>
+ * \todo Make sure this is correct after the stream is configured for<br>
+ * any of the roles<br>
+ */<br>
+ data->properties_.set(properties::MinNumRequests, 1);<br>
+<br></blockquote><div><br></div><div>Could you elaborate a bit on the above \todo, I'm not entirely sure it is relevant for the</div><div>Raspberry Pi pipeline handler.</div><div> </div><div>Thanks,</div><div>Naush</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
/*<br>
* Set a default value for the ScalerCropMaximum property to show<br>
* that we support its use, however, initialise it to zero because<br>
diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp<br>
index 00df4f0b3e6b..b5cbf2394b1c 100644<br>
--- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp<br>
+++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp<br>
@@ -24,6 +24,7 @@<br>
#include <libcamera/ipa/core_ipa_interface.h><br>
#include <libcamera/ipa/rkisp1_ipa_interface.h><br>
#include <libcamera/ipa/rkisp1_ipa_proxy.h><br>
+#include <libcamera/property_ids.h><br>
#include <libcamera/request.h><br>
#include <libcamera/stream.h><br>
<br>
@@ -944,6 +945,7 @@ int PipelineHandlerRkISP1::createCamera(MediaEntity *sensor)<br>
<br>
/* Initialize the camera properties. */<br>
data->properties_ = data->sensor_->properties();<br>
+ data->properties_.set(properties::MinNumRequests, 3);<br>
<br>
/*<br>
* \todo Read dealy values from the sensor itself or from a<br>
diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp<br>
index b29fff9820e5..c4adea61519f 100644<br>
--- a/src/libcamera/pipeline/simple/simple.cpp<br>
+++ b/src/libcamera/pipeline/simple/simple.cpp<br>
@@ -25,6 +25,7 @@<br>
<br>
#include <libcamera/camera.h><br>
#include <libcamera/control_ids.h><br>
+#include <libcamera/property_ids.h><br>
#include <libcamera/request.h><br>
#include <libcamera/stream.h><br>
<br>
@@ -436,6 +437,7 @@ int SimpleCameraData::init()<br>
}<br>
<br>
properties_ = sensor_->properties();<br>
+ properties_.set(properties::MinNumRequests, 3);<br>
<br>
return 0;<br>
}<br>
diff --git a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp<br>
index 0f634b8da609..0258111ad6cf 100644<br>
--- a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp<br>
+++ b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp<br>
@@ -525,6 +525,8 @@ int UVCCameraData::init(MediaDevice *media)<br>
properties_.set(properties::PixelArraySize, resolution);<br>
properties_.set(properties::PixelArrayActiveAreas, { Rectangle(resolution) });<br>
<br>
+ properties_.set(properties::MinNumRequests, 1);<br>
+<br>
/* Initialise the supported controls. */<br>
ControlInfoMap::Map ctrls;<br>
<br>
diff --git a/src/libcamera/pipeline/vimc/vimc.cpp b/src/libcamera/pipeline/vimc/vimc.cpp<br>
index 12f7517fd0ae..8c3f7ccb46bd 100644<br>
--- a/src/libcamera/pipeline/vimc/vimc.cpp<br>
+++ b/src/libcamera/pipeline/vimc/vimc.cpp<br>
@@ -21,6 +21,7 @@<br>
#include <libcamera/control_ids.h><br>
#include <libcamera/controls.h><br>
#include <libcamera/formats.h><br>
+#include <libcamera/property_ids.h><br>
#include <libcamera/request.h><br>
#include <libcamera/stream.h><br>
<br>
@@ -517,6 +518,8 @@ int VimcCameraData::init()<br>
/* Initialize the camera properties. */<br>
properties_ = sensor_->properties();<br>
<br>
+ properties_.set(properties::MinNumRequests, 2);<br>
+<br>
return 0;<br>
}<br>
<br>
diff --git a/src/libcamera/property_ids.yaml b/src/libcamera/property_ids.yaml<br>
index 12ecbce5eed4..4efa952ee393 100644<br>
--- a/src/libcamera/property_ids.yaml<br>
+++ b/src/libcamera/property_ids.yaml<br>
@@ -678,6 +678,15 @@ controls:<br>
\todo Turn this property into a "maximum control value" for the<br>
ScalerCrop control once "dynamic" controls have been implemented.<br>
<br>
+ - MinNumRequests:<br>
+ type: int32_t<br>
+ description: |<br>
+ The bare minimum number of requests needed in the camera pipeline for<br>
+ capture to be possible, as required by the driver. Note that this<br>
+ quantity does not guarantee that frames won't be dropped or that manual<br>
+ per-frame controls will be applied properly.<br>
+<br>
+<br>
# ----------------------------------------------------------------------------<br>
# Draft properties section<br>
<br>
-- <br>
2.32.0<br>
<br>
</blockquote></div></div>