[v10,0/7] Add VirtualPipelineHandler
mbox series

Message ID 20240829195703.1456614-1-chenghaoyang@chromium.org
Headers show
Series
  • Add VirtualPipelineHandler
Related show

Message

Harvey Yang Aug. 29, 2024, 7:47 p.m. UTC
Hi all,

This series adds virtual pipeline handler, which doesn't depend on any
hardware, like camera sensor or ISP. Currently the configuration
supports test patterns and images.

It passed the gitlab pipeline:
https://gitlab.freedesktop.org/chenghaoyang/libcamera/-/pipelines/1260567

I failed to pass multi_stream_test when trying to enable multiple
streams though. Please give me some hints what it tests and what I
missed:
```
[295:43:43.910237144] [1441841]  INFO IPAManager ipa_manager.cpp:137 libcamera is not installed. Adding '/usr/local/google/home/chenghaoyang/Workspace/libca
mera/build/src/ipa' to the IPA search path
[295:43:43.914030564] [1441841]  INFO Camera camera_manager.cpp:325 libcamera v0.3.1+79-8ca4f033-dirty (2024-08-29T19:18:51UTC)
[295:43:43.915493754] [1441844] ERROR DmaBufAllocator dma_buf_allocator.cpp:120 Could not open any dma-buf provider
[295:43:43.919118835] [1441841]  INFO IPAManager ipa_manager.cpp:137 libcamera is not installed. Adding '/usr/local/google/home/chenghaoyang/Workspace/libca
mera/build/src/ipa' to the IPA search path
[295:43:43.922245825] [1441841]  INFO Camera camera_manager.cpp:325 libcamera v0.3.1+79-8ca4f033-dirty (2024-08-29T19:18:51UTC)
[295:43:43.922820175] [1441846] ERROR DmaBufAllocator dma_buf_allocator.cpp:120 Could not open any dma-buf provider
Unable to set the pipeline to the playing state.
```

Gitlab pipeline failure:
https://gitlab.freedesktop.org/chenghaoyang/libcamera/-/pipelines/1260412


Update in v10:
Apply fixes according to Jacopo's and Barnabás' comments.
- Split test_pattern and path fields in the yaml format.
- Let FrameGenerators control frameCount_.
- Fixed match() returning values.

Update in v9: Allocate contiguous memory for planes in the same
FrameBuffer.

BR,
Harvey

Harvey Yang (4):
  libcamera: add DmaBufAllocator::exportBuffers()
  libcamera: Remove PipelineHandler Fatal check of non-empty
    MediaDevices
  libcamera: virtual: Add VirtualPipelineHandler
  libcamera: software_isp: Refactor SoftwareIsp to use
    DmaBufAllocator::exportBuffers

Konami Shu (3):
  libcamera: pipeline: Add test pattern for VirtualPipelineHandler
  libcamera: virtual: Read config and register cameras based on the
    config
  libcamera: virtual: Add ImageFrameGenerator

 .../libcamera/internal/dma_buf_allocator.h    |  12 +
 meson.build                                   |   1 +
 meson_options.txt                             |   3 +-
 src/android/meson.build                       |  19 --
 src/libcamera/dma_buf_allocator.cpp           |  55 +++
 src/libcamera/pipeline/virtual/README.md      |  50 +++
 .../pipeline/virtual/data/virtual.yaml        |  37 ++
 .../pipeline/virtual/frame_generator.h        |  28 ++
 .../virtual/image_frame_generator.cpp         | 179 ++++++++++
 .../pipeline/virtual/image_frame_generator.h  |  54 +++
 src/libcamera/pipeline/virtual/meson.build    |  13 +
 src/libcamera/pipeline/virtual/parser.cpp     | 251 ++++++++++++++
 src/libcamera/pipeline/virtual/parser.h       |  44 +++
 .../virtual/test_pattern_generator.cpp        | 140 ++++++++
 .../pipeline/virtual/test_pattern_generator.h |  57 ++++
 src/libcamera/pipeline/virtual/utils.h        |  17 +
 src/libcamera/pipeline/virtual/virtual.cpp    | 317 ++++++++++++++++++
 src/libcamera/pipeline/virtual/virtual.h      | 107 ++++++
 src/libcamera/pipeline_handler.cpp            |  11 +-
 src/libcamera/software_isp/software_isp.cpp   |  20 +-
 src/meson.build                               |  19 ++
 21 files changed, 1392 insertions(+), 42 deletions(-)
 create mode 100644 src/libcamera/pipeline/virtual/README.md
 create mode 100644 src/libcamera/pipeline/virtual/data/virtual.yaml
 create mode 100644 src/libcamera/pipeline/virtual/frame_generator.h
 create mode 100644 src/libcamera/pipeline/virtual/image_frame_generator.cpp
 create mode 100644 src/libcamera/pipeline/virtual/image_frame_generator.h
 create mode 100644 src/libcamera/pipeline/virtual/meson.build
 create mode 100644 src/libcamera/pipeline/virtual/parser.cpp
 create mode 100644 src/libcamera/pipeline/virtual/parser.h
 create mode 100644 src/libcamera/pipeline/virtual/test_pattern_generator.cpp
 create mode 100644 src/libcamera/pipeline/virtual/test_pattern_generator.h
 create mode 100644 src/libcamera/pipeline/virtual/utils.h
 create mode 100644 src/libcamera/pipeline/virtual/virtual.cpp
 create mode 100644 src/libcamera/pipeline/virtual/virtual.h