Remove asdcplib / OpenDCP deps.
authorCarl Hetherington <cth@carlh.net>
Tue, 17 Jul 2012 18:51:13 +0000 (19:51 +0100)
committerCarl Hetherington <cth@carlh.net>
Tue, 17 Jul 2012 18:51:13 +0000 (19:51 +0100)
src/lib/dcp_content_type.cc
src/lib/dcp_content_type.h
src/lib/make_dcp_job.cc
src/lib/make_dcp_job.h
src/lib/make_mxf_job.cc
src/lib/shell_command_job.cc [deleted file]
src/lib/shell_command_job.h [deleted file]
src/lib/wscript
src/wscript

index 72a26e4072622db2ca88083071e0ccf0997136d6..321aa61da494c2a9955e3b6a128f13e994ba4a5c 100644 (file)
@@ -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)
 {
 
 }
index cade673bc0f613a972449deaeb2fe8075f23c96c..aba3054490ad89aaf1ebc9e27a82c9bf5fcdab3c 100644 (file)
@@ -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;
index 21b8549be4e16e869769249317acaed814e3f59e..998d1f9c350dc8c91c375ebd452797c4f0bb1b6f 100644 (file)
@@ -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);
 }
index 4e3193572e377891323d9c5d75257cc2e55f98fe..98cb2d8c37fb681ed2327dc9f161555b18a522e5 100644 (file)
@@ -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 *);
index 38a8bc59e43724e8a2b4d6159cdf2b05f34bae27..ac4c61e6d23db4286f775d5ef2cbe94fbf9a8a53 100644 (file)
@@ -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 (file)
index 11805bd..0000000
+++ /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 (file)
index e5dd588..0000000
+++ /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
index 5d8adf7fff5c9a7ef29a14dd854871ccb009ffc6..406697f9ce57b2d42c8e291baa4c01ca1309470d 100644 (file)
@@ -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
index 3216dc07a81469a0475bba2de23feb92f29f7244..f864e1ce184c3145f26c343d06c07f3a166752b4 100644 (file)
@@ -7,6 +7,5 @@ def configure(conf):
 def build(bld):
     bld.recurse('lib')
     bld.recurse('tools')
-    bld.recurse('asdcplib')
     if not bld.env.DISABLE_GUI:
         bld.recurse('gtk')