diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2020-01-20 01:09:34 +0200 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2020-02-13 12:34:42 +0200 |
commit | 8a8502ec0ea5e64a0c44eb18aac0ecd4b6771e6b (patch) | |
tree | d8b00138032054e427c55e8ed0d38014b7873ef3 /src/v4l2/v4l2_compat_manager.h | |
parent | b3b0d0a2e92fefe8298ba37f78be4d2364a75f56 (diff) |
v4l2: Remove internal thread
Now that libcamera creates threads internally and doesn't rely on an
application-provided event loop, remove the thread from the V4L2
compatibility layer. The split between the V4L2CameraProxy and
V4L2Camera classes is still kept to separate the V4L2 adaptation from
camera operation. This may be further refactored later.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Diffstat (limited to 'src/v4l2/v4l2_compat_manager.h')
-rw-r--r-- | src/v4l2/v4l2_compat_manager.h | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/src/v4l2/v4l2_compat_manager.h b/src/v4l2/v4l2_compat_manager.h index d51b5953..872c7c3b 100644 --- a/src/v4l2/v4l2_compat_manager.h +++ b/src/v4l2/v4l2_compat_manager.h @@ -8,22 +8,19 @@ #ifndef __V4L2_COMPAT_MANAGER_H__ #define __V4L2_COMPAT_MANAGER_H__ -#include <condition_variable> #include <fcntl.h> #include <map> #include <memory> -#include <mutex> #include <sys/types.h> #include <vector> #include <libcamera/camera_manager.h> -#include "thread.h" #include "v4l2_camera_proxy.h" using namespace libcamera; -class V4L2CompatManager : public Thread +class V4L2CompatManager { public: struct FileOperations { @@ -46,8 +43,6 @@ public: static V4L2CompatManager *instance(); - int init(); - V4L2CameraProxy *getProxy(int fd); const FileOperations &fops() const { return fops_; } @@ -64,17 +59,13 @@ private: V4L2CompatManager(); ~V4L2CompatManager(); - void run() override; + int start(); int getCameraIndex(int fd); FileOperations fops_; CameraManager *cm_; - std::mutex mutex_; - std::condition_variable cv_; - bool initialized_; - std::vector<std::unique_ptr<V4L2CameraProxy>> proxies_; std::map<int, V4L2CameraProxy *> devices_; std::map<void *, V4L2CameraProxy *> mmaps_; |