<div dir="ltr"><div>Hi Laurent,</div><div><br></div><div>Thank you for the patches. I tested the series under Android with three concurrent streams at the same time: preview / video recording / photo taking. </div><div><br></div><div>Tested-by: Phi-Bang Nguyen <<a href="mailto:pnguyen@baylibre.com">pnguyen@baylibre.com</a>><br></div><div><br></div><div>Regards,</div><div>Phi Bang</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le dim. 31 janv. 2021 à 23:47, Laurent Pinchart <<a href="mailto:laurent.pinchart@ideasonboard.com">laurent.pinchart@ideasonboard.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello,<br>
<br>
This patch series implements multi-stream support in the simple pipeline<br>
handler.<br>
<br>
Multi-stream support in the capture device requires hardware processing<br>
capabilities (at least format conversion and scaling), which would<br>
likely not qualify the platform for support in the simple pipeline<br>
handler. However, for platforms that include a converter, the V4L2 M2M<br>
API allows opening multiple instances of the converter to create<br>
multiple output streams with different formats and resolution (as long<br>
as the hardware has enough bandwidth to run all the processing passes).<br>
This approach is generic and doesn't require any extra hardware feature<br>
compared to what the simple pipeline handler already uses.<br>
<br>
The patches starts with refactoring of the converter class to prepare<br>
for multiple streams support, and then refactors the simple pipeline<br>
handler to achieve the same goal. The last two patches enable<br>
multi-streams support<br>
<br>
The code has been tested on the MediaTek Pumpkin i500 board. Its<br>
support isn't available in the simple pipeline handler yet due to the<br>
drivers not being upstream, which is an issue that is being addressed.<br>
Enabling it, after importing the kernel headers that define the<br>
MediaTek-specific pixel formats and enabling them in libcamera, only<br>
requires the following change in the simple pipeline handler.<br>
<br>
diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp<br>
index 55a5528611c8..6b0170d1aba8 100644<br>
--- a/src/libcamera/pipeline/simple/simple.cpp<br>
+++ b/src/libcamera/pipeline/simple/simple.cpp<br>
@@ -132,6 +132,7 @@ namespace {<br>
<br>
 static const SimplePipelineInfo supportedDevices[] = {<br>
        { "imx7-csi", "pxp", 1 },<br>
+       { "mtk-camsv-p1", "mtk-mdp3", 3 },<br>
        { "qcom-camss", nullptr, 1 },<br>
        { "sun6i-csi", nullptr, 1 },<br>
 };<br>
<br>
Laurent Pinchart (20):<br>
  libcamera: pipeline: simple: Manage converter with std::unique_ptr<><br>
  libcamera: pipeline: simple: Don't override stride at configure time<br>
  libcamera: pipeline: simple: converter: Group query functions together<br>
  libcamera: pipeline: simple: converter: Use StreamConfiguration for<br>
    input configuration<br>
  libcamera: pipeline: simple: converter: Configure input stride<br>
  libcamera: pipeline: simple: converter: Differentiate input and output<br>
    buffers count<br>
  libcamera: pipeline: simple: converter: Replace open() with isValid()<br>
  libcamera: pipeline: simple: converter: Decouple input and output<br>
    completion<br>
  libcamera: pipeline: simple: converter: Add multi-stream support<br>
  libcamera: pipeline: simple: Store streams in a vector<br>
  libcamera: pipeline: simple: Drop unused members of configuration<br>
  libcamera: pipeline: simple: Document the pipeline handler design<br>
  libcamera: pipeline: simple: Rename Configuration::pixelFormat<br>
  libcamera: pipeline: simple: Cache pipeline config in<br>
    SimpleCameraConfiguration<br>
  libcamera: pipeline: simple: Add output formats to Configuration<br>
  libcamera: pipeline: simple: Move converter data to camera data<br>
  libcamera: pipeline: simple: Hardcode the number of internal buffers<br>
  libcamera: pipeline: simple: Support configuration of multiple streams<br>
  libcamera: pipeline: simple: Support usage of multiple streams<br>
  libcamera: pipeline: simple: Enable multiple streams for compatible<br>
    devices<br>
<br>
 src/libcamera/pipeline/simple/converter.cpp | 398 ++++++++------<br>
 src/libcamera/pipeline/simple/converter.h   |  60 ++-<br>
 src/libcamera/pipeline/simple/simple.cpp    | 542 +++++++++++++-------<br>
 3 files changed, 650 insertions(+), 350 deletions(-)<br>
<br>
-- <br>
Regards,<br>
<br>
Laurent Pinchart<br>
<br>
</blockquote></div></div>