diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-01-24 20:00:12 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-01-24 20:00:12 +0000 |
| commit | cd21997cc5d7e6bc16c6c6e767e61cddfc7f6add (patch) | |
| tree | acb51274968b5aacd8c209eeb4925ff8c67613aa | |
| parent | 0b760c0526b0b9d13def519ab8afba1e511d8111 (diff) | |
Possibly-working basic DCP creation.
| -rw-r--r-- | src/lib/film.cc | 12 | ||||
| -rw-r--r-- | src/lib/film.h | 3 | ||||
| -rw-r--r-- | src/lib/writer.cc | 26 |
3 files changed, 34 insertions, 7 deletions
diff --git a/src/lib/film.cc b/src/lib/film.cc index dc308078c..f6eb032fd 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -229,12 +229,16 @@ Film::hash_dir () const } string -Film::video_mxf_path () const +Film::video_mxf_dir () const { boost::filesystem::path p; - p /= "video"; - p /= video_state_identifier (); - return file (p.string()); + return dir ("video"); +} + +string +Film::video_mxf_filename () const +{ + return video_state_identifier() + ".mxf"; } /** Add suitable Jobs to the JobManager to create a DCP for this Film. diff --git a/src/lib/film.h b/src/lib/film.h index 4d2819be3..07764dac8 100644 --- a/src/lib/film.h +++ b/src/lib/film.h @@ -62,7 +62,8 @@ public: std::string hash_dir () const; std::string j2c_path (int f, bool t) const; std::string hash_path (int f) const; - std::string video_mxf_path () const; + std::string video_mxf_dir () const; + std::string video_mxf_filename () const; void examine_content (); void send_dcp_to_tms (); 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<Film> 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); |
