[v2,0/2] Add environment variable to order pipelines match
mbox series

Message ID 20240308110056.453320-1-julien.vuillaumier@nxp.com
Headers show
Series
  • Add environment variable to order pipelines match
Related show

Message

Julien Vuillaumier March 8, 2024, 11 a.m. UTC
Hi All,

This is the v2 of the change to support the configuration of the order
of pipelines match, by using an environment variable.

Changes in v2 vs v1:
- Add 'get factory by name' helper to PipelineHandlerFactoryBase as a
  preceding patch (Kieran)
- Move lamba pipeMatch() to a private class function (Kieran)
- Remove unnecessary string empty test (Jacopo)
- Inline lamba nameMatch (Jacopo)
- Update comments and variable names per v1 reviews (Kieran, Barnabas, Jacopo) 

Link to v1: https://lists.libcamera.org/pipermail/libcamera-devel/2024-March/040769.html

Thanks


There is currently no way to configure the order used by the CameraManager
to select the pipeline handlers to match devices from the DeviceEnumerator.
That is a limitation when multiple pipeline are compiled in, capable of
handling the devices of the platform. In that case, user can not specify
the pipeline that will bind to the devices and handle the cameras.

This change adds an environment variable, optionnaly initialized with an
ordered list of candidate pipelines that CameraManager shall use to match
the devices. When the variable is not set, CameraManager behavior is
unchanged: every registered pipeline is selected in turn to attempt device
matching. 

Using that variable, user has the option to explicitly select the pipeline
or the subset of available pipelines that CameraManager shall consider
for matching.

Julien Vuillaumier (2):
  libcamera: pipeline: Add a get factory by name helper
  libcamera: camera_manager: Add environment variable to order pipelines
    match

 Documentation/environment_variables.rst       |  5 ++
 include/libcamera/internal/camera_manager.h   |  1 +
 include/libcamera/internal/pipeline_handler.h |  1 +
 src/libcamera/camera_manager.cpp              | 57 +++++++++++++++----
 src/libcamera/pipeline_handler.cpp            | 22 +++++++
 5 files changed, 74 insertions(+), 12 deletions(-)