test: Get event dispatcher from current thread

For all tests that don't otherwise require access to the camera manager,
get the event dispatcher from the current thread instead of the camera
manager. This prepares for the removal of CameraManager::instance().

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
This commit is contained in:
Laurent Pinchart 2019-08-18 03:11:27 +03:00
parent 8c9deeb30f
commit fd0087b5d8
11 changed files with 24 additions and 25 deletions

View file

@ -13,10 +13,10 @@
#include <iostream>
#include <libcamera/buffer.h>
#include <libcamera/camera_manager.h>
#include <libcamera/event_dispatcher.h>
#include <libcamera/timer.h>
#include "thread.h"
#include "v4l2_videodevice_test.h"
class BufferSharingTest : public V4L2VideoDeviceTest
@ -116,7 +116,7 @@ protected:
int run()
{
EventDispatcher *dispatcher = CameraManager::instance()->eventDispatcher();
EventDispatcher *dispatcher = Thread::current()->eventDispatcher();
Timer timeout;
int ret;