summaryrefslogtreecommitdiff
path: root/src/lib/encode_server.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/encode_server.cc')
-rw-r--r--src/lib/encode_server.cc18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/lib/encode_server.cc b/src/lib/encode_server.cc
index 036ea58a5..8d1759986 100644
--- a/src/lib/encode_server.cc
+++ b/src/lib/encode_server.cc
@@ -37,6 +37,8 @@
#include "image.h"
#include "log.h"
#include "player_video.h"
+#include "util.h"
+#include "variant.h"
#include "version.h"
#include <dcp/raw_convert.h>
#include <dcp/warnings.h>
@@ -81,6 +83,7 @@ EncodeServer::EncodeServer (bool verbose, int num_threads)
#endif
, _verbose (verbose)
, _num_threads (num_threads)
+ , _frames_encoded(0)
{
}
@@ -169,6 +172,8 @@ EncodeServer::process (shared_ptr<Socket> socket, struct timeval& after_read, st
throw;
}
+ ++_frames_encoded;
+
return dcp_video_frame.index ();
}
@@ -243,7 +248,7 @@ EncodeServer::run ()
{
LOG_GENERAL ("Server %1 (%2) starting with %3 threads", dcpomatic_version, dcpomatic_git_commit, _num_threads);
if (_verbose) {
- cout << "DCP-o-matic server starting with " << _num_threads << " threads.\n";
+ cout << variant::dcpomatic_encode_server() << " starting with " << _num_threads << " threads.\n";
}
for (int i = 0; i < _num_threads; ++i) {
@@ -268,12 +273,9 @@ void
EncodeServer::broadcast_thread ()
try
{
- auto address = boost::asio::ip::address_v4::any ();
- boost::asio::ip::udp::endpoint listen_endpoint (address, HELLO_PORT);
+ boost::asio::ip::udp::endpoint listen_endpoint(boost::asio::ip::udp::v4(), HELLO_PORT);
- _broadcast.socket = new boost::asio::ip::udp::socket (_broadcast.io_service);
- _broadcast.socket->open (listen_endpoint.protocol ());
- _broadcast.socket->bind (listen_endpoint);
+ _broadcast.socket = new boost::asio::ip::udp::socket(_broadcast.io_service, listen_endpoint);
_broadcast.socket->async_receive_from (
boost::asio::buffer (_broadcast.buffer, sizeof (_broadcast.buffer)),
@@ -298,8 +300,8 @@ EncodeServer::broadcast_received ()
/* Reply to the client saying what we can do */
xmlpp::Document doc;
auto root = doc.create_root_node ("ServerAvailable");
- root->add_child("Threads")->add_child_text (raw_convert<string> (_worker_threads.size ()));
- root->add_child("Version")->add_child_text (raw_convert<string> (SERVER_LINK_VERSION));
+ cxml::add_text_child(root, "Threads", raw_convert<string>(_worker_threads.size()));
+ cxml::add_text_child(root, "Version", raw_convert<string>(SERVER_LINK_VERSION));
auto xml = doc.write_to_string ("UTF-8");
if (_verbose) {