[libcamera-devel,0/3] libcamera: add association between Camera and PipelineHandlers
mbox series

Message ID 20190122232955.31783-1-niklas.soderlund@ragnatech.se
Headers show
Series
  • libcamera: add association between Camera and PipelineHandlers
Related show

Message

Niklas Söderlund Jan. 22, 2019, 11:29 p.m. UTC
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(-)