forked from inspirit/PS3EYEDriver
-
Notifications
You must be signed in to change notification settings - Fork 3
/
mgr.hpp
43 lines (31 loc) · 830 Bytes
/
mgr.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#pragma once
#include "ps3eye.hpp"
#include <vector>
#include <thread>
#include <atomic>
struct libusb_context;
struct libusb_device;
struct libusb_device_handle;
namespace ps3eye::detail {
struct usb_manager
{
usb_manager();
~usb_manager();
static usb_manager& instance();
std::vector<std::shared_ptr<camera>> list_devices();
void camera_started();
void camera_stopped();
void set_debug(bool value);
private:
libusb_context* usb_context = nullptr;
std::thread update_thread;
std::atomic_int active_camera_count = 0;
std::atomic_bool exit_signaled = false;
usb_manager(const usb_manager&);
void operator=(const usb_manager&);
void start_xfer_thread();
void stop_xfer_thread();
void xfer_callback();
//int sTotalDevices = 0;
};
} // ns ps3eye::detail