X-Git-Url: https://main.carlh.net/gitweb/?p=dcpomatic.git;a=blobdiff_plain;f=src%2Flib%2Fdcp_content.cc;h=dbbd65077b85c871457f994164274b5bb2603dcf;hp=d41a59b7161addfa4ff2ffd6e2c3d99b9b5c9445;hb=5a5324ed3a381a86dfe0a6e3932c1d58fdcd596f;hpb=93d57d46e52e0050efda894fc3089a6410d55754 diff --git a/src/lib/dcp_content.cc b/src/lib/dcp_content.cc index d41a59b71..dbbd65077 100644 --- a/src/lib/dcp_content.cc +++ b/src/lib/dcp_content.cc @@ -1,19 +1,20 @@ /* Copyright (C) 2014-2016 Carl Hetherington - This program is free software; you can redistribute it and/or modify + This file is part of DCP-o-matic. + + DCP-o-matic is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - This program is distributed in the hope that it will be useful, + DCP-o-matic is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with DCP-o-matic. If not, see . */ @@ -34,6 +35,7 @@ #include #include #include +#include #include #include @@ -46,6 +48,7 @@ using std::pair; using std::vector; using std::list; using boost::shared_ptr; +using boost::make_shared; using boost::scoped_ptr; using boost::optional; using boost::function; @@ -62,6 +65,7 @@ DCPContent::DCPContent (shared_ptr film, boost::filesystem::path p) , _reference_video (false) , _reference_audio (false) , _reference_subtitle (false) + , _three_d (false) { video.reset (new VideoContent (this)); audio.reset (new AudioContent (this)); @@ -74,7 +78,7 @@ DCPContent::DCPContent (shared_ptr film, cxml::ConstNodePtr node, in : Content (film, node) { video = VideoContent::from_xml (this, node, version); - audio = AudioContent::from_xml (this, node); + audio = AudioContent::from_xml (this, node, version); subtitle = SubtitleContent::from_xml (this, node, version); audio->set_stream ( @@ -107,6 +111,7 @@ DCPContent::DCPContent (shared_ptr film, cxml::ConstNodePtr node, in DCPOMATIC_ASSERT (false); } } + _three_d = node->optional_bool_child("ThreeD").get_value_or (false); } void @@ -129,7 +134,7 @@ DCPContent::examine (shared_ptr job) job->set_progress_unknown (); Content::examine (job); - shared_ptr examiner (new DCPExaminer (shared_from_this ())); + shared_ptr examiner = make_shared (shared_from_this ()); video->take_from_examiner (examiner); set_default_colour_conversion (); @@ -154,11 +159,14 @@ DCPContent::examine (shared_ptr job) _encrypted = examiner->encrypted (); _kdm_valid = examiner->kdm_valid (); _standard = examiner->standard (); + _three_d = examiner->three_d (); } if (could_be_played != can_be_played ()) { signal_changed (DCPContentProperty::CAN_BE_PLAYED); } + + video->set_frame_type (_three_d ? VIDEO_FRAME_TYPE_3D : VIDEO_FRAME_TYPE_2D); } string @@ -220,6 +228,7 @@ DCPContent::as_xml (xmlpp::Node* node) const DCPOMATIC_ASSERT (false); } } + node->add_child("ThreeD")->add_child_text (_three_d ? "1" : "0"); } DCPTime @@ -274,6 +283,8 @@ DCPContent::directory () const void DCPContent::add_properties (list& p) const { + Content::add_properties (p); + video->add_properties (p); audio->add_properties (p); }