diff options
author | Hans de Goede <hdegoede@redhat.com> | 2024-08-30 13:12:06 +0200 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2024-08-30 15:15:39 +0300 |
commit | 11e396bf9faf708bedc785a3ac5a4d3cc69f4c75 (patch) | |
tree | 85ec3601d0e828ef1d4476837cf8eb749eb004cf /include | |
parent | c05e45ac7743c60a78ebee1b9e341fa5e089285d (diff) |
libcamera: camera: Use invokeMethod() for pipe_->acquire() and pipe_->release()
The uvcvideo driver needs to open / close its /dev/video# node from
pipe_->acquireDevices() / pipe_->releaseDevices().
V4L2VideoDevice::open() creates an EventNotifier and this notifier needs
to be created from the CameraManager thread.
Use invokeMethod() for pipe_->acquire() and pipe_->release() so that the
EventNotifiers are created from the CameraManager thread context.
Running pipe_->acquire() and pipe_->release() from the CameraManager
thread context serializes all calls to them. Drop PipelineHandler::lock_
this now is no longer necessary and update the "\context" part of the
documentation for acquire[Device]() and release[Device]() to match.
Note the delayed opening of /dev/video# is a special case because the
kernel uvcvideo driver powers on the USB device as soon as /dev/video#
is opened. This behavior should *not* be copied by other pipeline
handlers.
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/libcamera/internal/pipeline_handler.h | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/include/libcamera/internal/pipeline_handler.h b/include/libcamera/internal/pipeline_handler.h index 597f7c3e..c33cf715 100644 --- a/include/libcamera/internal/pipeline_handler.h +++ b/include/libcamera/internal/pipeline_handler.h @@ -14,7 +14,6 @@ #include <sys/types.h> #include <vector> -#include <libcamera/base/mutex.h> #include <libcamera/base/object.h> #include <libcamera/controls.h> @@ -99,9 +98,7 @@ private: std::queue<Request *> waitingRequests_; const char *name_; - - Mutex lock_; - unsigned int useCount_ LIBCAMERA_TSA_GUARDED_BY(lock_); + unsigned int useCount_; friend class PipelineHandlerFactoryBase; }; |