Working on SoftISP
Find a file
Niklas Söderlund 607a9d7f56 libcamera: pipeline_handler: Add camera disconnection support
Pipeline handlers are responsible for creating camera instances, but
also for destroying them when devices are unplugged. As camera objects
are reference-counted this isn't a straightforward operation and
involves the camera manager and camera object itself. Add two helper
methods in the PipelineHandler base class to register a camera and to
register a media device with the pipeline handler.

When registering a camera, the registerCamera() helper method will add
it to the camera manager. When registering a media device, the
registerMediaDevice() helper method will listen to device disconnection
events, and disconnect all cameras created by the pipeline handler as a
response.

Under the hood the PipelineHandler class needs to keep track of
registered cameras in order to handle disconnection. They can't be
stored as shared pointers as this would create a circular dependency
(the Camera class owns a shared pointer to the pipeline handler). Store
them as weak pointers instead. This is safe as a reference to the camera
is stored in the camera manager, and doesn't get removed until the
camera is unregistered from the manager by the PipelineHandler.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-01-25 01:59:28 +02:00
Documentation utils: checkstyle: Add support for clang-format 2019-01-22 14:30:00 +02:00
include libcamera: camera_manager: Add method to unregister a camera 2019-01-24 22:24:15 +02:00
licenses licenses: Add the Developer CoO 2019-01-02 21:59:46 +02:00
src libcamera: pipeline_handler: Add camera disconnection support 2019-01-25 01:59:28 +02:00
test libcamera: device_enumerator: Reference-count MediaDevice instances 2019-01-24 22:24:11 +02:00
utils utils: checkstyle: Add support for clang-format 2019-01-22 14:30:00 +02:00
.clang-format libcamera: Add clang-format style 2019-01-22 14:30:00 +02:00
.gitignore git: Add .gitignore file 2018-12-14 13:23:07 +00:00
meson.build meson: Utilise default compiler options 2019-01-15 21:14:35 +00:00
README.md README: Update build instructions 2018-11-26 15:52:21 +00:00

libcamera: A complex camera support library for Linux, Android, and ChromeOS

To build and install:

  meson build
  cd build
  ninja
  ninja install