From cd21997cc5d7e6bc16c6c6e767e61cddfc7f6add Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Thu, 24 Jan 2013 20:00:12 +0000 Subject: Possibly-working basic DCP creation. --- src/lib/writer.cc | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'src/lib/writer.cc') diff --git a/src/lib/writer.cc b/src/lib/writer.cc index 16ed5c349..33a7f42af 100644 --- a/src/lib/writer.cc +++ b/src/lib/writer.cc @@ -39,10 +39,15 @@ Writer::Writer (shared_ptr f) , _finish (false) , _last_written_frame (-1) { + /* Create our picture asset in a subdirectory, named according to the + film's parameters which affect the video output. We will hard-link + it into the DCP later. + */ + _picture_asset.reset ( new libdcp::MonoPictureAsset ( - _film->dir (_film->dcp_name()), - _film->video_mxf_path(), + _film->video_mxf_dir (), + _film->video_mxf_filename (), DCPFrameRate (_film->frames_per_second()).frames_per_second, _film->format()->dcp_size() ) @@ -207,6 +212,23 @@ Writer::finish () _picture_asset->set_entry_point (_film->trim_start ()); _picture_asset->set_duration (duration); + /* Hard-link the video MXF into the DCP */ + + boost::filesystem::path from; + from /= _film->video_mxf_dir(); + from /= _film->video_mxf_filename(); + + boost::filesystem::path to; + to /= _film->dir (_film->dcp_name()); + to /= "video.mxf"; + + boost::filesystem::create_hard_link (from, to); + + /* And update the asset */ + + _picture_asset->set_directory (_film->dir (_film->dcp_name ())); + _picture_asset->set_file_name ("video.mxf"); + if (_sound_asset) { _sound_asset->set_entry_point (_film->trim_start ()); _sound_asset->set_duration (duration); -- cgit v1.2.3