X-Git-Url: https://git.carlh.net/gitweb/?p=dcpomatic.git;a=blobdiff_plain;f=src%2Flib%2Fserver.cc;fp=src%2Flib%2Fserver.cc;h=07b82694666c3146be87fbae45d13cf4722f19d4;hp=9c5a77f681b2903390fec271f5610c62cd2d8b16;hb=996b0c06e23bcb6b300d7b8799df94993692e07d;hpb=907735ee6ca162583c7c9d20f5603a6db83a149f diff --git a/src/lib/server.cc b/src/lib/server.cc index 9c5a77f68..07b826946 100644 --- a/src/lib/server.cc +++ b/src/lib/server.cc @@ -29,6 +29,7 @@ #include #include #include +#include #include "server.h" #include "util.h" #include "scaler.h" @@ -51,6 +52,19 @@ using boost::bind; using boost::scoped_array; using libdcp::Size; +ServerDescription::ServerDescription (shared_ptr node) +{ + _host_name = node->string_child ("HostName"); + _threads = node->number_child ("Threads"); +} + +void +ServerDescription::as_xml (xmlpp::Node* root) const +{ + root->add_child("HostName")->add_child_text (_host_name); + root->add_child("Threads")->add_child_text (boost::lexical_cast (_threads)); +} + /** Create a server description from a string of metadata returned from as_metadata(). * @param v Metadata. * @return ServerDescription, or 0. @@ -68,15 +82,6 @@ ServerDescription::create_from_metadata (string v) return new ServerDescription (b[0], atoi (b[1].c_str ())); } -/** @return Description of this server as text */ -string -ServerDescription::as_metadata () const -{ - stringstream s; - s << _host_name << N_(" ") << _threads; - return s.str (); -} - Server::Server (shared_ptr log) : _log (log) { @@ -106,7 +111,6 @@ Server::process (shared_ptr socket) string scaler_id = get_required_string (kv, N_("scaler")); int frame = get_required_int (kv, N_("frame")); int frames_per_second = get_required_int (kv, N_("frames_per_second")); - string post_process = get_optional_string (kv, N_("post_process")); int colour_lut_index = get_required_int (kv, N_("colour_lut")); int j2k_bandwidth = get_required_int (kv, N_("j2k_bandwidth")); Position subtitle_position (get_optional_int (kv, N_("subtitle_x")), get_optional_int (kv, N_("subtitle_y"))); @@ -131,7 +135,7 @@ Server::process (shared_ptr socket) DCPVideoFrame dcp_video_frame ( image, sub, out_size, padding, subtitle_offset, subtitle_scale, - scaler, frame, frames_per_second, post_process, colour_lut_index, j2k_bandwidth, _log + scaler, frame, frames_per_second, colour_lut_index, j2k_bandwidth, _log ); shared_ptr encoded = dcp_video_frame.encode_locally ();