2 Copyright (C) 2013-2021 Carl Hetherington <cth@carlh.net>
4 This file is part of DCP-o-matic.
6 DCP-o-matic is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 DCP-o-matic is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with DCP-o-matic. If not, see <http://www.gnu.org/licenses/>.
22 #ifndef DCPOMATIC_TYPES_H
23 #define DCPOMATIC_TYPES_H
40 /** The version number of the protocol used to communicate
41 * with servers. Intended to be bumped when incompatibilities
42 * are introduced. v2 uses 64+n
44 * 64 - first version used
45 * 65 - v2.16.0 - checksums added to communication
47 #define SERVER_LINK_VERSION (64+1)
49 /** A film of F seconds at f FPS will be Ff frames;
50 Consider some delta FPS d, so if we run the same
51 film at (f + d) FPS it will last F(f + d) seconds.
53 Hence the difference in length over the length of the film will
54 be F(f + d) - Ff frames
59 So if we accept a difference of 1 frame, ie 1/f seconds, we can
66 So for a 3hr film, ie F = 3 * 60 * 60 = 10800, the acceptable
67 FPS error is 1/F ~= 0.0001 ~= 1e-4
69 #define VIDEO_FRAME_RATE_EPSILON (1e-4)
71 /** Port on which EncodeServer listens for frame encoding requests */
72 #define ENCODE_FRAME_PORT (Config::instance()->server_port_base())
73 /** Port on which EncodeServer listens for DCPOMATIC_HELLO from masters */
74 #define HELLO_PORT (Config::instance()->server_port_base()+1)
75 /** Port on which EncodeServerFinder in the main DCP-o-matic listens for replies to DCPOMATIC_HELLO from servers */
76 #define MAIN_SERVER_PRESENCE_PORT (Config::instance()->server_port_base()+2)
77 /** Port on which EncodeServerFinder in the batch converter listens for replies to DCPOMATIC_HELLO from servers */
78 #define BATCH_SERVER_PRESENCE_PORT (Config::instance()->server_port_base()+3)
79 /** Port on which batch converter listens for job requests */
80 #define BATCH_JOB_PORT (Config::instance()->server_port_base()+4)
81 /** Port on which player listens for play requests */
82 #define PLAYER_PLAY_PORT (Config::instance()->server_port_base()+5)
84 typedef std::vector<std::shared_ptr<Content>> ContentList;
85 typedef std::vector<std::shared_ptr<FFmpegContent>> FFmpegContentList;
87 typedef int64_t Frame;
116 CPLSummary (boost::filesystem::path p);
118 CPLSummary (std::string d, std::string i, std::string a, boost::filesystem::path f, bool e, time_t t)
121 , cpl_annotation_text (a)
124 , last_write_time (t)
127 std::string dcp_directory;
129 boost::optional<std::string> cpl_annotation_text;
130 boost::filesystem::path cpl_file;
131 /** true if this CPL has any encrypted assets */
133 time_t last_write_time;
136 enum class FileTransferProtocol {
141 enum class EmailProtocol {