diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2021-08-29 21:03:23 +0300 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2022-01-03 15:31:14 +0200 |
commit | ec6921d7f7ef70cd7c5ea3d7a20082d66b8aa6e5 (patch) | |
tree | 744fd998a9381101737bb1bd52cb2449e0f1448d /include | |
parent | 46b32fa0e48aed16778c6e8d324d65473fbd06b7 (diff) |
libcamera: media_device: Move recursive lock handling to pipeline handler
The MediaDevice lock is meant to prevent concurrent usage of multiple
cameras from the same pipeline handlers. As media devices are acquired
by pipeline handlers, we can't have multiple pipeline handlers trying to
lock the same media device. The recursive locking detection can thus be
moved to the pipeline handler. This simplifies the media device
implementation that now implements true lock semantics, and prepares for
support of concurrent camera usage.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/libcamera/internal/media_device.h | 1 | ||||
-rw-r--r-- | include/libcamera/internal/pipeline_handler.h | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/include/libcamera/internal/media_device.h b/include/libcamera/internal/media_device.h index af0b25b7..6e2a63f3 100644 --- a/include/libcamera/internal/media_device.h +++ b/include/libcamera/internal/media_device.h @@ -86,7 +86,6 @@ private: UniqueFD fd_; bool valid_; bool acquired_; - bool lockOwner_; std::map<unsigned int, MediaObject *> objects_; std::vector<MediaEntity *> entities_; diff --git a/include/libcamera/internal/pipeline_handler.h b/include/libcamera/internal/pipeline_handler.h index ec986a51..a7331ced 100644 --- a/include/libcamera/internal/pipeline_handler.h +++ b/include/libcamera/internal/pipeline_handler.h @@ -88,6 +88,8 @@ private: const char *name_; + bool lockOwner_; + friend class PipelineHandlerFactory; }; |