Hi,
This series aim to create a association between a Camera object and the
PipelineHandler which creates it. There is a need to for both objects to
keep a reference to the other.
The Camera needs to have a reference to the PipelineHandler as it needs
to call into it to perform actions requested by the user. While the
PipelineHandler need a reference to the Camera so it can inform it when
it goes away. As even one a PipelineHandler is gone the Camera might be
around, but once the hardware is gone (PipelineHandler) it should
obviously not try to forward any requests to it.
In this series both the ability to disconnect a camera and the actual
disconnection of it upon PipelineHandler removal is implemented. What is
not shown is how the Camera object should check that a PipelineHandler
still exists before it forwards any requests to it. This will be
demonstrated in a separate series which will be posted momentarily and
which deals with handling the Streams of the Camera which will require
interactions with the PipelineHandler.
Niklas Söderlund (3):
libcamera: camera: create a association with the responsible pipeline
handler
libcamera: pipelines: keep reference to cameras created
libcamera: camera: add method to disconnect camera
include/libcamera/camera.h | 10 +++++++--
src/libcamera/camera.cpp | 31 ++++++++++++++++++++++------
src/libcamera/pipeline/ipu3/ipu3.cpp | 13 ++++++++++--
src/libcamera/pipeline/uvcvideo.cpp | 12 ++++++++---
src/libcamera/pipeline/vimc.cpp | 19 ++++++++---------
5 files changed, 62 insertions(+), 23 deletions(-)