GIFT-Grab  1708
Copyright (c) 2015-7, University College London (UCL)
broadcastdaemon.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "ivideosource.h"
4 #include "macros.h"
5 #include <thread>
6 #include <mutex>
7 
8 namespace gg
9 {
10 
28 {
29 protected:
35 
40  bool _running;
41 
47  std::thread _thread;
48 
52  std::mutex _lock;
53 
54 public:
64  BroadcastDaemon(IVideoSource * source);
65 
69  virtual ~BroadcastDaemon();
70 
71 public:
80  void start(float frame_rate);
81 
85  void stop();
86 
87 protected:
93  void run(float sleep_duration_ms);
94 
95 private:
101  BroadcastDaemon();
102 
103 private:
104  DISALLOW_COPY_AND_ASSIGNMENT(BroadcastDaemon);
105 };
106 
107 }
std::mutex _lock
Definition: broadcastdaemon.h:52
An object of this class serves as a surrogate for implementing the observer pattern (http://www...
Definition: broadcastdaemon.h:27
void stop()
Stop current broadcast.
Definition: broadcastdaemon.cpp:47
This abstract class defines the interface that every video source must implement. ...
Definition: ivideosource.h:15
void run(float sleep_duration_ms)
This method is passed to broadcaster thread.
Definition: broadcastdaemon.cpp:62
Definition: broadcastdaemon.cpp:7
bool _running
Flag indicating status to actual daemon thread.
Definition: broadcastdaemon.h:40
void start(float frame_rate)
Start broadcasting at specified frame rate.
Definition: broadcastdaemon.cpp:25
std::thread _thread
Actual daemon thread.
Definition: broadcastdaemon.h:47
IVideoSource * _source
Definition: broadcastdaemon.h:34
virtual ~BroadcastDaemon()
Definition: broadcastdaemon.cpp:20