summaryrefslogtreecommitdiff
path: root/src/lib/make_dcp_job.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2012-07-17 19:51:13 +0100
committerCarl Hetherington <cth@carlh.net>2012-07-17 19:51:13 +0100
commitc7c8c894df8c2bb98aeed84011dd28da94afa392 (patch)
tree8959ce8c53fd47b7138e6e4352ebbeef4fec188d /src/lib/make_dcp_job.cc
parent6e5d1ca4075bbbff11292f26c4d98ab8bd92c115 (diff)
Remove asdcplib / OpenDCP deps.
Diffstat (limited to 'src/lib/make_dcp_job.cc')
-rw-r--r--src/lib/make_dcp_job.cc40
1 files changed, 22 insertions, 18 deletions
diff --git a/src/lib/make_dcp_job.cc b/src/lib/make_dcp_job.cc
index 21b8549be..998d1f9c3 100644
--- a/src/lib/make_dcp_job.cc
+++ b/src/lib/make_dcp_job.cc
@@ -38,7 +38,7 @@ using namespace boost;
* @param l Log.
*/
MakeDCPJob::MakeDCPJob (shared_ptr<const FilmState> s, shared_ptr<const Options> o, Log* l)
- : ShellCommandJob (s, o, l)
+ : Job (s, o, l)
{
}
@@ -69,26 +69,30 @@ MakeDCPJob::run ()
/* Remove any old DCP */
filesystem::remove_all (dcp_path);
- /* Re-make the DCP directory */
- _fs->dir (_fs->name);
-
- stringstream c;
- c << "cd \"" << dcp_path << "\" && "
- << " opendcp_xml -d -a \"" << _fs->name << "\""
- << " -t \"" << _fs->name << "\""
- << " -k " << _fs->dcp_content_type->opendcp_name()
- << " --reel \"" << _fs->file ("video.mxf") << "\"";
-
- if (have_audio) {
- c << " \"" << _fs->file ("audio.mxf") << "\"";
+ DCP dcp (_fs->dir (_fs->name()));
+ dcp.add_asset (
+ shared_ptr<MainPictureAsset> (new MainPictureAsset ("video.mxf", rint (_fs->frames_per_second), _fs->length, _opt->out_size))
+ );
+
+ if (filesystem::exists (filesystem::path (_fs->file ("audio.mxf")))) {
+ dcp.add_asset (
+ shared_ptr<MainSoundAsset> (new MainSoundAsset ("audio.mxf", rint (_fs->frames_per_second), _fs->length))
+ );
}
+
+ dcp.write_xml ();
- command (c.str ());
- filesystem::rename (filesystem::path (_fs->file ("video.mxf")), filesystem::path (dcp_path + "/video.mxf"));
- if (have_audio) {
- filesystem::rename (filesystem::path (_fs->file ("audio.mxf")), filesystem::path (dcp_path + "/audio.mxf"));
- }
+ add_pkl ();
+ add_cpl (pkl[0]);
+
+ add_reel (pkl[0].cpl[0]);
+
+ write_cpl ();
+ write_pkl ();
+ write_volindex ();
+ write_assetmap ();
+
set_progress (1);
}