Adapt for changes to libdcp API.
authorCarl Hetherington <cth@carlh.net>
Mon, 8 Jun 2015 13:25:10 +0000 (14:25 +0100)
committerCarl Hetherington <cth@carlh.net>
Mon, 8 Jun 2015 13:25:10 +0000 (14:25 +0100)
21 files changed:
src/lib/content_factory.cc
src/lib/content_subtitle.cc
src/lib/dcp_decoder.cc
src/lib/dcp_examiner.cc
src/lib/dcp_subtitle.cc
src/lib/dcp_subtitle.h
src/lib/dcp_subtitle_content.cc
src/lib/dcp_subtitle_decoder.cc
src/lib/dcp_video.h
src/lib/encoded_data.h
src/lib/film.cc
src/lib/film.h
src/lib/util.cc
src/lib/util.h
src/lib/writer.cc
src/lib/writer.h
test/audio_delay_test.cc
test/ffmpeg_audio_test.cc
test/recover_test.cc
test/silence_padding_test.cc
test/test.cc

index f4d9fe4e93f7734679a7e9145af58a227f8fb37b..db3a305006ba61c8d8e19c8bb84c6508c4673a5d 100644 (file)
@@ -29,7 +29,7 @@
 #include "dcp_subtitle_content.h"
 #include "util.h"
 #include <libcxml/cxml.h>
-#include <dcp/smpte_subtitle_content.h>
+#include <dcp/smpte_subtitle_asset.h>
 
 using std::string;
 using std::list;
@@ -87,7 +87,7 @@ content_factory (shared_ptr<const Film> film, boost::filesystem::path path)
                content.reset (new SubRipContent (film, path));
        } else if (ext == ".xml") {
                content.reset (new DCPSubtitleContent (film, path));
-       } else if (ext == ".mxf" && dcp::SMPTESubtitleContent::valid_mxf (path)) {
+       } else if (ext == ".mxf" && dcp::SMPTESubtitleAsset::valid_mxf (path)) {
                content.reset (new DCPSubtitleContent (film, path));
        }
 
index c4cfafad5bf99f243e0a63bc6ef579ba69018826..4eed8b4b2b0b03941428bf97f658634e8f8c6c4c 100644 (file)
@@ -25,7 +25,7 @@ ContentTextSubtitle::period () const
        /* XXX: assuming we have some subs and they are all at the same time */
        DCPOMATIC_ASSERT (!subs.empty ());
        return ContentTimePeriod (
-               ContentTime::from_seconds (subs.front().in().to_seconds()),
-               ContentTime::from_seconds (subs.front().out().to_seconds())
+               ContentTime::from_seconds (subs.front().in().as_seconds()),
+               ContentTime::from_seconds (subs.front().out().as_seconds())
                );
 }
index 0411ad94183d8818df84adcc5d23ac5ec1d3b5f8..8b2765d449689036b716f9e37cc6d16470b98c7e 100644 (file)
@@ -25,8 +25,8 @@
 #include <dcp/dcp.h>
 #include <dcp/cpl.h>
 #include <dcp/reel.h>
-#include <dcp/mono_picture_mxf.h>
-#include <dcp/stereo_picture_mxf.h>
+#include <dcp/mono_picture_asset.h>
+#include <dcp/stereo_picture_asset.h>
 #include <dcp/reel_picture_asset.h>
 #include <dcp/reel_sound_asset.h>
 #include <dcp/mono_picture_frame.h>
@@ -65,20 +65,20 @@ DCPDecoder::pass (PassReason)
        int64_t const frame = _next.frames (vfr);
        
        if ((*_reel)->main_picture ()) {
-               shared_ptr<dcp::PictureMXF> mxf = (*_reel)->main_picture()->mxf ();
-               shared_ptr<dcp::MonoPictureMXF> mono = dynamic_pointer_cast<dcp::MonoPictureMXF> (mxf);
-               shared_ptr<dcp::StereoPictureMXF> stereo = dynamic_pointer_cast<dcp::StereoPictureMXF> (mxf);
+               shared_ptr<dcp::PictureAsset> asset = (*_reel)->main_picture()->asset ();
+               shared_ptr<dcp::MonoPictureAsset> mono = dynamic_pointer_cast<dcp::MonoPictureAsset> (asset);
+               shared_ptr<dcp::StereoPictureAsset> stereo = dynamic_pointer_cast<dcp::StereoPictureAsset> (asset);
                int64_t const entry_point = (*_reel)->main_picture()->entry_point ();
                if (mono) {
-                       video (shared_ptr<ImageProxy> (new J2KImageProxy (mono->get_frame (entry_point + frame), mxf->size())), frame);
+                       video (shared_ptr<ImageProxy> (new J2KImageProxy (mono->get_frame (entry_point + frame), asset->size())), frame);
                } else {
                        video (
-                               shared_ptr<ImageProxy> (new J2KImageProxy (stereo->get_frame (entry_point + frame), mxf->size(), dcp::EYE_LEFT)),
+                               shared_ptr<ImageProxy> (new J2KImageProxy (stereo->get_frame (entry_point + frame), asset->size(), dcp::EYE_LEFT)),
                                frame
                                );
                        
                        video (
-                               shared_ptr<ImageProxy> (new J2KImageProxy (stereo->get_frame (entry_point + frame), mxf->size(), dcp::EYE_RIGHT)),
+                               shared_ptr<ImageProxy> (new J2KImageProxy (stereo->get_frame (entry_point + frame), asset->size(), dcp::EYE_RIGHT)),
                                frame
                                );
                }
@@ -86,7 +86,7 @@ DCPDecoder::pass (PassReason)
 
        if ((*_reel)->main_sound ()) {
                int64_t const entry_point = (*_reel)->main_sound()->entry_point ();
-               shared_ptr<const dcp::SoundFrame> sf = (*_reel)->main_sound()->mxf()->get_frame (entry_point + frame);
+               shared_ptr<const dcp::SoundFrame> sf = (*_reel)->main_sound()->asset()->get_frame (entry_point + frame);
                uint8_t const * from = sf->data ();
 
                int const channels = _dcp_content->audio_stream()->channels ();
index a0d13a7224bb42d090d0f26922f0ee8f99ef50f7..21ffeda296c503edb0d9af6c76aec737a335c3ec 100644 (file)
 #include <dcp/reel.h>
 #include <dcp/reel_picture_asset.h>
 #include <dcp/reel_sound_asset.h>
-#include <dcp/mono_picture_mxf.h>
+#include <dcp/mono_picture_asset.h>
 #include <dcp/mono_picture_frame.h>
-#include <dcp/stereo_picture_mxf.h>
+#include <dcp/stereo_picture_asset.h>
 #include <dcp/stereo_picture_frame.h>
-#include <dcp/sound_mxf.h>
+#include <dcp/sound_asset.h>
 
 #include "i18n.h"
 
@@ -74,10 +74,10 @@ DCPExaminer::DCPExaminer (shared_ptr<const DCPContent> content)
                                throw DCPError (_("Mismatched frame rates in DCP"));
                        }
 
-                       shared_ptr<dcp::PictureMXF> mxf = (*i)->main_picture()->mxf ();
+                       shared_ptr<dcp::PictureAsset> asset = (*i)->main_picture()->asset ();
                        if (!_video_size) {
-                               _video_size = mxf->size ();
-                       } else if (_video_size.get() != mxf->size ()) {
+                               _video_size = asset->size ();
+                       } else if (_video_size.get() != asset->size ()) {
                                throw DCPError (_("Mismatched video sizes in DCP"));
                        }
 
@@ -85,17 +85,17 @@ DCPExaminer::DCPExaminer (shared_ptr<const DCPContent> content)
                }
                        
                if ((*i)->main_sound ()) {
-                       shared_ptr<dcp::SoundMXF> mxf = (*i)->main_sound()->mxf ();
+                       shared_ptr<dcp::SoundAsset> asset = (*i)->main_sound()->asset ();
 
                        if (!_audio_channels) {
-                               _audio_channels = mxf->channels ();
-                       } else if (_audio_channels.get() != mxf->channels ()) {
+                               _audio_channels = asset->channels ();
+                       } else if (_audio_channels.get() != asset->channels ()) {
                                throw DCPError (_("Mismatched audio channel counts in DCP"));
                        }
 
                        if (!_audio_frame_rate) {
-                               _audio_frame_rate = mxf->sampling_rate ();
-                       } else if (_audio_frame_rate.get() != mxf->sampling_rate ()) {
+                               _audio_frame_rate = asset->sampling_rate ();
+                       } else if (_audio_frame_rate.get() != asset->sampling_rate ()) {
                                throw DCPError (_("Mismatched audio frame rates in DCP"));
                        }
 
@@ -113,9 +113,9 @@ DCPExaminer::DCPExaminer (shared_ptr<const DCPContent> content)
        /* Check that we can read the first picture frame */
        try {
                if (!dcp.cpls().empty () && !dcp.cpls().front()->reels().empty ()) {
-                       shared_ptr<dcp::PictureMXF> mxf = dcp.cpls().front()->reels().front()->main_picture()->mxf ();
-                       shared_ptr<dcp::MonoPictureMXF> mono = dynamic_pointer_cast<dcp::MonoPictureMXF> (mxf);
-                       shared_ptr<dcp::StereoPictureMXF> stereo = dynamic_pointer_cast<dcp::StereoPictureMXF> (mxf);
+                       shared_ptr<dcp::PictureAsset> asset = dcp.cpls().front()->reels().front()->main_picture()->asset ();
+                       shared_ptr<dcp::MonoPictureAsset> mono = dynamic_pointer_cast<dcp::MonoPictureAsset> (asset);
+                       shared_ptr<dcp::StereoPictureAsset> stereo = dynamic_pointer_cast<dcp::StereoPictureAsset> (asset);
                        
                        if (mono) {
                                mono->get_frame(0)->xyz_image ();
index 17874c27eca9520f50a3bee4a2c2e12d812a095b..66cee4ad866f9772e8cdc96e75dc696a66ac9c14 100644 (file)
 
 #include "dcp_subtitle.h"
 #include "exceptions.h"
-#include <dcp/interop_subtitle_content.h>
-#include <dcp/smpte_subtitle_content.h>
+#include <dcp/interop_subtitle_asset.h>
+#include <dcp/smpte_subtitle_asset.h>
 
 #include "i18n.h"
 
 using boost::shared_ptr;
 
-shared_ptr<dcp::SubtitleContent>
+shared_ptr<dcp::SubtitleAsset>
 DCPSubtitle::load (boost::filesystem::path file) const
 {
-       shared_ptr<dcp::SubtitleContent> sc;
+       shared_ptr<dcp::SubtitleAsset> sc;
        
        try {
-               sc.reset (new dcp::InteropSubtitleContent (file));
+               sc.reset (new dcp::InteropSubtitleAsset (file));
        } catch (...) {
                
        }
 
        if (!sc) {
                try {
-                       sc.reset (new dcp::SMPTESubtitleContent (file, true));
+                       sc.reset (new dcp::SMPTESubtitleAsset (file, true));
                } catch (...) {
 
                }
@@ -47,7 +47,7 @@ DCPSubtitle::load (boost::filesystem::path file) const
 
        if (!sc) {
                try {
-                       sc.reset (new dcp::SMPTESubtitleContent (file, false));
+                       sc.reset (new dcp::SMPTESubtitleAsset (file, false));
                } catch (...) {
 
                }
index e15acca44ea95a3743dbf80312e4884134812c7a..4b4d4c92a9822f19ac31c7e91e5ea5c8e53b918c 100644 (file)
 #include <boost/filesystem.hpp>
 
 namespace dcp {
-       class SubtitleContent;
+       class SubtitleAsset;
 }
 
 class DCPSubtitle
 {
 protected:
-       boost::shared_ptr<dcp::SubtitleContent> load (boost::filesystem::path) const;
+       boost::shared_ptr<dcp::SubtitleAsset> load (boost::filesystem::path) const;
 };
 
 #endif
index 3f9772d597de3b6464fe6b888a3f0be821d503d6..c457e84740ddbfab828876875f47349f51922093 100644 (file)
@@ -20,8 +20,8 @@
 #include "font.h"
 #include "dcp_subtitle_content.h"
 #include "raw_convert.h"
-#include <dcp/interop_subtitle_content.h>
-#include <dcp/smpte_subtitle_content.h>
+#include <dcp/interop_subtitle_asset.h>
+#include <dcp/smpte_subtitle_asset.h>
 #include <dcp/interop_load_font_node.h>
 #include <boost/foreach.hpp>
 
@@ -30,6 +30,7 @@
 using std::string;
 using std::list;
 using boost::shared_ptr;
+using boost::dynamic_pointer_cast;
 
 DCPSubtitleContent::DCPSubtitleContent (shared_ptr<const Film> film, boost::filesystem::path path)
        : Content (film, path)
@@ -51,12 +52,20 @@ DCPSubtitleContent::examine (shared_ptr<Job> job)
 {
        Content::examine (job);
 
-       shared_ptr<dcp::SubtitleContent> sc = load (path (0));
+       shared_ptr<dcp::SubtitleAsset> sc = load (path (0));
        
        boost::mutex::scoped_lock lm (_mutex);
-       
-       _subtitle_language = sc->language ();
-       _length = DCPTime::from_seconds (sc->latest_subtitle_out().to_seconds ());
+
+       shared_ptr<dcp::InteropSubtitleAsset> iop = dynamic_pointer_cast<dcp::InteropSubtitleAsset> (sc);
+       if (iop) {
+               _subtitle_language = iop->language ();
+       }
+       shared_ptr<dcp::SMPTESubtitleAsset> smpte = dynamic_pointer_cast<dcp::SMPTESubtitleAsset> (sc);
+       if (smpte) {
+               _subtitle_language = smpte->language().get_value_or ("");
+       }
+
+       _length = DCPTime::from_seconds (sc->latest_subtitle_out().as_seconds ());
 
        BOOST_FOREACH (shared_ptr<dcp::LoadFontNode> i, sc->load_font_nodes ()) {
                _fonts.push_back (shared_ptr<Font> (new Font (i->id)));
index 93a122590749b848d3eea519177c5f8bd61ce56a..95d7bdca4a8cba8f9b35e28e2ae6f4ff54f9c894 100644 (file)
@@ -19,7 +19,7 @@
 
 #include "dcp_subtitle_decoder.h"
 #include "dcp_subtitle_content.h"
-#include <dcp/interop_subtitle_content.h>
+#include <dcp/interop_subtitle_asset.h>
 
 using std::list;
 using std::cout;
@@ -28,7 +28,7 @@ using boost::shared_ptr;
 DCPSubtitleDecoder::DCPSubtitleDecoder (shared_ptr<const DCPSubtitleContent> content)
        : SubtitleDecoder (content)
 {
-       shared_ptr<dcp::SubtitleContent> c (load (content->path (0)));
+       shared_ptr<dcp::SubtitleAsset> c (load (content->path (0)));
        _subtitles = c->subtitles ();
        _next = _subtitles.begin ();
 }
@@ -40,7 +40,7 @@ DCPSubtitleDecoder::seek (ContentTime time, bool accurate)
 
        _next = _subtitles.begin ();
        list<dcp::SubtitleString>::const_iterator i = _subtitles.begin ();
-       while (i != _subtitles.end() && ContentTime::from_seconds (_next->in().to_seconds()) < time) {
+       while (i != _subtitles.end() && ContentTime::from_seconds (_next->in().as_seconds()) < time) {
                ++i;
        }
 }
@@ -75,8 +75,8 @@ DCPSubtitleDecoder::text_subtitles_during (ContentTimePeriod p, bool starting) c
 
        for (list<dcp::SubtitleString>::const_iterator i = _subtitles.begin(); i != _subtitles.end(); ++i) {
                ContentTimePeriod period (
-                       ContentTime::from_seconds (i->in().to_seconds ()),
-                       ContentTime::from_seconds (i->out().to_seconds ())
+                       ContentTime::from_seconds (i->in().as_seconds ()),
+                       ContentTime::from_seconds (i->out().as_seconds ())
                        );
                
                if ((starting && p.contains (period.from)) || (!starting && p.overlaps (period))) {
index af4712b2b1cd2ff2e4ba262c646ce95ea5991fed..125e2c8186ccef960fd45eac476454656bdf4efe 100644 (file)
@@ -19,7 +19,7 @@
 */
 
 #include "util.h"
-#include <dcp/picture_mxf_writer.h>
+#include <dcp/picture_asset_writer.h>
 #include <libcxml/cxml.h>
 
 /** @file  src/dcp_video_frame.h
index 245a888ddf531a51a8fcd66eb867545caa5a3816..368f267f153851d8c71ea309cd04f7f7893605bb 100644 (file)
@@ -18,7 +18,7 @@
 */
 
 #include "types.h"
-#include <dcp/picture_mxf_writer.h>
+#include <dcp/picture_asset_writer.h>
 #include <boost/noncopyable.hpp>
 #include <boost/filesystem.hpp>
 
index 590acedfd370f56dd04a5b2077c3a5758b78fc9f..d671820226633ad01e69247566c06c10e09697b9 100644 (file)
@@ -220,13 +220,13 @@ Film::info_file () const
 }
 
 boost::filesystem::path
-Film::internal_video_mxf_dir () const
+Film::internal_video_asset_dir () const
 {
        return dir ("video");
 }
 
 boost::filesystem::path
-Film::internal_video_mxf_filename () const
+Film::internal_video_asset_filename () const
 {
        return video_identifier() + ".mxf";
 }
@@ -1132,8 +1132,8 @@ bool
 Film::should_be_enough_disk_space (double& required, double& available, bool& can_hard_link) const
 {
        /* Create a test file and see if we can hard-link it */
-       boost::filesystem::path test = internal_video_mxf_dir() / "test";
-       boost::filesystem::path test2 = internal_video_mxf_dir() / "test2";
+       boost::filesystem::path test = internal_video_asset_dir() / "test";
+       boost::filesystem::path test2 = internal_video_asset_dir() / "test2";
        can_hard_link = true;
        FILE* f = fopen_boost (test, "w");
        if (f) {
@@ -1147,7 +1147,7 @@ Film::should_be_enough_disk_space (double& required, double& available, bool& ca
                boost::filesystem::remove (test2);
        }
 
-       boost::filesystem::space_info s = boost::filesystem::space (internal_video_mxf_dir ());
+       boost::filesystem::space_info s = boost::filesystem::space (internal_video_asset_dir ());
        required = double (required_disk_space ()) / 1073741824.0f;
        if (!can_hard_link) {
                required *= 2;
index b0f1a86855e9d91100fcbb4e0266650dbcb521f3..f9dc0ed9ce7e40df64324b80ed315978da9dab27 100644 (file)
@@ -66,8 +66,8 @@ public:
 
        boost::filesystem::path info_file () const;
        boost::filesystem::path j2c_path (int, Eyes, bool) const;
-       boost::filesystem::path internal_video_mxf_dir () const;
-       boost::filesystem::path internal_video_mxf_filename () const;
+       boost::filesystem::path internal_video_asset_dir () const;
+       boost::filesystem::path internal_video_asset_filename () const;
 
        boost::filesystem::path audio_analysis_path (boost::shared_ptr<const Playlist>) const;
 
index dccf32f4d6c5d1345d4c7202b0dbe5ae812eb85d..b662f8679f42b1921c97f02dfe894ade2c334a3e 100644 (file)
@@ -37,9 +37,9 @@
 #include "safe_stringstream.h"
 #include <dcp/util.h>
 #include <dcp/signer.h>
-#include <dcp/picture_mxf.h>
-#include <dcp/sound_mxf.h>
-#include <dcp/subtitle_content.h>
+#include <dcp/picture_asset.h>
+#include <dcp/sound_asset.h>
+#include <dcp/subtitle_asset.h>
 #include <glib.h>
 #include <pangomm/init.h>
 #include <boost/algorithm/string.hpp>
@@ -676,19 +676,19 @@ write_frame_info (FILE* file, int frame, Eyes eyes, dcp::FrameInfo info)
 }
 
 string
-video_mxf_filename (shared_ptr<dcp::PictureMXF> mxf)
+video_asset_filename (shared_ptr<dcp::PictureAsset> asset)
 {
-       return "j2c_" + mxf->id() + ".mxf";
+       return "j2c_" + asset->id() + ".mxf";
 }
 
 string
-audio_mxf_filename (shared_ptr<dcp::SoundMXF> mxf)
+audio_asset_filename (shared_ptr<dcp::SoundAsset> asset)
 {
-       return "pcm_" + mxf->id() + ".mxf";
+       return "pcm_" + asset->id() + ".mxf";
 }
 
 string
-subtitle_content_filename (shared_ptr<dcp::SubtitleContent> content)
+subtitle_content_filename (shared_ptr<dcp::SubtitleAsset> asset)
 {
-       return "sub_" + content->id() + ".xml";
+       return "sub_" + asset->id() + ".xml";
 }
index 51770c288695fd064d9d4fc73574664fe7146fb7..957453fb728e73e4d03c30ad67eac5ec24168074 100644 (file)
@@ -29,7 +29,7 @@
 #include "exceptions.h"
 #include "dcpomatic_time.h"
 #include <dcp/util.h>
-#include <dcp/picture_mxf_writer.h>
+#include <dcp/picture_asset_writer.h>
 extern "C" {
 #include <libavcodec/avcodec.h>
 #include <libavfilter/avfilter.h>
@@ -43,9 +43,9 @@ extern "C" {
 #undef check
 
 namespace dcp {
-       class PictureMXF;
-       class SoundMXF;
-       class SubtitleContent;
+       class PictureAsset;
+       class SoundAsset;
+       class SubtitleAsset;
 }
 
 /** The maximum number of audio channels that we can have in a DCP */
@@ -102,9 +102,9 @@ extern void set_backtrace_file (boost::filesystem::path);
 extern dcp::FrameInfo read_frame_info (FILE* file, int frame, Eyes eyes);
 extern void write_frame_info (FILE* file, int frame, Eyes eyes, dcp::FrameInfo info);
 extern std::map<std::string, std::string> split_get_request (std::string url);
-extern std::string video_mxf_filename (boost::shared_ptr<dcp::PictureMXF> mxf);
-extern std::string audio_mxf_filename (boost::shared_ptr<dcp::SoundMXF> mxf);
-extern std::string subtitle_content_filename (boost::shared_ptr<dcp::SubtitleContent> content);
+extern std::string video_asset_filename (boost::shared_ptr<dcp::PictureAsset> asset);
+extern std::string audio_asset_filename (boost::shared_ptr<dcp::SoundAsset> asset);
+extern std::string subtitle_content_filename (boost::shared_ptr<dcp::SubtitleAsset> content);
 
 #endif
 
index 650f8ac476c23676da570712882742e6c4995f43..03139a31c28824d150c6c266c9ffd313b9b25599 100644 (file)
 #include "version.h"
 #include "font.h"
 #include "util.h"
-#include <dcp/mono_picture_mxf.h>
-#include <dcp/stereo_picture_mxf.h>
-#include <dcp/sound_mxf.h>
-#include <dcp/sound_mxf_writer.h>
+#include <dcp/mono_picture_asset.h>
+#include <dcp/stereo_picture_asset.h>
+#include <dcp/sound_asset.h>
+#include <dcp/sound_asset_writer.h>
 #include <dcp/reel.h>
 #include <dcp/reel_mono_picture_asset.h>
 #include <dcp/reel_stereo_picture_asset.h>
@@ -46,7 +46,7 @@
 #include <dcp/dcp.h>
 #include <dcp/cpl.h>
 #include <dcp/signer.h>
-#include <dcp/interop_subtitle_content.h>
+#include <dcp/interop_subtitle_asset.h>
 #include <dcp/font.h>
 #include <boost/foreach.hpp>
 #include <fstream>
@@ -100,41 +100,46 @@ Writer::Writer (shared_ptr<const Film> f, weak_ptr<Job> j)
        */
 
        if (_film->three_d ()) {
-               _picture_mxf.reset (new dcp::StereoPictureMXF (dcp::Fraction (_film->video_frame_rate (), 1)));
+               _picture_asset.reset (new dcp::StereoPictureAsset (dcp::Fraction (_film->video_frame_rate (), 1)));
        } else {
-               _picture_mxf.reset (new dcp::MonoPictureMXF (dcp::Fraction (_film->video_frame_rate (), 1)));
+               _picture_asset.reset (new dcp::MonoPictureAsset (dcp::Fraction (_film->video_frame_rate (), 1)));
        }
 
-       _picture_mxf->set_size (_film->frame_size ());
+       _picture_asset->set_size (_film->frame_size ());
 
        if (_film->encrypted ()) {
-               _picture_mxf->set_key (_film->key ());
+               _picture_asset->set_key (_film->key ());
        }
 
-       _picture_mxf->set_file (
-               _film->internal_video_mxf_dir() / _film->internal_video_mxf_filename()
+       _picture_asset->set_file (
+               _film->internal_video_asset_dir() / _film->internal_video_asset_filename()
                );
 
        job->sub (_("Checking existing image data"));
-       check_existing_picture_mxf ();
+       check_existing_picture_asset ();
        
-       _picture_mxf_writer = _picture_mxf->start_write (
-               _film->internal_video_mxf_dir() / _film->internal_video_mxf_filename(),
+       _picture_asset_writer = _picture_asset->start_write (
+               _film->internal_video_asset_dir() / _film->internal_video_asset_filename(),
                _film->interop() ? dcp::INTEROP : dcp::SMPTE,
                _first_nonexistant_frame > 0
                );
 
        if (_film->audio_channels ()) {
-               _sound_mxf.reset (new dcp::SoundMXF (dcp::Fraction (_film->video_frame_rate(), 1), _film->audio_frame_rate (), _film->audio_channels ()));
+               _sound_asset.reset (
+                       new dcp::SoundAsset (dcp::Fraction (_film->video_frame_rate(), 1), _film->audio_frame_rate (), _film->audio_channels ())
+                       );
 
                if (_film->encrypted ()) {
-                       _sound_mxf->set_key (_film->key ());
+                       _sound_asset->set_key (_film->key ());
                }
        
-               /* Write the sound MXF into the film directory so that we leave the creation
+               /* Write the sound asset into the film directory so that we leave the creation
                   of the DCP directory until the last minute.
                */
-               _sound_mxf_writer = _sound_mxf->start_write (_film->directory() / audio_mxf_filename (_sound_mxf), _film->interop() ? dcp::INTEROP : dcp::SMPTE);
+               _sound_asset_writer = _sound_asset->start_write (
+                       _film->directory() / audio_asset_filename (_sound_asset),
+                       _film->interop() ? dcp::INTEROP : dcp::SMPTE
+                       );
        }
 
        /* Check that the signer is OK if we need one */
@@ -224,8 +229,8 @@ Writer::fake_write (int frame, Eyes eyes)
 void
 Writer::write (shared_ptr<const AudioBuffers> audio)
 {
-       if (_sound_mxf_writer) {
-               _sound_mxf_writer->write (audio->data(), audio->frames());
+       if (_sound_asset_writer) {
+               _sound_asset_writer->write (audio->data(), audio->frames());
        }
 }
 
@@ -321,20 +326,20 @@ try
                        switch (qi.type) {
                        case QueueItem::FULL:
                        {
-                               LOG_GENERAL (N_("Writer FULL-writes %1 (%2) to MXF"), qi.frame, qi.eyes);
+                               LOG_GENERAL (N_("Writer FULL-writes %1 (%2)"), qi.frame, qi.eyes);
                                if (!qi.encoded) {
                                        qi.encoded.reset (new EncodedData (_film->j2c_path (qi.frame, qi.eyes, false)));
                                }
 
-                               dcp::FrameInfo fin = _picture_mxf_writer->write (qi.encoded->data(), qi.encoded->size());
+                               dcp::FrameInfo fin = _picture_asset_writer->write (qi.encoded->data(), qi.encoded->size());
                                qi.encoded->write_info (_film, qi.frame, qi.eyes, fin);
                                _last_written[qi.eyes] = qi.encoded;
                                ++_full_written;
                                break;
                        }
                        case QueueItem::FAKE:
-                               LOG_GENERAL (N_("Writer FAKE-writes %1 to MXF"), qi.frame);
-                               _picture_mxf_writer->fake_write (qi.size);
+                               LOG_GENERAL (N_("Writer FAKE-writes %1"), qi.frame);
+                               _picture_asset_writer->fake_write (qi.size);
                                _last_written[qi.eyes].reset ();
                                ++_fake_written;
                                break;
@@ -441,17 +446,17 @@ Writer::finish ()
        
        terminate_thread (true);
 
-       _picture_mxf_writer->finalize ();
-       if (_sound_mxf_writer) {
-               _sound_mxf_writer->finalize ();
+       _picture_asset_writer->finalize ();
+       if (_sound_asset_writer) {
+               _sound_asset_writer->finalize ();
        }
        
-       /* Hard-link the video MXF into the DCP */
-       boost::filesystem::path video_from = _picture_mxf->file ();
+       /* Hard-link the video asset into the DCP */
+       boost::filesystem::path video_from = _picture_asset->file ();
        
        boost::filesystem::path video_to;
        video_to /= _film->dir (_film->dcp_name());
-       video_to /= video_mxf_filename (_picture_mxf);
+       video_to /= video_asset_filename (_picture_asset);
 
        boost::system::error_code ec;
        boost::filesystem::create_hard_link (video_from, video_to, ec);
@@ -464,23 +469,23 @@ Writer::finish ()
                }
        }
 
-       _picture_mxf->set_file (video_to);
+       _picture_asset->set_file (video_to);
 
-       /* Move the audio MXF into the DCP */
+       /* Move the audio asset into the DCP */
 
-       if (_sound_mxf) {
+       if (_sound_asset) {
                boost::filesystem::path audio_to;
                audio_to /= _film->dir (_film->dcp_name ());
-               audio_to /= audio_mxf_filename (_sound_mxf);
+               audio_to /= audio_asset_filename (_sound_asset);
                
-               boost::filesystem::rename (_film->file (audio_mxf_filename (_sound_mxf)), audio_to, ec);
+               boost::filesystem::rename (_film->file (audio_asset_filename (_sound_asset)), audio_to, ec);
                if (ec) {
                        throw FileError (
-                               String::compose (_("could not move audio MXF into the DCP (%1)"), ec.value ()), audio_mxf_filename (_sound_mxf)
+                               String::compose (_("could not move audio asset into the DCP (%1)"), ec.value ()), audio_asset_filename (_sound_asset)
                                );
                }
 
-               _sound_mxf->set_file (audio_to);
+               _sound_asset->set_file (audio_to);
        }
 
        dcp::DCP dcp (_film->dir (_film->dcp_name()));
@@ -496,32 +501,32 @@ Writer::finish ()
 
        shared_ptr<dcp::Reel> reel (new dcp::Reel ());
 
-       shared_ptr<dcp::MonoPictureMXF> mono = dynamic_pointer_cast<dcp::MonoPictureMXF> (_picture_mxf);
+       shared_ptr<dcp::MonoPictureAsset> mono = dynamic_pointer_cast<dcp::MonoPictureAsset> (_picture_asset);
        if (mono) {
                reel->add (shared_ptr<dcp::ReelPictureAsset> (new dcp::ReelMonoPictureAsset (mono, 0)));
                dcp.add (mono);
        }
 
-       shared_ptr<dcp::StereoPictureMXF> stereo = dynamic_pointer_cast<dcp::StereoPictureMXF> (_picture_mxf);
+       shared_ptr<dcp::StereoPictureAsset> stereo = dynamic_pointer_cast<dcp::StereoPictureAsset> (_picture_asset);
        if (stereo) {
                reel->add (shared_ptr<dcp::ReelPictureAsset> (new dcp::ReelStereoPictureAsset (stereo, 0)));
                dcp.add (stereo);
        }
 
-       if (_sound_mxf) {
-               reel->add (shared_ptr<dcp::ReelSoundAsset> (new dcp::ReelSoundAsset (_sound_mxf, 0)));
-               dcp.add (_sound_mxf);
+       if (_sound_asset) {
+               reel->add (shared_ptr<dcp::ReelSoundAsset> (new dcp::ReelSoundAsset (_sound_asset, 0)));
+               dcp.add (_sound_asset);
        }
 
-       if (_subtitle_content) {
+       if (_subtitle_asset) {
                boost::filesystem::path const liberation = shared_path () / "LiberationSans-Regular.ttf";
 
                /* Add all the fonts to the subtitle content and as assets to the DCP */
                BOOST_FOREACH (shared_ptr<Font> i, _fonts) {
                        boost::filesystem::path const from = i->file.get_value_or (liberation);
-                       _subtitle_content->add_font (i->id, from.leaf().string ());
+                       _subtitle_asset->add_font (i->id, from.leaf().string ());
 
-                       boost::filesystem::path to = _film->dir (_film->dcp_name ()) / _subtitle_content->id ();
+                       boost::filesystem::path to = _film->dir (_film->dcp_name ()) / _subtitle_asset->id ();
                        boost::filesystem::create_directories (to, ec);
                        if (ec) {
                                throw FileError (_("Could not create directory"), to);
@@ -538,17 +543,20 @@ Writer::finish ()
                        dcp.add (shared_ptr<dcp::Font> (new dcp::Font (to)));
                }
 
-               _subtitle_content->write_xml (_film->dir (_film->dcp_name ()) / _subtitle_content->id () / subtitle_content_filename (_subtitle_content));
+               _subtitle_asset->write (
+                       _film->dir (_film->dcp_name ()) / _subtitle_asset->id () / subtitle_content_filename (_subtitle_asset)
+                       );
+               
                reel->add (shared_ptr<dcp::ReelSubtitleAsset> (
                                   new dcp::ReelSubtitleAsset (
-                                          _subtitle_content,
+                                          _subtitle_asset,
                                           dcp::Fraction (_film->video_frame_rate(), 1),
-                                          _picture_mxf->intrinsic_duration (),
+                                          _picture_asset->intrinsic_duration (),
                                           0
                                           )
                                   ));
                
-               dcp.add (_subtitle_content);
+               dcp.add (_subtitle_asset);
        }
        
        cpl->add (reel);
@@ -557,11 +565,11 @@ Writer::finish ()
        DCPOMATIC_ASSERT (job);
 
        job->sub (_("Computing image digest"));
-       _picture_mxf->hash (boost::bind (&Job::set_progress, job.get(), _1, false));
+       _picture_asset->hash (boost::bind (&Job::set_progress, job.get(), _1, false));
 
-       if (_sound_mxf) {
+       if (_sound_asset) {
                job->sub (_("Computing audio digest"));
-               _sound_mxf->hash (boost::bind (&Job::set_progress, job.get(), _1, false));
+               _sound_asset->hash (boost::bind (&Job::set_progress, job.get(), _1, false));
        }
 
        dcp::XMLMetadata meta;
@@ -586,7 +594,7 @@ Writer::finish ()
 }
 
 bool
-Writer::check_existing_picture_mxf_frame (FILE* mxf, int f, Eyes eyes)
+Writer::check_existing_picture_asset_frame (FILE* asset, int f, Eyes eyes)
 {
        /* Read the frame info as written */
        FILE* file = fopen_boost (_film->info_file (), "rb");
@@ -602,10 +610,10 @@ Writer::check_existing_picture_mxf_frame (FILE* mxf, int f, Eyes eyes)
                return false;
        }
        
-       /* Read the data from the MXF and hash it */
-       dcpomatic_fseek (mxf, info.offset, SEEK_SET);
+       /* Read the data from the asset and hash it */
+       dcpomatic_fseek (asset, info.offset, SEEK_SET);
        EncodedData data (info.size);
-       size_t const read = fread (data.data(), 1, data.size(), mxf);
+       size_t const read = fread (data.data(), 1, data.size(), asset);
        if (read != static_cast<size_t> (data.size ())) {
                LOG_GENERAL ("Existing frame %1 is incomplete", f);
                return false;
@@ -622,12 +630,12 @@ Writer::check_existing_picture_mxf_frame (FILE* mxf, int f, Eyes eyes)
 }
 
 void
-Writer::check_existing_picture_mxf ()
+Writer::check_existing_picture_asset ()
 {
-       /* Try to open the existing MXF */
-       FILE* mxf = fopen_boost (_picture_mxf->file(), "rb");
-       if (!mxf) {
-               LOG_GENERAL ("Could not open existing MXF at %1 (errno=%2)", _picture_mxf->file().string(), errno);
+       /* Try to open the existing asset */
+       FILE* asset = fopen_boost (_picture_asset->file(), "rb");
+       if (!asset) {
+               LOG_GENERAL ("Could not open existing asset at %1 (errno=%2)", _picture_asset->file().string(), errno);
                return;
        }
 
@@ -639,14 +647,14 @@ Writer::check_existing_picture_mxf ()
                job->set_progress_unknown ();
 
                if (_film->three_d ()) {
-                       if (!check_existing_picture_mxf_frame (mxf, _first_nonexistant_frame, EYES_LEFT)) {
+                       if (!check_existing_picture_asset_frame (asset, _first_nonexistant_frame, EYES_LEFT)) {
                                break;
                        }
-                       if (!check_existing_picture_mxf_frame (mxf, _first_nonexistant_frame, EYES_RIGHT)) {
+                       if (!check_existing_picture_asset_frame (asset, _first_nonexistant_frame, EYES_RIGHT)) {
                                break;
                        }
                } else {
-                       if (!check_existing_picture_mxf_frame (mxf, _first_nonexistant_frame, EYES_BOTH)) {
+                       if (!check_existing_picture_asset_frame (asset, _first_nonexistant_frame, EYES_BOTH)) {
                                break;
                        }
                }
@@ -655,7 +663,7 @@ Writer::check_existing_picture_mxf ()
                ++_first_nonexistant_frame;
        }
 
-       fclose (mxf);
+       fclose (asset);
 }
 
 /** @param frame Frame index.
@@ -665,7 +673,7 @@ bool
 Writer::can_fake_write (int frame) const
 {
        /* We have to do a proper write of the first frame so that we can set up the JPEG2000
-          parameters in the MXF writer.
+          parameters in the asset writer.
        */
        return (frame != 0 && frame < _first_nonexistant_frame);
 }
@@ -677,16 +685,16 @@ Writer::write (PlayerSubtitles subs)
                return;
        }
 
-       if (!_subtitle_content) {
+       if (!_subtitle_asset) {
                string lang = _film->subtitle_language ();
                if (lang.empty ()) {
                        lang = "Unknown";
                }
-               _subtitle_content.reset (new dcp::InteropSubtitleContent (_film->name(), lang));
+               _subtitle_asset.reset (new dcp::InteropSubtitleAsset (_film->name(), lang));
        }
        
        for (list<dcp::SubtitleString>::const_iterator i = subs.text.begin(); i != subs.text.end(); ++i) {
-               _subtitle_content->add (*i);
+               _subtitle_asset->add (*i);
        }
 }
 
index e63591a8a338d50351b8ed4f0f45ad48e794c148..fe803d35e5c4d84fea5084ac98696cdecf43199e 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2015 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
@@ -37,15 +37,15 @@ class Job;
 class Font;
 
 namespace dcp {
-       class MonoPictureMXF;
-       class MonoPictureMXFWriter;
-       class StereoPictureMXF;
-       class StereoPictureMXFWriter;
-       class PictureMXF;
-       class PictureMXFWriter;
-       class SoundMXF;
-       class SoundMXFWriter;
-       class InteropSubtitleContent;
+       class MonoPictureAsset;
+       class MonoPictureAssetWriter;
+       class StereoPictureAsset;
+       class StereoPictureAssetWriter;
+       class PictureAsset;
+       class PictureAssetWriter;
+       class SoundAsset;
+       class SoundAssetWriter;
+       class InteropSubtitleAsset;
 }
 
 struct QueueItem
@@ -74,11 +74,11 @@ bool operator< (QueueItem const & a, QueueItem const & b);
 bool operator== (QueueItem const & a, QueueItem const & b);
 
 /** @class Writer
- *  @brief Class to manage writing JPEG2000 and audio data to MXFs on disk.
+ *  @brief Class to manage writing JPEG2000 and audio data to assets on disk.
  *
- *  This class creates sound and picture MXFs, then takes EncodedData
+ *  This class creates sound and picture assets, then takes EncodedData
  *  or AudioBuffers objects (containing image or sound data respectively)
- *  and writes them to the MXFs.
+ *  and writes them to the assets.
  *
  *  ::write() for EncodedData can be called out of order, and the Writer
  *  will sort it out.  write() for AudioBuffers must be called in order.
@@ -106,8 +106,8 @@ private:
 
        void thread ();
        void terminate_thread (bool);
-       void check_existing_picture_mxf ();
-       bool check_existing_picture_mxf_frame (FILE *, int, Eyes);
+       void check_existing_picture_asset ();
+       bool check_existing_picture_asset_frame (FILE *, int, Eyes);
        bool have_sequenced_image_at_queue_head ();
 
        /** our Film */
@@ -149,11 +149,11 @@ private:
        */
        int _pushed_to_disk;
        
-       boost::shared_ptr<dcp::PictureMXF> _picture_mxf;
-       boost::shared_ptr<dcp::PictureMXFWriter> _picture_mxf_writer;
-       boost::shared_ptr<dcp::SoundMXF> _sound_mxf;
-       boost::shared_ptr<dcp::SoundMXFWriter> _sound_mxf_writer;
-       boost::shared_ptr<dcp::InteropSubtitleContent> _subtitle_content;
+       boost::shared_ptr<dcp::PictureAsset> _picture_asset;
+       boost::shared_ptr<dcp::PictureAssetWriter> _picture_asset_writer;
+       boost::shared_ptr<dcp::SoundAsset> _sound_asset;
+       boost::shared_ptr<dcp::SoundAssetWriter> _sound_asset_writer;
+       boost::shared_ptr<dcp::InteropSubtitleAsset> _subtitle_asset;
 
        std::list<boost::shared_ptr<Font> > _fonts;
 };
index 63f363114894a4ee119aaf271b8fb36453bcee46..05384873f850a46340a2de918fdb8f0cd226310f 100644 (file)
@@ -27,7 +27,7 @@
 #include <dcp/sound_frame.h>
 #include <dcp/cpl.h>
 #include <dcp/reel.h>
-#include <dcp/sound_mxf.h>
+#include <dcp/sound_asset.h>
 #include <dcp/reel_sound_asset.h>
 #include "lib/sndfile_content.h"
 #include "lib/dcp_content_type.h"
@@ -75,11 +75,11 @@ void test_audio_delay (int delay_in_ms)
        /* Delay in frames */
        int const delay_in_frames = delay_in_ms * 48000 / 1000;
 
-       while (n < sound_asset->mxf()->intrinsic_duration()) {
-               shared_ptr<const dcp::SoundFrame> sound_frame = sound_asset->mxf()->get_frame (frame++);
+       while (n < sound_asset->asset()->intrinsic_duration()) {
+               shared_ptr<const dcp::SoundFrame> sound_frame = sound_asset->asset()->get_frame (frame++);
                uint8_t const * d = sound_frame->data ();
                
-               for (int i = 0; i < sound_frame->size(); i += (3 * sound_asset->mxf()->channels())) {
+               for (int i = 0; i < sound_frame->size(); i += (3 * sound_asset->asset()->channels())) {
 
                        /* Mono input so it will appear on centre */
                        int const sample = d[i + 7] | (d[i + 8] << 8);
index 1e2bbb377af7f68a18f0a896bd7ed9d735460192..2c34c437d4151b140c26937f11bff43f18ce071e 100644 (file)
@@ -24,7 +24,7 @@
 #include <boost/test/unit_test.hpp>
 #include <dcp/cpl.h>
 #include <dcp/dcp.h>
-#include <dcp/sound_mxf.h>
+#include <dcp/sound_asset.h>
 #include <dcp/sound_frame.h>
 #include <dcp/reel_sound_asset.h>
 #include <dcp/reel.h>
@@ -66,51 +66,51 @@ BOOST_AUTO_TEST_CASE (ffmpeg_audio_test)
 
        shared_ptr<const dcp::ReelSoundAsset> sound_asset = check.cpls().front()->reels().front()->main_sound ();
        BOOST_CHECK (sound_asset);
-       BOOST_CHECK_EQUAL (sound_asset->mxf()->channels (), 6);
+       BOOST_CHECK_EQUAL (sound_asset->asset()->channels (), 6);
 
        /* Sample index in the DCP */
        int n = 0;
        /* DCP sound asset frame */
        int frame = 0;
 
-       while (n < sound_asset->mxf()->intrinsic_duration()) {
-               shared_ptr<const dcp::SoundFrame> sound_frame = sound_asset->mxf()->get_frame (frame++);
+       while (n < sound_asset->asset()->intrinsic_duration()) {
+               shared_ptr<const dcp::SoundFrame> sound_frame = sound_asset->asset()->get_frame (frame++);
                uint8_t const * d = sound_frame->data ();
                
-               for (int i = 0; i < sound_frame->size(); i += (3 * sound_asset->mxf()->channels())) {
+               for (int i = 0; i < sound_frame->size(); i += (3 * sound_asset->asset()->channels())) {
 
-                       if (sound_asset->mxf()->channels() > 0) {
+                       if (sound_asset->asset()->channels() > 0) {
                                /* L should be silent */
                                int const sample = d[i + 0] | (d[i + 1] << 8);
                                BOOST_CHECK_EQUAL (sample, 0);
                        }
 
-                       if (sound_asset->mxf()->channels() > 1) {
+                       if (sound_asset->asset()->channels() > 1) {
                                /* R should be silent */
                                int const sample = d[i + 2] | (d[i + 3] << 8);
                                BOOST_CHECK_EQUAL (sample, 0);
                        }
                        
-                       if (sound_asset->mxf()->channels() > 2) {
+                       if (sound_asset->asset()->channels() > 2) {
                                /* Mono input so it will appear on centre */
                                int const sample = d[i + 7] | (d[i + 8] << 8);
                                BOOST_CHECK_EQUAL (sample, n);
                        }
 
-                       if (sound_asset->mxf()->channels() > 3) {
+                       if (sound_asset->asset()->channels() > 3) {
                                /* Lfe should be silent */
                                int const sample = d[i + 9] | (d[i + 10] << 8);
                                BOOST_CHECK_EQUAL (sample, 0);
                        }
 
-                       if (sound_asset->mxf()->channels() > 4) {
+                       if (sound_asset->asset()->channels() > 4) {
                                /* Ls should be silent */
                                int const sample = d[i + 11] | (d[i + 12] << 8);
                                BOOST_CHECK_EQUAL (sample, 0);
                        }
 
 
-                       if (sound_asset->mxf()->channels() > 5) {
+                       if (sound_asset->asset()->channels() > 5) {
                                /* Rs should be silent */
                                int const sample = d[i + 13] | (d[i + 14] << 8);
                                BOOST_CHECK_EQUAL (sample, 0);
index d76c2f716b96bebd3d8ace8dc41dc6bebb09418d..317b455205042ed80b58fb5a725ebe4248d46d6d 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2014 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2014-2015 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
@@ -22,7 +22,7 @@
  */
 
 #include <boost/test/unit_test.hpp>
-#include <dcp/stereo_picture_mxf.h>
+#include <dcp/stereo_picture_asset.h>
 #include "lib/film.h"
 #include "lib/dcp_content_type.h"
 #include "lib/image_content.h"
@@ -69,10 +69,9 @@ BOOST_AUTO_TEST_CASE (recover_test)
        film->make_dcp ();
        wait_for_jobs ();
 
-       shared_ptr<dcp::StereoPictureMXF> A (new dcp::StereoPictureMXF ("build/test/recover_test/original.mxf"));
-       shared_ptr<dcp::StereoPictureMXF> B (new dcp::StereoPictureMXF (video));
+       shared_ptr<dcp::StereoPictureAsset> A (new dcp::StereoPictureAsset ("build/test/recover_test/original.mxf"));
+       shared_ptr<dcp::StereoPictureAsset> B (new dcp::StereoPictureAsset (video));
 
        dcp::EqualityOptions eq;
-       eq.mxf_filenames_can_differ = true;
        BOOST_CHECK (A->equals (B, eq, boost::bind (&note, _1, _2)));
 }
index d876a0228d7acafa9cd7ab0bb8319097c127869d..9a797aab574f542bf996e90cf3e59362a3350880 100644 (file)
@@ -24,7 +24,7 @@
 #include <boost/test/unit_test.hpp>
 #include <dcp/cpl.h>
 #include <dcp/dcp.h>
-#include <dcp/sound_mxf.h>
+#include <dcp/sound_asset.h>
 #include <dcp/sound_frame.h>
 #include <dcp/reel.h>
 #include <dcp/reel_sound_asset.h>
@@ -63,51 +63,51 @@ test_silence_padding (int channels)
 
        shared_ptr<const dcp::ReelSoundAsset> sound_asset = check.cpls().front()->reels().front()->main_sound ();
        BOOST_CHECK (sound_asset);
-       BOOST_CHECK_EQUAL (sound_asset->mxf()->channels (), channels);
+       BOOST_CHECK_EQUAL (sound_asset->asset()->channels (), channels);
 
        /* Sample index in the DCP */
        int n = 0;
        /* DCP sound asset frame */
        int frame = 0;
 
-       while (n < sound_asset->mxf()->intrinsic_duration()) {
-               shared_ptr<const dcp::SoundFrame> sound_frame = sound_asset->mxf()->get_frame (frame++);
+       while (n < sound_asset->asset()->intrinsic_duration()) {
+               shared_ptr<const dcp::SoundFrame> sound_frame = sound_asset->asset()->get_frame (frame++);
                uint8_t const * d = sound_frame->data ();
                
-               for (int i = 0; i < sound_frame->size(); i += (3 * sound_asset->mxf()->channels())) {
+               for (int i = 0; i < sound_frame->size(); i += (3 * sound_asset->asset()->channels())) {
 
-                       if (sound_asset->mxf()->channels() > 0) {
+                       if (sound_asset->asset()->channels() > 0) {
                                /* L should be silent */
                                int const sample = d[i + 0] | (d[i + 1] << 8);
                                BOOST_CHECK_EQUAL (sample, 0);
                        }
 
-                       if (sound_asset->mxf()->channels() > 1) {
+                       if (sound_asset->asset()->channels() > 1) {
                                /* R should be silent */
                                int const sample = d[i + 2] | (d[i + 3] << 8);
                                BOOST_CHECK_EQUAL (sample, 0);
                        }
                        
-                       if (sound_asset->mxf()->channels() > 2) {
+                       if (sound_asset->asset()->channels() > 2) {
                                /* Mono input so it will appear on centre */
                                int const sample = d[i + 7] | (d[i + 8] << 8);
                                BOOST_CHECK_EQUAL (sample, n);
                        }
 
-                       if (sound_asset->mxf()->channels() > 3) {
+                       if (sound_asset->asset()->channels() > 3) {
                                /* Lfe should be silent */
                                int const sample = d[i + 9] | (d[i + 10] << 8);
                                BOOST_CHECK_EQUAL (sample, 0);
                        }
 
-                       if (sound_asset->mxf()->channels() > 4) {
+                       if (sound_asset->asset()->channels() > 4) {
                                /* Ls should be silent */
                                int const sample = d[i + 11] | (d[i + 12] << 8);
                                BOOST_CHECK_EQUAL (sample, 0);
                        }
 
 
-                       if (sound_asset->mxf()->channels() > 5) {
+                       if (sound_asset->asset()->channels() > 5) {
                                /* Rs should be silent */
                                int const sample = d[i + 13] | (d[i + 14] << 8);
                                BOOST_CHECK_EQUAL (sample, 0);
index b7ae1dec90aff95afa51da555bd6f360ee2b1db0..5dd591ddcc7ab2ad10d3ec8d47f46ced0c30d89b 100644 (file)
@@ -210,7 +210,6 @@ check_dcp (boost::filesystem::path ref, boost::filesystem::path check)
        options.max_std_dev_pixel_error = 5;
        options.max_audio_sample_error = 255;
        options.cpl_annotation_texts_can_differ = true;
-       options.mxf_filenames_can_differ = true;
        options.reel_annotation_texts_can_differ = true;
        options.reel_hashes_can_differ = true;