#include "util.h"
#include "scaler.h"
#include "image.h"
-#include "dcp_video_frame.h"
+#include "dcp_video.h"
#include "config.h"
#include "cross.h"
-#include "player_video_frame.h"
+#include "player_video.h"
+#include "encoded_data.h"
#include "i18n.h"
{
boost::mutex::scoped_lock lm (_worker_mutex);
_terminate = true;
- _worker_condition.notify_all ();
+ _empty_condition.notify_all ();
}
for (vector<boost::thread*>::iterator i = _worker_threads.begin(); i != _worker_threads.end(); ++i) {
return -1;
}
- shared_ptr<PlayerVideoFrame> pvf (new PlayerVideoFrame (xml, socket, _log));
+ shared_ptr<PlayerVideo> pvf (new PlayerVideo (xml, socket, _log));
- DCPVideoFrame dcp_video_frame (pvf, xml, _log);
+ DCPVideo dcp_video_frame (pvf, xml, _log);
gettimeofday (&after_read, 0);
void
Server::worker_thread ()
{
- while (1) {
+ while (true) {
boost::mutex::scoped_lock lock (_worker_mutex);
while (_queue.empty () && !_terminate) {
- _worker_condition.wait (lock);
+ _empty_condition.wait (lock);
}
if (_terminate) {
LOG_GENERAL_NC (message.str ());
}
- _worker_condition.notify_all ();
+ _full_condition.notify_all ();
}
}
/* Wait until the queue has gone down a bit */
while (_queue.size() >= _worker_threads.size() * 2 && !_terminate) {
- _worker_condition.wait (lock);
+ _full_condition.wait (lock);
}
_queue.push_back (socket);
- _worker_condition.notify_all ();
+ _empty_condition.notify_all ();
start_accept ();
}