+2018-02-04 Carl Hetherington <cth@carlh.net>
+
+ * Allow main DCP-o-matic and batch converter to run on the same
+ machine and both get access to encoding servers (#1190).
+
2018-02-03 Carl Hetherington <cth@carlh.net>
* Updated de_DE translation from Carsten Kurz.
if (_verbose) {
cout << "Offering services to master " << _broadcast.send_endpoint.address().to_string () << "\n";
}
- shared_ptr<Socket> socket (new Socket);
+
+ try {
+ shared_ptr<Socket> socket (new Socket);
+ socket->connect (boost::asio::ip::tcp::endpoint (_broadcast.send_endpoint.address(), MAIN_SERVER_PRESENCE_PORT));
+ socket->write (xml.length() + 1);
+ socket->write ((uint8_t *) xml.c_str(), xml.length() + 1);
+ } catch (...) {
+
+ }
+
try {
- socket->connect (boost::asio::ip::tcp::endpoint (_broadcast.send_endpoint.address(), SERVER_PRESENCE_PORT));
+ shared_ptr<Socket> socket (new Socket);
+ socket->connect (boost::asio::ip::tcp::endpoint (_broadcast.send_endpoint.address(), BATCH_SERVER_PRESENCE_PORT));
socket->write (xml.length() + 1);
socket->write ((uint8_t *) xml.c_str(), xml.length() + 1);
} catch (...) {
/*
- Copyright (C) 2013-2015 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2013-2018 Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
using namespace boost::asio::ip;
try {
- _listen_acceptor.reset (new tcp::acceptor (_listen_io_service, tcp::endpoint (tcp::v4(), SERVER_PRESENCE_PORT)));
+ _listen_acceptor.reset (
+ new tcp::acceptor (_listen_io_service, tcp::endpoint (tcp::v4(), is_batch_converter ? BATCH_SERVER_PRESENCE_PORT : MAIN_SERVER_PRESENCE_PORT))
+ );
} catch (...) {
boost::throw_exception (NetworkError (_("Could not listen for remote encode servers. Perhaps another instance of DCP-o-matic is running.")));
}
/*
- Copyright (C) 2013-2015 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2013-2018 Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
#define ENCODE_FRAME_PORT (Config::instance()->server_port_base())
/** Port on which EncodeServer listens for DCPOMATIC_HELLO from masters */
#define HELLO_PORT (Config::instance()->server_port_base()+1)
-/** Port on which EncodeServerFinder listens for replies to DCPOMATIC_HELLO from servers */
-#define SERVER_PRESENCE_PORT (Config::instance()->server_port_base()+2)
+/** Port on which EncodeServerFinder in the main DCP-o-matic listens for replies to DCPOMATIC_HELLO from servers */
+#define MAIN_SERVER_PRESENCE_PORT (Config::instance()->server_port_base()+2)
+/** Port on which EncodeServerFinder in the batch converter listens for replies to DCPOMATIC_HELLO from servers */
+#define BATCH_SERVER_PRESENCE_PORT (Config::instance()->server_port_base()+3)
/** Port on which batch converter listens for job requests */
-#define BATCH_JOB_PORT (Config::instance()->server_port_base()+3)
+#define BATCH_JOB_PORT (Config::instance()->server_port_base()+4)
typedef std::vector<boost::shared_ptr<Content> > ContentList;
typedef std::vector<boost::shared_ptr<FFmpegContent> > FFmpegContentList;
* in during App::onInit().
*/
string program_name;
+bool is_batch_converter = false;
static boost::thread::id ui_thread;
static boost::filesystem::path backtrace_file;
#define MAX_KDM_SIZE (256 * 1024)
extern std::string program_name;
+extern bool is_batch_converter;
struct AVSubtitle;
class AudioBuffers;
/*
- Copyright (C) 2013-2015 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2013-2018 Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
bool OnInit ()
{
SetAppName (_("DCP-o-matic Batch Converter"));
+ is_batch_converter = true;
Config::FailedToLoad.connect (boost::bind (&App::config_failed_to_load, this));
Config::Warning.connect (boost::bind (&App::config_warning, this, _1));