2 Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #include "lib/server.h"
29 #include <boost/array.hpp>
30 #include <boost/asio.hpp>
31 #include <boost/algorithm/string.hpp>
32 #include <boost/thread.hpp>
33 #include <boost/thread/mutex.hpp>
34 #include <boost/thread/condition.hpp>
35 #include "lib/config.h"
36 #include "lib/dcp_video_frame.h"
37 #include "lib/exceptions.h"
39 #include "lib/config.h"
40 #include "lib/scaler.h"
41 #include "lib/image.h"
43 #include "lib/version.h"
48 using boost::shared_ptr;
53 cerr << "Syntax: " << n << " [OPTION]\n"
54 << " -v, --version show DCP-o-matic version\n"
55 << " -h, --help show this help\n"
56 << " -t, --threads number of parallel encoding threads to use\n";
60 main (int argc, char* argv[])
62 int num_threads = Config::instance()->num_local_encoding_threads ();
66 static struct option long_options[] = {
67 { "version", no_argument, 0, 'v'},
68 { "help", no_argument, 0, 'h'},
69 { "threads", required_argument, 0, 't'},
73 int c = getopt_long (argc, argv, "vht:", long_options, &option_index);
81 cout << "dcpomatic version " << dcpomatic_version << " " << dcpomatic_git_commit << "\n";
87 num_threads = atoi (optarg);
92 Scaler::setup_scalers ();
93 shared_ptr<FileLog> log (new FileLog ("servomatic.log"));
95 server.run (num_threads);