From ec6921d7f7ef70cd7c5ea3d7a20082d66b8aa6e5 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Sun, 29 Aug 2021 21:03:23 +0300 Subject: 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 Reviewed-by: Kieran Bingham Reviewed-by: Umang Jain --- include/libcamera/internal/media_device.h | 1 - include/libcamera/internal/pipeline_handler.h | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'include') 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 objects_; std::vector 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; }; -- cgit v1.2.1