[libcamera-devel,RFC,v2,0/5] Add IPAManager
mbox series

Message ID 20190523164210.2105-1-paul.elder@ideasonboard.com
Headers show
Series
  • Add IPAManager
Related show

Message

Paul Elder May 23, 2019, 4:42 p.m. UTC
Pipeline handlers need a way to acquire an IPA module. To achieve this,
we use an IPA manager, that loads many IPA modules, after which a
pipeline handler can ask the IPA manager for an IPA module that matches
it. Each IPA can only be used with one pipeline, but a pipeline may work
with many IPAs (not simultaneously).

I took inspiration from the DeviceEnumerator, and went for one
IPAManager, that scans a directory (or many) for IPA modules, and loads
them into a list, after which a pipeline handler can aquire one.
5/5 "libcamera: pipelines: add IPAManager" shows how this might work.
The pipeline handler fills in parameters into a struct IPAModuleInfo
which the IPA manager uses to find a matching IPA module.

Changes in v2:
- added documentation
- made IPAManager into a real singleton (not my misunderstood one)
- removed IPAManager as a parameter to PipelineHandler::match()
- IPAManager returns non-const IPAModule

Paul Elder (5):
  libcamera: ipa_module_info: update struct to allow IPA matching
  libcamera: ipa_module: add aquired attribute
  libcamera: ipa_manager: implement class for managing IPA modules
  test: ipa_manager: add test for IPAManager
  libcamera: pipelines: uvcvideo: add IPAManager

 Documentation/Doxyfile.in               |   7 +-
 include/libcamera/ipa/ipa_module_info.h |   8 +-
 src/libcamera/include/ipa_manager.h     |  39 ++++++++
 src/libcamera/include/ipa_module.h      |   5 +
 src/libcamera/ipa_manager.cpp           | 122 ++++++++++++++++++++++++
 src/libcamera/ipa_module.cpp            |  62 ++++++++++--
 src/libcamera/meson.build               |   2 +
 src/libcamera/pipeline/uvcvideo.cpp     |  16 +++-
 test/ipa/ipa_manager_test.cpp           |  45 +++++++++
 test/ipa/ipa_test.cpp                   |  37 ++++---
 test/ipa/meson.build                    |   3 +-
 test/ipa/shared_test.c                  |   4 +-
 test/ipa/shared_test.cpp                |   6 +-
 13 files changed, 328 insertions(+), 28 deletions(-)
 create mode 100644 src/libcamera/include/ipa_manager.h
 create mode 100644 src/libcamera/ipa_manager.cpp
 create mode 100644 test/ipa/ipa_manager_test.cpp