Update for new libdcp; add some more formats; fix compile with old boost.
authorCarl Hetherington <cth@carlh.net>
Wed, 22 Aug 2012 23:23:43 +0000 (00:23 +0100)
committerCarl Hetherington <cth@carlh.net>
Wed, 22 Aug 2012 23:23:43 +0000 (00:23 +0100)
src/lib/film.cc
src/lib/format.cc
src/lib/make_dcp_job.cc
wscript

index 65a75b845ba9668c620419f28428e5738f334044..f8a3b192da0147b37b3202b68c66457279b1c621 100644 (file)
@@ -167,8 +167,16 @@ Film::set_content (string c)
 {
        string check = _state.directory;
 
+#if BOOST_FILESYSTEM_VERSION == 3
        filesystem::path slash ("/");
        string platform_slash = slash.make_preferred().string ();
+#else
+#ifdef DVDOMATIC_WINDOWS
+       string platform_slash = "\\";
+#else
+       string platform_slash = "/";
+#endif
+#endif 
 
        if (!ends_with (check, platform_slash)) {
                check += platform_slash;
index d99ed926a2ac42df20ed7216c716bb9a91256ddd..ff3a5b2023ae45509141cb7bda8fbc4261440726 100644 (file)
@@ -76,8 +76,12 @@ Format::as_metadata () const
 void
 Format::setup_formats ()
 {
+       _formats.push_back (new Format (119, Size (1285, 1080), "119", "1.19"));
+       _formats.push_back (new Format (133, Size (1436, 1080), "133", "1.33"));
+       _formats.push_back (new Format (138, Size (1485, 1080), "138", "1.375"));
        _formats.push_back (new Format (133, Size (1998, 1080), "133-in-flat", "4:3 within Flat"));
        _formats.push_back (new Format (137, Size (1480, 1080), "137", "Academy"));
+       _formats.push_back (new Format (166, Size (1793, 1080), "166", "1.66"));
        _formats.push_back (new Format (178, Size (1998, 1080), "178-in-flat", "16:9 within Flat"));
        _formats.push_back (new Format (185, Size (1998, 1080), "185", "Flat"));
        _formats.push_back (new Format (239, Size (2048, 858), "239", "Scope"));
index 4f42e13f13f2881939de89ea3d5097338b174423..525f76c0e26b26f2dce5c49867232c7312948497 100644 (file)
@@ -23,6 +23,9 @@
 
 #include <boost/filesystem.hpp>
 #include <libdcp/dcp.h>
+#include <libdcp/picture_asset.h>
+#include <libdcp/sound_asset.h>
+#include <libdcp/reel.h>
 extern "C" {
 #include <libavutil/pixdesc.h>
 }
@@ -88,15 +91,40 @@ MakeDCPJob::run ()
        dcp.Progress.connect (sigc::mem_fun (*this, &MakeDCPJob::dcp_progress));
 
        descend (0.9);
-       dcp.add_picture_asset (sigc::mem_fun (*this, &MakeDCPJob::j2c_path), _opt->out_size.width, _opt->out_size.height);
+       shared_ptr<libdcp::MonoPictureAsset> pa (
+               new libdcp::MonoPictureAsset (
+                       sigc::mem_fun (*this, &MakeDCPJob::j2c_path),
+                       _fs->dir (_fs->name),
+                       "video.mxf",
+                       &dcp.Progress,
+                       rint (_fs->frames_per_second),
+                       frames,
+                       _opt->out_size.width,
+                       _opt->out_size.height
+                       )
+               );
+       
        ascend ();
 
+       shared_ptr<libdcp::SoundAsset> sa;
+
        if (_fs->audio_channels > 0) {
                descend (0.1);
-               dcp.add_sound_asset (sigc::mem_fun (*this, &MakeDCPJob::wav_path), _fs->audio_channels);
+               sa.reset (
+                       new libdcp::SoundAsset (
+                               sigc::mem_fun (*this, &MakeDCPJob::wav_path),
+                               _fs->dir (_fs->name),
+                               "audio.mxf",
+                               &dcp.Progress,
+                               rint (_fs->frames_per_second),
+                               frames,
+                               _fs->audio_channels
+                               )
+                       );
                ascend ();
        }
 
+       dcp.add_reel (shared_ptr<libdcp::Reel> (new libdcp::Reel (pa, sa, shared_ptr<libdcp::SubtitleAsset> ())));
        dcp.write_xml ();
 
        set_progress (1);
diff --git a/wscript b/wscript
index 31feb08bcfd6b9d799fb4fbdaef63105a22bf295..08ecad4de784dc31273df298e0bb7150645c5eb5 100644 (file)
--- a/wscript
+++ b/wscript
@@ -60,7 +60,7 @@ def configure(conf):
     conf.check_cfg(package = 'libswresample', args = '--cflags --libs', uselib_store = 'SWRESAMPLE', mandatory = True)
     conf.check_cfg(package = 'libpostproc', args = '--cflags --libs', uselib_store = 'POSTPROC', mandatory = True)
     conf.check_cfg(package = 'sndfile', args = '--cflags --libs', uselib_store = 'SNDFILE', mandatory = True)
-    conf.check_cfg(package = 'libdcp', atleast_version = '0.07', args = '--cflags --libs', uselib_store = 'DCP', mandatory = True)
+    conf.check_cfg(package = 'libdcp', atleast_version = '0.11', args = '--cflags --libs', uselib_store = 'DCP', mandatory = True)
     conf.check_cfg(package = 'glib-2.0', args = '--cflags --libs', uselib_store = 'GLIB', mandatory = True)
     conf.check_cfg(package = '', path = 'Magick++-config', args = '--cppflags --cxxflags --libs', uselib_store = 'MAGICK', mandatory = True)
     conf.check_cc(msg = 'Checking for library libtiff', function_name = 'TIFFOpen', header_name = 'tiffio.h', lib = 'tiff', uselib_store = 'TIFF')