[v2,0/8] Add Layers support
mbox series

Message ID 20250703114225.2074071-1-paul.elder@ideasonboard.com
Headers show
Series
  • Add Layers support
Related show

Message

Paul Elder July 3, 2025, 11:42 a.m. UTC
This series introduces a new concept to libcamera, called Layers. They
sit between the application and the Camera, and hook into a subset of
the Camera calls. This allows things that don't belong inside a
Camera/IPA nor inside an application to be implemented, such as the Sync
algorithm. As a light demonstration of the capabilities of Layers, this
series implements a Layer that intercepts all control-related calls to
implement the AeEnable control transparently.

Patches 1~3 are refactoring and reorganizing existing code. Patch 4
implements the LayerManager, which is the main component. Patch 5~6
connects the Camera to the layer infrastructure. Finally patches 7~8
implement a simple layer that implements the AeEnable control, to
demonstrate how a Layer might work.

v2 most notably reorganizes the LayerManager to be under the
CameraManager instead of the Camera, and adds support for closures so
that each layer can store its data per camera.

Paul Elder (8):
  libcamera: ipa_manager: Factor out .so file searching
  libcamera: ipa_module: Factor out ELF file handling
  libcamera: camera: Add indirection to Camera signal emissions
  libcamera: layer_manager: Add LayerManager implementation
  libcamera: camera_manager: Add LayerManager
  libcamera: camera: Hook into the LayerManager
  layer: Add layer to inject AeEnable control
  camera, ipa: all: Remove AeEnable handling

 include/libcamera/internal/camera.h           |   4 +
 include/libcamera/internal/camera_manager.h   |   3 +
 include/libcamera/internal/ipa_manager.h      |   4 -
 include/libcamera/internal/layer_manager.h    | 117 ++++++
 include/libcamera/internal/meson.build        |   2 +
 include/libcamera/internal/utils.h            |  32 ++
 include/libcamera/layer.h                     |  54 +++
 include/libcamera/meson.build                 |   1 +
 src/ipa/mali-c55/algorithms/agc.cpp           |   1 +
 src/ipa/rkisp1/algorithms/agc.cpp             |   2 -
 src/ipa/rpi/common/ipa_base.cpp               |   2 -
 src/layer/inject_controls/inject_controls.cpp | 176 ++++++++
 src/layer/inject_controls/inject_controls.h   |  24 ++
 src/layer/inject_controls/meson.build         |  16 +
 src/layer/meson.build                         |  12 +
 src/libcamera/camera.cpp                      |  80 +++-
 src/libcamera/camera_manager.cpp              |   2 +
 src/libcamera/ipa_manager.cpp                 | 108 +----
 src/libcamera/ipa_module.cpp                  | 152 +------
 src/libcamera/layer_manager.cpp               | 383 ++++++++++++++++++
 src/libcamera/meson.build                     |   2 +
 src/libcamera/pipeline/uvcvideo/uvcvideo.cpp  |   5 -
 src/libcamera/pipeline_handler.cpp            |   2 +-
 src/libcamera/request.cpp                     |   2 +-
 src/libcamera/utils.cpp                       | 264 ++++++++++++
 src/meson.build                               |   1 +
 26 files changed, 1176 insertions(+), 275 deletions(-)
 create mode 100644 include/libcamera/internal/layer_manager.h
 create mode 100644 include/libcamera/internal/utils.h
 create mode 100644 include/libcamera/layer.h
 create mode 100644 src/layer/inject_controls/inject_controls.cpp
 create mode 100644 src/layer/inject_controls/inject_controls.h
 create mode 100644 src/layer/inject_controls/meson.build
 create mode 100644 src/layer/meson.build
 create mode 100644 src/libcamera/layer_manager.cpp
 create mode 100644 src/libcamera/utils.cpp