summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2021-08-29 21:03:23 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2021-11-19 22:38:44 +0200
commitd9ae18088a62afc9cebcaa35809fa2457c37bac8 (patch)
treee7e04f7e5a52944ab2a699104ea9214474649971 /include
parent86364c7b5e7233b6658d14ca2d49681e30af8ffe (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>
Diffstat (limited to 'include')
-rw-r--r--include/libcamera/internal/media_device.h1
-rw-r--r--include/libcamera/internal/pipeline_handler.h2
2 files changed, 2 insertions, 1 deletions
diff --git a/include/libcamera/internal/media_device.h b/include/libcamera/internal/media_device.h
index 1f2304c1..e86e5074 100644
--- a/include/libcamera/internal/media_device.h
+++ b/include/libcamera/internal/media_device.h
@@ -85,7 +85,6 @@ private:
int 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 41cba44d..fc6d476b 100644
--- a/include/libcamera/internal/pipeline_handler.h
+++ b/include/libcamera/internal/pipeline_handler.h
@@ -81,6 +81,8 @@ private:
const char *name_;
+ bool lockOwner_;
+
friend class PipelineHandlerFactory;
};