2 Copyright (C) 2020-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/>.
21 #include "copy_dcp_details_to_film.h"
22 #include "dcp_content.h"
25 #include "video_content.h"
26 #include "audio_content.h"
28 #include "dcp_content_type.h"
35 using std::shared_ptr;
39 copy_dcp_details_to_film (shared_ptr<const DCPContent> dcp, shared_ptr<Film> film)
41 auto name = dcp->name ();
42 name = name.substr (0, name.find("_"));
43 film->set_name (name);
44 film->set_use_isdcf_name (true);
45 if (dcp->content_kind()) {
46 film->set_dcp_content_type (DCPContentType::from_libdcp_kind(dcp->content_kind().get()));
48 film->set_encrypted (dcp->encrypted());
49 film->set_reel_type (ReelType::BY_VIDEO_CONTENT);
50 film->set_interop (dcp->standard() == dcp::Standard::INTEROP);
51 film->set_three_d (dcp->three_d());
54 film->set_container (Ratio::nearest_from_ratio(dcp->video->size().ratio()));
55 film->set_resolution (dcp->resolution());
56 DCPOMATIC_ASSERT (dcp->video_frame_rate());
57 film->set_video_frame_rate (*dcp->video_frame_rate());
61 film->set_audio_channels (dcp->audio->stream()->channels());
64 film->clear_markers ();
65 for (auto const& i: dcp->markers()) {
66 film->set_marker (i.first, dcpomatic::DCPTime(i.second.get()));
69 film->set_ratings (dcp->ratings());
70 film->set_content_versions (dcp->content_versions());