summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-08-11 15:46:59 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-08-17 18:32:38 +0300
commitb566e97aacd4d4c023526671bafc371ed2eca2c3 (patch)
treee82da4e408c790820a43ad24ef98e4235d6c24c3 /src
parent980d1ee0c0e15fc3c8332138f9e39f3b2df1ea9c (diff)
libcamera: camera_manager: Bind CameraManager to threads
The CameraManager class uses the event dispatcher of the current thread. This makes the CameraManager::eventDispatcher() and CameraManager::setEventDispatcher() methods inconsistent, as they access different event dispatcher instances depending on the calling thread. Fix this by inheriting from the Object class, which binds the CameraManager to a thread, and use the event dispatcher of the bound thread. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Diffstat (limited to 'src')
-rw-r--r--src/libcamera/camera_manager.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libcamera/camera_manager.cpp b/src/libcamera/camera_manager.cpp
index 2cf01423..4a880684 100644
--- a/src/libcamera/camera_manager.cpp
+++ b/src/libcamera/camera_manager.cpp
@@ -248,7 +248,7 @@ CameraManager *CameraManager::instance()
*/
void CameraManager::setEventDispatcher(std::unique_ptr<EventDispatcher> dispatcher)
{
- Thread::current()->setEventDispatcher(std::move(dispatcher));
+ thread()->setEventDispatcher(std::move(dispatcher));
}
/**
@@ -264,7 +264,7 @@ void CameraManager::setEventDispatcher(std::unique_ptr<EventDispatcher> dispatch
*/
EventDispatcher *CameraManager::eventDispatcher()
{
- return Thread::current()->eventDispatcher();
+ return thread()->eventDispatcher();
}
} /* namespace libcamera */