@@ -40,14 +40,13 @@ class PipelineHandlerISI;
class ISICameraData : public Camera::Private
{
public:
- ISICameraData(PipelineHandler *ph)
+ /* Maximum amount of streams (i.e. pipes) per camera. */
+ static constexpr unsigned int kNumStreams = 3;
+
+ ISICameraData(PipelineHandler *ph, unsigned int numStreams)
: Camera::Private(ph)
{
- /*
- * \todo Assume 2 channels only for now, as that's the number of
- * available channels on i.MX8MP.
- */
- streams_.resize(2);
+ streams_.resize(std::min(kNumStreams, numStreams));
}
PipelineHandlerISI *pipe();
@@ -1052,8 +1051,12 @@ bool PipelineHandlerISI::match(DeviceEnumerator *enumerator)
}
/* Create the camera data. */
+ /*
+ * \todo compute available pipes per camera instead of using
+ * pipes_.size() for multi cameras case.
+ */
std::unique_ptr<ISICameraData> data =
- std::make_unique<ISICameraData>(this);
+ std::make_unique<ISICameraData>(this, pipes_.size());
data->sensor_ = CameraSensorFactoryBase::create(sensor);
data->csis_ = std::make_unique<V4L2Subdevice>(csi);
This patch adds number of streams per camera as constructor parameter, and limits stream count to 3. Some applications may need up to 3 streams for preview + capture + video record. Currently, imx8-isi pipeline only supports up to 2. Increase constant parameter to 3 to match these applications' requirements. Minimum value between default value 3, and total amount of ISI's pipes is now applied. For SOCs which only have 1 ISI pipe (ie i.MX93), available stream count becomes 1. Signed-off-by: Antoine Bouyer <antoine.bouyer@nxp.com> --- src/libcamera/pipeline/imx8-isi/imx8-isi.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-)