projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix problems with FFmpeg files that have all-zero stream IDs.
[dcpomatic.git]
/
src
/
lib
/
server_finder.h
diff --git
a/src/lib/server_finder.h
b/src/lib/server_finder.h
index 8b56022de693fc36694c5cd20e210fff48a077c7..01e26f7dfee1aa3a7c432d8ba9c68c9d4e777057 100644
(file)
--- a/
src/lib/server_finder.h
+++ b/
src/lib/server_finder.h
@@
-23,19
+23,33
@@
class ServerFinder
{
public:
class ServerFinder
{
public:
- ServerFinder ();
- ~ServerFinder ();
+ void connect (boost::function<void (ServerDescription)>);
- boost::signals2::signal<void (ServerDescription)> ServerFound;
+ static ServerFinder* instance ();
+
+ void disable () {
+ _disabled = true;
+ }
private:
private:
+ ServerFinder ();
+
void broadcast_thread ();
void listen_thread ();
void broadcast_thread ();
void listen_thread ();
+
+ bool server_found (std::string) const;
+
+ boost::signals2::signal<void (ServerDescription)> ServerFound;
+
+ bool _disabled;
- /**
A t
hread to periodically issue broadcasts to find encoding servers */
+ /**
T
hread to periodically issue broadcasts to find encoding servers */
boost::thread* _broadcast_thread;
boost::thread* _broadcast_thread;
+ /** Thread to listen to the responses from servers */
boost::thread* _listen_thread;
boost::thread* _listen_thread;
- bool _terminate;
- boost::mutex _mutex;
+ std::list<ServerDescription> _servers;
+ mutable boost::mutex _mutex;
+
+ static ServerFinder* _instance;
};
};