Fix DCP name in editor; fix use of DCP entry points.
[dcpomatic.git] / src / lib / server.cc
index 66ee2b0e3cf2ca93eeb7512a03763c2598836dcc..5598ef69f8388aae66098669ad9361e369691ab9 100644 (file)
 #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"
 
@@ -79,7 +80,7 @@ Server::~Server ()
        {
                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) {
@@ -112,9 +113,9 @@ Server::process (shared_ptr<Socket> socket, struct timeval& after_read, struct t
                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);
        
@@ -136,10 +137,10 @@ Server::process (shared_ptr<Socket> socket, struct timeval& after_read, struct t
 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) {
@@ -194,7 +195,7 @@ Server::worker_thread ()
                        LOG_GENERAL_NC (message.str ());
                }
                
-               _worker_condition.notify_all ();
+               _full_condition.notify_all ();
        }
 }
 
@@ -291,11 +292,11 @@ Server::handle_accept (shared_ptr<Socket> socket, boost::system::error_code cons
        
        /* 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 ();
 }