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)
{
}
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);
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;
* @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)
{
}
/* 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);
}
/** @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 *);
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);
+++ /dev/null
-/*
- 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 ();
-}
+++ /dev/null
-/*
- 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
screen.cc
server.cc
scp_dcp_job.cc
- shell_command_job.cc
thumbs_job.cc
tiff_decoder.cc
tiff_encoder.cc
def build(bld):
bld.recurse('lib')
bld.recurse('tools')
- bld.recurse('asdcplib')
if not bld.env.DISABLE_GUI:
bld.recurse('gtk')