-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdisp.h
58 lines (41 loc) · 996 Bytes
/
disp.h
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#ifndef _DISP_INC_
#define _DISP_INC_
#include <map>
#include <memory>
#include <thread>
#include <tuple>
#include <boost/asio.hpp>
#include "streamer.h"
namespace vid {
namespace ba = boost::asio;
class Dispatcher;
// enum class StreamStatus {
// Active,
// Disabled
// };
}
#include "cam.h"
#include "view.h"
class vid::Dispatcher {
typedef std::map<std::string, CameraSPtr > CamerasMap;
typedef std::shared_ptr<std::thread> ThreadSPtr;
public:
void run(bool should_join=false);
void wait();
/// io_service to provide to streamers upon construction
ba::io_service &service() {
return io;
}
///
/// @param view view to bind with streeam
/// @param cname camera name
/// @param sname stream name
///
void bind( IView::pointer view, const std::string &cname, const std::string &sname);
void add_camera(const std::string &, CameraSPtr);
private:
ba::io_service io;
CamerasMap cams;
std::vector<ThreadSPtr> thrs;
};
#endif