summaryrefslogtreecommitdiff
path: root/src/lib
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
parent6e5d1ca4075bbbff11292f26c4d98ab8bd92c115 (diff)
Remove asdcplib / OpenDCP deps.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/dcp_content_type.cc4
-rw-r--r--src/lib/dcp_content_type.h8
-rw-r--r--src/lib/make_dcp_job.cc40
-rw-r--r--src/lib/make_dcp_job.h2
-rw-r--r--src/lib/make_mxf_job.cc2
-rw-r--r--src/lib/shell_command_job.cc71
-rw-r--r--src/lib/shell_command_job.h46
-rw-r--r--src/lib/wscript1
8 files changed, 30 insertions, 144 deletions
diff --git a/src/lib/dcp_content_type.cc b/src/lib/dcp_content_type.cc
index 72a26e407..321aa61da 100644
--- a/src/lib/dcp_content_type.cc
+++ b/src/lib/dcp_content_type.cc
@@ -28,9 +28,9 @@ using namespace std;
vector<DCPContentType const *> DCPContentType::_dcp_content_types;
-DCPContentType::DCPContentType (string p, string o)
+DCPContentType::DCPContentType (string p, string d)
: _pretty_name (p)
- , _opendcp_name (o)
+ , _dcp_name (d)
{
}
diff --git a/src/lib/dcp_content_type.h b/src/lib/dcp_content_type.h
index cade673bc..aba305449 100644
--- a/src/lib/dcp_content_type.h
+++ b/src/lib/dcp_content_type.h
@@ -37,9 +37,9 @@ public:
return _pretty_name;
}
- /** @return name as understood by OpenDCP */
- std::string opendcp_name () const {
- return _opendcp_name;
+ /** @return name as written to a DCP */
+ std::string dcp_name () const {
+ return _dcp_name;
}
static DCPContentType const * from_pretty_name (std::string);
@@ -50,7 +50,7 @@ public:
private:
std::string _pretty_name;
- std::string _opendcp_name;
+ std::string _dcp_name;
/** All available DCP content types */
static std::vector<DCPContentType const *> _dcp_content_types;
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);
}
diff --git a/src/lib/make_dcp_job.h b/src/lib/make_dcp_job.h
index 4e3193572..98cb2d8c3 100644
--- a/src/lib/make_dcp_job.h
+++ b/src/lib/make_dcp_job.h
@@ -26,7 +26,7 @@
/** @class MakeDCPJob
* @brief A job to create DCPs
*/
-class MakeDCPJob : public ShellCommandJob
+class MakeDCPJob : public Job
{
public:
MakeDCPJob (boost::shared_ptr<const FilmState>, boost::shared_ptr<const Options>, Log *);
diff --git a/src/lib/make_mxf_job.cc b/src/lib/make_mxf_job.cc
index 38a8bc59e..ac4c61e6d 100644
--- a/src/lib/make_mxf_job.cc
+++ b/src/lib/make_mxf_job.cc
@@ -244,7 +244,7 @@ MakeMXFJob::fill_writer_info (ASDCP::WriterInfo* writer_info)
writer_info->ProductName = "dvd-o-matic";
/* set the label type */
- writer_info->LabelSetType = ASDCP::LS_MXF_INTEROP;
+ writer_info->LabelSetType = ASDCP::LS_MXF_SMPTE;
/* generate a random UUID for this essence */
Kumu::GenRandomUUID (writer_info->AssetUUID);
diff --git a/src/lib/shell_command_job.cc b/src/lib/shell_command_job.cc
deleted file mode 100644
index 11805bdfe..000000000
--- a/src/lib/shell_command_job.cc
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
-
- This program 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,
- 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.
-
-*/
-
-/** @file src/shell_command_job.cc
- * @brief A job which calls a command via a shell.
- */
-
-#include <stdio.h>
-#include "shell_command_job.h"
-#include "log.h"
-
-using namespace std;
-using namespace boost;
-
-/** @param s Our FilmState.
- * @param o Options.
- * @param l Log.
- */
-ShellCommandJob::ShellCommandJob (shared_ptr<const FilmState> s, shared_ptr<const Options> o, Log* l)
- : Job (s, o, l)
-{
-
-}
-
-/** Run a command via a shell.
- * @param c Command to run.
- */
-void
-ShellCommandJob::command (string c)
-{
- _log->log ("Command: " + c, Log::VERBOSE);
-
- int const r = system (c.c_str());
- if (r < 0) {
- set_state (FINISHED_ERROR);
- return;
- } else if (WEXITSTATUS (r) != 0) {
- set_error ("command failed");
- set_state (FINISHED_ERROR);
- } else {
- set_state (FINISHED_OK);
- }
-}
-
-string
-ShellCommandJob::status () const
-{
- if (!running () && !finished()) {
- return "Waiting";
- } else if (running ()) {
- return "";
- }
-
- return Job::status ();
-}
diff --git a/src/lib/shell_command_job.h b/src/lib/shell_command_job.h
deleted file mode 100644
index e5dd58867..000000000
--- a/src/lib/shell_command_job.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
-
- This program 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,
- 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.
-
-*/
-
-/** @file src/shell_command_job.h
- * @brief A job which calls a command via a shell.
- */
-
-#ifndef DVDOMATIC_SHELL_COMMAND_JOB_H
-#define DVDOMATIC_SHELL_COMMAND_JOB_H
-
-#include "job.h"
-
-class FilmState;
-class Log;
-
-/** @class ShellCommandJob
- * @brief A job which calls a command via a shell.
- */
-class ShellCommandJob : public Job
-{
-public:
- ShellCommandJob (boost::shared_ptr<const FilmState> s, boost::shared_ptr<const Options> o, Log* l);
-
- std::string status () const;
-
-protected:
- void command (std::string c);
-};
-
-#endif
diff --git a/src/lib/wscript b/src/lib/wscript
index 5d8adf7ff..406697f9c 100644
--- a/src/lib/wscript
+++ b/src/lib/wscript
@@ -46,7 +46,6 @@ def build(bld):
screen.cc
server.cc
scp_dcp_job.cc
- shell_command_job.cc
thumbs_job.cc
tiff_decoder.cc
tiff_encoder.cc