Take Film pointer out of Content.
authorCarl Hetherington <cth@carlh.net>
Wed, 21 Nov 2018 01:59:04 +0000 (01:59 +0000)
committerCarl Hetherington <cth@carlh.net>
Wed, 21 Nov 2018 01:59:04 +0000 (01:59 +0000)
127 files changed:
src/lib/analyse_audio_job.cc
src/lib/atmos_mxf_content.cc
src/lib/atmos_mxf_content.h
src/lib/audio_content.cc
src/lib/audio_content.h
src/lib/audio_decoder.cc
src/lib/audio_decoder.h
src/lib/content.cc
src/lib/content.h
src/lib/content_factory.cc
src/lib/content_factory.h
src/lib/dcp.cc
src/lib/dcp_content.cc
src/lib/dcp_content.h
src/lib/dcp_decoder.cc
src/lib/dcp_decoder.h
src/lib/dcp_subtitle_content.cc
src/lib/dcp_subtitle_content.h
src/lib/dcp_subtitle_decoder.cc
src/lib/dcp_subtitle_decoder.h
src/lib/decoder.cc
src/lib/decoder.h
src/lib/decoder_factory.cc
src/lib/decoder_factory.h
src/lib/decoder_part.cc
src/lib/decoder_part.h
src/lib/empty.cc
src/lib/empty.h
src/lib/examine_content_job.cc
src/lib/ffmpeg.cc
src/lib/ffmpeg_content.cc
src/lib/ffmpeg_content.h
src/lib/ffmpeg_decoder.cc
src/lib/ffmpeg_decoder.h
src/lib/film.cc
src/lib/image_content.cc
src/lib/image_content.h
src/lib/image_decoder.cc
src/lib/image_decoder.h
src/lib/log.cc
src/lib/log.h
src/lib/overlaps.cc
src/lib/overlaps.h
src/lib/player.cc
src/lib/player_video.cc
src/lib/player_video.h
src/lib/playlist.cc
src/lib/playlist.h
src/lib/string_text_file_content.cc
src/lib/string_text_file_content.h
src/lib/string_text_file_decoder.cc
src/lib/string_text_file_decoder.h
src/lib/text_decoder.cc
src/lib/text_decoder.h
src/lib/video_content.cc
src/lib/video_content.h
src/lib/video_decoder.cc
src/lib/video_decoder.h
src/lib/video_mxf_content.cc
src/lib/video_mxf_content.h
src/lib/video_mxf_decoder.cc
src/lib/video_mxf_decoder.h
src/tools/dcpomatic_player.cc
src/wx/audio_dialog.cc
src/wx/audio_panel.cc
src/wx/content_menu.cc
src/wx/content_panel.cc
src/wx/controls.cc
src/wx/film_viewer.cc
src/wx/player_information.cc
src/wx/subtitle_appearance_dialog.cc
src/wx/subtitle_appearance_dialog.h
src/wx/text_panel.cc
src/wx/text_view.cc
src/wx/timeline.cc
src/wx/timeline_content_view.cc
src/wx/timing_panel.cc
src/wx/video_panel.cc
test/4k_test.cc
test/audio_analysis_test.cc
test/audio_delay_test.cc
test/audio_processor_test.cc
test/butler_test.cc
test/closed_caption_test.cc
test/content_test.cc
test/dcp_playback_test.cc
test/dcp_subtitle_test.cc
test/digest_test.cc
test/empty_test.cc
test/ffmpeg_audio_only_test.cc
test/ffmpeg_audio_test.cc
test/ffmpeg_dcp_test.cc
test/ffmpeg_decoder_seek_test.cc
test/ffmpeg_decoder_sequential_test.cc
test/ffmpeg_encoder_test.cc
test/ffmpeg_examiner_test.cc
test/ffmpeg_pts_offset_test.cc
test/file_naming_test.cc
test/frame_rate_test.cc
test/import_dcp_test.cc
test/interrupt_encoder_test.cc
test/isdcf_name_test.cc
test/j2k_bandwidth_test.cc
test/optimise_stills_test.cc
test/player_test.cc
test/recover_test.cc
test/reels_test.cc
test/remake_id_test.cc
test/remake_with_subtitle_test.cc
test/repeat_frame_test.cc
test/required_disk_space_test.cc
test/scaling_test.cc
test/silence_padding_test.cc
test/skip_frame_test.cc
test/srt_subtitle_test.cc
test/ssa_subtitle_test.cc
test/subtitle_charset_test.cc
test/subtitle_reel_number_test.cc
test/subtitle_trim_test.cc
test/threed_test.cc
test/time_calculation_test.cc
test/torture_test.cc
test/upmixer_a_test.cc
test/vf_kdm_test.cc
test/vf_test.cc
test/video_content_scale_test.cc
test/video_mxf_content_test.cc

index 5994bc71a7ec7338bed1e9457de2a4b04c9f53f2..8c9a90283f17ee1f7f3117d0887ea3c880dfac58 100644 (file)
@@ -111,7 +111,7 @@ AnalyseAudioJob::run ()
        player->set_play_referenced ();
        player->Audio.connect (bind (&AnalyseAudioJob::analyse, this, _1, _2));
 
        player->set_play_referenced ();
        player->Audio.connect (bind (&AnalyseAudioJob::analyse, this, _1, _2));
 
-       DCPTime const length = _playlist->length ();
+       DCPTime const length = _playlist->length (_film);
 
        Frame const len = DCPTime (length - _start).frames_round (_film->audio_frame_rate());
        _samples_per_point = max (int64_t (1), len / _num_points);
 
        Frame const len = DCPTime (length - _start).frames_round (_film->audio_frame_rate());
        _samples_per_point = max (int64_t (1), len / _num_points);
@@ -214,6 +214,6 @@ AnalyseAudioJob::analyse (shared_ptr<const AudioBuffers> b, DCPTime time)
 
        _done += frames;
 
 
        _done += frames;
 
-       DCPTime const length = _playlist->length ();
+       DCPTime const length = _playlist->length (_film);
        set_progress ((time.seconds() - _start.seconds()) / (length.seconds() - _start.seconds()));
 }
        set_progress ((time.seconds() - _start.seconds()) / (length.seconds() - _start.seconds()));
 }
index a42b1095429fd35a467685185fce2f8f50be5905..8300c2cd6e4e9026fefe9efa731e56682aeb0d87 100644 (file)
@@ -33,14 +33,14 @@ using std::list;
 using std::string;
 using boost::shared_ptr;
 
 using std::string;
 using boost::shared_ptr;
 
-AtmosMXFContent::AtmosMXFContent (shared_ptr<const Film> film, boost::filesystem::path path)
-       : Content (film, path)
+AtmosMXFContent::AtmosMXFContent (boost::filesystem::path path)
+       : Content (path)
 {
 
 }
 
 {
 
 }
 
-AtmosMXFContent::AtmosMXFContent (shared_ptr<const Film> film, cxml::ConstNodePtr node, int)
-       : Content (film, node)
+AtmosMXFContent::AtmosMXFContent (cxml::ConstNodePtr node, int)
+       : Content (node)
 {
 
 }
 {
 
 }
@@ -65,10 +65,10 @@ AtmosMXFContent::valid_mxf (boost::filesystem::path path)
 }
 
 void
 }
 
 void
-AtmosMXFContent::examine (shared_ptr<Job> job)
+AtmosMXFContent::examine (shared_ptr<const Film> film, shared_ptr<Job> job)
 {
        job->set_progress_unknown ();
 {
        job->set_progress_unknown ();
-       Content::examine (job);
+       Content::examine (film, job);
        shared_ptr<dcp::AtmosAsset> a (new dcp::AtmosAsset (path(0)));
 
        {
        shared_ptr<dcp::AtmosAsset> a (new dcp::AtmosAsset (path(0)));
 
        {
@@ -91,8 +91,8 @@ AtmosMXFContent::as_xml (xmlpp::Node* node, bool with_paths) const
 }
 
 DCPTime
 }
 
 DCPTime
-AtmosMXFContent::full_length () const
+AtmosMXFContent::full_length (shared_ptr<const Film> film) const
 {
 {
-       FrameRateChange const frc (active_video_frame_rate(), film()->video_frame_rate());
-       return DCPTime::from_frames (llrint (_length * frc.factor()), film()->video_frame_rate());
+       FrameRateChange const frc (active_video_frame_rate(film), film->video_frame_rate());
+       return DCPTime::from_frames (llrint (_length * frc.factor()), film->video_frame_rate());
 }
 }
index 0f5225c2ec7fa8ad871862b05d10399177a48a43..156ebc7888c708d94517207f1c02cc02c4ae87dd 100644 (file)
 class AtmosMXFContent : public Content
 {
 public:
 class AtmosMXFContent : public Content
 {
 public:
-       AtmosMXFContent (boost::shared_ptr<const Film> film, boost::filesystem::path path);
-       AtmosMXFContent (boost::shared_ptr<const Film> film, cxml::ConstNodePtr node, int version);
+       AtmosMXFContent (boost::filesystem::path path);
+       AtmosMXFContent (cxml::ConstNodePtr node, int version);
 
        boost::shared_ptr<AtmosMXFContent> shared_from_this () {
                return boost::dynamic_pointer_cast<AtmosMXFContent> (Content::shared_from_this ());
        }
 
 
        boost::shared_ptr<AtmosMXFContent> shared_from_this () {
                return boost::dynamic_pointer_cast<AtmosMXFContent> (Content::shared_from_this ());
        }
 
-       void examine (boost::shared_ptr<Job> job);
+       void examine (boost::shared_ptr<const Film> film, boost::shared_ptr<Job> job);
        std::string summary () const;
        void as_xml (xmlpp::Node* node, bool with_path) const;
        std::string summary () const;
        void as_xml (xmlpp::Node* node, bool with_path) const;
-       DCPTime full_length () const;
+       DCPTime full_length (boost::shared_ptr<const Film> film) const;
 
        static bool valid_mxf (boost::filesystem::path path);
 
 
        static bool valid_mxf (boost::filesystem::path path);
 
index 59ba992ad2058a7117bc0f29ed128a755fb1b2ce..f3372011933c724985e2b172d8e37124ad908d91 100644 (file)
@@ -194,12 +194,12 @@ AudioContent::mapping () const
  *  that it is in sync with the active video content at its start time.
  */
 int
  *  that it is in sync with the active video content at its start time.
  */
 int
-AudioContent::resampled_frame_rate () const
+AudioContent::resampled_frame_rate (shared_ptr<const Film> film) const
 {
        /* Resample to a DCI-approved sample rate */
        double t = has_rate_above_48k() ? 96000 : 48000;
 
 {
        /* Resample to a DCI-approved sample rate */
        double t = has_rate_above_48k() ? 96000 : 48000;
 
-       FrameRateChange frc (_parent->active_video_frame_rate(), _parent->film()->video_frame_rate());
+       FrameRateChange frc (_parent->active_video_frame_rate(film), film->video_frame_rate());
 
        /* Compensate if the DCP is being run at a different frame rate
           to the source; that is, if the video is run such that it will
 
        /* Compensate if the DCP is being run at a different frame rate
           to the source; that is, if the video is run such that it will
@@ -214,7 +214,7 @@ AudioContent::resampled_frame_rate () const
 }
 
 string
 }
 
 string
-AudioContent::processing_description () const
+AudioContent::processing_description (shared_ptr<const Film> film) const
 {
        if (streams().empty ()) {
                return "";
 {
        if (streams().empty ()) {
                return "";
@@ -233,7 +233,7 @@ AudioContent::processing_description () const
 
        optional<int> common_frame_rate;
        BOOST_FOREACH (AudioStreamPtr i, streams()) {
 
        optional<int> common_frame_rate;
        BOOST_FOREACH (AudioStreamPtr i, streams()) {
-               if (i->frame_rate() != resampled_frame_rate()) {
+               if (i->frame_rate() != resampled_frame_rate(film)) {
                        resampled = true;
                } else {
                        not_resampled = true;
                        resampled = true;
                } else {
                        not_resampled = true;
@@ -250,14 +250,14 @@ AudioContent::processing_description () const
        }
 
        if (not_resampled && resampled) {
        }
 
        if (not_resampled && resampled) {
-               return String::compose (_("Some audio will be resampled to %1Hz"), resampled_frame_rate ());
+               return String::compose (_("Some audio will be resampled to %1Hz"), resampled_frame_rate(film));
        }
 
        if (!not_resampled && resampled) {
                if (same) {
        }
 
        if (!not_resampled && resampled) {
                if (same) {
-                       return String::compose (_("Audio will be resampled from %1Hz to %2Hz"), common_frame_rate.get(), resampled_frame_rate ());
+                       return String::compose (_("Audio will be resampled from %1Hz to %2Hz"), common_frame_rate.get(), resampled_frame_rate(film));
                } else {
                } else {
-                       return String::compose (_("Audio will be resampled to %1Hz"), resampled_frame_rate ());
+                       return String::compose (_("Audio will be resampled to %1Hz"), resampled_frame_rate(film));
                }
        }
 
                }
        }
 
@@ -295,7 +295,7 @@ AudioContent::channel_names () const
 }
 
 void
 }
 
 void
-AudioContent::add_properties (list<UserProperty>& p) const
+AudioContent::add_properties (shared_ptr<const Film> film, list<UserProperty>& p) const
 {
        shared_ptr<const AudioStream> stream;
        if (streams().size() == 1) {
 {
        shared_ptr<const AudioStream> stream;
        if (streams().size() == 1) {
@@ -307,8 +307,8 @@ AudioContent::add_properties (list<UserProperty>& p) const
                p.push_back (UserProperty (UserProperty::AUDIO, _("Content audio sample rate"), stream->frame_rate(), _("Hz")));
        }
 
                p.push_back (UserProperty (UserProperty::AUDIO, _("Content audio sample rate"), stream->frame_rate(), _("Hz")));
        }
 
-       FrameRateChange const frc (_parent->active_video_frame_rate(), _parent->film()->video_frame_rate());
-       ContentTime const c (_parent->full_length(), frc);
+       FrameRateChange const frc (_parent->active_video_frame_rate(film), film->video_frame_rate());
+       ContentTime const c (_parent->full_length(film), frc);
 
        p.push_back (
                UserProperty (UserProperty::LENGTH, _("Full length in video frames at content rate"), c.frames_round(frc.source))
 
        p.push_back (
                UserProperty (UserProperty::LENGTH, _("Full length in video frames at content rate"), c.frames_round(frc.source))
@@ -324,7 +324,7 @@ AudioContent::add_properties (list<UserProperty>& p) const
                        );
        }
 
                        );
        }
 
-       p.push_back (UserProperty (UserProperty::AUDIO, _("DCP sample rate"), resampled_frame_rate (), _("Hz")));
+       p.push_back (UserProperty (UserProperty::AUDIO, _("DCP sample rate"), resampled_frame_rate(film), _("Hz")));
        p.push_back (UserProperty (UserProperty::LENGTH, _("Full length in video frames at DCP rate"), c.frames_round (frc.dcp)));
 
        if (stream) {
        p.push_back (UserProperty (UserProperty::LENGTH, _("Full length in video frames at DCP rate"), c.frames_round (frc.dcp)));
 
        if (stream) {
@@ -332,7 +332,7 @@ AudioContent::add_properties (list<UserProperty>& p) const
                        UserProperty (
                                UserProperty::LENGTH,
                                _("Full length in audio samples at DCP rate"),
                        UserProperty (
                                UserProperty::LENGTH,
                                _("Full length in audio samples at DCP rate"),
-                               c.frames_round (resampled_frame_rate ())
+                               c.frames_round(resampled_frame_rate(film))
                                )
                        );
        }
                                )
                        );
        }
@@ -397,9 +397,9 @@ AudioContent::take_settings_from (shared_ptr<const AudioContent> c)
 }
 
 void
 }
 
 void
-AudioContent::modify_position (DCPTime& pos) const
+AudioContent::modify_position (shared_ptr<const Film> film, DCPTime& pos) const
 {
 {
-       pos = pos.round (_parent->film()->audio_frame_rate());
+       pos = pos.round (film->audio_frame_rate());
 }
 
 void
 }
 
 void
index eec67b2010a29fd723e8a9c1fb0848e040e28008..051fc8db8941f137fdd54d90f457dd709204aa42 100644 (file)
@@ -52,7 +52,7 @@ public:
 
        AudioMapping mapping () const;
        void set_mapping (AudioMapping);
 
        AudioMapping mapping () const;
        void set_mapping (AudioMapping);
-       int resampled_frame_rate () const;
+       int resampled_frame_rate (boost::shared_ptr<const Film> film) const;
        bool has_rate_above_48k () const;
        std::vector<std::string> channel_names () const;
 
        bool has_rate_above_48k () const;
        std::vector<std::string> channel_names () const;
 
@@ -69,7 +69,7 @@ public:
                return _delay;
        }
 
                return _delay;
        }
 
-       std::string processing_description () const;
+       std::string processing_description (boost::shared_ptr<const Film> film) const;
 
        std::vector<AudioStreamPtr> streams () const {
                boost::mutex::scoped_lock lm (_mutex);
 
        std::vector<AudioStreamPtr> streams () const {
                boost::mutex::scoped_lock lm (_mutex);
@@ -81,9 +81,9 @@ public:
        void set_streams (std::vector<AudioStreamPtr> streams);
        AudioStreamPtr stream () const;
 
        void set_streams (std::vector<AudioStreamPtr> streams);
        AudioStreamPtr stream () const;
 
-       void add_properties (std::list<UserProperty> &) const;
+       void add_properties (boost::shared_ptr<const Film> film, std::list<UserProperty> &) const;
 
 
-       void modify_position (DCPTime& pos) const;
+       void modify_position (boost::shared_ptr<const Film> film, DCPTime& pos) const;
        void modify_trim_start (ContentTime& pos) const;
 
        static boost::shared_ptr<AudioContent> from_xml (Content* parent, cxml::ConstNodePtr, int version);
        void modify_trim_start (ContentTime& pos) const;
 
        static boost::shared_ptr<AudioContent> from_xml (Content* parent, cxml::ConstNodePtr, int version);
index b4aa2bacda401b35d7ca3c5420b210545a9f5450..95b3a130db0287819cfe623656adbc7eb08a8a8c 100644 (file)
@@ -29,7 +29,7 @@
 
 #include "i18n.h"
 
 
 #include "i18n.h"
 
-#define LOG_GENERAL(...) _log->log (String::compose (__VA_ARGS__), LogEntry::TYPE_GENERAL);
+#define LOG_GENERAL(...) dcpomatic_log->log (String::compose(__VA_ARGS__), LogEntry::TYPE_GENERAL);
 
 using std::cout;
 using std::map;
 
 using std::cout;
 using std::map;
@@ -37,8 +37,8 @@ using std::pair;
 using boost::shared_ptr;
 using boost::optional;
 
 using boost::shared_ptr;
 using boost::optional;
 
-AudioDecoder::AudioDecoder (Decoder* parent, shared_ptr<const AudioContent> content, shared_ptr<Log> log, bool fast)
-       : DecoderPart (parent, log)
+AudioDecoder::AudioDecoder (Decoder* parent, shared_ptr<const AudioContent> content, bool fast)
+       : DecoderPart (parent)
        , _content (content)
        , _fast (fast)
 {
        , _content (content)
        , _fast (fast)
 {
@@ -49,7 +49,7 @@ AudioDecoder::AudioDecoder (Decoder* parent, shared_ptr<const AudioContent> cont
 }
 
 void
 }
 
 void
-AudioDecoder::emit (AudioStreamPtr stream, shared_ptr<const AudioBuffers> data, ContentTime time)
+AudioDecoder::emit (shared_ptr<const Film> film, AudioStreamPtr stream, shared_ptr<const AudioBuffers> data, ContentTime time)
 {
        if (ignore ()) {
                return;
 {
        if (ignore ()) {
                return;
@@ -66,7 +66,7 @@ AudioDecoder::emit (AudioStreamPtr stream, shared_ptr<const AudioBuffers> data,
                        silence (_content->delay ());
                }
                time += ContentTime::from_seconds (_content->delay() / 1000.0);
                        silence (_content->delay ());
                }
                time += ContentTime::from_seconds (_content->delay() / 1000.0);
-               _positions[stream] = time.frames_round (_content->resampled_frame_rate ());
+               _positions[stream] = time.frames_round (_content->resampled_frame_rate(film));
        }
 
        shared_ptr<Resampler> resampler;
        }
 
        shared_ptr<Resampler> resampler;
@@ -74,15 +74,15 @@ AudioDecoder::emit (AudioStreamPtr stream, shared_ptr<const AudioBuffers> data,
        if (i != _resamplers.end ()) {
                resampler = i->second;
        } else {
        if (i != _resamplers.end ()) {
                resampler = i->second;
        } else {
-               if (stream->frame_rate() != _content->resampled_frame_rate()) {
+               if (stream->frame_rate() != _content->resampled_frame_rate(film)) {
                        LOG_GENERAL (
                                "Creating new resampler from %1 to %2 with %3 channels",
                                stream->frame_rate(),
                        LOG_GENERAL (
                                "Creating new resampler from %1 to %2 with %3 channels",
                                stream->frame_rate(),
-                               _content->resampled_frame_rate(),
+                               _content->resampled_frame_rate(film),
                                stream->channels()
                                );
 
                                stream->channels()
                                );
 
-                       resampler.reset (new Resampler (stream->frame_rate(), _content->resampled_frame_rate(), stream->channels()));
+                       resampler.reset (new Resampler (stream->frame_rate(), _content->resampled_frame_rate(film), stream->channels()));
                        if (_fast) {
                                resampler->set_fast ();
                        }
                        if (_fast) {
                                resampler->set_fast ();
                        }
@@ -104,19 +104,19 @@ AudioDecoder::emit (AudioStreamPtr stream, shared_ptr<const AudioBuffers> data,
 
 /** @return Time just after the last thing that was emitted from a given stream */
 ContentTime
 
 /** @return Time just after the last thing that was emitted from a given stream */
 ContentTime
-AudioDecoder::stream_position (AudioStreamPtr stream) const
+AudioDecoder::stream_position (shared_ptr<const Film> film, AudioStreamPtr stream) const
 {
        PositionMap::const_iterator i = _positions.find (stream);
        DCPOMATIC_ASSERT (i != _positions.end ());
 {
        PositionMap::const_iterator i = _positions.find (stream);
        DCPOMATIC_ASSERT (i != _positions.end ());
-       return ContentTime::from_frames (i->second, _content->resampled_frame_rate());
+       return ContentTime::from_frames (i->second, _content->resampled_frame_rate(film));
 }
 
 ContentTime
 }
 
 ContentTime
-AudioDecoder::position () const
+AudioDecoder::position (shared_ptr<const Film> film) const
 {
        optional<ContentTime> p;
        for (PositionMap::const_iterator i = _positions.begin(); i != _positions.end(); ++i) {
 {
        optional<ContentTime> p;
        for (PositionMap::const_iterator i = _positions.begin(); i != _positions.end(); ++i) {
-               ContentTime const ct = stream_position (i->first);
+               ContentTime const ct = stream_position (film, i->first);
                if (!p || ct < *p) {
                        p = ct;
                }
                if (!p || ct < *p) {
                        p = ct;
                }
index 8765be42674c3fd8a41323c5bf865dfdab2d7071..50e361e8f19f80cb181bc8a55d3e80f1aa73da8c 100644 (file)
@@ -36,6 +36,7 @@ class AudioBuffers;
 class AudioContent;
 class AudioDecoderStream;
 class Log;
 class AudioContent;
 class AudioDecoderStream;
 class Log;
+class Film;
 class Resampler;
 
 /** @class AudioDecoder.
 class Resampler;
 
 /** @class AudioDecoder.
@@ -44,14 +45,14 @@ class Resampler;
 class AudioDecoder : public boost::enable_shared_from_this<AudioDecoder>, public DecoderPart
 {
 public:
 class AudioDecoder : public boost::enable_shared_from_this<AudioDecoder>, public DecoderPart
 {
 public:
-       AudioDecoder (Decoder* parent, boost::shared_ptr<const AudioContent> content, boost::shared_ptr<Log> log, bool fast);
+       AudioDecoder (Decoder* parent, boost::shared_ptr<const AudioContent> content, bool fast);
 
 
-       ContentTime position () const;
-       void emit (AudioStreamPtr stream, boost::shared_ptr<const AudioBuffers>, ContentTime);
+       ContentTime position (boost::shared_ptr<const Film> film) const;
+       void emit (boost::shared_ptr<const Film> film, AudioStreamPtr stream, boost::shared_ptr<const AudioBuffers>, ContentTime);
        void seek ();
        void flush ();
 
        void seek ();
        void flush ();
 
-       ContentTime stream_position (AudioStreamPtr stream) const;
+       ContentTime stream_position (boost::shared_ptr<const Film> film, AudioStreamPtr stream) const;
 
        /** @return Number of frames of data that were accepted */
        boost::signals2::signal<void (AudioStreamPtr, ContentAudio)> Data;
 
        /** @return Number of frames of data that were accepted */
        boost::signals2::signal<void (AudioStreamPtr, ContentAudio)> Data;
index 6f5d23fd5ab04be2007c9b9e3b298d4b9c809f5f..5139eb4cc57557a828dc14f58da879baa573cec4 100644 (file)
@@ -60,9 +60,8 @@ int const ContentProperty::TRIM_START = 403;
 int const ContentProperty::TRIM_END = 404;
 int const ContentProperty::VIDEO_FRAME_RATE = 405;
 
 int const ContentProperty::TRIM_END = 404;
 int const ContentProperty::VIDEO_FRAME_RATE = 405;
 
-Content::Content (shared_ptr<const Film> film)
-       : _film (film)
-       , _position (0)
+Content::Content ()
+       : _position (0)
        , _trim_start (0)
        , _trim_end (0)
        , _change_signals_frequent (false)
        , _trim_start (0)
        , _trim_end (0)
        , _change_signals_frequent (false)
@@ -70,9 +69,8 @@ Content::Content (shared_ptr<const Film> film)
 
 }
 
 
 }
 
-Content::Content (shared_ptr<const Film> film, DCPTime p)
-       : _film (film)
-       , _position (p)
+Content::Content (DCPTime p)
+       : _position (p)
        , _trim_start (0)
        , _trim_end (0)
        , _change_signals_frequent (false)
        , _trim_start (0)
        , _trim_end (0)
        , _change_signals_frequent (false)
@@ -80,9 +78,8 @@ Content::Content (shared_ptr<const Film> film, DCPTime p)
 
 }
 
 
 }
 
-Content::Content (shared_ptr<const Film> film, boost::filesystem::path p)
-       : _film (film)
-       , _position (0)
+Content::Content (boost::filesystem::path p)
+       : _position (0)
        , _trim_start (0)
        , _trim_end (0)
        , _change_signals_frequent (false)
        , _trim_start (0)
        , _trim_end (0)
        , _change_signals_frequent (false)
@@ -90,9 +87,8 @@ Content::Content (shared_ptr<const Film> film, boost::filesystem::path p)
        add_path (p);
 }
 
        add_path (p);
 }
 
-Content::Content (shared_ptr<const Film> film, cxml::ConstNodePtr node)
-       : _film (film)
-       , _change_signals_frequent (false)
+Content::Content (cxml::ConstNodePtr node)
+       : _change_signals_frequent (false)
 {
        list<cxml::NodePtr> path_children = node->node_children ("Path");
        BOOST_FOREACH (cxml::NodePtr i, path_children) {
 {
        list<cxml::NodePtr> path_children = node->node_children ("Path");
        BOOST_FOREACH (cxml::NodePtr i, path_children) {
@@ -113,9 +109,8 @@ Content::Content (shared_ptr<const Film> film, cxml::ConstNodePtr node)
        _video_frame_rate = node->optional_number_child<double> ("VideoFrameRate");
 }
 
        _video_frame_rate = node->optional_number_child<double> ("VideoFrameRate");
 }
 
-Content::Content (shared_ptr<const Film> film, vector<shared_ptr<Content> > c)
-       : _film (film)
-       , _position (c.front()->position ())
+Content::Content (vector<shared_ptr<Content> > c)
+       : _position (c.front()->position ())
        , _trim_start (c.front()->trim_start ())
        , _trim_end (c.back()->trim_end ())
        , _video_frame_rate (c.front()->video_frame_rate())
        , _trim_start (c.front()->trim_start ())
        , _trim_end (c.back()->trim_end ())
        , _video_frame_rate (c.front()->video_frame_rate())
@@ -184,7 +179,7 @@ Content::calculate_digest () const
 }
 
 void
 }
 
 void
-Content::examine (shared_ptr<Job> job)
+Content::examine (shared_ptr<const Film>, shared_ptr<Job> job)
 {
        if (job) {
                job->sub (_("Computing digest"));
 {
        if (job) {
                job->sub (_("Computing digest"));
@@ -216,16 +211,16 @@ Content::signal_change (ChangeType c, int p)
 }
 
 void
 }
 
 void
-Content::set_position (DCPTime p)
+Content::set_position (shared_ptr<const Film> film, DCPTime p)
 {
        /* video and audio content can modify its position */
 
        if (video) {
 {
        /* video and audio content can modify its position */
 
        if (video) {
-               video->modify_position (p);
+               video->modify_position (film, p);
        }
 
        if (audio) {
        }
 
        if (audio) {
-               audio->modify_position (p);
+               audio->modify_position (film, p);
        }
 
        ChangeSignaller<Content> cc (this, ContentProperty::POSITION);
        }
 
        ChangeSignaller<Content> cc (this, ContentProperty::POSITION);
@@ -275,13 +270,8 @@ Content::set_trim_end (ContentTime t)
 
 
 shared_ptr<Content>
 
 
 shared_ptr<Content>
-Content::clone () const
+Content::clone (shared_ptr<const Film> film) const
 {
 {
-       shared_ptr<const Film> film = _film.lock ();
-       if (!film) {
-               return shared_ptr<Content> ();
-       }
-
        /* This is a bit naughty, but I can't think of a compelling reason not to do it ... */
        xmlpp::Document doc;
        xmlpp::Node* node = doc.create_root_node ("Content");
        /* This is a bit naughty, but I can't think of a compelling reason not to do it ... */
        xmlpp::Document doc;
        xmlpp::Node* node = doc.create_root_node ("Content");
@@ -289,7 +279,7 @@ Content::clone () const
 
        /* notes is unused here (we assume) */
        list<string> notes;
 
        /* notes is unused here (we assume) */
        list<string> notes;
-       return content_factory (film, cxml::NodePtr (new cxml::Node (node)), Film::current_state_version, notes);
+       return content_factory (film, cxml::NodePtr(new cxml::Node(node)), Film::current_state_version, notes);
 }
 
 string
 }
 
 string
@@ -303,9 +293,9 @@ Content::technical_summary () const
 }
 
 DCPTime
 }
 
 DCPTime
-Content::length_after_trim () const
+Content::length_after_trim (shared_ptr<const Film> film) const
 {
 {
-       return max (DCPTime (), full_length() - DCPTime (trim_start() + trim_end(), film()->active_frame_rate_change (position ())));
+       return max (DCPTime(), full_length(film) - DCPTime(trim_start() + trim_end(), film->active_frame_rate_change(position())));
 }
 
 /** @return string which changes when something about this content changes which affects
 }
 
 /** @return string which changes when something about this content changes which affects
@@ -373,14 +363,6 @@ Content::user_properties () const
        return p;
 }
 
        return p;
 }
 
-shared_ptr<const Film>
-Content::film () const
-{
-       shared_ptr<const Film> film = _film.lock ();
-       DCPOMATIC_ASSERT (film);
-       return film;
-}
-
 /** @return DCP times of points within this content where a reel split could occur */
 list<DCPTime>
 Content::reel_split_points () const
 /** @return DCP times of points within this content where a reel split could occur */
 list<DCPTime>
 Content::reel_split_points () const
@@ -424,7 +406,7 @@ Content::unset_video_frame_rate ()
 }
 
 double
 }
 
 double
-Content::active_video_frame_rate () const
+Content::active_video_frame_rate (shared_ptr<const Film> film) const
 {
        {
                boost::mutex::scoped_lock lm (_mutex);
 {
        {
                boost::mutex::scoped_lock lm (_mutex);
@@ -437,8 +419,6 @@ Content::active_video_frame_rate () const
           prepared for any concurrent video content or perhaps
           just the DCP rate.
        */
           prepared for any concurrent video content or perhaps
           just the DCP rate.
        */
-       shared_ptr<const Film> film = _film.lock ();
-       DCPOMATIC_ASSERT (film);
        return film->active_frame_rate_change(position()).source;
 }
 
        return film->active_frame_rate_change(position()).source;
 }
 
index 2eaa738d2c72e3e88a9388cd7bfa28f2eb88d5b6..c6fa2c9f4ea315dc47e18a3b5b7653f463d021c7 100644 (file)
@@ -64,18 +64,18 @@ public:
 class Content : public boost::enable_shared_from_this<Content>, public Signaller, public boost::noncopyable
 {
 public:
 class Content : public boost::enable_shared_from_this<Content>, public Signaller, public boost::noncopyable
 {
 public:
-       explicit Content (boost::shared_ptr<const Film>);
-       Content (boost::shared_ptr<const Film>, DCPTime);
-       Content (boost::shared_ptr<const Film>, boost::filesystem::path);
-       Content (boost::shared_ptr<const Film>, cxml::ConstNodePtr);
-       Content (boost::shared_ptr<const Film>, std::vector<boost::shared_ptr<Content> >);
+       explicit Content ();
+       Content (DCPTime);
+       Content (boost::filesystem::path);
+       Content (cxml::ConstNodePtr);
+       Content (std::vector<boost::shared_ptr<Content> >);
        virtual ~Content () {}
 
        /** Examine the content to establish digest, frame rates and any other
         *  useful metadata.
         *  @param job Job to use to report progress, or 0.
         */
        virtual ~Content () {}
 
        /** Examine the content to establish digest, frame rates and any other
         *  useful metadata.
         *  @param job Job to use to report progress, or 0.
         */
-       virtual void examine (boost::shared_ptr<Job> job);
+       virtual void examine (boost::shared_ptr<const Film> film, boost::shared_ptr<Job> job);
 
        virtual void take_settings_from (boost::shared_ptr<const Content> c);
 
 
        virtual void take_settings_from (boost::shared_ptr<const Content> c);
 
@@ -90,14 +90,14 @@ public:
        virtual std::string technical_summary () const;
 
        virtual void as_xml (xmlpp::Node *, bool with_paths) const;
        virtual std::string technical_summary () const;
 
        virtual void as_xml (xmlpp::Node *, bool with_paths) const;
-       virtual DCPTime full_length () const = 0;
+       virtual DCPTime full_length (boost::shared_ptr<const Film>) const = 0;
        virtual std::string identifier () const;
        /** @return points at which to split this content when
         *  REELTYPE_BY_VIDEO_CONTENT is in use.
         */
        virtual std::list<DCPTime> reel_split_points () const;
 
        virtual std::string identifier () const;
        /** @return points at which to split this content when
         *  REELTYPE_BY_VIDEO_CONTENT is in use.
         */
        virtual std::list<DCPTime> reel_split_points () const;
 
-       boost::shared_ptr<Content> clone () const;
+       boost::shared_ptr<Content> clone (boost::shared_ptr<const Film> film) const;
 
        void set_paths (std::vector<boost::filesystem::path> paths);
 
 
        void set_paths (std::vector<boost::filesystem::path> paths);
 
@@ -134,7 +134,7 @@ public:
                return _digest;
        }
 
                return _digest;
        }
 
-       void set_position (DCPTime);
+       void set_position (boost::shared_ptr<const Film> film, DCPTime);
 
        /** DCPTime that this content starts; i.e. the time that the first
         *  bit of the content (trimmed or not) will happen.
 
        /** DCPTime that this content starts; i.e. the time that the first
         *  bit of the content (trimmed or not) will happen.
@@ -159,11 +159,11 @@ public:
        }
 
        /** @return Time immediately after the last thing in this content */
        }
 
        /** @return Time immediately after the last thing in this content */
-       DCPTime end () const {
-               return position() + length_after_trim();
+       DCPTime end (boost::shared_ptr<const Film> film) const {
+               return position() + length_after_trim(film);
        }
 
        }
 
-       DCPTime length_after_trim () const;
+       DCPTime length_after_trim (boost::shared_ptr<const Film> film) const;
 
        boost::optional<double> video_frame_rate () const {
                boost::mutex::scoped_lock lm (_mutex);
 
        boost::optional<double> video_frame_rate () const {
                boost::mutex::scoped_lock lm (_mutex);
@@ -173,14 +173,12 @@ public:
        void set_video_frame_rate (double r);
        void unset_video_frame_rate ();
 
        void set_video_frame_rate (double r);
        void unset_video_frame_rate ();
 
-       double active_video_frame_rate () const;
+       double active_video_frame_rate (boost::shared_ptr<const Film> film) const;
 
        void set_change_signals_frequent (bool f) {
                _change_signals_frequent = f;
        }
 
 
        void set_change_signals_frequent (bool f) {
                _change_signals_frequent = f;
        }
 
-       boost::shared_ptr<const Film> film () const;
-
        std::list<UserProperty> user_properties () const;
 
        std::string calculate_digest () const;
        std::list<UserProperty> user_properties () const;
 
        std::string calculate_digest () const;
@@ -199,8 +197,6 @@ protected:
 
        virtual void add_properties (std::list<UserProperty> &) const;
 
 
        virtual void add_properties (std::list<UserProperty> &) const;
 
-       boost::weak_ptr<const Film> _film;
-
        /** _mutex which should be used to protect accesses, as examine
         *  jobs can update content state in threads other than the main one.
         */
        /** _mutex which should be used to protect accesses, as examine
         *  jobs can update content state in threads other than the main one.
         */
index 10486b0c3948130a63081c24f63a49f13fc522f5..934677c664dd99e3e14917109b89f36d7f089d53 100644 (file)
@@ -47,10 +47,9 @@ using std::list;
 using boost::shared_ptr;
 using boost::optional;
 
 using boost::shared_ptr;
 using boost::optional;
 
-#define LOG_GENERAL(...) film->log()->log (String::compose (__VA_ARGS__), LogEntry::TYPE_GENERAL);
+#define LOG_GENERAL(...) dcpomatic_log->log (String::compose (__VA_ARGS__), LogEntry::TYPE_GENERAL);
 
 /** Create a Content object from an XML node.
 
 /** Create a Content object from an XML node.
- *  @param film Film that the content will be in.
  *  @param node XML description.
  *  @param version XML state version.
  *  @param notes A list to which is added descriptions of any non-critial warnings / messages.
  *  @param node XML description.
  *  @param version XML state version.
  *  @param notes A list to which is added descriptions of any non-critial warnings / messages.
@@ -67,14 +66,14 @@ content_factory (shared_ptr<const Film> film, cxml::ConstNodePtr node, int versi
                /* SndfileContent is now handled by the FFmpeg code rather than by
                   separate libsndfile-based code.
                */
                /* SndfileContent is now handled by the FFmpeg code rather than by
                   separate libsndfile-based code.
                */
-               content.reset (new FFmpegContent (film, node, version, notes));
+               content.reset (new FFmpegContent (node, version, notes));
        } else if (type == "Image") {
        } else if (type == "Image") {
-               content.reset (new ImageContent (film, node, version));
+               content.reset (new ImageContent (node, version));
        } else if (type == "Sndfile") {
                /* SndfileContent is now handled by the FFmpeg code rather than by
                   separate libsndfile-based code.
                */
        } else if (type == "Sndfile") {
                /* SndfileContent is now handled by the FFmpeg code rather than by
                   separate libsndfile-based code.
                */
-               content.reset (new FFmpegContent (film, node, version, notes));
+               content.reset (new FFmpegContent (node, version, notes));
 
                content->audio->set_stream (
                        AudioStreamPtr (
 
                content->audio->set_stream (
                        AudioStreamPtr (
@@ -88,20 +87,20 @@ content_factory (shared_ptr<const Film> film, cxml::ConstNodePtr node, int versi
                        );
 
        } else if (type == "SubRip" || type == "TextSubtitle") {
                        );
 
        } else if (type == "SubRip" || type == "TextSubtitle") {
-               content.reset (new StringTextFileContent (film, node, version));
+               content.reset (new StringTextFileContent (node, version));
        } else if (type == "DCP") {
        } else if (type == "DCP") {
-               content.reset (new DCPContent (film, node, version));
+               content.reset (new DCPContent (node, version));
        } else if (type == "DCPSubtitle") {
        } else if (type == "DCPSubtitle") {
-               content.reset (new DCPSubtitleContent (film, node, version));
+               content.reset (new DCPSubtitleContent (node, version));
        } else if (type == "VideoMXF") {
        } else if (type == "VideoMXF") {
-               content.reset (new VideoMXFContent (film, node, version));
+               content.reset (new VideoMXFContent (node, version));
        } else if (type == "AtmosMXF") {
        } else if (type == "AtmosMXF") {
-               content.reset (new AtmosMXFContent (film, node, version));
+               content.reset (new AtmosMXFContent (node, version));
        }
 
        /* See if this content should be nudged to start on a video frame */
        DCPTime const old_pos = content->position();
        }
 
        /* See if this content should be nudged to start on a video frame */
        DCPTime const old_pos = content->position();
-       content->set_position(old_pos);
+       content->set_position(film, old_pos);
        if (old_pos != content->position()) {
                string note = _("Your project contains video content that was not aligned to a frame boundary.");
                note += "  ";
        if (old_pos != content->position()) {
                string note = _("Your project contains video content that was not aligned to a frame boundary.");
                note += "  ";
@@ -143,12 +142,11 @@ content_factory (shared_ptr<const Film> film, cxml::ConstNodePtr node, int versi
 }
 
 /** Create some Content objects from a file or directory.
 }
 
 /** Create some Content objects from a file or directory.
- *  @param film Film that the content will be in.
  *  @param path File or directory.
  *  @return Content objects.
  */
 list<shared_ptr<Content> >
  *  @param path File or directory.
  *  @return Content objects.
  */
 list<shared_ptr<Content> >
-content_factory (shared_ptr<const Film> film, boost::filesystem::path path)
+content_factory (boost::filesystem::path path)
 {
        list<shared_ptr<Content> > content;
 
 {
        list<shared_ptr<Content> > content;
 
@@ -193,10 +191,10 @@ content_factory (shared_ptr<const Film> film, boost::filesystem::path path)
                }
 
                if (image_files > 0 && sound_files == 0)  {
                }
 
                if (image_files > 0 && sound_files == 0)  {
-                       content.push_back (shared_ptr<Content> (new ImageContent (film, path)));
+                       content.push_back (shared_ptr<Content> (new ImageContent(path)));
                } else if (image_files == 0 && sound_files > 0) {
                        for (boost::filesystem::directory_iterator i(path); i != boost::filesystem::directory_iterator(); ++i) {
                } else if (image_files == 0 && sound_files > 0) {
                        for (boost::filesystem::directory_iterator i(path); i != boost::filesystem::directory_iterator(); ++i) {
-                               content.push_back (shared_ptr<FFmpegContent> (new FFmpegContent (film, i->path())));
+                               content.push_back (shared_ptr<FFmpegContent> (new FFmpegContent(i->path())));
                        }
                }
 
                        }
                }
 
@@ -208,26 +206,26 @@ content_factory (shared_ptr<const Film> film, boost::filesystem::path path)
                transform (ext.begin(), ext.end(), ext.begin(), ::tolower);
 
                if (valid_image_file (path)) {
                transform (ext.begin(), ext.end(), ext.begin(), ::tolower);
 
                if (valid_image_file (path)) {
-                       single.reset (new ImageContent (film, path));
+                       single.reset (new ImageContent(path));
                } else if (ext == ".srt" || ext == ".ssa" || ext == ".ass") {
                } else if (ext == ".srt" || ext == ".ssa" || ext == ".ass") {
-                       single.reset (new StringTextFileContent (film, path));
+                       single.reset (new StringTextFileContent(path));
                } else if (ext == ".xml") {
                        cxml::Document doc;
                        doc.read_file (path);
                        if (doc.root_name() == "DCinemaSecurityMessage") {
                                throw KDMAsContentError ();
                        }
                } else if (ext == ".xml") {
                        cxml::Document doc;
                        doc.read_file (path);
                        if (doc.root_name() == "DCinemaSecurityMessage") {
                                throw KDMAsContentError ();
                        }
-                       single.reset (new DCPSubtitleContent (film, path));
+                       single.reset (new DCPSubtitleContent(path));
                } else if (ext == ".mxf" && dcp::SMPTESubtitleAsset::valid_mxf (path)) {
                } else if (ext == ".mxf" && dcp::SMPTESubtitleAsset::valid_mxf (path)) {
-                       single.reset (new DCPSubtitleContent (film, path));
+                       single.reset (new DCPSubtitleContent(path));
                } else if (ext == ".mxf" && VideoMXFContent::valid_mxf (path)) {
                } else if (ext == ".mxf" && VideoMXFContent::valid_mxf (path)) {
-                       single.reset (new VideoMXFContent (film, path));
+                       single.reset (new VideoMXFContent(path));
                } else if (ext == ".mxf" && AtmosMXFContent::valid_mxf (path)) {
                } else if (ext == ".mxf" && AtmosMXFContent::valid_mxf (path)) {
-                       single.reset (new AtmosMXFContent (film, path));
+                       single.reset (new AtmosMXFContent(path));
                }
 
                if (!single) {
                }
 
                if (!single) {
-                       single.reset (new FFmpegContent (film, path));
+                       single.reset (new FFmpegContent(path));
                }
 
                content.push_back (single);
                }
 
                content.push_back (single);
index f712d9364a1f3bed8666b941b8da19fd07e49cf4..af77d93581e67a936982c286bd8d505e0ab5a508 100644 (file)
@@ -29,4 +29,4 @@ class Film;
 class Content;
 
 extern boost::shared_ptr<Content> content_factory (boost::shared_ptr<const Film>, cxml::ConstNodePtr, int, std::list<std::string> &);
 class Content;
 
 extern boost::shared_ptr<Content> content_factory (boost::shared_ptr<const Film>, cxml::ConstNodePtr, int, std::list<std::string> &);
-extern std::list<boost::shared_ptr<Content> > content_factory (boost::shared_ptr<const Film>, boost::filesystem::path);
+extern std::list<boost::shared_ptr<Content> > content_factory (boost::filesystem::path);
index 9db478330f6873ccb9e73a1269e1c12e628e342f..1bf15ca249dee74f4245378508c6d3c8fe2b9db0 100644 (file)
@@ -35,7 +35,7 @@ using std::list;
 using std::string;
 using boost::shared_ptr;
 
 using std::string;
 using boost::shared_ptr;
 
-#define LOG_GENERAL(...) _dcp_content->film()->log()->log (String::compose (__VA_ARGS__), LogEntry::TYPE_GENERAL);
+#define LOG_GENERAL(...) dcpomatic_log->log (String::compose (__VA_ARGS__), LogEntry::TYPE_GENERAL);
 
 /** Find all the CPLs in our directories, cross-add assets and return the CPLs */
 list<shared_ptr<dcp::CPL> >
 
 /** Find all the CPLs in our directories, cross-add assets and return the CPLs */
 list<shared_ptr<dcp::CPL> >
index cc636b0bfb0d5bd40965935aa31296ad114cdcc7..0bd28a9e37de0d1ce51d5e4a7bdb7e9fc86fba1e 100644 (file)
@@ -64,11 +64,10 @@ int const DCPContentProperty::NAME               = 605;
 int const DCPContentProperty::TEXTS              = 606;
 int const DCPContentProperty::CPL                = 607;
 
 int const DCPContentProperty::TEXTS              = 606;
 int const DCPContentProperty::CPL                = 607;
 
-#define LOG_GENERAL(...) this->film()->log()->log(String::compose(__VA_ARGS__), LogEntry::TYPE_GENERAL);
+#define LOG_GENERAL(...) dcpomatic_log->log(String::compose(__VA_ARGS__), LogEntry::TYPE_GENERAL);
 
 
-DCPContent::DCPContent (shared_ptr<const Film> film, boost::filesystem::path p)
-       : Content (film)
-       , _encrypted (false)
+DCPContent::DCPContent (boost::filesystem::path p)
+       : _encrypted (false)
        , _needs_assets (false)
        , _kdm_valid (false)
        , _reference_video (false)
        , _needs_assets (false)
        , _kdm_valid (false)
        , _reference_video (false)
@@ -85,8 +84,8 @@ DCPContent::DCPContent (shared_ptr<const Film> film, boost::filesystem::path p)
        }
 }
 
        }
 }
 
-DCPContent::DCPContent (shared_ptr<const Film> film, cxml::ConstNodePtr node, int version)
-       : Content (film, node)
+DCPContent::DCPContent (cxml::ConstNodePtr node, int version)
+       : Content (node)
 {
        video = VideoContent::from_xml (this, node, version);
        audio = AudioContent::from_xml (this, node, version);
 {
        video = VideoContent::from_xml (this, node, version);
        audio = AudioContent::from_xml (this, node, version);
@@ -176,7 +175,7 @@ DCPContent::read_directory (boost::filesystem::path p)
 }
 
 void
 }
 
 void
-DCPContent::examine (shared_ptr<Job> job)
+DCPContent::examine (shared_ptr<const Film> film, shared_ptr<Job> job)
 {
        bool const needed_assets = needs_assets ();
        bool const needed_kdm = needs_kdm ();
 {
        bool const needed_assets = needs_assets ();
        bool const needed_kdm = needs_kdm ();
@@ -192,7 +191,7 @@ DCPContent::examine (shared_ptr<Job> job)
        if (job) {
                job->set_progress_unknown ();
        }
        if (job) {
                job->set_progress_unknown ();
        }
-       Content::examine (job);
+       Content::examine (film, job);
 
        shared_ptr<DCPExaminer> examiner (new DCPExaminer (shared_from_this ()));
 
 
        shared_ptr<DCPExaminer> examiner (new DCPExaminer (shared_from_this ()));
 
@@ -214,7 +213,7 @@ DCPContent::examine (shared_ptr<Job> job)
                AudioStreamPtr as (new AudioStream (examiner->audio_frame_rate(), examiner->audio_length(), examiner->audio_channels()));
                audio->set_stream (as);
                AudioMapping m = as->mapping ();
                AudioStreamPtr as (new AudioStream (examiner->audio_frame_rate(), examiner->audio_length(), examiner->audio_channels()));
                audio->set_stream (as);
                AudioMapping m = as->mapping ();
-               film()->make_audio_mapping_default (m);
+               film->make_audio_mapping_default (m);
                as->set_mapping (m);
        }
 
                as->set_mapping (m);
        }
 
@@ -338,13 +337,13 @@ DCPContent::as_xml (xmlpp::Node* node, bool with_paths) const
 }
 
 DCPTime
 }
 
 DCPTime
-DCPContent::full_length () const
+DCPContent::full_length (shared_ptr<const Film> film) const
 {
        if (!video) {
                return DCPTime();
        }
 {
        if (!video) {
                return DCPTime();
        }
-       FrameRateChange const frc (active_video_frame_rate (), film()->video_frame_rate ());
-       return DCPTime::from_frames (llrint (video->length () * frc.factor ()), film()->video_frame_rate ());
+       FrameRateChange const frc (active_video_frame_rate(film), film->video_frame_rate());
+       return DCPTime::from_frames (llrint(video->length() * frc.factor()), film->video_frame_rate());
 }
 
 string
 }
 
 string
@@ -406,14 +405,14 @@ DCPContent::directories () const
 }
 
 void
 }
 
 void
-DCPContent::add_properties (list<UserProperty>& p) const
+DCPContent::add_properties (shared_ptr<const Film> film, list<UserProperty>& p) const
 {
        Content::add_properties (p);
        if (video) {
                video->add_properties (p);
        }
        if (audio) {
 {
        Content::add_properties (p);
        if (video) {
                video->add_properties (p);
        }
        if (audio) {
-               audio->add_properties (p);
+               audio->add_properties (film, p);
        }
 }
 
        }
 }
 
@@ -460,7 +459,7 @@ DCPContent::set_reference_text (TextType type, bool r)
 }
 
 list<DCPTimePeriod>
 }
 
 list<DCPTimePeriod>
-DCPContent::reels () const
+DCPContent::reels (shared_ptr<const Film> film) const
 {
        list<int64_t> reel_lengths = _reel_lengths;
        if (reel_lengths.empty ()) {
 {
        list<int64_t> reel_lengths = _reel_lengths;
        if (reel_lengths.empty ()) {
@@ -470,7 +469,7 @@ DCPContent::reels () const
                        reel_lengths = examiner->reel_lengths ();
                } catch (...) {
                        /* Could not examine the DCP; guess reels */
                        reel_lengths = examiner->reel_lengths ();
                } catch (...) {
                        /* Could not examine the DCP; guess reels */
-                       reel_lengths.push_back (length_after_trim().frames_round (film()->video_frame_rate ()));
+                       reel_lengths.push_back (length_after_trim(film).frames_round(film->video_frame_rate()));
                }
        }
 
                }
        }
 
@@ -485,10 +484,10 @@ DCPContent::reels () const
 
        BOOST_FOREACH (int64_t i, reel_lengths) {
                /* This reel runs from `pos' to `to' */
 
        BOOST_FOREACH (int64_t i, reel_lengths) {
                /* This reel runs from `pos' to `to' */
-               DCPTime const to = pos + DCPTime::from_frames (i, film()->video_frame_rate());
+               DCPTime const to = pos + DCPTime::from_frames (i, film->video_frame_rate());
                if (to > position()) {
                if (to > position()) {
-                       p.push_back (DCPTimePeriod (max(position(), pos), min(end(), to)));
-                       if (to > end()) {
+                       p.push_back (DCPTimePeriod (max(position(), pos), min(end(film), to)));
+                       if (to > end(film)) {
                                break;
                        }
                }
                                break;
                        }
                }
@@ -499,25 +498,25 @@ DCPContent::reels () const
 }
 
 list<DCPTime>
 }
 
 list<DCPTime>
-DCPContent::reel_split_points () const
+DCPContent::reel_split_points (shared_ptr<const Film> film) const
 {
        list<DCPTime> s;
 {
        list<DCPTime> s;
-       BOOST_FOREACH (DCPTimePeriod i, reels()) {
+       BOOST_FOREACH (DCPTimePeriod i, reels(film)) {
                s.push_back (i.from);
        }
        return s;
 }
 
 bool
                s.push_back (i.from);
        }
        return s;
 }
 
 bool
-DCPContent::can_reference (function<bool (shared_ptr<const Content>)> part, string overlapping, string& why_not) const
+DCPContent::can_reference (shared_ptr<const Film> film, function<bool (shared_ptr<const Content>)> part, string overlapping, string& why_not) const
 {
        /* We must be using the same standard as the film */
        if (_standard) {
 {
        /* We must be using the same standard as the film */
        if (_standard) {
-               if (_standard.get() == dcp::INTEROP && !film()->interop()) {
+               if (_standard.get() == dcp::INTEROP && !film->interop()) {
                        /// TRANSLATORS: this string will follow "Cannot reference this DCP: "
                        why_not = _("it is Interop and the film is set to SMPTE.");
                        return false;
                        /// TRANSLATORS: this string will follow "Cannot reference this DCP: "
                        why_not = _("it is Interop and the film is set to SMPTE.");
                        return false;
-               } else if (_standard.get() == dcp::SMPTE && film()->interop()) {
+               } else if (_standard.get() == dcp::SMPTE && film->interop()) {
                        /// TRANSLATORS: this string will follow "Cannot reference this DCP: "
                        why_not = _("it is SMPTE and the film is set to Interop.");
                        return false;
                        /// TRANSLATORS: this string will follow "Cannot reference this DCP: "
                        why_not = _("it is SMPTE and the film is set to Interop.");
                        return false;
@@ -525,17 +524,17 @@ DCPContent::can_reference (function<bool (shared_ptr<const Content>)> part, stri
        }
 
        /* And the same frame rate */
        }
 
        /* And the same frame rate */
-       if (!video_frame_rate() || (lrint(video_frame_rate().get()) != film()->video_frame_rate())) {
+       if (!video_frame_rate() || (lrint(video_frame_rate().get()) != film->video_frame_rate())) {
                /// TRANSLATORS: this string will follow "Cannot reference this DCP: "
                why_not = _("it has a different frame rate to the film.");
                return false;
        }
 
                /// TRANSLATORS: this string will follow "Cannot reference this DCP: "
                why_not = _("it has a different frame rate to the film.");
                return false;
        }
 
-       list<DCPTimePeriod> const fr = film()->reels ();
+       list<DCPTimePeriod> const fr = film->reels ();
 
        list<DCPTimePeriod> reel_list;
        try {
 
        list<DCPTimePeriod> reel_list;
        try {
-               reel_list = reels ();
+               reel_list = reels (film);
        } catch (dcp::DCPReadError) {
                /* We couldn't read the DCP; it's probably missing */
                return false;
        } catch (dcp::DCPReadError) {
                /* We couldn't read the DCP; it's probably missing */
                return false;
@@ -555,7 +554,7 @@ DCPContent::can_reference (function<bool (shared_ptr<const Content>)> part, stri
                }
        }
 
                }
        }
 
-       ContentList a = overlaps (film()->content(), part, position(), end());
+       ContentList a = overlaps (film, film->content(), part, position(), end(film));
        if (a.size() != 1 || a.front().get() != this) {
                why_not = overlapping;
                return false;
        if (a.size() != 1 || a.front().get() != this) {
                why_not = overlapping;
                return false;
@@ -571,7 +570,7 @@ bool check_video (shared_ptr<const Content> c)
 }
 
 bool
 }
 
 bool
-DCPContent::can_reference_video (string& why_not) const
+DCPContent::can_reference_video (shared_ptr<const Film> film, string& why_not) const
 {
        if (!video) {
                why_not = _("There is no video in this DCP");
 {
        if (!video) {
                why_not = _("There is no video in this DCP");
@@ -583,7 +582,7 @@ DCPContent::can_reference_video (string& why_not) const
                video_res = RESOLUTION_4K;
        }
 
                video_res = RESOLUTION_4K;
        }
 
-       if (film()->resolution() != video_res) {
+       if (film->resolution() != video_res) {
                if (video_res == RESOLUTION_4K) {
                        /// TRANSLATORS: this string will follow "Cannot reference this DCP: "
                        why_not = _("it is 4K and the film is 2K.");
                if (video_res == RESOLUTION_4K) {
                        /// TRANSLATORS: this string will follow "Cannot reference this DCP: "
                        why_not = _("it is 4K and the film is 2K.");
@@ -592,14 +591,14 @@ DCPContent::can_reference_video (string& why_not) const
                        why_not = _("it is 2K and the film is 4K.");
                }
                return false;
                        why_not = _("it is 2K and the film is 4K.");
                }
                return false;
-       } else if (film()->frame_size() != video->size()) {
+       } else if (film->frame_size() != video->size()) {
                /// TRANSLATORS: this string will follow "Cannot reference this DCP: "
                why_not = _("its video frame size differs from the film's.");
                return false;
        }
 
        /// TRANSLATORS: this string will follow "Cannot reference this DCP: "
                /// TRANSLATORS: this string will follow "Cannot reference this DCP: "
                why_not = _("its video frame size differs from the film's.");
                return false;
        }
 
        /// TRANSLATORS: this string will follow "Cannot reference this DCP: "
-       return can_reference (bind (&check_video, _1), _("it overlaps other video content; remove the other content."), why_not);
+       return can_reference (film, bind (&check_video, _1), _("it overlaps other video content; remove the other content."), why_not);
 }
 
 static
 }
 
 static
@@ -609,11 +608,11 @@ bool check_audio (shared_ptr<const Content> c)
 }
 
 bool
 }
 
 bool
-DCPContent::can_reference_audio (string& why_not) const
+DCPContent::can_reference_audio (shared_ptr<const Film> film, string& why_not) const
 {
        shared_ptr<DCPDecoder> decoder;
        try {
 {
        shared_ptr<DCPDecoder> decoder;
        try {
-               decoder.reset (new DCPDecoder (shared_from_this(), film()->log(), false));
+               decoder.reset (new DCPDecoder (shared_from_this(), false));
        } catch (dcp::DCPReadError) {
                /* We couldn't read the DCP, so it's probably missing */
                return false;
        } catch (dcp::DCPReadError) {
                /* We couldn't read the DCP, so it's probably missing */
                return false;
@@ -634,7 +633,7 @@ DCPContent::can_reference_audio (string& why_not) const
         }
 
        /// TRANSLATORS: this string will follow "Cannot reference this DCP: "
         }
 
        /// TRANSLATORS: this string will follow "Cannot reference this DCP: "
-       return can_reference (bind (&check_audio, _1), _("it overlaps other audio content; remove the other content."), why_not);
+       return can_reference (film, bind (&check_audio, _1), _("it overlaps other audio content; remove the other content."), why_not);
 }
 
 static
 }
 
 static
@@ -644,11 +643,11 @@ bool check_text (shared_ptr<const Content> c)
 }
 
 bool
 }
 
 bool
-DCPContent::can_reference_text (TextType type, string& why_not) const
+DCPContent::can_reference_text (shared_ptr<const Film> film, TextType type, string& why_not) const
 {
        shared_ptr<DCPDecoder> decoder;
        try {
 {
        shared_ptr<DCPDecoder> decoder;
        try {
-               decoder.reset (new DCPDecoder (shared_from_this(), film()->log(), false));
+               decoder.reset (new DCPDecoder (shared_from_this(), false));
        } catch (dcp::DCPReadError) {
                /* We couldn't read the DCP, so it's probably missing */
                return false;
        } catch (dcp::DCPReadError) {
                /* We couldn't read the DCP, so it's probably missing */
                return false;
@@ -671,7 +670,7 @@ DCPContent::can_reference_text (TextType type, string& why_not) const
         }
 
        /// TRANSLATORS: this string will follow "Cannot reference this DCP: "
         }
 
        /// TRANSLATORS: this string will follow "Cannot reference this DCP: "
-       return can_reference (bind (&check_text, _1), _("it overlaps other text content; remove the other content."), why_not);
+       return can_reference (film, bind (&check_text, _1), _("it overlaps other text content; remove the other content."), why_not);
 }
 
 void
 }
 
 void
index 2a3ef46e80092db8b2fd4288211eccac18975163..874e1ee318f447914e4a6fdbb464b27dccbe6eed 100644 (file)
@@ -50,8 +50,8 @@ class ContentPart;
 class DCPContent : public Content
 {
 public:
 class DCPContent : public Content
 {
 public:
-       DCPContent (boost::shared_ptr<const Film>, boost::filesystem::path p);
-       DCPContent (boost::shared_ptr<const Film>, cxml::ConstNodePtr, int version);
+       DCPContent (boost::filesystem::path p);
+       DCPContent (cxml::ConstNodePtr, int version);
 
        boost::shared_ptr<DCPContent> shared_from_this () {
                return boost::dynamic_pointer_cast<DCPContent> (Content::shared_from_this ());
 
        boost::shared_ptr<DCPContent> shared_from_this () {
                return boost::dynamic_pointer_cast<DCPContent> (Content::shared_from_this ());
@@ -61,9 +61,9 @@ public:
                return boost::dynamic_pointer_cast<const DCPContent> (Content::shared_from_this ());
        }
 
                return boost::dynamic_pointer_cast<const DCPContent> (Content::shared_from_this ());
        }
 
-       DCPTime full_length () const;
+       DCPTime full_length (boost::shared_ptr<const Film> film) const;
 
 
-       void examine (boost::shared_ptr<Job>);
+       void examine (boost::shared_ptr<const Film> film, boost::shared_ptr<Job>);
        std::string summary () const;
        std::string technical_summary () const;
        void as_xml (xmlpp::Node *, bool with_paths) const;
        std::string summary () const;
        std::string technical_summary () const;
        void as_xml (xmlpp::Node *, bool with_paths) const;
@@ -71,7 +71,7 @@ public:
        void take_settings_from (boost::shared_ptr<const Content> c);
 
        void set_default_colour_conversion ();
        void take_settings_from (boost::shared_ptr<const Content> c);
 
        void set_default_colour_conversion ();
-       std::list<DCPTime> reel_split_points () const;
+       std::list<DCPTime> reel_split_points (boost::shared_ptr<const Film> film) const;
 
        std::vector<boost::filesystem::path> directories () const;
 
 
        std::vector<boost::filesystem::path> directories () const;
 
@@ -98,7 +98,7 @@ public:
                return _reference_video;
        }
 
                return _reference_video;
        }
 
-       bool can_reference_video (std::string &) const;
+       bool can_reference_video (boost::shared_ptr<const Film> film, std::string &) const;
 
        void set_reference_audio (bool r);
 
 
        void set_reference_audio (bool r);
 
@@ -107,7 +107,7 @@ public:
                return _reference_audio;
        }
 
                return _reference_audio;
        }
 
-       bool can_reference_audio (std::string &) const;
+       bool can_reference_audio (boost::shared_ptr<const Film> film, std::string &) const;
 
        void set_reference_text (TextType type, bool r);
 
 
        void set_reference_text (TextType type, bool r);
 
@@ -119,7 +119,7 @@ public:
                return _reference_text[type];
        }
 
                return _reference_text[type];
        }
 
-       bool can_reference_text (TextType type, std::string &) const;
+       bool can_reference_text (boost::shared_ptr<const Film> film, TextType type, std::string &) const;
 
        void set_cpl (std::string id);
 
 
        void set_cpl (std::string id);
 
@@ -148,11 +148,12 @@ public:
 private:
        friend class reels_test5;
 
 private:
        friend class reels_test5;
 
-       void add_properties (std::list<UserProperty>& p) const;
+       void add_properties (boost::shared_ptr<const Film> film, std::list<UserProperty>& p) const;
 
        void read_directory (boost::filesystem::path);
 
        void read_directory (boost::filesystem::path);
-       std::list<DCPTimePeriod> reels () const;
+       std::list<DCPTimePeriod> reels (boost::shared_ptr<const Film> film) const;
        bool can_reference (
        bool can_reference (
+               boost::shared_ptr<const Film> film,
                boost::function <bool (boost::shared_ptr<const Content>)>,
                std::string overlapping,
                std::string& why_not
                boost::function <bool (boost::shared_ptr<const Content>)>,
                std::string overlapping,
                std::string& why_not
index 71a7e42d035cc5e8f40b3387f99e6fda51229b40..a67b244f75392b4803a7d1638372c80e216f1070 100644 (file)
@@ -55,19 +55,19 @@ using boost::shared_ptr;
 using boost::dynamic_pointer_cast;
 using boost::optional;
 
 using boost::dynamic_pointer_cast;
 using boost::optional;
 
-DCPDecoder::DCPDecoder (shared_ptr<const DCPContent> c, shared_ptr<Log> log, bool fast)
+DCPDecoder::DCPDecoder (shared_ptr<const DCPContent> c, bool fast)
        : DCP (c)
        , _decode_referenced (false)
 {
        if (c->video) {
        : DCP (c)
        , _decode_referenced (false)
 {
        if (c->video) {
-               video.reset (new VideoDecoder (this, c, log));
+               video.reset (new VideoDecoder (this, c));
        }
        if (c->audio) {
        }
        if (c->audio) {
-               audio.reset (new AudioDecoder (this, c->audio, log, fast));
+               audio.reset (new AudioDecoder (this, c->audio, fast));
        }
        BOOST_FOREACH (shared_ptr<TextContent> i, c->text) {
                /* XXX: this time here should be the time of the first subtitle, not 0 */
        }
        BOOST_FOREACH (shared_ptr<TextContent> i, c->text) {
                /* XXX: this time here should be the time of the first subtitle, not 0 */
-               text.push_back (shared_ptr<TextDecoder> (new TextDecoder (this, i, log, ContentTime())));
+               text.push_back (shared_ptr<TextDecoder> (new TextDecoder (this, i, ContentTime())));
        }
 
        list<shared_ptr<dcp::CPL> > cpl_list = cpls ();
        }
 
        list<shared_ptr<dcp::CPL> > cpl_list = cpls ();
@@ -101,13 +101,13 @@ DCPDecoder::DCPDecoder (shared_ptr<const DCPContent> c, shared_ptr<Log> log, boo
 
 
 bool
 
 
 bool
-DCPDecoder::pass ()
+DCPDecoder::pass (shared_ptr<const Film> film)
 {
        if (_reel == _reels.end () || !_dcp_content->can_be_played ()) {
                return true;
        }
 
 {
        if (_reel == _reels.end () || !_dcp_content->can_be_played ()) {
                return true;
        }
 
-       double const vfr = _dcp_content->active_video_frame_rate ();
+       double const vfr = _dcp_content->active_video_frame_rate (film);
 
        /* Frame within the (played part of the) reel that is coming up next */
        int64_t const frame = _next.frames_round (vfr);
 
        /* Frame within the (played part of the) reel that is coming up next */
        int64_t const frame = _next.frames_round (vfr);
@@ -118,12 +118,13 @@ DCPDecoder::pass ()
        /* We must emit texts first as when we emit the video for this frame
           it will expect already to have the texts.
        */
        /* We must emit texts first as when we emit the video for this frame
           it will expect already to have the texts.
        */
-       pass_texts (_next, picture_asset->size());
+       pass_texts (film, _next, picture_asset->size());
 
        if ((_mono_reader || _stereo_reader) && (_decode_referenced || !_dcp_content->reference_video())) {
                int64_t const entry_point = (*_reel)->main_picture()->entry_point ();
                if (_mono_reader) {
                        video->emit (
 
        if ((_mono_reader || _stereo_reader) && (_decode_referenced || !_dcp_content->reference_video())) {
                int64_t const entry_point = (*_reel)->main_picture()->entry_point ();
                if (_mono_reader) {
                        video->emit (
+                               film,
                                shared_ptr<ImageProxy> (
                                        new J2KImageProxy (
                                                _mono_reader->get_frame (entry_point + frame),
                                shared_ptr<ImageProxy> (
                                        new J2KImageProxy (
                                                _mono_reader->get_frame (entry_point + frame),
@@ -136,6 +137,7 @@ DCPDecoder::pass ()
                                );
                } else {
                        video->emit (
                                );
                } else {
                        video->emit (
+                               film,
                                shared_ptr<ImageProxy> (
                                        new J2KImageProxy (
                                                _stereo_reader->get_frame (entry_point + frame),
                                shared_ptr<ImageProxy> (
                                        new J2KImageProxy (
                                                _stereo_reader->get_frame (entry_point + frame),
@@ -149,6 +151,7 @@ DCPDecoder::pass ()
                                );
 
                        video->emit (
                                );
 
                        video->emit (
+                               film,
                                shared_ptr<ImageProxy> (
                                        new J2KImageProxy (
                                                _stereo_reader->get_frame (entry_point + frame),
                                shared_ptr<ImageProxy> (
                                        new J2KImageProxy (
                                                _stereo_reader->get_frame (entry_point + frame),
@@ -179,7 +182,7 @@ DCPDecoder::pass ()
                        }
                }
 
                        }
                }
 
-               audio->emit (_dcp_content->audio->stream(), data, ContentTime::from_frames (_offset, vfr) + _next);
+               audio->emit (film, _dcp_content->audio->stream(), data, ContentTime::from_frames (_offset, vfr) + _next);
        }
 
        _next += ContentTime::from_frames (1, vfr);
        }
 
        _next += ContentTime::from_frames (1, vfr);
@@ -195,29 +198,37 @@ DCPDecoder::pass ()
 }
 
 void
 }
 
 void
-DCPDecoder::pass_texts (ContentTime next, dcp::Size size)
+DCPDecoder::pass_texts (shared_ptr<const Film> film, ContentTime next, dcp::Size size)
 {
        list<shared_ptr<TextDecoder> >::const_iterator decoder = text.begin ();
        if ((*_reel)->main_subtitle()) {
                DCPOMATIC_ASSERT (decoder != text.end ());
                pass_texts (
 {
        list<shared_ptr<TextDecoder> >::const_iterator decoder = text.begin ();
        if ((*_reel)->main_subtitle()) {
                DCPOMATIC_ASSERT (decoder != text.end ());
                pass_texts (
-                       next, (*_reel)->main_subtitle()->asset(), _dcp_content->reference_text(TEXT_OPEN_SUBTITLE), (*_reel)->main_subtitle()->entry_point(), *decoder, size
+                       film,
+                       next,
+                       (*_reel)->main_subtitle()->asset(),
+                       _dcp_content->reference_text(TEXT_OPEN_SUBTITLE),
+                       (*_reel)->main_subtitle()->entry_point(),
+                       *decoder,
+                       size
                        );
                ++decoder;
        }
        BOOST_FOREACH (shared_ptr<dcp::ReelClosedCaptionAsset> i, (*_reel)->closed_captions()) {
                DCPOMATIC_ASSERT (decoder != text.end ());
                pass_texts (
                        );
                ++decoder;
        }
        BOOST_FOREACH (shared_ptr<dcp::ReelClosedCaptionAsset> i, (*_reel)->closed_captions()) {
                DCPOMATIC_ASSERT (decoder != text.end ());
                pass_texts (
-                       next, i->asset(), _dcp_content->reference_text(TEXT_CLOSED_CAPTION), i->entry_point(), *decoder, size
+                       film, next, i->asset(), _dcp_content->reference_text(TEXT_CLOSED_CAPTION), i->entry_point(), *decoder, size
                        );
                ++decoder;
        }
 }
 
 void
                        );
                ++decoder;
        }
 }
 
 void
-DCPDecoder::pass_texts (ContentTime next, shared_ptr<dcp::SubtitleAsset> asset, bool reference, int64_t entry_point, shared_ptr<TextDecoder> decoder, dcp::Size size)
+DCPDecoder::pass_texts (
+       shared_ptr<const Film> film, ContentTime next, shared_ptr<dcp::SubtitleAsset> asset, bool reference, int64_t entry_point, shared_ptr<TextDecoder> decoder, dcp::Size size
+       )
 {
 {
-       double const vfr = _dcp_content->active_video_frame_rate ();
+       double const vfr = _dcp_content->active_video_frame_rate (film);
        /* Frame within the (played part of the) reel that is coming up next */
        int64_t const frame = next.frames_round (vfr);
 
        /* Frame within the (played part of the) reel that is coming up next */
        int64_t const frame = next.frames_round (vfr);
 
@@ -348,13 +359,13 @@ DCPDecoder::get_readers ()
 }
 
 void
 }
 
 void
-DCPDecoder::seek (ContentTime t, bool accurate)
+DCPDecoder::seek (shared_ptr<const Film> film, ContentTime t, bool accurate)
 {
        if (!_dcp_content->can_be_played ()) {
                return;
        }
 
 {
        if (!_dcp_content->can_be_played ()) {
                return;
        }
 
-       Decoder::seek (t, accurate);
+       Decoder::seek (film, t, accurate);
 
        _reel = _reels.begin ();
        _offset = 0;
 
        _reel = _reels.begin ();
        _offset = 0;
@@ -371,8 +382,8 @@ DCPDecoder::seek (ContentTime t, bool accurate)
 
        /* Seek to pre-roll position */
 
 
        /* Seek to pre-roll position */
 
-       while (_reel != _reels.end() && pre >= ContentTime::from_frames ((*_reel)->main_picture()->duration(), _dcp_content->active_video_frame_rate ())) {
-               ContentTime rd = ContentTime::from_frames ((*_reel)->main_picture()->duration(), _dcp_content->active_video_frame_rate ());
+       while (_reel != _reels.end() && pre >= ContentTime::from_frames ((*_reel)->main_picture()->duration(), _dcp_content->active_video_frame_rate(film))) {
+               ContentTime rd = ContentTime::from_frames ((*_reel)->main_picture()->duration(), _dcp_content->active_video_frame_rate(film));
                pre -= rd;
                t -= rd;
                next_reel ();
                pre -= rd;
                t -= rd;
                next_reel ();
@@ -380,16 +391,16 @@ DCPDecoder::seek (ContentTime t, bool accurate)
 
        /* Pass texts in the pre-roll */
 
 
        /* Pass texts in the pre-roll */
 
-       double const vfr = _dcp_content->active_video_frame_rate ();
+       double const vfr = _dcp_content->active_video_frame_rate (film);
        for (int i = 0; i < pre_roll_seconds * vfr; ++i) {
        for (int i = 0; i < pre_roll_seconds * vfr; ++i) {
-               pass_texts (pre, (*_reel)->main_picture()->asset()->size());
+               pass_texts (film, pre, (*_reel)->main_picture()->asset()->size());
                pre += ContentTime::from_frames (1, vfr);
        }
 
        /* Seek to correct position */
 
                pre += ContentTime::from_frames (1, vfr);
        }
 
        /* Seek to correct position */
 
-       while (_reel != _reels.end() && t >= ContentTime::from_frames ((*_reel)->main_picture()->duration(), _dcp_content->active_video_frame_rate ())) {
-               t -= ContentTime::from_frames ((*_reel)->main_picture()->duration(), _dcp_content->active_video_frame_rate ());
+       while (_reel != _reels.end() && t >= ContentTime::from_frames ((*_reel)->main_picture()->duration(), _dcp_content->active_video_frame_rate(film))) {
+               t -= ContentTime::from_frames ((*_reel)->main_picture()->duration(), _dcp_content->active_video_frame_rate(film));
                next_reel ();
        }
 
                next_reel ();
        }
 
index 8281babc3a0a92c985c1448d706eadaaa5d332fe..d3c5c57eddc368ba65f68c77b37713bf1f52fffb 100644 (file)
@@ -40,7 +40,7 @@ struct dcp_subtitle_within_dcp_test;
 class DCPDecoder : public DCP, public Decoder
 {
 public:
 class DCPDecoder : public DCP, public Decoder
 {
 public:
-       DCPDecoder (boost::shared_ptr<const DCPContent>, boost::shared_ptr<Log> log, bool fast);
+       DCPDecoder (boost::shared_ptr<const DCPContent>, bool fast);
 
        std::list<boost::shared_ptr<dcp::Reel> > reels () const {
                return _reels;
 
        std::list<boost::shared_ptr<dcp::Reel> > reels () const {
                return _reels;
@@ -49,17 +49,23 @@ public:
        void set_decode_referenced (bool r);
        void set_forced_reduction (boost::optional<int> reduction);
 
        void set_decode_referenced (bool r);
        void set_forced_reduction (boost::optional<int> reduction);
 
-       bool pass ();
-       void seek (ContentTime t, bool accurate);
+       bool pass (boost::shared_ptr<const Film> film);
+       void seek (boost::shared_ptr<const Film> film, ContentTime t, bool accurate);
 
 private:
        friend struct dcp_subtitle_within_dcp_test;
 
        void next_reel ();
        void get_readers ();
 
 private:
        friend struct dcp_subtitle_within_dcp_test;
 
        void next_reel ();
        void get_readers ();
-       void pass_texts (ContentTime next, dcp::Size size);
+       void pass_texts (boost::shared_ptr<const Film> film, ContentTime next, dcp::Size size);
        void pass_texts (
        void pass_texts (
-               ContentTime next, boost::shared_ptr<dcp::SubtitleAsset> asset, bool reference, int64_t entry_point, boost::shared_ptr<TextDecoder> decoder, dcp::Size size
+               boost::shared_ptr<const Film> film,
+               ContentTime next,
+               boost::shared_ptr<dcp::SubtitleAsset> asset,
+               bool reference,
+               int64_t entry_point,
+               boost::shared_ptr<TextDecoder> decoder,
+               dcp::Size size
                );
 
        /** Time of next thing to return from pass relative to the start of _reel */
                );
 
        /** Time of next thing to return from pass relative to the start of _reel */
index a8e98d4264b3d82f12293b9f22c6eccbeebe4ceb..21a50c1990db485f4c20c3b71ba4349f20cd6e0d 100644 (file)
@@ -37,23 +37,23 @@ using boost::shared_ptr;
 using boost::dynamic_pointer_cast;
 using dcp::raw_convert;
 
 using boost::dynamic_pointer_cast;
 using dcp::raw_convert;
 
-DCPSubtitleContent::DCPSubtitleContent (shared_ptr<const Film> film, boost::filesystem::path path)
-       : Content (film, path)
+DCPSubtitleContent::DCPSubtitleContent (boost::filesystem::path path)
+       : Content (path)
 {
        text.push_back (shared_ptr<TextContent> (new TextContent (this, TEXT_OPEN_SUBTITLE, TEXT_OPEN_SUBTITLE)));
 }
 
 {
        text.push_back (shared_ptr<TextContent> (new TextContent (this, TEXT_OPEN_SUBTITLE, TEXT_OPEN_SUBTITLE)));
 }
 
-DCPSubtitleContent::DCPSubtitleContent (shared_ptr<const Film> film, cxml::ConstNodePtr node, int version)
-       : Content (film, node)
+DCPSubtitleContent::DCPSubtitleContent (cxml::ConstNodePtr node, int version)
+       : Content (node)
        , _length (node->number_child<ContentTime::Type> ("Length"))
 {
        text = TextContent::from_xml (this, node, version);
 }
 
 void
        , _length (node->number_child<ContentTime::Type> ("Length"))
 {
        text = TextContent::from_xml (this, node, version);
 }
 
 void
-DCPSubtitleContent::examine (shared_ptr<Job> job)
+DCPSubtitleContent::examine (shared_ptr<const Film> film, shared_ptr<Job> job)
 {
 {
-       Content::examine (job);
+       Content::examine (film, job);
 
        shared_ptr<dcp::SubtitleAsset> sc = load (path (0));
 
 
        shared_ptr<dcp::SubtitleAsset> sc = load (path (0));
 
@@ -82,9 +82,9 @@ DCPSubtitleContent::examine (shared_ptr<Job> job)
 }
 
 DCPTime
 }
 
 DCPTime
-DCPSubtitleContent::full_length () const
+DCPSubtitleContent::full_length (shared_ptr<const Film> film) const
 {
 {
-       FrameRateChange const frc (active_video_frame_rate(), film()->video_frame_rate());
+       FrameRateChange const frc (active_video_frame_rate(film), film->video_frame_rate());
        return DCPTime (_length, frc);
 }
 
        return DCPTime (_length, frc);
 }
 
index 36945adcdb4af8bdba3d696679ee811a1adc43a1..5eaad0d2fc677efc04b7a7896695d11997284155 100644 (file)
 class DCPSubtitleContent : public DCPSubtitle, public Content
 {
 public:
 class DCPSubtitleContent : public DCPSubtitle, public Content
 {
 public:
-       DCPSubtitleContent (boost::shared_ptr<const Film>, boost::filesystem::path);
-       DCPSubtitleContent (boost::shared_ptr<const Film>, cxml::ConstNodePtr, int);
+       DCPSubtitleContent (boost::filesystem::path);
+       DCPSubtitleContent (cxml::ConstNodePtr, int);
 
 
-       void examine (boost::shared_ptr<Job>);
+       void examine (boost::shared_ptr<const Film> film, boost::shared_ptr<Job>);
        std::string summary () const;
        std::string technical_summary () const;
        void as_xml (xmlpp::Node *, bool with_paths) const;
        std::string summary () const;
        std::string technical_summary () const;
        void as_xml (xmlpp::Node *, bool with_paths) const;
-       DCPTime full_length () const;
+       DCPTime full_length (boost::shared_ptr<const Film> film) const;
 
 private:
        ContentTime _length;
 
 private:
        ContentTime _length;
index 9c803a3b61d012a965fcfece5d4a7ed675b70b38..07e879ddfad8ac0d685980bba67c95cc29783643 100644 (file)
@@ -29,7 +29,7 @@ using boost::shared_ptr;
 using boost::dynamic_pointer_cast;
 using boost::bind;
 
 using boost::dynamic_pointer_cast;
 using boost::bind;
 
-DCPSubtitleDecoder::DCPSubtitleDecoder (shared_ptr<const DCPSubtitleContent> content, shared_ptr<Log> log)
+DCPSubtitleDecoder::DCPSubtitleDecoder (shared_ptr<const DCPSubtitleContent> content)
 {
        shared_ptr<dcp::SubtitleAsset> c (load (content->path (0)));
        _subtitles = c->subtitles ();
 {
        shared_ptr<dcp::SubtitleAsset> c (load (content->path (0)));
        _subtitles = c->subtitles ();
@@ -39,13 +39,13 @@ DCPSubtitleDecoder::DCPSubtitleDecoder (shared_ptr<const DCPSubtitleContent> con
        if (_next != _subtitles.end()) {
                first = content_time_period(*_next).from;
        }
        if (_next != _subtitles.end()) {
                first = content_time_period(*_next).from;
        }
-       text.push_back (shared_ptr<TextDecoder> (new TextDecoder (this, content->only_text(), log, first)));
+       text.push_back (shared_ptr<TextDecoder> (new TextDecoder (this, content->only_text(), first)));
 }
 
 void
 }
 
 void
-DCPSubtitleDecoder::seek (ContentTime time, bool accurate)
+DCPSubtitleDecoder::seek (shared_ptr<const Film> film, ContentTime time, bool accurate)
 {
 {
-       Decoder::seek (time, accurate);
+       Decoder::seek (film, time, accurate);
 
        _next = _subtitles.begin ();
        list<shared_ptr<dcp::Subtitle> >::const_iterator i = _subtitles.begin ();
 
        _next = _subtitles.begin ();
        list<shared_ptr<dcp::Subtitle> >::const_iterator i = _subtitles.begin ();
@@ -55,7 +55,7 @@ DCPSubtitleDecoder::seek (ContentTime time, bool accurate)
 }
 
 bool
 }
 
 bool
-DCPSubtitleDecoder::pass ()
+DCPSubtitleDecoder::pass (shared_ptr<const Film>)
 {
        if (_next == _subtitles.end ()) {
                return true;
 {
        if (_next == _subtitles.end ()) {
                return true;
index 984d9882607788afe7ea627464c95646e1d901a2..7e832241e82fa211e2572091c6ca2ef52fd9e1f2 100644 (file)
@@ -26,10 +26,10 @@ class DCPSubtitleContent;
 class DCPSubtitleDecoder : public DCPSubtitle, public Decoder
 {
 public:
 class DCPSubtitleDecoder : public DCPSubtitle, public Decoder
 {
 public:
-       DCPSubtitleDecoder (boost::shared_ptr<const DCPSubtitleContent>, boost::shared_ptr<Log> log);
+       DCPSubtitleDecoder (boost::shared_ptr<const DCPSubtitleContent>);
 
 
-       bool pass ();
-       void seek (ContentTime time, bool accurate);
+       bool pass (boost::shared_ptr<const Film> film);
+       void seek (boost::shared_ptr<const Film> film, ContentTime time, bool accurate);
 
 private:
        ContentTimePeriod content_time_period (boost::shared_ptr<dcp::Subtitle> s) const;
 
 private:
        ContentTimePeriod content_time_period (boost::shared_ptr<dcp::Subtitle> s) const;
index 6078141dcfab4d0f84fff1026154106ff389595d..fb7663f5ca8833caadcd02cd46034b8733f07491 100644 (file)
@@ -31,21 +31,21 @@ using boost::shared_ptr;
 
 /** @return Earliest time of content that the next pass() will emit */
 ContentTime
 
 /** @return Earliest time of content that the next pass() will emit */
 ContentTime
-Decoder::position () const
+Decoder::position (shared_ptr<const Film> film) const
 {
        optional<ContentTime> pos;
 
 {
        optional<ContentTime> pos;
 
-       if (video && !video->ignore() && (!pos || video->position() < *pos)) {
-               pos = video->position();
+       if (video && !video->ignore() && (!pos || video->position(film) < *pos)) {
+               pos = video->position(film);
        }
 
        }
 
-       if (audio && !audio->ignore() && (!pos || audio->position() < *pos)) {
-               pos = audio->position();
+       if (audio && !audio->ignore() && (!pos || audio->position(film) < *pos)) {
+               pos = audio->position(film);
        }
 
        BOOST_FOREACH (shared_ptr<TextDecoder> i, text) {
        }
 
        BOOST_FOREACH (shared_ptr<TextDecoder> i, text) {
-               if (!i->ignore() && (!pos || i->position() < *pos)) {
-                       pos = i->position();
+               if (!i->ignore() && (!pos || i->position(film) < *pos)) {
+                       pos = i->position(film);
                }
        }
 
                }
        }
 
@@ -53,7 +53,7 @@ Decoder::position () const
 }
 
 void
 }
 
 void
-Decoder::seek (ContentTime, bool)
+Decoder::seek (shared_ptr<const Film>, ContentTime, bool)
 {
        if (video) {
                video->seek ();
 {
        if (video) {
                video->seek ();
index 55d9cfc64b92172d35e1714708965e4672f430de..a8a67ee72624224afdb4af65db9d4522a7a6f23a 100644 (file)
@@ -34,6 +34,7 @@ class VideoDecoder;
 class AudioDecoder;
 class TextDecoder;
 class DecoderPart;
 class AudioDecoder;
 class TextDecoder;
 class DecoderPart;
+class Film;
 
 /** @class Decoder.
  *  @brief Parent class for decoders of content.
 
 /** @class Decoder.
  *  @brief Parent class for decoders of content.
@@ -52,10 +53,10 @@ public:
        /** Do some decoding and perhaps emit video, audio or subtitle data.
         *  @return true if this decoder will emit no more data unless a seek() happens.
         */
        /** Do some decoding and perhaps emit video, audio or subtitle data.
         *  @return true if this decoder will emit no more data unless a seek() happens.
         */
-       virtual bool pass () = 0;
-       virtual void seek (ContentTime time, bool accurate);
+       virtual bool pass (boost::shared_ptr<const Film> film) = 0;
+       virtual void seek (boost::shared_ptr<const Film> film, ContentTime time, bool accurate);
 
 
-       ContentTime position () const;
+       ContentTime position (boost::shared_ptr<const Film> film) const;
 };
 
 #endif
 };
 
 #endif
index df23ef6f604cb5d476a90f90231a4f9cdeea5c76..b3e16a3f01a48c28284464246fea66da817559ff 100644 (file)
@@ -37,17 +37,17 @@ using boost::shared_ptr;
 using boost::dynamic_pointer_cast;
 
 shared_ptr<Decoder>
 using boost::dynamic_pointer_cast;
 
 shared_ptr<Decoder>
-decoder_factory (shared_ptr<const Content> content, shared_ptr<Log> log, bool fast)
+decoder_factory (shared_ptr<const Film> film, shared_ptr<const Content> content, bool fast)
 {
        shared_ptr<const FFmpegContent> fc = dynamic_pointer_cast<const FFmpegContent> (content);
        if (fc) {
 {
        shared_ptr<const FFmpegContent> fc = dynamic_pointer_cast<const FFmpegContent> (content);
        if (fc) {
-               return shared_ptr<Decoder> (new FFmpegDecoder (fc, log, fast));
+               return shared_ptr<Decoder> (new FFmpegDecoder(film, fc, fast));
        }
 
        shared_ptr<const DCPContent> dc = dynamic_pointer_cast<const DCPContent> (content);
        if (dc) {
                try {
        }
 
        shared_ptr<const DCPContent> dc = dynamic_pointer_cast<const DCPContent> (content);
        if (dc) {
                try {
-                       return shared_ptr<Decoder> (new DCPDecoder (dc, log, fast));
+                       return shared_ptr<Decoder> (new DCPDecoder(dc, fast));
                } catch (KDMError& e) {
                        /* This will be found and reported to the user when the content is examined */
                        return shared_ptr<Decoder>();
                } catch (KDMError& e) {
                        /* This will be found and reported to the user when the content is examined */
                        return shared_ptr<Decoder>();
@@ -56,22 +56,22 @@ decoder_factory (shared_ptr<const Content> content, shared_ptr<Log> log, bool fa
 
        shared_ptr<const ImageContent> ic = dynamic_pointer_cast<const ImageContent> (content);
        if (ic) {
 
        shared_ptr<const ImageContent> ic = dynamic_pointer_cast<const ImageContent> (content);
        if (ic) {
-               return shared_ptr<Decoder> (new ImageDecoder (ic, log));
+               return shared_ptr<Decoder> (new ImageDecoder(ic));
        }
 
        shared_ptr<const StringTextFileContent> rc = dynamic_pointer_cast<const StringTextFileContent> (content);
        if (rc) {
        }
 
        shared_ptr<const StringTextFileContent> rc = dynamic_pointer_cast<const StringTextFileContent> (content);
        if (rc) {
-               return shared_ptr<Decoder> (new StringTextFileDecoder (rc, log));
+               return shared_ptr<Decoder> (new StringTextFileDecoder(rc));
        }
 
        shared_ptr<const DCPSubtitleContent> dsc = dynamic_pointer_cast<const DCPSubtitleContent> (content);
        if (dsc) {
        }
 
        shared_ptr<const DCPSubtitleContent> dsc = dynamic_pointer_cast<const DCPSubtitleContent> (content);
        if (dsc) {
-               return shared_ptr<Decoder> (new DCPSubtitleDecoder (dsc, log));
+               return shared_ptr<Decoder> (new DCPSubtitleDecoder(dsc));
        }
 
        shared_ptr<const VideoMXFContent> vmc = dynamic_pointer_cast<const VideoMXFContent> (content);
        if (vmc) {
        }
 
        shared_ptr<const VideoMXFContent> vmc = dynamic_pointer_cast<const VideoMXFContent> (content);
        if (vmc) {
-               return shared_ptr<Decoder> (new VideoMXFDecoder (vmc, log));
+               return shared_ptr<Decoder> (new VideoMXFDecoder(vmc));
        }
 
        return shared_ptr<Decoder> ();
        }
 
        return shared_ptr<Decoder> ();
index 52a53afd2b34f129fb250087a429e5a149ddd5b8..d4e39da178fd258855e2ef3da8fa7a1ea06235b4 100644 (file)
@@ -21,7 +21,7 @@
 class ImageDecoder;
 
 extern boost::shared_ptr<Decoder> decoder_factory (
 class ImageDecoder;
 
 extern boost::shared_ptr<Decoder> decoder_factory (
+       boost::shared_ptr<const Film> film,
        boost::shared_ptr<const Content> content,
        boost::shared_ptr<const Content> content,
-       boost::shared_ptr<Log> log,
        bool fast
        );
        bool fast
        );
index d8f988388a7bf5a7119ebafb25cde969d3d131bc..3e06204defb5a0e40e92ef8ea1da3ae725aeb912 100644 (file)
@@ -23,9 +23,8 @@
 
 using boost::shared_ptr;
 
 
 using boost::shared_ptr;
 
-DecoderPart::DecoderPart (Decoder* parent, shared_ptr<Log> log)
+DecoderPart::DecoderPart (Decoder* parent)
        : _parent (parent)
        : _parent (parent)
-       , _log (log)
        , _ignore (false)
 {
 
        , _ignore (false)
 {
 
index 0b8b6a43bfdedc89d416aa21df3b60800649b741..7ba2cb2eb67c81f4ee8159e890ebbefce0d09f10 100644 (file)
 
 class Decoder;
 class Log;
 
 class Decoder;
 class Log;
+class Film;
 
 class DecoderPart
 {
 public:
 
 class DecoderPart
 {
 public:
-       DecoderPart (Decoder* parent, boost::shared_ptr<Log> log);
+       DecoderPart (Decoder* parent);
        virtual ~DecoderPart () {}
 
        virtual ~DecoderPart () {}
 
-       virtual ContentTime position () const = 0;
+       virtual ContentTime position (boost::shared_ptr<const Film> film) const = 0;
        virtual void seek () = 0;
 
        void set_ignore (bool i) {
        virtual void seek () = 0;
 
        void set_ignore (bool i) {
@@ -46,7 +47,6 @@ public:
 
 protected:
        Decoder* _parent;
 
 protected:
        Decoder* _parent;
-       boost::shared_ptr<Log> _log;
 
 private:
        bool _ignore;
 
 private:
        bool _ignore;
index 1e6e1c3fb51d21e76b1d7f2c8b058bb97040a2e1..1df318b25275a2a634fe45ef21017e28889859cf 100644 (file)
@@ -35,16 +35,16 @@ using boost::shared_ptr;
 using boost::dynamic_pointer_cast;
 using boost::function;
 
 using boost::dynamic_pointer_cast;
 using boost::function;
 
-Empty::Empty (list<shared_ptr<Piece> > pieces, DCPTime length, function<bool (shared_ptr<Piece>)> part)
+Empty::Empty (shared_ptr<const Film> film, list<shared_ptr<Piece> > pieces, function<bool (shared_ptr<Piece>)> part)
 {
        list<DCPTimePeriod> full;
        BOOST_FOREACH (shared_ptr<Piece> i, pieces) {
                if (part(i)) {
 {
        list<DCPTimePeriod> full;
        BOOST_FOREACH (shared_ptr<Piece> i, pieces) {
                if (part(i)) {
-                       full.push_back (DCPTimePeriod (i->content->position(), i->content->end()));
+                       full.push_back (DCPTimePeriod (i->content->position(), i->content->end(film)));
                }
        }
 
                }
        }
 
-       _periods = subtract (DCPTimePeriod(DCPTime(), length), coalesce(full));
+       _periods = subtract (DCPTimePeriod(DCPTime(), film->length()), coalesce(full));
 
        if (!_periods.empty ()) {
                _position = _periods.front().from;
 
        if (!_periods.empty ()) {
                _position = _periods.front().from;
index 73548f72981c271721f4ef6d661b7e1f4be1bfb5..50f21fc4d5380edebda09c05fcfd58a15f8289f0 100644 (file)
@@ -35,7 +35,7 @@ class Empty
 {
 public:
        Empty () {}
 {
 public:
        Empty () {}
-       Empty (std::list<boost::shared_ptr<Piece> > pieces, DCPTime length, boost::function<bool (boost::shared_ptr<Piece>)> part);
+       Empty (boost::shared_ptr<const Film> film, std::list<boost::shared_ptr<Piece> > pieces, boost::function<bool (boost::shared_ptr<Piece>)> part);
 
        DCPTime position () const {
                return _position;
 
        DCPTime position () const {
                return _position;
index a9df63be77daf5b7e7fcf07539a90beadfa8c4cb..81088a4416cd0e7a838adaf4578e6c1e14b55d3e 100644 (file)
@@ -53,7 +53,7 @@ ExamineContentJob::json_name () const
 void
 ExamineContentJob::run ()
 {
 void
 ExamineContentJob::run ()
 {
-       _content->examine (shared_from_this ());
+       _content->examine (_film, shared_from_this());
        set_progress (1);
        set_state (FINISHED_OK);
 }
        set_progress (1);
        set_state (FINISHED_OK);
 }
index 1502b3de96148d76a94b4d1a8d5f2fb4ea3dd082..3bd08e84a6ea7c1be2f27426e1755171dce484d4 100644 (file)
@@ -113,7 +113,6 @@ FFmpeg::setup_general ()
        /* This might not work too well in some cases of multiple FFmpeg decoders,
           but it's probably good enough.
        */
        /* This might not work too well in some cases of multiple FFmpeg decoders,
           but it's probably good enough.
        */
-       _ffmpeg_log = _ffmpeg_content->film()->log ();
        av_log_set_callback (FFmpeg::ffmpeg_log_callback);
 
        _file_group.set_paths (_ffmpeg_content->paths ());
        av_log_set_callback (FFmpeg::ffmpeg_log_callback);
 
        _file_group.set_paths (_ffmpeg_content->paths ());
@@ -219,10 +218,7 @@ FFmpeg::setup_decoders ()
                                throw DecodeError (N_("could not open decoder"));
                        }
                } else {
                                throw DecodeError (N_("could not open decoder"));
                        }
                } else {
-                       shared_ptr<Log> log = _ffmpeg_log.lock ();
-                       if (log) {
-                               log->log (String::compose ("No codec found for stream %1", i), LogEntry::TYPE_WARNING);
-                       }
+                       dcpomatic_log->log (String::compose ("No codec found for stream %1", i), LogEntry::TYPE_WARNING);
                }
        }
 }
                }
        }
 }
index c7a15619dd0e12d6c4eed919af2567d03932467d..2b494dc9233259afdf2f73e30c1c015777b311ed 100644 (file)
@@ -45,7 +45,7 @@ extern "C" {
 
 #include "i18n.h"
 
 
 #include "i18n.h"
 
-#define LOG_GENERAL(...) film->log()->log (String::compose (__VA_ARGS__), LogEntry::TYPE_GENERAL);
+#define LOG_GENERAL(...) dcpomatic_log->log (String::compose (__VA_ARGS__), LogEntry::TYPE_GENERAL);
 
 using std::string;
 using std::vector;
 
 using std::string;
 using std::vector;
@@ -63,8 +63,8 @@ int const FFmpegContentProperty::SUBTITLE_STREAMS = 100;
 int const FFmpegContentProperty::SUBTITLE_STREAM = 101;
 int const FFmpegContentProperty::FILTERS = 102;
 
 int const FFmpegContentProperty::SUBTITLE_STREAM = 101;
 int const FFmpegContentProperty::FILTERS = 102;
 
-FFmpegContent::FFmpegContent (shared_ptr<const Film> film, boost::filesystem::path p)
-       : Content (film, p)
+FFmpegContent::FFmpegContent (boost::filesystem::path p)
+       : Content (p)
        , _encrypted (false)
 {
 
        , _encrypted (false)
 {
 
@@ -81,8 +81,8 @@ get_optional_enum (cxml::ConstNodePtr node, string name)
        return static_cast<T>(*v);
 }
 
        return static_cast<T>(*v);
 }
 
-FFmpegContent::FFmpegContent (shared_ptr<const Film> film, cxml::ConstNodePtr node, int version, list<string>& notes)
-       : Content (film, node)
+FFmpegContent::FFmpegContent (cxml::ConstNodePtr node, int version, list<string>& notes)
+       : Content (node)
 {
        video = VideoContent::from_xml (this, node, version);
        audio = AudioContent::from_xml (this, node, version);
 {
        video = VideoContent::from_xml (this, node, version);
        audio = AudioContent::from_xml (this, node, version);
@@ -130,8 +130,8 @@ FFmpegContent::FFmpegContent (shared_ptr<const Film> film, cxml::ConstNodePtr no
        _encrypted = node->optional_bool_child("Encrypted").get_value_or(false);
 }
 
        _encrypted = node->optional_bool_child("Encrypted").get_value_or(false);
 }
 
-FFmpegContent::FFmpegContent (shared_ptr<const Film> film, vector<shared_ptr<Content> > c)
-       : Content (film, c)
+FFmpegContent::FFmpegContent (vector<shared_ptr<Content> > c)
+       : Content (c)
 {
        vector<shared_ptr<Content> >::const_iterator i = c.begin ();
 
 {
        vector<shared_ptr<Content> >::const_iterator i = c.begin ();
 
@@ -258,14 +258,14 @@ FFmpegContent::as_xml (xmlpp::Node* node, bool with_paths) const
 }
 
 void
 }
 
 void
-FFmpegContent::examine (shared_ptr<Job> job)
+FFmpegContent::examine (shared_ptr<const Film> film, shared_ptr<Job> job)
 {
        ChangeSignaller<Content> cc1 (this, FFmpegContentProperty::SUBTITLE_STREAMS);
        ChangeSignaller<Content> cc2 (this, FFmpegContentProperty::SUBTITLE_STREAM);
 
        job->set_progress_unknown ();
 
 {
        ChangeSignaller<Content> cc1 (this, FFmpegContentProperty::SUBTITLE_STREAMS);
        ChangeSignaller<Content> cc2 (this, FFmpegContentProperty::SUBTITLE_STREAM);
 
        job->set_progress_unknown ();
 
-       Content::examine (job);
+       Content::examine (film, job);
 
        shared_ptr<FFmpegExaminer> examiner (new FFmpegExaminer (shared_from_this (), job));
 
 
        shared_ptr<FFmpegExaminer> examiner (new FFmpegExaminer (shared_from_this (), job));
 
@@ -309,7 +309,7 @@ FFmpegContent::examine (shared_ptr<Job> job)
 
                        AudioStreamPtr as = audio->streams().front();
                        AudioMapping m = as->mapping ();
 
                        AudioStreamPtr as = audio->streams().front();
                        AudioMapping m = as->mapping ();
-                       film()->make_audio_mapping_default (m, first_path);
+                       film->make_audio_mapping_default (m, first_path);
                        as->set_mapping (m);
                }
 
                        as->set_mapping (m);
                }
 
@@ -400,11 +400,11 @@ operator!= (FFmpegStream const & a, FFmpegStream const & b)
 }
 
 DCPTime
 }
 
 DCPTime
-FFmpegContent::full_length () const
+FFmpegContent::full_length (shared_ptr<const Film> film) const
 {
 {
-       FrameRateChange const frc (active_video_frame_rate (), film()->video_frame_rate ());
+       FrameRateChange const frc (active_video_frame_rate(film), film->video_frame_rate());
        if (video) {
        if (video) {
-               return DCPTime::from_frames (llrint (video->length_after_3d_combine() * frc.factor()), film()->video_frame_rate());
+               return DCPTime::from_frames (llrint (video->length_after_3d_combine() * frc.factor()), film->video_frame_rate());
        }
 
        DCPOMATIC_ASSERT (audio);
        }
 
        DCPOMATIC_ASSERT (audio);
@@ -490,7 +490,7 @@ FFmpegContent::set_default_colour_conversion ()
 }
 
 void
 }
 
 void
-FFmpegContent::add_properties (list<UserProperty>& p) const
+FFmpegContent::add_properties (shared_ptr<const Film> film, list<UserProperty>& p) const
 {
        Content::add_properties (p);
 
 {
        Content::add_properties (p);
 
@@ -627,7 +627,7 @@ FFmpegContent::add_properties (list<UserProperty>& p) const
        }
 
        if (audio) {
        }
 
        if (audio) {
-               audio->add_properties (p);
+               audio->add_properties (film, p);
        }
 }
 
        }
 }
 
index d2e164f1d5352e4ce844b7e4dbaa5dfa4f783f5f..8bd5ef4fa9b05ab1ddd80dfc433fa94d793ddef7 100644 (file)
@@ -46,20 +46,20 @@ public:
 class FFmpegContent : public Content
 {
 public:
 class FFmpegContent : public Content
 {
 public:
-       FFmpegContent (boost::shared_ptr<const Film>, boost::filesystem::path);
-       FFmpegContent (boost::shared_ptr<const Film>, cxml::ConstNodePtr, int version, std::list<std::string> &);
-       FFmpegContent (boost::shared_ptr<const Film>, std::vector<boost::shared_ptr<Content> >);
+       FFmpegContent (boost::filesystem::path);
+       FFmpegContent (cxml::ConstNodePtr, int version, std::list<std::string> &);
+       FFmpegContent (std::vector<boost::shared_ptr<Content> >);
 
        boost::shared_ptr<FFmpegContent> shared_from_this () {
                return boost::dynamic_pointer_cast<FFmpegContent> (Content::shared_from_this ());
        }
 
 
        boost::shared_ptr<FFmpegContent> shared_from_this () {
                return boost::dynamic_pointer_cast<FFmpegContent> (Content::shared_from_this ());
        }
 
-       void examine (boost::shared_ptr<Job>);
+       void examine (boost::shared_ptr<const Film> film, boost::shared_ptr<Job>);
        void take_settings_from (boost::shared_ptr<const Content> c);
        std::string summary () const;
        std::string technical_summary () const;
        void as_xml (xmlpp::Node *, bool with_paths) const;
        void take_settings_from (boost::shared_ptr<const Content> c);
        std::string summary () const;
        std::string technical_summary () const;
        void as_xml (xmlpp::Node *, bool with_paths) const;
-       DCPTime full_length () const;
+       DCPTime full_length (boost::shared_ptr<const Film> film) const;
 
        std::string identifier () const;
 
 
        std::string identifier () const;
 
@@ -104,7 +104,7 @@ public:
        }
 
 private:
        }
 
 private:
-       void add_properties (std::list<UserProperty> &) const;
+       void add_properties (boost::shared_ptr<const Film> film, std::list<UserProperty> &) const;
 
        friend struct ffmpeg_pts_offset_test;
        friend struct audio_sampling_rate_test;
 
        friend struct ffmpeg_pts_offset_test;
        friend struct audio_sampling_rate_test;
index 9076464ac73aaa318566a1d1cb8f089be8b1173b..0e40f128b4e48886ea1f6f66dee0139f4b757115 100644 (file)
@@ -58,10 +58,10 @@ extern "C" {
 
 #include "i18n.h"
 
 
 #include "i18n.h"
 
-#define LOG_GENERAL(...) _log->log (String::compose (__VA_ARGS__), LogEntry::TYPE_GENERAL);
-#define LOG_ERROR(...) _log->log (String::compose (__VA_ARGS__), LogEntry::TYPE_ERROR);
-#define LOG_WARNING_NC(...) _log->log (__VA_ARGS__, LogEntry::TYPE_WARNING);
-#define LOG_WARNING(...) _log->log (String::compose (__VA_ARGS__), LogEntry::TYPE_WARNING);
+#define LOG_GENERAL(...) dcpomatic_log->log (String::compose (__VA_ARGS__), LogEntry::TYPE_GENERAL);
+#define LOG_ERROR(...) dcpomatic_log->log (String::compose (__VA_ARGS__), LogEntry::TYPE_ERROR);
+#define LOG_WARNING_NC(...) dcpomatic_log->log (__VA_ARGS__, LogEntry::TYPE_WARNING);
+#define LOG_WARNING(...) dcpomatic_log->log (String::compose (__VA_ARGS__), LogEntry::TYPE_WARNING);
 
 using std::cout;
 using std::string;
 
 using std::cout;
 using std::string;
@@ -78,14 +78,13 @@ using boost::optional;
 using boost::dynamic_pointer_cast;
 using dcp::Size;
 
 using boost::dynamic_pointer_cast;
 using dcp::Size;
 
-FFmpegDecoder::FFmpegDecoder (shared_ptr<const FFmpegContent> c, shared_ptr<Log> log, bool fast)
+FFmpegDecoder::FFmpegDecoder (shared_ptr<const Film> film, shared_ptr<const FFmpegContent> c, bool fast)
        : FFmpeg (c)
        : FFmpeg (c)
-       , _log (log)
        , _have_current_subtitle (false)
 {
        if (c->video) {
        , _have_current_subtitle (false)
 {
        if (c->video) {
-               video.reset (new VideoDecoder (this, c, log));
-               _pts_offset = pts_offset (c->ffmpeg_audio_streams(), c->first_video(), c->active_video_frame_rate());
+               video.reset (new VideoDecoder (this, c));
+               _pts_offset = pts_offset (c->ffmpeg_audio_streams(), c->first_video(), c->active_video_frame_rate(film));
                /* It doesn't matter what size or pixel format this is, it just needs to be black */
                _black_image.reset (new Image (AV_PIX_FMT_RGB24, dcp::Size (128, 128), true));
                _black_image->make_black ();
                /* It doesn't matter what size or pixel format this is, it just needs to be black */
                _black_image.reset (new Image (AV_PIX_FMT_RGB24, dcp::Size (128, 128), true));
                _black_image->make_black ();
@@ -94,19 +93,19 @@ FFmpegDecoder::FFmpegDecoder (shared_ptr<const FFmpegContent> c, shared_ptr<Log>
        }
 
        if (c->audio) {
        }
 
        if (c->audio) {
-               audio.reset (new AudioDecoder (this, c->audio, log, fast));
+               audio.reset (new AudioDecoder (this, c->audio, fast));
        }
 
        if (c->only_text()) {
                /* XXX: this time here should be the time of the first subtitle, not 0 */
        }
 
        if (c->only_text()) {
                /* XXX: this time here should be the time of the first subtitle, not 0 */
-               text.push_back (shared_ptr<TextDecoder> (new TextDecoder (this, c->only_text(), log, ContentTime())));
+               text.push_back (shared_ptr<TextDecoder> (new TextDecoder (this, c->only_text(), ContentTime())));
        }
 
        _next_time.resize (_format_context->nb_streams);
 }
 
 void
        }
 
        _next_time.resize (_format_context->nb_streams);
 }
 
 void
-FFmpegDecoder::flush ()
+FFmpegDecoder::flush (shared_ptr<const Film> film)
 {
        /* Get any remaining frames */
 
 {
        /* Get any remaining frames */
 
@@ -115,29 +114,29 @@ FFmpegDecoder::flush ()
 
        /* XXX: should we reset _packet.data and size after each *_decode_* call? */
 
 
        /* XXX: should we reset _packet.data and size after each *_decode_* call? */
 
-       while (video && decode_video_packet ()) {}
+       while (video && decode_video_packet(film)) {}
 
        if (audio) {
 
        if (audio) {
-               decode_audio_packet ();
+               decode_audio_packet (film);
        }
 
        /* Make sure all streams are the same length and round up to the next video frame */
 
        }
 
        /* Make sure all streams are the same length and round up to the next video frame */
 
-       FrameRateChange const frc = _ffmpeg_content->film()->active_frame_rate_change(_ffmpeg_content->position());
-       ContentTime full_length (_ffmpeg_content->full_length(), frc);
+       FrameRateChange const frc = film->active_frame_rate_change(_ffmpeg_content->position());
+       ContentTime full_length (_ffmpeg_content->full_length(film), frc);
        full_length = full_length.ceil (frc.source);
        if (video) {
                double const vfr = _ffmpeg_content->video_frame_rate().get();
                Frame const f = full_length.frames_round (vfr);
        full_length = full_length.ceil (frc.source);
        if (video) {
                double const vfr = _ffmpeg_content->video_frame_rate().get();
                Frame const f = full_length.frames_round (vfr);
-               Frame v = video->position().frames_round (vfr) + 1;
+               Frame v = video->position(film).frames_round (vfr) + 1;
                while (v < f) {
                while (v < f) {
-                       video->emit (shared_ptr<const ImageProxy> (new RawImageProxy (_black_image)), v);
+                       video->emit (film, shared_ptr<const ImageProxy> (new RawImageProxy (_black_image)), v);
                        ++v;
                }
        }
 
        BOOST_FOREACH (shared_ptr<FFmpegAudioStream> i, _ffmpeg_content->ffmpeg_audio_streams ()) {
                        ++v;
                }
        }
 
        BOOST_FOREACH (shared_ptr<FFmpegAudioStream> i, _ffmpeg_content->ffmpeg_audio_streams ()) {
-               ContentTime a = audio->stream_position(i);
+               ContentTime a = audio->stream_position(film, i);
                /* Unfortunately if a is 0 that really means that we don't know the stream position since
                   there has been no data on it since the last seek.  In this case we'll just do nothing
                   here.  I'm not sure if that's the right idea.
                /* Unfortunately if a is 0 that really means that we don't know the stream position since
                   there has been no data on it since the last seek.  In this case we'll just do nothing
                   here.  I'm not sure if that's the right idea.
@@ -147,7 +146,7 @@ FFmpegDecoder::flush ()
                                ContentTime to_do = min (full_length - a, ContentTime::from_seconds (0.1));
                                shared_ptr<AudioBuffers> silence (new AudioBuffers (i->channels(), to_do.frames_ceil (i->frame_rate())));
                                silence->make_silent ();
                                ContentTime to_do = min (full_length - a, ContentTime::from_seconds (0.1));
                                shared_ptr<AudioBuffers> silence (new AudioBuffers (i->channels(), to_do.frames_ceil (i->frame_rate())));
                                silence->make_silent ();
-                               audio->emit (i, silence, a);
+                               audio->emit (film, i, silence, a);
                                a += to_do;
                        }
                }
                                a += to_do;
                        }
                }
@@ -159,7 +158,7 @@ FFmpegDecoder::flush ()
 }
 
 bool
 }
 
 bool
-FFmpegDecoder::pass ()
+FFmpegDecoder::pass (shared_ptr<const Film> film)
 {
        int r = av_read_frame (_format_context, &_packet);
 
 {
        int r = av_read_frame (_format_context, &_packet);
 
@@ -175,7 +174,7 @@ FFmpegDecoder::pass ()
                        LOG_ERROR (N_("error on av_read_frame (%1) (%2)"), &buf[0], r);
                }
 
                        LOG_ERROR (N_("error on av_read_frame (%1) (%2)"), &buf[0], r);
                }
 
-               flush ();
+               flush (film);
                return true;
        }
 
                return true;
        }
 
@@ -183,11 +182,11 @@ FFmpegDecoder::pass ()
        shared_ptr<const FFmpegContent> fc = _ffmpeg_content;
 
        if (_video_stream && si == _video_stream.get() && !video->ignore()) {
        shared_ptr<const FFmpegContent> fc = _ffmpeg_content;
 
        if (_video_stream && si == _video_stream.get() && !video->ignore()) {
-               decode_video_packet ();
+               decode_video_packet (film);
        } else if (fc->subtitle_stream() && fc->subtitle_stream()->uses_index(_format_context, si) && !only_text()->ignore()) {
                decode_subtitle_packet ();
        } else {
        } else if (fc->subtitle_stream() && fc->subtitle_stream()->uses_index(_format_context, si) && !only_text()->ignore()) {
                decode_subtitle_packet ();
        } else {
-               decode_audio_packet ();
+               decode_audio_packet (film);
        }
 
        av_packet_unref (&_packet);
        }
 
        av_packet_unref (&_packet);
@@ -341,9 +340,9 @@ FFmpegDecoder::bytes_per_audio_sample (shared_ptr<FFmpegAudioStream> stream) con
 }
 
 void
 }
 
 void
-FFmpegDecoder::seek (ContentTime time, bool accurate)
+FFmpegDecoder::seek (shared_ptr<const Film> film, ContentTime time, bool accurate)
 {
 {
-       Decoder::seek (time, accurate);
+       Decoder::seek (film, time, accurate);
 
        /* If we are doing an `accurate' seek, we need to use pre-roll, as
           we don't really know what the seek will give us.
 
        /* If we are doing an `accurate' seek, we need to use pre-roll, as
           we don't really know what the seek will give us.
@@ -396,7 +395,7 @@ FFmpegDecoder::seek (ContentTime time, bool accurate)
 }
 
 void
 }
 
 void
-FFmpegDecoder::decode_audio_packet ()
+FFmpegDecoder::decode_audio_packet (shared_ptr<const Film> film)
 {
        /* Audio packets can contain multiple frames, so we may have to call avcodec_decode_audio4
           several times.
 {
        /* Audio packets can contain multiple frames, so we may have to call avcodec_decode_audio4
           several times.
@@ -479,7 +478,7 @@ FFmpegDecoder::decode_audio_packet ()
 
                        /* Give this data provided there is some, and its time is sane */
                        if (ct >= ContentTime() && data->frames() > 0) {
 
                        /* Give this data provided there is some, and its time is sane */
                        if (ct >= ContentTime() && data->frames() > 0) {
-                               audio->emit (*stream, data, ct);
+                               audio->emit (film, *stream, data, ct);
                        }
                }
 
                        }
                }
 
@@ -489,7 +488,7 @@ FFmpegDecoder::decode_audio_packet ()
 }
 
 bool
 }
 
 bool
-FFmpegDecoder::decode_video_packet ()
+FFmpegDecoder::decode_video_packet (shared_ptr<const Film> film)
 {
        DCPOMATIC_ASSERT (_video_stream);
 
 {
        DCPOMATIC_ASSERT (_video_stream);
 
@@ -527,8 +526,9 @@ FFmpegDecoder::decode_video_packet ()
                        double const pts = i->second * av_q2d (_format_context->streams[_video_stream.get()]->time_base) + _pts_offset.seconds ();
 
                        video->emit (
                        double const pts = i->second * av_q2d (_format_context->streams[_video_stream.get()]->time_base) + _pts_offset.seconds ();
 
                        video->emit (
+                               film,
                                shared_ptr<ImageProxy> (new RawImageProxy (image)),
                                shared_ptr<ImageProxy> (new RawImageProxy (image)),
-                               llrint(pts * _ffmpeg_content->active_video_frame_rate())
+                               llrint(pts * _ffmpeg_content->active_video_frame_rate(film))
                                );
                } else {
                        LOG_WARNING_NC ("Dropping frame without PTS");
                                );
                } else {
                        LOG_WARNING_NC ("Dropping frame without PTS");
index 16a55d5589139d56c3555b2c3a3f7b1f11a8760d..408ce30a7b731b94fa5e07bf4f53056491a8b2c7 100644 (file)
@@ -45,21 +45,21 @@ struct ffmpeg_pts_offset_test;
 class FFmpegDecoder : public FFmpeg, public Decoder
 {
 public:
 class FFmpegDecoder : public FFmpeg, public Decoder
 {
 public:
-       FFmpegDecoder (boost::shared_ptr<const FFmpegContent>, boost::shared_ptr<Log> log, bool fast);
+       FFmpegDecoder (boost::shared_ptr<const Film> film, boost::shared_ptr<const FFmpegContent>, bool fast);
 
 
-       bool pass ();
-       void seek (ContentTime time, bool);
+       bool pass (boost::shared_ptr<const Film> film);
+       void seek (boost::shared_ptr<const Film> film, ContentTime time, bool);
 
 private:
        friend struct ::ffmpeg_pts_offset_test;
 
 
 private:
        friend struct ::ffmpeg_pts_offset_test;
 
-       void flush ();
+       void flush (boost::shared_ptr<const Film> film);
 
        AVSampleFormat audio_sample_format (boost::shared_ptr<FFmpegAudioStream> stream) const;
        int bytes_per_audio_sample (boost::shared_ptr<FFmpegAudioStream> stream) const;
 
 
        AVSampleFormat audio_sample_format (boost::shared_ptr<FFmpegAudioStream> stream) const;
        int bytes_per_audio_sample (boost::shared_ptr<FFmpegAudioStream> stream) const;
 
-       bool decode_video_packet ();
-       void decode_audio_packet ();
+       bool decode_video_packet (boost::shared_ptr<const Film> film);
+       void decode_audio_packet (boost::shared_ptr<const Film> film);
        void decode_subtitle_packet ();
 
        void decode_bitmap_subtitle (AVSubtitleRect const * rect, ContentTime from);
        void decode_subtitle_packet ();
 
        void decode_bitmap_subtitle (AVSubtitleRect const * rect, ContentTime from);
@@ -68,8 +68,6 @@ private:
        void maybe_add_subtitle ();
        boost::shared_ptr<AudioBuffers> deinterleave_audio (boost::shared_ptr<FFmpegAudioStream> stream) const;
 
        void maybe_add_subtitle ();
        boost::shared_ptr<AudioBuffers> deinterleave_audio (boost::shared_ptr<FFmpegAudioStream> stream) const;
 
-       boost::shared_ptr<Log> _log;
-
        std::list<boost::shared_ptr<VideoFilterGraph> > _filter_graphs;
        boost::mutex _filter_graphs_mutex;
 
        std::list<boost::shared_ptr<VideoFilterGraph> > _filter_graphs;
        boost::mutex _filter_graphs_mutex;
 
index 426c7f81ddeb30bb0b90b4a26db8e6edacf8c5d6..4d6b3d7e3b4fa132bf54b9e75fa568246f1e3615 100644 (file)
@@ -975,7 +975,7 @@ Film::signal_change (ChangeType type, Property p)
                        /* We want to call Playlist::maybe_sequence but this must happen after the
                           main signal emission (since the butler will see that emission and un-suspend itself).
                        */
                        /* We want to call Playlist::maybe_sequence but this must happen after the
                           main signal emission (since the butler will see that emission and un-suspend itself).
                        */
-                       emit (boost::bind(&Playlist::maybe_sequence, _playlist.get()));
+                       emit (boost::bind(&Playlist::maybe_sequence, _playlist.get(), shared_from_this()));
                }
        } else {
                Change (type, p);
                }
        } else {
                Change (type, p);
@@ -1116,7 +1116,7 @@ Film::maybe_add_content (weak_ptr<Job> j, weak_ptr<Content> c, bool disable_audi
 
        if (Config::instance()->automatic_audio_analysis() && content->audio && !disable_audio_analysis) {
                shared_ptr<Playlist> playlist (new Playlist);
 
        if (Config::instance()->automatic_audio_analysis() && content->audio && !disable_audio_analysis) {
                shared_ptr<Playlist> playlist (new Playlist);
-               playlist->add (content);
+               playlist->add (shared_from_this(), content);
                boost::signals2::connection c;
                JobManager::instance()->analyse_audio (
                        shared_from_this(), playlist, false, c, bind (&Film::audio_analysis_finished, this)
                boost::signals2::connection c;
                JobManager::instance()->analyse_audio (
                        shared_from_this(), playlist, false, c, bind (&Film::audio_analysis_finished, this)
@@ -1130,9 +1130,9 @@ Film::add_content (shared_ptr<Content> c)
 {
        /* Add {video,subtitle} content after any existing {video,subtitle} content */
        if (c->video) {
 {
        /* Add {video,subtitle} content after any existing {video,subtitle} content */
        if (c->video) {
-               c->set_position (_playlist->video_end());
+               c->set_position (shared_from_this(), _playlist->video_end(shared_from_this()));
        } else if (!c->text.empty()) {
        } else if (!c->text.empty()) {
-               c->set_position (_playlist->text_end());
+               c->set_position (shared_from_this(), _playlist->text_end(shared_from_this()));
        }
 
        if (_template_film) {
        }
 
        if (_template_film) {
@@ -1142,7 +1142,7 @@ Film::add_content (shared_ptr<Content> c)
                }
        }
 
                }
        }
 
-       _playlist->add (c);
+       _playlist->add (shared_from_this(), c);
 }
 
 void
 }
 
 void
@@ -1154,20 +1154,20 @@ Film::remove_content (shared_ptr<Content> c)
 void
 Film::move_content_earlier (shared_ptr<Content> c)
 {
 void
 Film::move_content_earlier (shared_ptr<Content> c)
 {
-       _playlist->move_earlier (c);
+       _playlist->move_earlier (shared_from_this(), c);
 }
 
 void
 Film::move_content_later (shared_ptr<Content> c)
 {
 }
 
 void
 Film::move_content_later (shared_ptr<Content> c)
 {
-       _playlist->move_later (c);
+       _playlist->move_later (shared_from_this(), c);
 }
 
 /** @return length of the film from time 0 to the last thing on the playlist */
 DCPTime
 Film::length () const
 {
 }
 
 /** @return length of the film from time 0 to the last thing on the playlist */
 DCPTime
 Film::length () const
 {
-       return _playlist->length().ceil(video_frame_rate());
+       return _playlist->length(shared_from_this()).ceil(video_frame_rate());
 }
 
 int
 }
 
 int
@@ -1379,7 +1379,7 @@ Film::make_kdms (
 uint64_t
 Film::required_disk_space () const
 {
 uint64_t
 Film::required_disk_space () const
 {
-       return _playlist->required_disk_space (j2k_bandwidth(), audio_channels(), audio_frame_rate());
+       return _playlist->required_disk_space (shared_from_this(), j2k_bandwidth(), audio_channels(), audio_frame_rate());
 }
 
 /** This method checks the disk that the Film is on and tries to decide whether or not
 }
 
 /** This method checks the disk that the Film is on and tries to decide whether or not
@@ -1513,7 +1513,7 @@ Film::audio_output_names () const
 void
 Film::repeat_content (ContentList c, int n)
 {
 void
 Film::repeat_content (ContentList c, int n)
 {
-       _playlist->repeat (c, n);
+       _playlist->repeat (shared_from_this(), c, n);
 }
 
 void
 }
 
 void
@@ -1554,7 +1554,7 @@ Film::reels () const
                        }
                }
 
                        }
                }
 
-               DCPTime video_end = last_video ? last_video->end() : DCPTime(0);
+               DCPTime video_end = last_video ? last_video->end(shared_from_this()) : DCPTime(0);
                if (last_split) {
                        /* Definitely go from the last split to the end of the video content */
                        p.push_back (DCPTimePeriod (last_split.get(), video_end));
                if (last_split) {
                        /* Definitely go from the last split to the end of the video content */
                        p.push_back (DCPTimePeriod (last_split.get(), video_end));
@@ -1589,7 +1589,7 @@ Film::reels () const
 string
 Film::content_summary (DCPTimePeriod period) const
 {
 string
 Film::content_summary (DCPTimePeriod period) const
 {
-       return _playlist->content_summary (period);
+       return _playlist->content_summary (shared_from_this(), period);
 }
 
 void
 }
 
 void
index 9e0bb09b5925a0a14f76f9afce703c7fb5b38ea7..55ffac4f251f786ba9393307d1df24e561e0a785 100644 (file)
@@ -40,8 +40,7 @@ using std::list;
 using std::vector;
 using boost::shared_ptr;
 
 using std::vector;
 using boost::shared_ptr;
 
-ImageContent::ImageContent (shared_ptr<const Film> film, boost::filesystem::path p)
-       : Content (film)
+ImageContent::ImageContent (boost::filesystem::path p)
 {
        video.reset (new VideoContent (this));
 
 {
        video.reset (new VideoContent (this));
 
@@ -55,8 +54,8 @@ ImageContent::ImageContent (shared_ptr<const Film> film, boost::filesystem::path
 }
 
 
 }
 
 
-ImageContent::ImageContent (shared_ptr<const Film> film, cxml::ConstNodePtr node, int version)
-       : Content (film, node)
+ImageContent::ImageContent (cxml::ConstNodePtr node, int version)
+       : Content (node)
 {
        video = VideoContent::from_xml (this, node, version);
 }
 {
        video = VideoContent::from_xml (this, node, version);
 }
@@ -102,7 +101,7 @@ ImageContent::as_xml (xmlpp::Node* node, bool with_paths) const
 }
 
 void
 }
 
 void
-ImageContent::examine (shared_ptr<Job> job)
+ImageContent::examine (shared_ptr<const Film> film, shared_ptr<Job> job)
 {
        if (_path_to_scan) {
                job->sub (_("Scanning image files"));
 {
        if (_path_to_scan) {
                job->sub (_("Scanning image files"));
@@ -126,10 +125,7 @@ ImageContent::examine (shared_ptr<Job> job)
                set_paths (paths);
        }
 
                set_paths (paths);
        }
 
-       Content::examine (job);
-
-       shared_ptr<const Film> film = _film.lock ();
-       DCPOMATIC_ASSERT (film);
+       Content::examine (film, job);
 
        shared_ptr<ImageExaminer> examiner (new ImageExaminer (film, shared_from_this(), job));
        video->take_from_examiner (examiner);
 
        shared_ptr<ImageExaminer> examiner (new ImageExaminer (film, shared_from_this(), job));
        video->take_from_examiner (examiner);
@@ -137,12 +133,10 @@ ImageContent::examine (shared_ptr<Job> job)
 }
 
 DCPTime
 }
 
 DCPTime
-ImageContent::full_length () const
+ImageContent::full_length (shared_ptr<const Film> film) const
 {
 {
-       shared_ptr<const Film> film = _film.lock ();
-       DCPOMATIC_ASSERT (film);
-       FrameRateChange const frc (active_video_frame_rate(), film->video_frame_rate());
-       return DCPTime::from_frames (llrint (video->length_after_3d_combine() * frc.factor ()), film->video_frame_rate ());
+       FrameRateChange const frc (active_video_frame_rate(film), film->video_frame_rate());
+       return DCPTime::from_frames (llrint(video->length_after_3d_combine() * frc.factor()), film->video_frame_rate());
 }
 
 string
 }
 
 string
index eeaf1e2b02bea67a346928ba141e1a3dc2c28902..bc0f331515f861f71134706c661b246f7efd8b2e 100644 (file)
 class ImageContent : public Content
 {
 public:
 class ImageContent : public Content
 {
 public:
-       ImageContent (boost::shared_ptr<const Film>, boost::filesystem::path);
-       ImageContent (boost::shared_ptr<const Film>, cxml::ConstNodePtr, int);
+       ImageContent (boost::filesystem::path);
+       ImageContent (cxml::ConstNodePtr, int);
 
        boost::shared_ptr<ImageContent> shared_from_this () {
                return boost::dynamic_pointer_cast<ImageContent> (Content::shared_from_this ());
        };
 
 
        boost::shared_ptr<ImageContent> shared_from_this () {
                return boost::dynamic_pointer_cast<ImageContent> (Content::shared_from_this ());
        };
 
-       void examine (boost::shared_ptr<Job>);
+       void examine (boost::shared_ptr<const Film> film, boost::shared_ptr<Job>);
        std::string summary () const;
        std::string technical_summary () const;
        void as_xml (xmlpp::Node *, bool with_paths) const;
        std::string summary () const;
        std::string technical_summary () const;
        void as_xml (xmlpp::Node *, bool with_paths) const;
-       DCPTime full_length () const;
+       DCPTime full_length (boost::shared_ptr<const Film> film) const;
 
        std::string identifier () const;
 
 
        std::string identifier () const;
 
index e06f6023d54a8d35b1203f81eef72e823ab9ed0d..ce8843b0d76b9c45c08d239ac1d6be4024e5bc5c 100644 (file)
@@ -36,15 +36,15 @@ using std::cout;
 using boost::shared_ptr;
 using dcp::Size;
 
 using boost::shared_ptr;
 using dcp::Size;
 
-ImageDecoder::ImageDecoder (shared_ptr<const ImageContent> c, shared_ptr<Log> log)
+ImageDecoder::ImageDecoder (shared_ptr<const ImageContent> c)
        : _image_content (c)
        , _frame_video_position (0)
 {
        : _image_content (c)
        , _frame_video_position (0)
 {
-       video.reset (new VideoDecoder (this, c, log));
+       video.reset (new VideoDecoder (this, c));
 }
 
 bool
 }
 
 bool
-ImageDecoder::pass ()
+ImageDecoder::pass (boost::shared_ptr<const Film> film)
 {
        if (_frame_video_position >= _image_content->video->length()) {
                return true;
 {
        if (_frame_video_position >= _image_content->video->length()) {
                return true;
@@ -71,14 +71,14 @@ ImageDecoder::pass ()
                }
        }
 
                }
        }
 
-       video->emit (_image, _frame_video_position);
+       video->emit (film, _image, _frame_video_position);
        ++_frame_video_position;
        return false;
 }
 
 void
        ++_frame_video_position;
        return false;
 }
 
 void
-ImageDecoder::seek (ContentTime time, bool accurate)
+ImageDecoder::seek (shared_ptr<const Film> film, ContentTime time, bool accurate)
 {
 {
-       Decoder::seek (time, accurate);
-       _frame_video_position = time.frames_round (_image_content->active_video_frame_rate ());
+       Decoder::seek (film, time, accurate);
+       _frame_video_position = time.frames_round (_image_content->active_video_frame_rate(film));
 }
 }
index 140032317f9fb331147c31ede4e4a998f73607e2..25ad9f07f6de365eed3d3796e41e47c96d2d0145 100644 (file)
@@ -27,14 +27,14 @@ class ImageProxy;
 class ImageDecoder : public Decoder
 {
 public:
 class ImageDecoder : public Decoder
 {
 public:
-       ImageDecoder (boost::shared_ptr<const ImageContent> c, boost::shared_ptr<Log> log);
+       ImageDecoder (boost::shared_ptr<const ImageContent> c);
 
        boost::shared_ptr<const ImageContent> content () {
                return _image_content;
        }
 
 
        boost::shared_ptr<const ImageContent> content () {
                return _image_content;
        }
 
-       bool pass ();
-       void seek (ContentTime, bool);
+       bool pass (boost::shared_ptr<const Film> film);
+       void seek (boost::shared_ptr<const Film> film, ContentTime, bool);
 
 private:
 
 
 private:
 
index e3ffd1cadcc05f4f114e107df4e870d46ce0a3f6..8f7794aed8f48cb265eda768a8b954cb07280bf8 100644 (file)
@@ -35,6 +35,8 @@ using std::string;
 using std::cout;
 using boost::shared_ptr;
 
 using std::cout;
 using boost::shared_ptr;
 
+boost::shared_ptr<Log> dcpomatic_log;
+
 Log::Log ()
        : _types (0)
 {
 Log::Log ()
        : _types (0)
 {
index 65d0229e981876a2e1741f580ce51460d4aa214d..636de6a583e0172b6d8d410147b1b59bcf5e3d0d 100644 (file)
@@ -66,4 +66,6 @@ private:
        boost::signals2::scoped_connection _config_connection;
 };
 
        boost::signals2::scoped_connection _config_connection;
 };
 
+extern boost::shared_ptr<Log> dcpomatic_log;
+
 #endif
 #endif
index 54077d96b0c5777bf63fafd7d4ece2e3c7275749..4c75ac0c3e4e567c6baf73ecf5a490d4ccba6075 100644 (file)
 using boost::shared_ptr;
 using boost::function;
 
 using boost::shared_ptr;
 using boost::function;
 
-ContentList overlaps (ContentList cl, function<bool (shared_ptr<const Content>)> part, DCPTime from, DCPTime to)
+ContentList overlaps (shared_ptr<const Film> film, ContentList cl, function<bool (shared_ptr<const Content>)> part, DCPTime from, DCPTime to)
 {
        ContentList overlaps;
        DCPTimePeriod period (from, to);
        BOOST_FOREACH (shared_ptr<Content> i, cl) {
 {
        ContentList overlaps;
        DCPTimePeriod period (from, to);
        BOOST_FOREACH (shared_ptr<Content> i, cl) {
-               if (part(i) && DCPTimePeriod(i->position(), i->end()).overlap(period)) {
+               if (part(i) && DCPTimePeriod(i->position(), i->end(film)).overlap(period)) {
                        overlaps.push_back (i);
                }
        }
                        overlaps.push_back (i);
                }
        }
index 7dd9802c3827ab66bb85fa23bab8d6d95e54b5ba..be3edf9d42559bae365c3e6f364a8572dd4705cf 100644 (file)
 #include "dcpomatic_time.h"
 
 class ContentPart;
 #include "dcpomatic_time.h"
 
 class ContentPart;
+class Film;
 
 /** @return Pieces of content with a given part (video, audio,
  *  subtitle) that overlap a specified time range in the given
  *  ContentList
  */
 ContentList overlaps (
 
 /** @return Pieces of content with a given part (video, audio,
  *  subtitle) that overlap a specified time range in the given
  *  ContentList
  */
 ContentList overlaps (
-       ContentList cl, boost::function<bool (boost::shared_ptr<const Content>)> part, DCPTime from, DCPTime to
+       boost::shared_ptr<const Film> film, ContentList cl, boost::function<bool (boost::shared_ptr<const Content>)> part, DCPTime from, DCPTime to
        );
        );
index a7440cb4ffaef40de59a1ca5d5a68259e340c49c..283a641d9ac178fabd890f23e710e00b4d878614 100644 (file)
@@ -60,7 +60,7 @@
 
 #include "i18n.h"
 
 
 #include "i18n.h"
 
-#define LOG_GENERAL(...) _film->log()->log (String::compose (__VA_ARGS__), LogEntry::TYPE_GENERAL);
+#define LOG_GENERAL(...) dcpomatic_log->log (String::compose (__VA_ARGS__), LogEntry::TYPE_GENERAL);
 
 using std::list;
 using std::cout;
 
 using std::list;
 using std::cout;
@@ -155,8 +155,8 @@ Player::setup_pieces_unlocked ()
                        continue;
                }
 
                        continue;
                }
 
-               shared_ptr<Decoder> decoder = decoder_factory (i, _film->log(), _fast);
-               FrameRateChange frc (i->active_video_frame_rate(), _film->video_frame_rate());
+               shared_ptr<Decoder> decoder = decoder_factory (_film, i, _fast);
+               FrameRateChange frc (i->active_video_frame_rate(_film), _film->video_frame_rate());
 
                if (!decoder) {
                        /* Not something that we can decode; e.g. Atmos content */
 
                if (!decoder) {
                        /* Not something that we can decode; e.g. Atmos content */
@@ -227,8 +227,8 @@ Player::setup_pieces_unlocked ()
                }
        }
 
                }
        }
 
-       _black = Empty (_pieces, _film->length(), bind(&have_video, _1));
-       _silent = Empty (_pieces, _film->length(), bind(&have_audio, _1));
+       _black = Empty (_film, _pieces, bind(&have_video, _1));
+       _silent = Empty (_film, _pieces, bind(&have_audio, _1));
 
        _last_video_time = DCPTime ();
        _last_video_eyes = EYES_BOTH;
 
        _last_video_time = DCPTime ();
        _last_video_eyes = EYES_BOTH;
@@ -343,7 +343,7 @@ Frame
 Player::dcp_to_content_video (shared_ptr<const Piece> piece, DCPTime t) const
 {
        DCPTime s = t - piece->content->position ();
 Player::dcp_to_content_video (shared_ptr<const Piece> piece, DCPTime t) const
 {
        DCPTime s = t - piece->content->position ();
-       s = min (piece->content->length_after_trim(), s);
+       s = min (piece->content->length_after_trim(_film), s);
        s = max (DCPTime(), s + DCPTime (piece->content->trim_start(), piece->frc));
 
        /* It might seem more logical here to convert s to a ContentTime (using the FrameRateChange)
        s = max (DCPTime(), s + DCPTime (piece->content->trim_start(), piece->frc));
 
        /* It might seem more logical here to convert s to a ContentTime (using the FrameRateChange)
@@ -368,7 +368,7 @@ Frame
 Player::dcp_to_resampled_audio (shared_ptr<const Piece> piece, DCPTime t) const
 {
        DCPTime s = t - piece->content->position ();
 Player::dcp_to_resampled_audio (shared_ptr<const Piece> piece, DCPTime t) const
 {
        DCPTime s = t - piece->content->position ();
-       s = min (piece->content->length_after_trim(), s);
+       s = min (piece->content->length_after_trim(_film), s);
        /* See notes in dcp_to_content_video */
        return max (DCPTime (), DCPTime (piece->content->trim_start (), piece->frc) + s).frames_floor (_film->audio_frame_rate ());
 }
        /* See notes in dcp_to_content_video */
        return max (DCPTime (), DCPTime (piece->content->trim_start (), piece->frc) + s).frames_floor (_film->audio_frame_rate ());
 }
@@ -386,7 +386,7 @@ ContentTime
 Player::dcp_to_content_time (shared_ptr<const Piece> piece, DCPTime t) const
 {
        DCPTime s = t - piece->content->position ();
 Player::dcp_to_content_time (shared_ptr<const Piece> piece, DCPTime t) const
 {
        DCPTime s = t - piece->content->position ();
-       s = min (piece->content->length_after_trim(), s);
+       s = min (piece->content->length_after_trim(_film), s);
        return max (ContentTime (), ContentTime (s, piece->frc) + piece->content->trim_start());
 }
 
        return max (ContentTime (), ContentTime (s, piece->frc) + piece->content->trim_start());
 }
 
@@ -480,7 +480,7 @@ Player::get_reel_assets ()
 
                scoped_ptr<DCPDecoder> decoder;
                try {
 
                scoped_ptr<DCPDecoder> decoder;
                try {
-                       decoder.reset (new DCPDecoder (j, _film->log(), false));
+                       decoder.reset (new DCPDecoder (j, false));
                } catch (...) {
                        return a;
                }
                } catch (...) {
                        return a;
                }
@@ -554,7 +554,7 @@ Player::pass ()
                return false;
        }
 
                return false;
        }
 
-       if (_playlist->length() == DCPTime()) {
+       if (_playlist->length(_film) == DCPTime()) {
                /* Special case of an empty Film; just give one black frame */
                emit_video (black_player_video_frame(EYES_BOTH), DCPTime());
                return true;
                /* Special case of an empty Film; just give one black frame */
                emit_video (black_player_video_frame(EYES_BOTH), DCPTime());
                return true;
@@ -570,8 +570,8 @@ Player::pass ()
                        continue;
                }
 
                        continue;
                }
 
-               DCPTime const t = content_time_to_dcp (i, max(i->decoder->position(), i->content->trim_start()));
-               if (t > i->content->end()) {
+               DCPTime const t = content_time_to_dcp (i, max(i->decoder->position(_film), i->content->trim_start()));
+               if (t > i->content->end(_film)) {
                        i->done = true;
                } else {
 
                        i->done = true;
                } else {
 
@@ -610,7 +610,7 @@ Player::pass ()
 
        switch (which) {
        case CONTENT:
 
        switch (which) {
        case CONTENT:
-               earliest_content->done = earliest_content->decoder->pass ();
+               earliest_content->done = earliest_content->decoder->pass (_film);
                break;
        case BLACK:
                emit_video (black_player_video_frame(EYES_BOTH), _black.position());
                break;
        case BLACK:
                emit_video (black_player_video_frame(EYES_BOTH), _black.position());
@@ -735,7 +735,7 @@ Player::video (weak_ptr<Piece> wp, ContentVideo video)
                return;
        }
 
                return;
        }
 
-       FrameRateChange frc(piece->content->active_video_frame_rate(), _film->video_frame_rate());
+       FrameRateChange frc(piece->content->active_video_frame_rate(_film), _film->video_frame_rate());
        if (frc.skip && (video.frame % 2) == 1) {
                return;
        }
        if (frc.skip && (video.frame % 2) == 1) {
                return;
        }
@@ -754,7 +754,7 @@ Player::video (weak_ptr<Piece> wp, ContentVideo video)
        /* Fill gaps that we discover now that we have some video which needs to be emitted.
           This is where we need to fill to.
        */
        /* Fill gaps that we discover now that we have some video which needs to be emitted.
           This is where we need to fill to.
        */
-       DCPTime fill_to = min (time, piece->content->end());
+       DCPTime fill_to = min (time, piece->content->end(_film));
 
        if (_last_video_time) {
                DCPTime fill_from = max (*_last_video_time, piece->content->position());
 
        if (_last_video_time) {
                DCPTime fill_from = max (*_last_video_time, piece->content->position());
@@ -764,7 +764,7 @@ Player::video (weak_ptr<Piece> wp, ContentVideo video)
                        if (fill_to_eyes == EYES_BOTH) {
                                fill_to_eyes = EYES_LEFT;
                        }
                        if (fill_to_eyes == EYES_BOTH) {
                                fill_to_eyes = EYES_LEFT;
                        }
-                       if (fill_to == piece->content->end()) {
+                       if (fill_to == piece->content->end(_film)) {
                                /* Don't fill after the end of the content */
                                fill_to_eyes = EYES_LEFT;
                        }
                                /* Don't fill after the end of the content */
                                fill_to_eyes = EYES_LEFT;
                        }
@@ -801,7 +801,7 @@ Player::video (weak_ptr<Piece> wp, ContentVideo video)
                new PlayerVideo (
                        video.image,
                        piece->content->video->crop (),
                new PlayerVideo (
                        video.image,
                        piece->content->video->crop (),
-                       piece->content->video->fade (video.frame),
+                       piece->content->video->fade (_film, video.frame),
                        piece->content->video->scale().size (
                                piece->content->video, _video_container_size, _film->frame_size ()
                                ),
                        piece->content->video->scale().size (
                                piece->content->video, _video_container_size, _film->frame_size ()
                                ),
@@ -816,7 +816,7 @@ Player::video (weak_ptr<Piece> wp, ContentVideo video)
 
        DCPTime t = time;
        for (int i = 0; i < frc.repeat; ++i) {
 
        DCPTime t = time;
        for (int i = 0; i < frc.repeat; ++i) {
-               if (t < piece->content->end()) {
+               if (t < piece->content->end(_film)) {
                        emit_video (_last_video[wp], t);
                }
                t += one_video_frame ();
                        emit_video (_last_video[wp], t);
                }
                t += one_video_frame ();
@@ -839,7 +839,7 @@ Player::audio (weak_ptr<Piece> wp, AudioStreamPtr stream, ContentAudio content_a
        /* Compute time in the DCP */
        DCPTime time = resampled_audio_to_dcp (piece, content_audio.frame);
        /* And the end of this block in the DCP */
        /* Compute time in the DCP */
        DCPTime time = resampled_audio_to_dcp (piece, content_audio.frame);
        /* And the end of this block in the DCP */
-       DCPTime end = time + DCPTime::from_frames(content_audio.audio->frames(), content->resampled_frame_rate());
+       DCPTime end = time + DCPTime::from_frames(content_audio.audio->frames(), content->resampled_frame_rate(_film));
 
        /* Remove anything that comes before the start or after the end of the content */
        if (time < piece->content->position()) {
 
        /* Remove anything that comes before the start or after the end of the content */
        if (time < piece->content->position()) {
@@ -850,11 +850,11 @@ Player::audio (weak_ptr<Piece> wp, AudioStreamPtr stream, ContentAudio content_a
                }
                content_audio.audio = cut.first;
                time = cut.second;
                }
                content_audio.audio = cut.first;
                time = cut.second;
-       } else if (time > piece->content->end()) {
+       } else if (time > piece->content->end(_film)) {
                /* Discard it all */
                return;
                /* Discard it all */
                return;
-       } else if (end > piece->content->end()) {
-               Frame const remaining_frames = DCPTime(piece->content->end() - time).frames_round(_film->audio_frame_rate());
+       } else if (end > piece->content->end(_film)) {
+               Frame const remaining_frames = DCPTime(piece->content->end(_film) - time).frames_round(_film->audio_frame_rate());
                if (remaining_frames == 0) {
                        return;
                }
                if (remaining_frames == 0) {
                        return;
                }
@@ -933,7 +933,7 @@ Player::plain_text_start (weak_ptr<Piece> wp, weak_ptr<const TextContent> wc, Co
        PlayerText ps;
        DCPTime const from (content_time_to_dcp (piece, subtitle.from()));
 
        PlayerText ps;
        DCPTime const from (content_time_to_dcp (piece, subtitle.from()));
 
-       if (from > piece->content->end()) {
+       if (from > piece->content->end(_film)) {
                return;
        }
 
                return;
        }
 
@@ -984,7 +984,7 @@ Player::subtitle_stop (weak_ptr<Piece> wp, weak_ptr<const TextContent> wc, Conte
 
        DCPTime const dcp_to = content_time_to_dcp (piece, to);
 
 
        DCPTime const dcp_to = content_time_to_dcp (piece, to);
 
-       if (dcp_to > piece->content->end()) {
+       if (dcp_to > piece->content->end(_film)) {
                return;
        }
 
                return;
        }
 
@@ -1024,11 +1024,11 @@ Player::seek (DCPTime time, bool accurate)
        BOOST_FOREACH (shared_ptr<Piece> i, _pieces) {
                if (time < i->content->position()) {
                        /* Before; seek to the start of the content */
        BOOST_FOREACH (shared_ptr<Piece> i, _pieces) {
                if (time < i->content->position()) {
                        /* Before; seek to the start of the content */
-                       i->decoder->seek (dcp_to_content_time (i, i->content->position()), accurate);
+                       i->decoder->seek (_film, dcp_to_content_time (i, i->content->position()), accurate);
                        i->done = false;
                        i->done = false;
-               } else if (i->content->position() <= time && time < i->content->end()) {
+               } else if (i->content->position() <= time && time < i->content->end(_film)) {
                        /* During; seek to position */
                        /* During; seek to position */
-                       i->decoder->seek (dcp_to_content_time (i, time), accurate);
+                       i->decoder->seek (_film, dcp_to_content_time (i, time), accurate);
                        i->done = false;
                } else {
                        /* After; this piece is done */
                        i->done = false;
                } else {
                        /* After; this piece is done */
index 94432d66e046c289eb4f60f31923f8ac62623abe..6c0cf20c1f807b0c3b5fafcc2ff79b6d1874ee55 100644 (file)
@@ -315,7 +315,7 @@ PlayerVideo::shallow_copy () const
  *  @return true if this was possible, false if not.
  */
 bool
  *  @return true if this was possible, false if not.
  */
 bool
-PlayerVideo::reset_metadata (dcp::Size video_container_size, dcp::Size film_frame_size)
+PlayerVideo::reset_metadata (shared_ptr<const Film> film, dcp::Size video_container_size, dcp::Size film_frame_size)
 {
        shared_ptr<Content> content = _content.lock();
        if (!content || !_video_frame) {
 {
        shared_ptr<Content> content = _content.lock();
        if (!content || !_video_frame) {
@@ -323,7 +323,7 @@ PlayerVideo::reset_metadata (dcp::Size video_container_size, dcp::Size film_fram
        }
 
        _crop = content->video->crop();
        }
 
        _crop = content->video->crop();
-       _fade = content->video->fade(_video_frame.get());
+       _fade = content->video->fade(film, _video_frame.get());
        _inter_size = content->video->scale().size(content->video, video_container_size, film_frame_size);
        _out_size = video_container_size;
        _colour_conversion = content->video->colour_conversion();
        _inter_size = content->video->scale().size(content->video, video_container_size, film_frame_size);
        _out_size = video_container_size;
        _colour_conversion = content->video->colour_conversion();
index 8ffe70afb02f0d0d1de0c7d091c232c7876d8a27..a874fd3b262a0afb28459e7c44cbab31c6c123d0 100644 (file)
@@ -34,6 +34,7 @@ extern "C" {
 
 class Image;
 class ImageProxy;
 
 class Image;
 class ImageProxy;
+class Film;
 class Socket;
 
 /** Everything needed to describe a video frame coming out of the player, but with the
 class Socket;
 
 /** Everything needed to describe a video frame coming out of the player, but with the
@@ -71,7 +72,7 @@ public:
        void add_metadata (xmlpp::Node* node) const;
        void send_binary (boost::shared_ptr<Socket> socket) const;
 
        void add_metadata (xmlpp::Node* node) const;
        void send_binary (boost::shared_ptr<Socket> socket) const;
 
-       bool reset_metadata (dcp::Size video_container_size, dcp::Size film_frame_size);
+       bool reset_metadata (boost::shared_ptr<const Film> film, dcp::Size video_container_size, dcp::Size film_frame_size);
 
        bool has_j2k () const;
        dcp::Data j2k () const;
 
        bool has_j2k () const;
        dcp::Data j2k () const;
index e4fc0f0723df7e100229dd1765d8ee831ba4c7da..0e6497495802a51b8338e46e628243ce798abb5b 100644 (file)
@@ -61,12 +61,15 @@ Playlist::Playlist ()
 Playlist::~Playlist ()
 {
        _content.clear ();
 Playlist::~Playlist ()
 {
        _content.clear ();
-       reconnect ();
+       disconnect ();
 }
 
 void
 }
 
 void
-Playlist::content_change (ChangeType type, weak_ptr<Content> content, int property, bool frequent)
+Playlist::content_change (weak_ptr<const Film> weak_film, ChangeType type, weak_ptr<Content> content, int property, bool frequent)
 {
 {
+       shared_ptr<const Film> film = weak_film.lock ();
+       DCPOMATIC_ASSERT (film);
+
        if (type == CHANGE_TYPE_DONE) {
                if (
                        property == ContentProperty::TRIM_START ||
        if (type == CHANGE_TYPE_DONE) {
                if (
                        property == ContentProperty::TRIM_START ||
@@ -79,7 +82,7 @@ Playlist::content_change (ChangeType type, weak_ptr<Content> content, int proper
                           - any other position changes will be timeline drags which should not result in content
                           being sequenced.
                        */
                           - any other position changes will be timeline drags which should not result in content
                           being sequenced.
                        */
-                       maybe_sequence ();
+                       maybe_sequence (film);
                }
 
                if (
                }
 
                if (
@@ -100,7 +103,7 @@ Playlist::content_change (ChangeType type, weak_ptr<Content> content, int proper
 }
 
 void
 }
 
 void
-Playlist::maybe_sequence ()
+Playlist::maybe_sequence (shared_ptr<const Film> film)
 {
        if (!_sequence || _sequencing) {
                return;
 {
        if (!_sequence || _sequencing) {
                return;
@@ -123,11 +126,11 @@ Playlist::maybe_sequence ()
                }
 
                if (i->video->frame_type() == VIDEO_FRAME_TYPE_3D_RIGHT) {
                }
 
                if (i->video->frame_type() == VIDEO_FRAME_TYPE_3D_RIGHT) {
-                       i->set_position (next_right);
-                       next_right = i->end();
+                       i->set_position (film, next_right);
+                       next_right = i->end(film);
                } else {
                } else {
-                       i->set_position (next_left);
-                       next_left = i->end();
+                       i->set_position (film, next_left);
+                       next_left = i->end(film);
                }
 
                placed.push_back (i);
                }
 
                placed.push_back (i);
@@ -141,8 +144,8 @@ Playlist::maybe_sequence ()
                        continue;
                }
 
                        continue;
                }
 
-               i->set_position (next);
-               next = i->end();
+               i->set_position (film, next);
+               next = i->end(film);
        }
 
 
        }
 
 
@@ -188,7 +191,7 @@ Playlist::set_from_xml (shared_ptr<const Film> film, cxml::ConstNodePtr node, in
        /* This shouldn't be necessary but better safe than sorry (there could be old files) */
        sort (_content.begin(), _content.end(), ContentSorter ());
 
        /* This shouldn't be necessary but better safe than sorry (there could be old files) */
        sort (_content.begin(), _content.end(), ContentSorter ());
 
-       reconnect ();
+       reconnect (film);
 }
 
 /** @param node &lt;Playlist&gt; node.
 }
 
 /** @param node &lt;Playlist&gt; node.
@@ -203,12 +206,12 @@ Playlist::as_xml (xmlpp::Node* node, bool with_content_paths)
 }
 
 void
 }
 
 void
-Playlist::add (shared_ptr<Content> c)
+Playlist::add (shared_ptr<const Film> film, shared_ptr<Content> c)
 {
        Change (CHANGE_TYPE_PENDING);
        _content.push_back (c);
        sort (_content.begin(), _content.end(), ContentSorter ());
 {
        Change (CHANGE_TYPE_PENDING);
        _content.push_back (c);
        sort (_content.begin(), _content.end(), ContentSorter ());
-       reconnect ();
+       reconnect (film);
        Change (CHANGE_TYPE_DONE);
 }
 
        Change (CHANGE_TYPE_DONE);
 }
 
@@ -323,11 +326,11 @@ Playlist::best_video_frame_rate () const
 
 /** @return length of the playlist from time 0 to the last thing on the playlist */
 DCPTime
 
 /** @return length of the playlist from time 0 to the last thing on the playlist */
 DCPTime
-Playlist::length () const
+Playlist::length (shared_ptr<const Film> film) const
 {
        DCPTime len;
        BOOST_FOREACH (shared_ptr<const Content> i, _content) {
 {
        DCPTime len;
        BOOST_FOREACH (shared_ptr<const Content> i, _content) {
-               len = max (len, i->end());
+               len = max (len, i->end(film));
        }
 
        return len;
        }
 
        return len;
@@ -350,26 +353,32 @@ Playlist::start () const
 }
 
 void
 }
 
 void
-Playlist::reconnect ()
+Playlist::disconnect ()
 {
        for (list<boost::signals2::connection>::iterator i = _content_connections.begin(); i != _content_connections.end(); ++i) {
                i->disconnect ();
        }
 
        _content_connections.clear ();
 {
        for (list<boost::signals2::connection>::iterator i = _content_connections.begin(); i != _content_connections.end(); ++i) {
                i->disconnect ();
        }
 
        _content_connections.clear ();
+}
+
+void
+Playlist::reconnect (shared_ptr<const Film> film)
+{
+       disconnect ();
 
        BOOST_FOREACH (shared_ptr<Content> i, _content) {
 
        BOOST_FOREACH (shared_ptr<Content> i, _content) {
-               _content_connections.push_back (i->Change.connect(boost::bind(&Playlist::content_change, this, _1, _2, _3, _4)));
+               _content_connections.push_back (i->Change.connect(boost::bind(&Playlist::content_change, this, film, _1, _2, _3, _4)));
        }
 }
 
 DCPTime
        }
 }
 
 DCPTime
-Playlist::video_end () const
+Playlist::video_end (shared_ptr<const Film> film) const
 {
        DCPTime end;
        BOOST_FOREACH (shared_ptr<Content> i, _content) {
                if (i->video) {
 {
        DCPTime end;
        BOOST_FOREACH (shared_ptr<Content> i, _content) {
                if (i->video) {
-                       end = max (end, i->end ());
+                       end = max (end, i->end(film));
                }
        }
 
                }
        }
 
@@ -377,12 +386,12 @@ Playlist::video_end () const
 }
 
 DCPTime
 }
 
 DCPTime
-Playlist::text_end () const
+Playlist::text_end (shared_ptr<const Film> film) const
 {
        DCPTime end;
        BOOST_FOREACH (shared_ptr<Content> i, _content) {
                if (!i->text.empty ()) {
 {
        DCPTime end;
        BOOST_FOREACH (shared_ptr<Content> i, _content) {
                if (!i->text.empty ()) {
-                       end = max (end, i->end ());
+                       end = max (end, i->end(film));
                }
        }
 
                }
        }
 
@@ -446,14 +455,14 @@ Playlist::content () const
 }
 
 void
 }
 
 void
-Playlist::repeat (ContentList c, int n)
+Playlist::repeat (shared_ptr<const Film> film, ContentList c, int n)
 {
        pair<DCPTime, DCPTime> range (DCPTime::max (), DCPTime ());
        BOOST_FOREACH (shared_ptr<Content> i, c) {
                range.first = min (range.first, i->position ());
                range.second = max (range.second, i->position ());
 {
        pair<DCPTime, DCPTime> range (DCPTime::max (), DCPTime ());
        BOOST_FOREACH (shared_ptr<Content> i, c) {
                range.first = min (range.first, i->position ());
                range.second = max (range.second, i->position ());
-               range.first = min (range.first, i->end ());
-               range.second = max (range.second, i->end ());
+               range.first = min (range.first, i->end(film));
+               range.second = max (range.second, i->end(film));
        }
 
        Change (CHANGE_TYPE_PENDING);
        }
 
        Change (CHANGE_TYPE_PENDING);
@@ -461,8 +470,8 @@ Playlist::repeat (ContentList c, int n)
        DCPTime pos = range.second;
        for (int i = 0; i < n; ++i) {
                BOOST_FOREACH (shared_ptr<Content> j, c) {
        DCPTime pos = range.second;
        for (int i = 0; i < n; ++i) {
                BOOST_FOREACH (shared_ptr<Content> j, c) {
-                       shared_ptr<Content> copy = j->clone ();
-                       copy->set_position (pos + copy->position() - range.first);
+                       shared_ptr<Content> copy = j->clone (film);
+                       copy->set_position (film, pos + copy->position() - range.first);
                        _content.push_back (copy);
                }
                pos += range.second - range.first;
                        _content.push_back (copy);
                }
                pos += range.second - range.first;
@@ -470,12 +479,12 @@ Playlist::repeat (ContentList c, int n)
 
        sort (_content.begin(), _content.end(), ContentSorter ());
 
 
        sort (_content.begin(), _content.end(), ContentSorter ());
 
-       reconnect ();
+       reconnect (film);
        Change (CHANGE_TYPE_DONE);
 }
 
 void
        Change (CHANGE_TYPE_DONE);
 }
 
 void
-Playlist::move_earlier (shared_ptr<Content> c)
+Playlist::move_earlier (shared_ptr<const Film> film, shared_ptr<Content> c)
 {
        ContentList::iterator previous = _content.end ();
        ContentList::iterator i = _content.begin();
 {
        ContentList::iterator previous = _content.end ();
        ContentList::iterator i = _content.begin();
@@ -492,12 +501,12 @@ Playlist::move_earlier (shared_ptr<Content> c)
        shared_ptr<Content> previous_c = *previous;
 
        DCPTime const p = previous_c->position ();
        shared_ptr<Content> previous_c = *previous;
 
        DCPTime const p = previous_c->position ();
-       previous_c->set_position (p + c->length_after_trim ());
-       c->set_position (p);
+       previous_c->set_position (film, p + c->length_after_trim(film));
+       c->set_position (film, p);
 }
 
 void
 }
 
 void
-Playlist::move_later (shared_ptr<Content> c)
+Playlist::move_later (shared_ptr<const Film> film, shared_ptr<Content> c)
 {
        ContentList::iterator i = _content.begin();
        while (i != _content.end() && *i != c) {
 {
        ContentList::iterator i = _content.begin();
        while (i != _content.end() && *i != c) {
@@ -515,24 +524,24 @@ Playlist::move_later (shared_ptr<Content> c)
 
        shared_ptr<Content> next_c = *next;
 
 
        shared_ptr<Content> next_c = *next;
 
-       next_c->set_position (c->position ());
-       c->set_position (c->position() + next_c->length_after_trim ());
+       next_c->set_position (film, c->position());
+       c->set_position (film, c->position() + next_c->length_after_trim(film));
 }
 
 int64_t
 }
 
 int64_t
-Playlist::required_disk_space (int j2k_bandwidth, int audio_channels, int audio_frame_rate) const
+Playlist::required_disk_space (shared_ptr<const Film> film, int j2k_bandwidth, int audio_channels, int audio_frame_rate) const
 {
 {
-       int64_t video = uint64_t (j2k_bandwidth / 8) * length().seconds ();
-       int64_t audio = uint64_t (audio_channels * audio_frame_rate * 3) * length().seconds ();
+       int64_t video = uint64_t (j2k_bandwidth / 8) * length(film).seconds();
+       int64_t audio = uint64_t (audio_channels * audio_frame_rate * 3) * length(film).seconds();
 
        BOOST_FOREACH (shared_ptr<Content> i, _content) {
                shared_ptr<DCPContent> d = dynamic_pointer_cast<DCPContent> (i);
                if (d) {
                        if (d->reference_video()) {
 
        BOOST_FOREACH (shared_ptr<Content> i, _content) {
                shared_ptr<DCPContent> d = dynamic_pointer_cast<DCPContent> (i);
                if (d) {
                        if (d->reference_video()) {
-                               video -= uint64_t (j2k_bandwidth / 8) * d->length_after_trim().seconds();
+                               video -= uint64_t (j2k_bandwidth / 8) * d->length_after_trim(film).seconds();
                        }
                        if (d->reference_audio()) {
                        }
                        if (d->reference_audio()) {
-                               audio -= uint64_t (audio_channels * audio_frame_rate * 3) * d->length_after_trim().seconds();
+                               audio -= uint64_t (audio_channels * audio_frame_rate * 3) * d->length_after_trim(film).seconds();
                        }
                }
        }
                        }
                }
        }
@@ -542,13 +551,13 @@ Playlist::required_disk_space (int j2k_bandwidth, int audio_channels, int audio_
 }
 
 string
 }
 
 string
-Playlist::content_summary (DCPTimePeriod period) const
+Playlist::content_summary (shared_ptr<const Film> film, DCPTimePeriod period) const
 {
        string best_summary;
        int best_score = -1;
        BOOST_FOREACH (shared_ptr<Content> i, _content) {
                int score = 0;
 {
        string best_summary;
        int best_score = -1;
        BOOST_FOREACH (shared_ptr<Content> i, _content) {
                int score = 0;
-               optional<DCPTimePeriod> const o = DCPTimePeriod(i->position(), i->end()).overlap (period);
+               optional<DCPTimePeriod> const o = DCPTimePeriod(i->position(), i->end(film)).overlap (period);
                if (o) {
                        score += 100 * o.get().duration().get() / period.duration().get();
                }
                if (o) {
                        score += 100 * o.get().duration().get() / period.duration().get();
                }
index d55232dadb8898793417165ed3b955290a39db14..d9140bdfb6d87ead55318bf8ffbac1a6c81dd92e 100644 (file)
@@ -48,31 +48,31 @@ public:
        void as_xml (xmlpp::Node *, bool with_content_paths);
        void set_from_xml (boost::shared_ptr<const Film> film, cxml::ConstNodePtr node, int version, std::list<std::string>& notes);
 
        void as_xml (xmlpp::Node *, bool with_content_paths);
        void set_from_xml (boost::shared_ptr<const Film> film, cxml::ConstNodePtr node, int version, std::list<std::string>& notes);
 
-       void add (boost::shared_ptr<Content>);
+       void add (boost::shared_ptr<const Film> film, boost::shared_ptr<Content>);
        void remove (boost::shared_ptr<Content>);
        void remove (ContentList);
        void remove (boost::shared_ptr<Content>);
        void remove (ContentList);
-       void move_earlier (boost::shared_ptr<Content>);
-       void move_later (boost::shared_ptr<Content>);
+       void move_earlier (boost::shared_ptr<const Film> film, boost::shared_ptr<Content>);
+       void move_later (boost::shared_ptr<const Film> film, boost::shared_ptr<Content>);
 
        ContentList content () const;
 
        std::string video_identifier () const;
 
 
        ContentList content () const;
 
        std::string video_identifier () const;
 
-       DCPTime length () const;
+       DCPTime length (boost::shared_ptr<const Film> film) const;
        boost::optional<DCPTime> start () const;
        boost::optional<DCPTime> start () const;
-       int64_t required_disk_space (int j2k_bandwidth, int audio_channels, int audio_frame_rate) const;
+       int64_t required_disk_space (boost::shared_ptr<const Film> film, int j2k_bandwidth, int audio_channels, int audio_frame_rate) const;
 
        int best_video_frame_rate () const;
 
        int best_video_frame_rate () const;
-       DCPTime video_end () const;
-       DCPTime text_end () const;
+       DCPTime video_end (boost::shared_ptr<const Film> film) const;
+       DCPTime text_end (boost::shared_ptr<const Film> film) const;
        FrameRateChange active_frame_rate_change (DCPTime, int dcp_frame_rate) const;
        FrameRateChange active_frame_rate_change (DCPTime, int dcp_frame_rate) const;
-       std::string content_summary (DCPTimePeriod period) const;
+       std::string content_summary (boost::shared_ptr<const Film> film, DCPTimePeriod period) const;
        std::pair<double, double> speed_up_range (int dcp_video_frame_rate) const;
 
        void set_sequence (bool);
        std::pair<double, double> speed_up_range (int dcp_video_frame_rate) const;
 
        void set_sequence (bool);
-       void maybe_sequence ();
+       void maybe_sequence (boost::shared_ptr<const Film> film);
 
 
-       void repeat (ContentList, int);
+       void repeat (boost::shared_ptr<const Film> film, ContentList, int);
 
        /** Emitted when content has been added to or removed from the playlist; implies OrderChanged */
        mutable boost::signals2::signal<void (ChangeType)> Change;
 
        /** Emitted when content has been added to or removed from the playlist; implies OrderChanged */
        mutable boost::signals2::signal<void (ChangeType)> Change;
@@ -81,8 +81,9 @@ public:
        mutable boost::signals2::signal<void (ChangeType, boost::weak_ptr<Content>, int, bool)> ContentChange;
 
 private:
        mutable boost::signals2::signal<void (ChangeType, boost::weak_ptr<Content>, int, bool)> ContentChange;
 
 private:
-       void content_change (ChangeType, boost::weak_ptr<Content>, int, bool);
-       void reconnect ();
+       void content_change (boost::weak_ptr<const Film>, ChangeType, boost::weak_ptr<Content>, int, bool);
+       void disconnect ();
+       void reconnect (boost::shared_ptr<const Film> film);
 
        /** List of content.  Kept sorted in position order. */
        ContentList _content;
 
        /** List of content.  Kept sorted in position order. */
        ContentList _content;
index 9c941c2bb14842c813a6d78f7a3f2b54218bfeec..35f76be7c4d1894346a4426363a1aba4f416060c 100644 (file)
@@ -36,23 +36,23 @@ using boost::shared_ptr;
 using boost::optional;
 using dcp::raw_convert;
 
 using boost::optional;
 using dcp::raw_convert;
 
-StringTextFileContent::StringTextFileContent (shared_ptr<const Film> film, boost::filesystem::path path)
-       : Content (film, path)
+StringTextFileContent::StringTextFileContent (boost::filesystem::path path)
+       : Content (path)
 {
        text.push_back (shared_ptr<TextContent> (new TextContent (this, TEXT_OPEN_SUBTITLE, TEXT_UNKNOWN)));
 }
 
 {
        text.push_back (shared_ptr<TextContent> (new TextContent (this, TEXT_OPEN_SUBTITLE, TEXT_UNKNOWN)));
 }
 
-StringTextFileContent::StringTextFileContent (shared_ptr<const Film> film, cxml::ConstNodePtr node, int version)
-       : Content (film, node)
+StringTextFileContent::StringTextFileContent (cxml::ConstNodePtr node, int version)
+       : Content (node)
        , _length (node->number_child<ContentTime::Type> ("Length"))
 {
        text = TextContent::from_xml (this, node, version);
 }
 
 void
        , _length (node->number_child<ContentTime::Type> ("Length"))
 {
        text = TextContent::from_xml (this, node, version);
 }
 
 void
-StringTextFileContent::examine (boost::shared_ptr<Job> job)
+StringTextFileContent::examine (shared_ptr<const Film> film, shared_ptr<Job> job)
 {
 {
-       Content::examine (job);
+       Content::examine (film, job);
        StringTextFile s (shared_from_this ());
 
        /* Default to turning these subtitles on */
        StringTextFile s (shared_from_this ());
 
        /* Default to turning these subtitles on */
@@ -89,8 +89,8 @@ StringTextFileContent::as_xml (xmlpp::Node* node, bool with_paths) const
 }
 
 DCPTime
 }
 
 DCPTime
-StringTextFileContent::full_length () const
+StringTextFileContent::full_length (shared_ptr<const Film> film) const
 {
 {
-       FrameRateChange const frc (active_video_frame_rate(), film()->video_frame_rate ());
+       FrameRateChange const frc (active_video_frame_rate(film), film->video_frame_rate());
        return DCPTime (_length, frc);
 }
        return DCPTime (_length, frc);
 }
index c2de86ce560d5809b97e1edd9c7d3a7a1c5db02d..9a71d5828696683aa6b97b5b460c0eeda1ed377e 100644 (file)
@@ -28,18 +28,18 @@ class Job;
 class StringTextFileContent : public Content
 {
 public:
 class StringTextFileContent : public Content
 {
 public:
-       StringTextFileContent (boost::shared_ptr<const Film>, boost::filesystem::path);
-       StringTextFileContent (boost::shared_ptr<const Film>, cxml::ConstNodePtr, int);
+       StringTextFileContent (boost::filesystem::path);
+       StringTextFileContent (cxml::ConstNodePtr, int);
 
        boost::shared_ptr<StringTextFileContent> shared_from_this () {
                return boost::dynamic_pointer_cast<StringTextFileContent> (Content::shared_from_this ());
        }
 
 
        boost::shared_ptr<StringTextFileContent> shared_from_this () {
                return boost::dynamic_pointer_cast<StringTextFileContent> (Content::shared_from_this ());
        }
 
-       void examine (boost::shared_ptr<Job>);
+       void examine (boost::shared_ptr<const Film> film, boost::shared_ptr<Job>);
        std::string summary () const;
        std::string technical_summary () const;
        void as_xml (xmlpp::Node *, bool with_paths) const;
        std::string summary () const;
        std::string technical_summary () const;
        void as_xml (xmlpp::Node *, bool with_paths) const;
-       DCPTime full_length () const;
+       DCPTime full_length (boost::shared_ptr<const Film> film) const;
 
 private:
        ContentTime _length;
 
 private:
        ContentTime _length;
index 8286c1e391d0c3a2e441d16b02c02fb596c6a254..e67450b8b719efe38527d74f5b908de3c67a9290 100644 (file)
@@ -35,7 +35,7 @@ using boost::shared_ptr;
 using boost::optional;
 using boost::dynamic_pointer_cast;
 
 using boost::optional;
 using boost::dynamic_pointer_cast;
 
-StringTextFileDecoder::StringTextFileDecoder (shared_ptr<const StringTextFileContent> content, shared_ptr<Log> log)
+StringTextFileDecoder::StringTextFileDecoder (shared_ptr<const StringTextFileContent> content)
        : StringTextFile (content)
        , _next (0)
 {
        : StringTextFile (content)
        , _next (0)
 {
@@ -43,11 +43,11 @@ StringTextFileDecoder::StringTextFileDecoder (shared_ptr<const StringTextFileCon
        if (!_subtitles.empty()) {
                first = content_time_period(_subtitles[0]).from;
        }
        if (!_subtitles.empty()) {
                first = content_time_period(_subtitles[0]).from;
        }
-       text.push_back (shared_ptr<TextDecoder> (new TextDecoder (this, content->only_text(), log, first)));
+       text.push_back (shared_ptr<TextDecoder> (new TextDecoder (this, content->only_text(), first)));
 }
 
 void
 }
 
 void
-StringTextFileDecoder::seek (ContentTime time, bool accurate)
+StringTextFileDecoder::seek (shared_ptr<const Film> film, ContentTime time, bool accurate)
 {
        /* It's worth back-tracking a little here as decoding is cheap and it's nice if we don't miss
           too many subtitles when seeking.
 {
        /* It's worth back-tracking a little here as decoding is cheap and it's nice if we don't miss
           too many subtitles when seeking.
@@ -57,7 +57,7 @@ StringTextFileDecoder::seek (ContentTime time, bool accurate)
                time = ContentTime();
        }
 
                time = ContentTime();
        }
 
-       Decoder::seek (time, accurate);
+       Decoder::seek (film, time, accurate);
 
        _next = 0;
        while (_next < _subtitles.size() && ContentTime::from_seconds (_subtitles[_next].from.all_as_seconds ()) < time) {
 
        _next = 0;
        while (_next < _subtitles.size() && ContentTime::from_seconds (_subtitles[_next].from.all_as_seconds ()) < time) {
@@ -66,7 +66,7 @@ StringTextFileDecoder::seek (ContentTime time, bool accurate)
 }
 
 bool
 }
 
 bool
-StringTextFileDecoder::pass ()
+StringTextFileDecoder::pass (shared_ptr<const Film>)
 {
        if (_next >= _subtitles.size ()) {
                return true;
 {
        if (_next >= _subtitles.size ()) {
                return true;
index 6a9552bbec918f8b2c885f8adb9253bc450cdfe1..8cdf8cd9eb4eeff770630d203ff91614c88129a9 100644 (file)
 #include "decoder.h"
 
 class StringTextFileContent;
 #include "decoder.h"
 
 class StringTextFileContent;
-class Log;
 
 class StringTextFileDecoder : public Decoder, public StringTextFile
 {
 public:
 
 class StringTextFileDecoder : public Decoder, public StringTextFile
 {
 public:
-       StringTextFileDecoder (boost::shared_ptr<const StringTextFileContent>, boost::shared_ptr<Log> log);
+       StringTextFileDecoder (boost::shared_ptr<const StringTextFileContent>);
 
 
-       void seek (ContentTime time, bool accurate);
-       bool pass ();
+       void seek (boost::shared_ptr<const Film> film, ContentTime time, bool accurate);
+       bool pass (boost::shared_ptr<const Film> film);
 
 private:
        ContentTimePeriod content_time_period (sub::Subtitle s) const;
 
 private:
        ContentTimePeriod content_time_period (sub::Subtitle s) const;
index d6cf517c2e04393706ffcf81593c24fc91598dda..74fea6ec309d937243f5157ba6ab7a50afdada06 100644 (file)
@@ -40,10 +40,9 @@ using boost::function;
 TextDecoder::TextDecoder (
        Decoder* parent,
        shared_ptr<const TextContent> c,
 TextDecoder::TextDecoder (
        Decoder* parent,
        shared_ptr<const TextContent> c,
-       shared_ptr<Log> log,
        ContentTime first
        )
        ContentTime first
        )
-       : DecoderPart (parent, log)
+       : DecoderPart (parent)
        , _content (c)
        , _position (first)
 {
        , _content (c)
        , _position (first)
 {
index d45e37fc7c78817abc30f4d1e739ab920156c04f..a82f43f51af2e3a1ddd8bf1178366241cae51add 100644 (file)
@@ -41,11 +41,10 @@ public:
        TextDecoder (
                Decoder* parent,
                boost::shared_ptr<const TextContent>,
        TextDecoder (
                Decoder* parent,
                boost::shared_ptr<const TextContent>,
-               boost::shared_ptr<Log> log,
                ContentTime first
                );
 
                ContentTime first
                );
 
-       ContentTime position () const {
+       ContentTime position (boost::shared_ptr<const Film>) const {
                return _position;
        }
 
                return _position;
        }
 
index 8cb30546371a7c43a19a3afd1529c7941ffbb0c4..15445a68a4c7ea0a5e564b2fcd6fc52d4a9739b0 100644 (file)
@@ -38,7 +38,7 @@
 
 #include "i18n.h"
 
 
 #include "i18n.h"
 
-#define LOG_GENERAL(...) _parent->film()->log()->log (String::compose (__VA_ARGS__), LogEntry::TYPE_GENERAL);
+#define LOG_GENERAL(...) dcpomatic_log->log (String::compose (__VA_ARGS__), LogEntry::TYPE_GENERAL);
 
 int const VideoContentProperty::SIZE     = 0;
 int const VideoContentProperty::FRAME_TYPE  = 1;
 
 int const VideoContentProperty::SIZE     = 0;
 int const VideoContentProperty::FRAME_TYPE  = 1;
@@ -332,10 +332,9 @@ VideoContent::size_after_crop () const
 }
 
 void
 }
 
 void
-VideoContent::scale_and_crop_to_fit_width ()
+VideoContent::scale_and_crop_to_fit_width (shared_ptr<const Film> film)
 {
 {
-       shared_ptr<const Film> film = _parent->film ();
-       set_scale (VideoContentScale (film->container ()));
+       set_scale (VideoContentScale(film->container()));
 
        int const crop = max (0, int (size().height - double (film->frame_size().height) * size().width / film->frame_size().width));
        set_left_crop (0);
 
        int const crop = max (0, int (size().height - double (film->frame_size().height) * size().width / film->frame_size().width));
        set_left_crop (0);
@@ -345,10 +344,9 @@ VideoContent::scale_and_crop_to_fit_width ()
 }
 
 void
 }
 
 void
-VideoContent::scale_and_crop_to_fit_height ()
+VideoContent::scale_and_crop_to_fit_height (shared_ptr<const Film> film)
 {
 {
-       shared_ptr<const Film> film = _parent->film ();
-       set_scale (VideoContentScale (film->container ()));
+       set_scale (VideoContentScale(film->container()));
 
        int const crop = max (0, int (size().width - double (film->frame_size().width) * size().height / film->frame_size().height));
        set_left_crop (crop / 2);
 
        int const crop = max (0, int (size().width - double (film->frame_size().width) * size().height / film->frame_size().height));
        set_left_crop (crop / 2);
@@ -359,13 +357,11 @@ VideoContent::scale_and_crop_to_fit_height ()
 
 /** @param f Frame index within the whole (untrimmed) content */
 optional<double>
 
 /** @param f Frame index within the whole (untrimmed) content */
 optional<double>
-VideoContent::fade (Frame f) const
+VideoContent::fade (shared_ptr<const Film> film, Frame f) const
 {
        DCPOMATIC_ASSERT (f >= 0);
 
 {
        DCPOMATIC_ASSERT (f >= 0);
 
-       shared_ptr<const Film> film = _parent->film ();
-
-       double const vfr = _parent->active_video_frame_rate ();
+       double const vfr = _parent->active_video_frame_rate(film);
 
        Frame const ts = _parent->trim_start().frames_round(vfr);
        if ((f - ts) < fade_in()) {
 
        Frame const ts = _parent->trim_start().frames_round(vfr);
        if ((f - ts) < fade_in()) {
@@ -381,7 +377,7 @@ VideoContent::fade (Frame f) const
 }
 
 string
 }
 
 string
-VideoContent::processing_description () const
+VideoContent::processing_description (shared_ptr<const Film> film) const
 {
        string d;
        char buffer[256];
 {
        string d;
        char buffer[256];
@@ -417,7 +413,6 @@ VideoContent::processing_description () const
                d += buffer;
        }
 
                d += buffer;
        }
 
-       shared_ptr<const Film> film = _parent->film ();
        dcp::Size const container_size = film->frame_size ();
        dcp::Size const scaled = scale().size (shared_from_this(), container_size, container_size);
 
        dcp::Size const container_size = film->frame_size ();
        dcp::Size const scaled = scale().size (shared_from_this(), container_size, container_size);
 
@@ -547,9 +542,9 @@ VideoContent::take_settings_from (shared_ptr<const VideoContent> c)
 }
 
 void
 }
 
 void
-VideoContent::modify_position (DCPTime& pos) const
+VideoContent::modify_position (shared_ptr<const Film> film, DCPTime& pos) const
 {
 {
-       pos = pos.round (_parent->film()->video_frame_rate());
+       pos = pos.round (film->video_frame_rate());
 }
 
 void
 }
 
 void
index 774210c13ff191eb37521b6be328a110d79035d1..7ecc2813a067cf70f83509f5f1fe6aa23bf755ce 100644 (file)
@@ -156,19 +156,19 @@ public:
        dcp::Size size_after_3d_split () const;
        dcp::Size size_after_crop () const;
 
        dcp::Size size_after_3d_split () const;
        dcp::Size size_after_crop () const;
 
-       boost::optional<double> fade (Frame) const;
+       boost::optional<double> fade (boost::shared_ptr<const Film> film, Frame) const;
 
 
-       void scale_and_crop_to_fit_width ();
-       void scale_and_crop_to_fit_height ();
+       void scale_and_crop_to_fit_width (boost::shared_ptr<const Film> film);
+       void scale_and_crop_to_fit_height (boost::shared_ptr<const Film> film);
 
 
-       std::string processing_description () const;
+       std::string processing_description (boost::shared_ptr<const Film> film) const;
 
        void set_length (Frame);
 
        void take_from_examiner (boost::shared_ptr<VideoExaminer>);
        void add_properties (std::list<UserProperty> &) const;
 
 
        void set_length (Frame);
 
        void take_from_examiner (boost::shared_ptr<VideoExaminer>);
        void add_properties (std::list<UserProperty> &) const;
 
-       void modify_position (DCPTime& pos) const;
+       void modify_position (boost::shared_ptr<const Film> film, DCPTime& pos) const;
        void modify_trim_start (ContentTime& pos) const;
 
        static boost::shared_ptr<VideoContent> from_xml (Content* parent, cxml::ConstNodePtr, int);
        void modify_trim_start (ContentTime& pos) const;
 
        static boost::shared_ptr<VideoContent> from_xml (Content* parent, cxml::ConstNodePtr, int);
index 3625e074fba0460fc63729a00bc30c446f7d769b..813320eb86f89ecd5518a315df121a9011500411 100644 (file)
@@ -36,8 +36,8 @@ using std::back_inserter;
 using boost::shared_ptr;
 using boost::optional;
 
 using boost::shared_ptr;
 using boost::optional;
 
-VideoDecoder::VideoDecoder (Decoder* parent, shared_ptr<const Content> c, shared_ptr<Log> log)
-       : DecoderPart (parent, log)
+VideoDecoder::VideoDecoder (Decoder* parent, shared_ptr<const Content> c)
+       : DecoderPart (parent)
        , _content (c)
 {
 
        , _content (c)
 {
 
@@ -53,7 +53,7 @@ VideoDecoder::VideoDecoder (Decoder* parent, shared_ptr<const Content> c, shared
  *  and so on.
  */
 void
  *  and so on.
  */
 void
-VideoDecoder::emit (shared_ptr<const ImageProxy> image, Frame frame)
+VideoDecoder::emit (shared_ptr<const Film> film, shared_ptr<const ImageProxy> image, Frame frame)
 {
        if (ignore ()) {
                return;
 {
        if (ignore ()) {
                return;
@@ -95,7 +95,7 @@ VideoDecoder::emit (shared_ptr<const ImageProxy> image, Frame frame)
                DCPOMATIC_ASSERT (false);
        }
 
                DCPOMATIC_ASSERT (false);
        }
 
-       _position = ContentTime::from_frames (frame, _content->active_video_frame_rate ());
+       _position = ContentTime::from_frames (frame, _content->active_video_frame_rate(film));
 }
 
 void
 }
 
 void
index 3fc30cf9dab3b9c897cb99844c645058a5e55eef..0fc7ca5a404832a34ba5daadcd567611a5eaa277 100644 (file)
@@ -44,20 +44,19 @@ class Log;
 class VideoDecoder : public DecoderPart
 {
 public:
 class VideoDecoder : public DecoderPart
 {
 public:
-       VideoDecoder (Decoder* parent, boost::shared_ptr<const Content> c, boost::shared_ptr<Log> log);
+       VideoDecoder (Decoder* parent, boost::shared_ptr<const Content> c);
 
        friend struct video_decoder_fill_test1;
        friend struct video_decoder_fill_test2;
        friend struct ffmpeg_pts_offset_test;
        friend void ffmpeg_decoder_sequential_test_one (boost::filesystem::path file, float fps, int gaps, int video_length);
 
 
        friend struct video_decoder_fill_test1;
        friend struct video_decoder_fill_test2;
        friend struct ffmpeg_pts_offset_test;
        friend void ffmpeg_decoder_sequential_test_one (boost::filesystem::path file, float fps, int gaps, int video_length);
 
-       ContentTime position () const {
+       ContentTime position (boost::shared_ptr<const Film>) const {
                return _position;
        }
 
        void seek ();
                return _position;
        }
 
        void seek ();
-
-       void emit (boost::shared_ptr<const ImageProxy>, Frame frame);
+       void emit (boost::shared_ptr<const Film> film, boost::shared_ptr<const ImageProxy>, Frame frame);
 
        /** @return true if the emitted data was accepted, false if not */
        boost::signals2::signal<void (ContentVideo)> Data;
 
        /** @return true if the emitted data was accepted, false if not */
        boost::signals2::signal<void (ContentVideo)> Data;
index 8e762ae14f6d8545993f185d370a630dae1436eb..4f69cb2e2301ed1fb76d2395b25b058934638dbd 100644 (file)
@@ -36,14 +36,14 @@ using std::list;
 using std::string;
 using boost::shared_ptr;
 
 using std::string;
 using boost::shared_ptr;
 
-VideoMXFContent::VideoMXFContent (shared_ptr<const Film> film, boost::filesystem::path path)
-       : Content (film, path)
+VideoMXFContent::VideoMXFContent (boost::filesystem::path path)
+       : Content (path)
 {
 
 }
 
 {
 
 }
 
-VideoMXFContent::VideoMXFContent (shared_ptr<const Film> film, cxml::ConstNodePtr node, int version)
-       : Content (film, node)
+VideoMXFContent::VideoMXFContent (cxml::ConstNodePtr node, int version)
+       : Content (node)
 {
        video = VideoContent::from_xml (this, node, version);
 }
 {
        video = VideoContent::from_xml (this, node, version);
 }
@@ -78,11 +78,11 @@ VideoMXFContent::valid_mxf (boost::filesystem::path path)
 }
 
 void
 }
 
 void
-VideoMXFContent::examine (shared_ptr<Job> job)
+VideoMXFContent::examine (shared_ptr<const Film> film, shared_ptr<Job> job)
 {
        job->set_progress_unknown ();
 
 {
        job->set_progress_unknown ();
 
-       Content::examine (job);
+       Content::examine (film, job);
 
        video.reset (new VideoContent (this));
        shared_ptr<VideoMXFExaminer> examiner (new VideoMXFExaminer (shared_from_this ()));
 
        video.reset (new VideoContent (this));
        shared_ptr<VideoMXFExaminer> examiner (new VideoMXFExaminer (shared_from_this ()));
@@ -117,10 +117,10 @@ VideoMXFContent::as_xml (xmlpp::Node* node, bool with_paths) const
 }
 
 DCPTime
 }
 
 DCPTime
-VideoMXFContent::full_length () const
+VideoMXFContent::full_length (shared_ptr<const Film> film) const
 {
 {
-       FrameRateChange const frc (active_video_frame_rate(), film()->video_frame_rate());
-       return DCPTime::from_frames (llrint (video->length_after_3d_combine() * frc.factor()), film()->video_frame_rate());
+       FrameRateChange const frc (active_video_frame_rate(film), film->video_frame_rate());
+       return DCPTime::from_frames (llrint (video->length_after_3d_combine() * frc.factor()), film->video_frame_rate());
 }
 
 void
 }
 
 void
index 1fa428704d620084eaa0645aa118d8fed389bc74..c536cb2aa99da5fe7e8ee3177c777d2a945be6a5 100644 (file)
 class VideoMXFContent : public Content
 {
 public:
 class VideoMXFContent : public Content
 {
 public:
-       VideoMXFContent (boost::shared_ptr<const Film> film, boost::filesystem::path path);
-       VideoMXFContent (boost::shared_ptr<const Film> film, cxml::ConstNodePtr node, int version);
+       VideoMXFContent (boost::filesystem::path path);
+       VideoMXFContent (cxml::ConstNodePtr node, int version);
 
        boost::shared_ptr<VideoMXFContent> shared_from_this () {
                return boost::dynamic_pointer_cast<VideoMXFContent> (Content::shared_from_this ());
        }
 
 
        boost::shared_ptr<VideoMXFContent> shared_from_this () {
                return boost::dynamic_pointer_cast<VideoMXFContent> (Content::shared_from_this ());
        }
 
-       void examine (boost::shared_ptr<Job> job);
+       void examine (boost::shared_ptr<const Film> film, boost::shared_ptr<Job> job);
        std::string summary () const;
        std::string technical_summary () const;
        std::string identifier () const;
        void as_xml (xmlpp::Node* node, bool with_paths) const;
        std::string summary () const;
        std::string technical_summary () const;
        std::string identifier () const;
        void as_xml (xmlpp::Node* node, bool with_paths) const;
-       DCPTime full_length () const;
+       DCPTime full_length (boost::shared_ptr<const Film> film) const;
        void add_properties (std::list<UserProperty>& p) const;
 
        static bool valid_mxf (boost::filesystem::path path);
        void add_properties (std::list<UserProperty>& p) const;
 
        static bool valid_mxf (boost::filesystem::path path);
index 194830c635e4ec5cab4495c99fb2e6790d38515f..7d9656dd5a7d755aabf1379c42212cb33c1f2326 100644 (file)
 using boost::shared_ptr;
 using boost::optional;
 
 using boost::shared_ptr;
 using boost::optional;
 
-VideoMXFDecoder::VideoMXFDecoder (shared_ptr<const VideoMXFContent> content, shared_ptr<Log> log)
+VideoMXFDecoder::VideoMXFDecoder (shared_ptr<const VideoMXFContent> content)
        : _content (content)
 {
        : _content (content)
 {
-       video.reset (new VideoDecoder (this, content, log));
+       video.reset (new VideoDecoder (this, content));
 
        shared_ptr<dcp::MonoPictureAsset> mono;
        try {
 
        shared_ptr<dcp::MonoPictureAsset> mono;
        try {
@@ -68,9 +68,9 @@ VideoMXFDecoder::VideoMXFDecoder (shared_ptr<const VideoMXFContent> content, sha
 }
 
 bool
 }
 
 bool
-VideoMXFDecoder::pass ()
+VideoMXFDecoder::pass (shared_ptr<const Film> film)
 {
 {
-       double const vfr = _content->active_video_frame_rate ();
+       double const vfr = _content->active_video_frame_rate (film);
        int64_t const frame = _next.frames_round (vfr);
 
        if (frame >= _content->video->length()) {
        int64_t const frame = _next.frames_round (vfr);
 
        if (frame >= _content->video->length()) {
@@ -79,6 +79,7 @@ VideoMXFDecoder::pass ()
 
        if (_mono_reader) {
                video->emit (
 
        if (_mono_reader) {
                video->emit (
+                       film,
                        shared_ptr<ImageProxy> (
                                new J2KImageProxy (_mono_reader->get_frame(frame), _size, AV_PIX_FMT_XYZ12LE, optional<int>())
                                ),
                        shared_ptr<ImageProxy> (
                                new J2KImageProxy (_mono_reader->get_frame(frame), _size, AV_PIX_FMT_XYZ12LE, optional<int>())
                                ),
@@ -86,12 +87,14 @@ VideoMXFDecoder::pass ()
                        );
        } else {
                video->emit (
                        );
        } else {
                video->emit (
+                       film,
                        shared_ptr<ImageProxy> (
                                new J2KImageProxy (_stereo_reader->get_frame(frame), _size, dcp::EYE_LEFT, AV_PIX_FMT_XYZ12LE, optional<int>())
                                ),
                        frame
                        );
                video->emit (
                        shared_ptr<ImageProxy> (
                                new J2KImageProxy (_stereo_reader->get_frame(frame), _size, dcp::EYE_LEFT, AV_PIX_FMT_XYZ12LE, optional<int>())
                                ),
                        frame
                        );
                video->emit (
+                       film,
                        shared_ptr<ImageProxy> (
                                new J2KImageProxy (_stereo_reader->get_frame(frame), _size, dcp::EYE_RIGHT, AV_PIX_FMT_XYZ12LE, optional<int>())
                                ),
                        shared_ptr<ImageProxy> (
                                new J2KImageProxy (_stereo_reader->get_frame(frame), _size, dcp::EYE_RIGHT, AV_PIX_FMT_XYZ12LE, optional<int>())
                                ),
@@ -104,8 +107,8 @@ VideoMXFDecoder::pass ()
 }
 
 void
 }
 
 void
-VideoMXFDecoder::seek (ContentTime t, bool accurate)
+VideoMXFDecoder::seek (shared_ptr<const Film> film, ContentTime t, bool accurate)
 {
 {
-       Decoder::seek (t, accurate);
+       Decoder::seek (film, t, accurate);
        _next = t;
 }
        _next = t;
 }
index 3cbdcfb2dffbc5e4316bffc725243ceba76ebc84..6b5b328ac09aebe0956ec705b8bd5ba046df5fde 100644 (file)
@@ -28,10 +28,10 @@ class Log;
 class VideoMXFDecoder : public Decoder
 {
 public:
 class VideoMXFDecoder : public Decoder
 {
 public:
-       VideoMXFDecoder (boost::shared_ptr<const VideoMXFContent>, boost::shared_ptr<Log> log);
+       VideoMXFDecoder (boost::shared_ptr<const VideoMXFContent>);
 
 
-       bool pass ();
-       void seek (ContentTime t, bool accurate);
+       bool pass (boost::shared_ptr<const Film> film);
+       void seek (boost::shared_ptr<const Film> film, ContentTime t, bool accurate);
 
 private:
 
 
 private:
 
index 473cc6d8bd7f17e696c5e89d30afd2e070863041..7028624a847116c270df7839a248f0781485ecfb 100644 (file)
@@ -38,6 +38,7 @@
 #include "lib/job_manager.h"
 #include "lib/job.h"
 #include "lib/film.h"
 #include "lib/job_manager.h"
 #include "lib/job.h"
 #include "lib/film.h"
+#include "lib/null_log.h"
 #include "lib/video_content.h"
 #include "lib/text_content.h"
 #include "lib/ratio.h"
 #include "lib/video_content.h"
 #include "lib/text_content.h"
 #include "lib/ratio.h"
@@ -126,6 +127,9 @@ public:
                , _view_full_screen (0)
                , _view_dual_screen (0)
        {
                , _view_full_screen (0)
                , _view_dual_screen (0)
        {
+               /* XXX */
+               dcpomatic_log.reset (new NullLog());
+               cout << "here's the log " << dcpomatic_log.get() << "\n";
 
 #if defined(DCPOMATIC_WINDOWS)
                maybe_open_console ();
 
 #if defined(DCPOMATIC_WINDOWS)
                maybe_open_console ();
@@ -399,7 +403,7 @@ public:
 
                reset_film ();
                try {
 
                reset_film ();
                try {
-                       shared_ptr<DCPContent> dcp (new DCPContent(_film, dir));
+                       shared_ptr<DCPContent> dcp (new DCPContent(dir));
                        _film->examine_and_add_content (dcp);
                        bool const ok = display_progress (_("DCP-o-matic Player"), _("Loading content"));
                        if (!ok || !report_errors_from_last_job(this)) {
                        _film->examine_and_add_content (dcp);
                        bool const ok = display_progress (_("DCP-o-matic Player"), _("Loading content"));
                        if (!ok || !report_errors_from_last_job(this)) {
@@ -489,7 +493,7 @@ public:
 
                                if (kdm) {
                                        dcp->add_kdm (*kdm);
 
                                if (kdm) {
                                        dcp->add_kdm (*kdm);
-                                       dcp->examine (shared_ptr<Job>());
+                                       dcp->examine (_film, shared_ptr<Job>());
                                }
                        }
 
                                }
                        }
 
@@ -692,7 +696,7 @@ private:
                        DCPOMATIC_ASSERT (dcp);
                        try {
                                dcp->add_kdm (dcp::EncryptedKDM (dcp::file_to_string (wx_to_std (d->GetPath ()), MAX_KDM_SIZE)));
                        DCPOMATIC_ASSERT (dcp);
                        try {
                                dcp->add_kdm (dcp::EncryptedKDM (dcp::file_to_string (wx_to_std (d->GetPath ()), MAX_KDM_SIZE)));
-                               dcp->examine (shared_ptr<Job>());
+                               dcp->examine (_film, shared_ptr<Job>());
                        } catch (exception& e) {
                                error_dialog (this, wxString::Format (_("Could not load KDM.")), std_to_wx(e.what()));
                                d->Destroy ();
                        } catch (exception& e) {
                                error_dialog (this, wxString::Format (_("Could not load KDM.")), std_to_wx(e.what()));
                                d->Destroy ();
@@ -753,7 +757,7 @@ private:
                }
 
                dcp->set_cpl ((*i)->id());
                }
 
                dcp->set_cpl ((*i)->id());
-               dcp->examine (shared_ptr<Job>());
+               dcp->examine (_film, shared_ptr<Job>());
        }
 
        void view_full_screen ()
        }
 
        void view_full_screen ()
index e1f7c15a621f913959feb2fa1e83e073f43022aa..48540077e5584d4514abdb3b956f0eceb6d4bbaf 100644 (file)
@@ -156,7 +156,7 @@ AudioDialog::AudioDialog (wxWindow* parent, shared_ptr<Film> film, shared_ptr<Co
 
        if (content) {
                _playlist.reset (new Playlist ());
 
        if (content) {
                _playlist.reset (new Playlist ());
-               const_pointer_cast<Playlist> (_playlist)->add (content);
+               const_pointer_cast<Playlist>(_playlist)->add(film, content);
        } else {
                _playlist = film->playlist ();
        }
        } else {
                _playlist = film->playlist ();
        }
index 954d1676d4abfc03c2d52e80bbc6636d50e5d947..38504eacf15e1b6472dcd5be499c17fbcd552567 100644 (file)
@@ -266,7 +266,7 @@ AudioPanel::setup_description ()
                return;
        }
 
                return;
        }
 
-       checked_set (_description, ac.front()->audio->processing_description ());
+       checked_set (_description, ac.front()->audio->processing_description(_parent->film()));
 }
 
 void
 }
 
 void
@@ -304,7 +304,7 @@ AudioPanel::setup_sensitivity ()
        }
 
        string why_not;
        }
 
        string why_not;
-       bool const can_reference = dcp && dcp->can_reference_audio (why_not);
+       bool const can_reference = dcp && dcp->can_reference_audio (_parent->film(), why_not);
        setup_refer_button (_reference, _reference_note, dcp, can_reference, why_not);
 
        if (_reference->GetValue ()) {
        setup_refer_button (_reference, _reference_note, dcp, can_reference, why_not);
 
        if (_reference->GetValue ()) {
@@ -353,7 +353,7 @@ AudioPanel::setup_peak ()
                _peak->SetLabel (wxT (""));
        } else {
                shared_ptr<Playlist> playlist (new Playlist);
                _peak->SetLabel (wxT (""));
        } else {
                shared_ptr<Playlist> playlist (new Playlist);
-               playlist->add (sel.front ());
+               playlist->add (_parent->film(), sel.front());
                try {
                        shared_ptr<AudioAnalysis> analysis (new AudioAnalysis (_parent->film()->audio_analysis_path (playlist)));
                        peak_dB = 20 * log10 (analysis->overall_sample_peak().first.peak) + analysis->gain_correction (playlist);
                try {
                        shared_ptr<AudioAnalysis> analysis (new AudioAnalysis (_parent->film()->audio_analysis_path (playlist)));
                        peak_dB = 20 * log10 (analysis->overall_sample_peak().first.peak) + analysis->gain_correction (playlist);
index 6a5ca8be4dd9a1998cf076fc0d4abf9ca29c2d7a..017d2c659ba97abac31a9b70a9b4b46facb63c7d 100644 (file)
@@ -209,7 +209,7 @@ ContentMenu::join ()
        }
 
        try {
        }
 
        try {
-               shared_ptr<FFmpegContent> joined (new FFmpegContent (film, fc));
+               shared_ptr<FFmpegContent> joined (new FFmpegContent(fc));
                film->remove_content (_content);
                film->examine_and_add_content (joined);
        } catch (JoinError& e) {
                film->remove_content (_content);
                film->examine_and_add_content (joined);
        } catch (JoinError& e) {
@@ -306,9 +306,9 @@ ContentMenu::find_missing ()
 
        if (r == wxID_OK) {
                if (dc) {
 
        if (r == wxID_OK) {
                if (dc) {
-                       content.push_back (shared_ptr<DCPContent> (new DCPContent (film, path)));
+                       content.push_back (shared_ptr<DCPContent>(new DCPContent(path)));
                } else {
                } else {
-                       content = content_factory (film, path);
+                       content = content_factory (path);
                }
        }
 
                }
        }
 
index 8e6c49294326a6d6edacd9b75e7f72c8f0802338..93b270faac8029352915946ce3a11636a199e529 100644 (file)
@@ -450,7 +450,7 @@ ContentPanel::add_folder_clicked ()
        list<shared_ptr<Content> > content;
 
        try {
        list<shared_ptr<Content> > content;
 
        try {
-               content = content_factory (_film, path);
+               content = content_factory (path);
        } catch (exception& e) {
                error_dialog (_parent, e.what());
                return;
        } catch (exception& e) {
                error_dialog (_parent, e.what());
                return;
@@ -493,7 +493,7 @@ ContentPanel::add_dcp_clicked ()
        }
 
        try {
        }
 
        try {
-               _film->examine_and_add_content (shared_ptr<Content> (new DCPContent (_film, path)));
+               _film->examine_and_add_content (shared_ptr<Content> (new DCPContent (path)));
        } catch (exception& e) {
                error_dialog (_parent, e.what());
        }
        } catch (exception& e) {
                error_dialog (_parent, e.what());
        }
@@ -755,7 +755,7 @@ ContentPanel::add_files (list<boost::filesystem::path> paths)
 
        try {
                BOOST_FOREACH (boost::filesystem::path i, paths) {
 
        try {
                BOOST_FOREACH (boost::filesystem::path i, paths) {
-                       BOOST_FOREACH (shared_ptr<Content> j, content_factory (_film, i)) {
+                       BOOST_FOREACH (shared_ptr<Content> j, content_factory(i)) {
                                _film->examine_and_add_content (j);
                        }
                }
                                _film->examine_and_add_content (j);
                        }
                }
index cf805e8f78cf9171562b30f04fe43cc44db9db05..af1dbdf14dd0db95ac8e7f2b5d137a690cca7a79 100644 (file)
@@ -214,7 +214,7 @@ Controls::Controls (wxWindow* parent, shared_ptr<FilmViewer> viewer, bool editor
 void
 Controls::add_clicked ()
 {
 void
 Controls::add_clicked ()
 {
-       shared_ptr<Content> sel = selected_content()->clone();
+       shared_ptr<Content> sel = selected_content()->clone(_film);
        DCPOMATIC_ASSERT (sel);
        _film->examine_and_add_content (sel);
        bool const ok = display_progress (_("DCP-o-matic"), _("Loading DCP"));
        DCPOMATIC_ASSERT (sel);
        _film->examine_and_add_content (sel);
        bool const ok = display_progress (_("DCP-o-matic"), _("Loading DCP"));
@@ -604,7 +604,7 @@ Controls::add_content_to_list (shared_ptr<Content> content, wxListCtrl* ctrl)
        wxListItem it;
        it.SetId(N);
        it.SetColumn(0);
        wxListItem it;
        it.SetId(N);
        it.SetColumn(0);
-       DCPTime length = content->length_after_trim ();
+       DCPTime length = content->length_after_trim (_film);
        int seconds = length.seconds();
        int minutes = seconds / 60;
        seconds -= minutes * 60;
        int seconds = length.seconds();
        int minutes = seconds / 60;
        seconds -= minutes * 60;
@@ -662,9 +662,9 @@ Controls::update_content_directory ()
                try {
                        shared_ptr<Content> content;
                        if (is_directory(*i) && (is_regular_file(*i / "ASSETMAP") || is_regular_file(*i / "ASSETMAP.xml"))) {
                try {
                        shared_ptr<Content> content;
                        if (is_directory(*i) && (is_regular_file(*i / "ASSETMAP") || is_regular_file(*i / "ASSETMAP.xml"))) {
-                               content.reset (new DCPContent(_film, *i));
+                               content.reset (new DCPContent(*i));
                        } else if (i->path().extension() == ".mp4" || i->path().extension() == ".ecinema") {
                        } else if (i->path().extension() == ".mp4" || i->path().extension() == ".ecinema") {
-                               content = content_factory(_film, *i).front();
+                               content = content_factory(*i).front();
                        }
 
                        if (content) {
                        }
 
                        if (content) {
index afa1940db3fe94e5014e61c38b70dfbbc373e648..2d489b3e82ec9465acc6c9b336cdb3da986afba5 100644 (file)
@@ -544,7 +544,7 @@ FilmViewer::quick_refresh ()
                return false;
        }
 
                return false;
        }
 
-       if (!_player_video.first->reset_metadata (_player->video_container_size(), _film->frame_size())) {
+       if (!_player_video.first->reset_metadata (_film, _player->video_container_size(), _film->frame_size())) {
                return false;
        }
 
                return false;
        }
 
index c0821510ceb54d56b2be333f2e3f77e8c70eb0be..5f480d5b4902832b14886a3aeb726c1d154fb7e8 100644 (file)
@@ -153,8 +153,8 @@ PlayerInformation::triggered_update ()
 
        string const len = String::compose(
                wx_to_std(_("Length: %1 (%2 frames)")),
 
        string const len = String::compose(
                wx_to_std(_("Length: %1 (%2 frames)")),
-               time_to_hmsf(dcp->full_length(), lrint(*vfr)),
-               dcp->full_length().frames_round(*vfr)
+               time_to_hmsf(dcp->full_length(fv->film()), lrint(*vfr)),
+               dcp->full_length(fv->film()).frames_round(*vfr)
                );
 
        checked_set (_dcp[r++], std_to_wx(len));
                );
 
        checked_set (_dcp[r++], std_to_wx(len));
index 6473cd68bbbf738be99effaaaed733985c5b2408..a37f5a2ce6f4c151e17dfe8c3e1e4ae1500e8868 100644 (file)
@@ -39,8 +39,9 @@ int const SubtitleAppearanceDialog::NONE = 0;
 int const SubtitleAppearanceDialog::OUTLINE = 1;
 int const SubtitleAppearanceDialog::SHADOW = 2;
 
 int const SubtitleAppearanceDialog::OUTLINE = 1;
 int const SubtitleAppearanceDialog::SHADOW = 2;
 
-SubtitleAppearanceDialog::SubtitleAppearanceDialog (wxWindow* parent, shared_ptr<Content> content, shared_ptr<TextContent> caption)
+SubtitleAppearanceDialog::SubtitleAppearanceDialog (wxWindow* parent, shared_ptr<const Film> film, shared_ptr<Content> content, shared_ptr<TextContent> caption)
        : wxDialog (parent, wxID_ANY, _("Caption appearance"))
        : wxDialog (parent, wxID_ANY, _("Caption appearance"))
+       , _film (film)
        , _content (content)
        , _caption (caption)
 {
        , _content (content)
        , _caption (caption)
 {
@@ -164,17 +165,17 @@ SubtitleAppearanceDialog::SubtitleAppearanceDialog (wxWindow* parent, shared_ptr
        optional<ContentTime> fade_in = _caption->fade_in();
        _force_fade_in->SetValue (static_cast<bool>(fade_in));
        if (fade_in) {
        optional<ContentTime> fade_in = _caption->fade_in();
        _force_fade_in->SetValue (static_cast<bool>(fade_in));
        if (fade_in) {
-               _fade_in->set (*fade_in, _content->active_video_frame_rate());
+               _fade_in->set (*fade_in, _content->active_video_frame_rate(film));
        } else {
        } else {
-               _fade_in->set (ContentTime(), _content->active_video_frame_rate());
+               _fade_in->set (ContentTime(), _content->active_video_frame_rate(film));
        }
 
        optional<ContentTime> fade_out = _caption->fade_out();
        _force_fade_out->SetValue (static_cast<bool>(fade_out));
        if (fade_out) {
        }
 
        optional<ContentTime> fade_out = _caption->fade_out();
        _force_fade_out->SetValue (static_cast<bool>(fade_out));
        if (fade_out) {
-               _fade_out->set (*fade_out, _content->active_video_frame_rate ());
+               _fade_out->set (*fade_out, _content->active_video_frame_rate(film));
        } else {
        } else {
-               _fade_out->set (ContentTime(), _content->active_video_frame_rate ());
+               _fade_out->set (ContentTime(), _content->active_video_frame_rate(film));
        }
 
        _outline_width->SetValue (_caption->outline_width ());
        }
 
        _outline_width->SetValue (_caption->outline_width ());
@@ -213,6 +214,8 @@ SubtitleAppearanceDialog::set_to (wxWindow* w, int& r)
 void
 SubtitleAppearanceDialog::apply ()
 {
 void
 SubtitleAppearanceDialog::apply ()
 {
+       shared_ptr<const Film> film = _film.lock ();
+
        if (_force_colour->GetValue ()) {
                wxColour const c = _colour->GetColour ();
                _caption->set_colour (dcp::Colour (c.Red(), c.Green(), c.Blue()));
        if (_force_colour->GetValue ()) {
                wxColour const c = _colour->GetColour ();
                _caption->set_colour (dcp::Colour (c.Red(), c.Green(), c.Blue()));
@@ -241,12 +244,12 @@ SubtitleAppearanceDialog::apply ()
                _caption->unset_effect_colour ();
        }
        if (_force_fade_in->GetValue ()) {
                _caption->unset_effect_colour ();
        }
        if (_force_fade_in->GetValue ()) {
-               _caption->set_fade_in (_fade_in->get (_content->active_video_frame_rate ()));
+               _caption->set_fade_in (_fade_in->get(_content->active_video_frame_rate(film)));
        } else {
                _caption->unset_fade_in ();
        }
        if (_force_fade_out->GetValue ()) {
        } else {
                _caption->unset_fade_in ();
        }
        if (_force_fade_out->GetValue ()) {
-               _caption->set_fade_out (_fade_out->get (_content->active_video_frame_rate ()));
+               _caption->set_fade_out (_fade_out->get(_content->active_video_frame_rate(film)));
        } else {
                _caption->unset_fade_out ();
        }
        } else {
                _caption->unset_fade_out ();
        }
index 80ef584704a17e2f3453aedc3ccca6ec90e55a25..d02e283d90a8d80e06eba09e6ee1ac1919fa42e7 100644 (file)
@@ -32,11 +32,12 @@ class RGBAColourPicker;
 class FFmpegSubtitleStream;
 class wxCheckBox;
 class wxWidget;
 class FFmpegSubtitleStream;
 class wxCheckBox;
 class wxWidget;
+class Film;
 
 class SubtitleAppearanceDialog : public wxDialog
 {
 public:
 
 class SubtitleAppearanceDialog : public wxDialog
 {
 public:
-       SubtitleAppearanceDialog (wxWindow* parent, boost::shared_ptr<Content> content, boost::shared_ptr<TextContent> caption);
+       SubtitleAppearanceDialog (wxWindow* parent, boost::shared_ptr<const Film> film, boost::shared_ptr<Content> content, boost::shared_ptr<TextContent> caption);
 
        void apply ();
 
 
        void apply ();
 
@@ -46,6 +47,7 @@ private:
        wxCheckBox* set_to (wxWindow* w, int& r);
        void content_change (ChangeType type);
 
        wxCheckBox* set_to (wxWindow* w, int& r);
        void content_change (ChangeType type);
 
+       boost::weak_ptr<const Film> _film;
        wxCheckBox* _force_colour;
        wxColourPickerCtrl* _colour;
        wxCheckBox* _force_effect;
        wxCheckBox* _force_colour;
        wxColourPickerCtrl* _colour;
        wxCheckBox* _force_effect;
index 350dddc0dffe9d5b2d6952673c76735b4a6f7994..4b53a941e768924c592ad6e83ce9dde06a9e5615 100644 (file)
@@ -457,7 +457,7 @@ TextPanel::setup_sensitivity ()
        }
 
        string why_not;
        }
 
        string why_not;
-       bool const can_reference = dcp && dcp->can_reference_text (_original_type, why_not);
+       bool const can_reference = dcp && dcp->can_reference_text (_parent->film(), _original_type, why_not);
        setup_refer_button (_reference, _reference_note, dcp, can_reference, why_not);
 
        bool const reference = _reference->GetValue ();
        setup_refer_button (_reference, _reference_note, dcp, can_reference, why_not);
 
        bool const reference = _reference->GetValue ();
@@ -582,7 +582,7 @@ TextPanel::text_view_clicked ()
        ContentList c = _parent->selected_text ();
        DCPOMATIC_ASSERT (c.size() == 1);
 
        ContentList c = _parent->selected_text ();
        DCPOMATIC_ASSERT (c.size() == 1);
 
-       shared_ptr<Decoder> decoder = decoder_factory (c.front(), _parent->film()->log(), false);
+       shared_ptr<Decoder> decoder = decoder_factory (_parent->film(), c.front(), false);
 
        if (decoder) {
                _text_view = new TextView (this, _parent->film(), c.front(), c.front()->text_of_original_type(_original_type), decoder, _parent->film_viewer());
 
        if (decoder) {
                _text_view = new TextView (this, _parent->film(), c.front(), c.front()->text_of_original_type(_original_type), decoder, _parent->film_viewer());
@@ -627,7 +627,7 @@ TextPanel::appearance_dialog_clicked ()
        ContentList c = _parent->selected_text ();
        DCPOMATIC_ASSERT (c.size() == 1);
 
        ContentList c = _parent->selected_text ();
        DCPOMATIC_ASSERT (c.size() == 1);
 
-       SubtitleAppearanceDialog* d = new SubtitleAppearanceDialog (this, c.front(), c.front()->text_of_original_type(_original_type));
+       SubtitleAppearanceDialog* d = new SubtitleAppearanceDialog (this, _parent->film(), c.front(), c.front()->text_of_original_type(_original_type));
        if (d->ShowModal () == wxID_OK) {
                d->apply ();
        }
        if (d->ShowModal () == wxID_OK) {
                d->apply ();
        }
index 9b591b19161406408c88bef739a4c4323a1f91d0..49a98dc5e3c06f4647aa742093c50f6a5061a613 100644 (file)
@@ -96,7 +96,7 @@ TextView::TextView (
                        i->Stop.connect (bind (&TextView::data_stop, this, _1));
                }
        }
                        i->Stop.connect (bind (&TextView::data_stop, this, _1));
                }
        }
-       while (!decoder->pass ()) {}
+       while (!decoder->pass (film)) {}
        SetSizerAndFit (sizer);
 }
 
        SetSizerAndFit (sizer);
 }
 
index a607b1eb170fac26507bf8822a7a421a5fc8dafb..206c13cf69e64fa15a00316dfff917de9d9304a0 100644 (file)
@@ -268,7 +268,7 @@ Timeline::film_content_change (ChangeType type, int property, bool frequent)
 
 template <class T>
 int
 
 template <class T>
 int
-place (TimelineViewList& views, int& tracks)
+place (shared_ptr<const Film> film, TimelineViewList& views, int& tracks)
 {
        int const base = tracks;
 
 {
        int const base = tracks;
 
@@ -282,7 +282,7 @@ place (TimelineViewList& views, int& tracks)
                int t = base;
 
                shared_ptr<Content> content = cv->content();
                int t = base;
 
                shared_ptr<Content> content = cv->content();
-               DCPTimePeriod const content_period (content->position(), content->end());
+               DCPTimePeriod const content_period (content->position(), content->end(film));
 
                while (true) {
                        TimelineViewList::iterator j = views.begin();
 
                while (true) {
                        TimelineViewList::iterator j = views.begin();
@@ -296,7 +296,7 @@ place (TimelineViewList& views, int& tracks)
                                shared_ptr<Content> test_content = test->content();
                                if (
                                        test->track() && test->track().get() == t &&
                                shared_ptr<Content> test_content = test->content();
                                if (
                                        test->track() && test->track().get() == t &&
-                                       content_period.overlap(DCPTimePeriod(test_content->position(), test_content->end()))) {
+                                       content_period.overlap(DCPTimePeriod(test_content->position(), test_content->end(film)))) {
                                        /* we have an overlap on track `t' */
                                        ++t;
                                        break;
                                        /* we have an overlap on track `t' */
                                        ++t;
                                        break;
@@ -354,6 +354,9 @@ Timeline::assign_tracks ()
           Audio N
        */
 
           Audio N
        */
 
+       shared_ptr<const Film> film = _film.lock ();
+       DCPOMATIC_ASSERT (film);
+
        _tracks = 0;
 
        for (TimelineViewList::iterator i = _views.begin(); i != _views.end(); ++i) {
        _tracks = 0;
 
        for (TimelineViewList::iterator i = _views.begin(); i != _views.end(); ++i) {
@@ -386,7 +389,7 @@ Timeline::assign_tracks ()
 
        /* Texts */
 
 
        /* Texts */
 
-       int const text_tracks = place<TimelineTextContentView> (_views, _tracks);
+       int const text_tracks = place<TimelineTextContentView> (film, _views, _tracks);
 
        /* Atmos */
 
 
        /* Atmos */
 
@@ -412,7 +415,7 @@ Timeline::assign_tracks ()
 
        TimelineViewList views = _views;
        sort(views.begin(), views.end(), AudioMappingComparator());
 
        TimelineViewList views = _views;
        sort(views.begin(), views.end(), AudioMappingComparator());
-       int const audio_tracks = place<TimelineAudioContentView> (views, _tracks);
+       int const audio_tracks = place<TimelineAudioContentView> (film, views, _tracks);
 
        _labels_view->set_3d (have_3d);
        _labels_view->set_audio_tracks (audio_tracks);
 
        _labels_view->set_3d (have_3d);
        _labels_view->set_audio_tracks (audio_tracks);
@@ -520,10 +523,13 @@ Timeline::left_down_select (wxMouseEvent& ev)
                                continue;
                        }
 
                                continue;
                        }
 
+                       shared_ptr<Film> film = _film.lock ();
+                       DCPOMATIC_ASSERT (film);
+
                        _start_snaps.push_back (cv->content()->position());
                        _end_snaps.push_back (cv->content()->position());
                        _start_snaps.push_back (cv->content()->position());
                        _end_snaps.push_back (cv->content()->position());
-                       _start_snaps.push_back (cv->content()->end());
-                       _end_snaps.push_back (cv->content()->end());
+                       _start_snaps.push_back (cv->content()->end(film));
+                       _end_snaps.push_back (cv->content()->end(film));
 
                        BOOST_FOREACH (DCPTime i, cv->content()->reel_split_points()) {
                                _start_snaps.push_back (i);
 
                        BOOST_FOREACH (DCPTime i, cv->content()->reel_split_points()) {
                                _start_snaps.push_back (i);
@@ -725,9 +731,11 @@ Timeline::set_position_from_event (wxMouseEvent& ev)
 
        DCPTime new_position = _down_view_position + DCPTime::from_seconds ((p.x - _down_point.x) / pps);
 
 
        DCPTime new_position = _down_view_position + DCPTime::from_seconds ((p.x - _down_point.x) / pps);
 
-       if (_snap) {
+       shared_ptr<Film> film = _film.lock ();
+       DCPOMATIC_ASSERT (film);
 
 
-               DCPTime const new_end = new_position + _down_view->content()->length_after_trim();
+       if (_snap) {
+               DCPTime const new_end = new_position + _down_view->content()->length_after_trim(film);
                /* Signed `distance' to nearest thing (i.e. negative is left on the timeline,
                   positive is right).
                */
                /* Signed `distance' to nearest thing (i.e. negative is left on the timeline,
                   positive is right).
                */
@@ -755,10 +763,8 @@ Timeline::set_position_from_event (wxMouseEvent& ev)
                new_position = DCPTime ();
        }
 
                new_position = DCPTime ();
        }
 
-       _down_view->content()->set_position (new_position);
+       _down_view->content()->set_position (film, new_position);
 
 
-       shared_ptr<Film> film = _film.lock ();
-       DCPOMATIC_ASSERT (film);
        film->set_sequence (false);
 }
 
        film->set_sequence (false);
 }
 
index 12691f661d34d163eff989173d62bb1254f63ab0..69f1723cee28b6ea055ab647a1833882fa7a0e67 100644 (file)
@@ -50,7 +50,7 @@ TimelineContentView::bbox () const
        return dcpomatic::Rect<int> (
                time_x (content->position ()),
                y_pos (_track.get()),
        return dcpomatic::Rect<int> (
                time_x (content->position ()),
                y_pos (_track.get()),
-               content->length_after_trim().seconds() * _timeline.pixels_per_second().get_value_or(0),
+               content->length_after_trim(film).seconds() * _timeline.pixels_per_second().get_value_or(0),
                _timeline.pixels_per_track()
                );
 }
                _timeline.pixels_per_track()
                );
 }
@@ -104,7 +104,7 @@ TimelineContentView::do_paint (wxGraphicsContext* gc, list<dcpomatic::Rect<int>
        }
 
        DCPTime const position = cont->position ();
        }
 
        DCPTime const position = cont->position ();
-       DCPTime const len = cont->length_after_trim ();
+       DCPTime const len = cont->length_after_trim (film);
 
        wxColour selected (background_colour().Red() / 2, background_colour().Green() / 2, background_colour().Blue() / 2);
 
 
        wxColour selected (background_colour().Red() / 2, background_colour().Green() / 2, background_colour().Blue() / 2);
 
index b1d13367fd4a5e624c94a27e2450d9c4a73ccd4e..cbaed68709edf620adb37640949e82019a141705 100644 (file)
@@ -227,11 +227,11 @@ TimingPanel::update_full_length ()
 {
        set<DCPTime> check;
        BOOST_FOREACH (shared_ptr<const Content> i, _parent->selected ()) {
 {
        set<DCPTime> check;
        BOOST_FOREACH (shared_ptr<const Content> i, _parent->selected ()) {
-               check.insert (i->full_length ());
+               check.insert (i->full_length(_parent->film()));
        }
 
        if (check.size() == 1) {
        }
 
        if (check.size() == 1) {
-               _full_length->set (_parent->selected().front()->full_length (), _parent->film()->video_frame_rate ());
+               _full_length->set (_parent->selected().front()->full_length(_parent->film()), _parent->film()->video_frame_rate());
        } else {
                _full_length->clear ();
        }
        } else {
                _full_length->clear ();
        }
@@ -242,11 +242,11 @@ TimingPanel::update_play_length ()
 {
        set<DCPTime> check;
        BOOST_FOREACH (shared_ptr<const Content> i, _parent->selected ()) {
 {
        set<DCPTime> check;
        BOOST_FOREACH (shared_ptr<const Content> i, _parent->selected ()) {
-               check.insert (i->length_after_trim ());
+               check.insert (i->length_after_trim(_parent->film()));
        }
 
        if (check.size() == 1) {
        }
 
        if (check.size() == 1) {
-               _play_length->set (_parent->selected().front()->length_after_trim (), _parent->film()->video_frame_rate ());
+               _play_length->set (_parent->selected().front()->length_after_trim(_parent->film()), _parent->film()->video_frame_rate());
        } else {
                _play_length->clear ();
        }
        } else {
                _play_length->clear ();
        }
@@ -371,7 +371,7 @@ TimingPanel::position_changed ()
 {
        DCPTime const pos = _position->get (_parent->film()->video_frame_rate ());
        BOOST_FOREACH (shared_ptr<Content> i, _parent->selected ()) {
 {
        DCPTime const pos = _position->get (_parent->film()->video_frame_rate ());
        BOOST_FOREACH (shared_ptr<Content> i, _parent->selected ()) {
-               i->set_position (pos);
+               i->set_position (_parent->film(), pos);
        }
 }
 
        }
 }
 
@@ -407,7 +407,7 @@ TimingPanel::trim_start_changed ()
        ContentTime const trim = _trim_start->get (_parent->film()->video_frame_rate ());
 
        BOOST_FOREACH (shared_ptr<Content> i, _parent->selected ()) {
        ContentTime const trim = _trim_start->get (_parent->film()->video_frame_rate ());
 
        BOOST_FOREACH (shared_ptr<Content> i, _parent->selected ()) {
-               if (i->position() <= ph && ph < i->end()) {
+               if (i->position() <= ph && ph < i->end(_parent->film())) {
                        /* The playhead is in i.  Use it as a reference to work out
                           where to put the playhead post-trim; we're trying to keep the playhead
                           at the same frame of content that we're looking at pre-trim.
                        /* The playhead is in i.  Use it as a reference to work out
                           where to put the playhead post-trim; we're trying to keep the playhead
                           at the same frame of content that we're looking at pre-trim.
@@ -457,7 +457,7 @@ TimingPanel::play_length_changed ()
        BOOST_FOREACH (shared_ptr<Content> i, _parent->selected ()) {
                FrameRateChange const frc = _parent->film()->active_frame_rate_change (i->position ());
                i->set_trim_end (
        BOOST_FOREACH (shared_ptr<Content> i, _parent->selected ()) {
                FrameRateChange const frc = _parent->film()->active_frame_rate_change (i->position ());
                i->set_trim_end (
-                       ContentTime (max(DCPTime(), i->full_length() - play_length), frc) - i->trim_start ()
+                       ContentTime (max(DCPTime(), i->full_length(_parent->film()) - play_length), frc) - i->trim_start()
                        );
        }
 }
                        );
        }
 }
@@ -522,9 +522,9 @@ TimingPanel::trim_start_to_playhead_clicked ()
        fv->set_coalesce_player_changes (true);
 
        BOOST_FOREACH (shared_ptr<Content> i, _parent->selected ()) {
        fv->set_coalesce_player_changes (true);
 
        BOOST_FOREACH (shared_ptr<Content> i, _parent->selected ()) {
-               if (i->position() < ph && ph < i->end ()) {
-                       FrameRateChange const frc = film->active_frame_rate_change (i->position ());
-                       i->set_trim_start (i->trim_start() + ContentTime (ph - i->position (), frc));
+               if (i->position() < ph && ph < i->end(film)) {
+                       FrameRateChange const frc = film->active_frame_rate_change (i->position());
+                       i->set_trim_start (i->trim_start() + ContentTime (ph - i->position(), frc));
                        new_ph = i->position ();
                }
        }
                        new_ph = i->position ();
                }
        }
@@ -547,9 +547,9 @@ TimingPanel::trim_end_to_playhead_clicked ()
        shared_ptr<const Film> film = _parent->film ();
        DCPTime const ph = fv->position().floor (film->video_frame_rate ());
        BOOST_FOREACH (shared_ptr<Content> i, _parent->selected ()) {
        shared_ptr<const Film> film = _parent->film ();
        DCPTime const ph = fv->position().floor (film->video_frame_rate ());
        BOOST_FOREACH (shared_ptr<Content> i, _parent->selected ()) {
-               if (i->position() < ph && ph < i->end ()) {
+               if (i->position() < ph && ph < i->end(film)) {
                        FrameRateChange const frc = film->active_frame_rate_change (i->position ());
                        FrameRateChange const frc = film->active_frame_rate_change (i->position ());
-                       i->set_trim_end (ContentTime (i->position() + i->full_length() - ph - DCPTime::from_frames (1, frc.dcp), frc) - i->trim_start());
+                       i->set_trim_end (ContentTime(i->position() + i->full_length(film) - ph - DCPTime::from_frames(1, frc.dcp), frc) - i->trim_start());
                }
        }
 }
                }
        }
 }
@@ -572,7 +572,7 @@ TimingPanel::setup_sensitivity ()
        DCPTime const ph = fv->position ();
        bool any_over_ph = false;
        BOOST_FOREACH (shared_ptr<const Content> i, _parent->selected ()) {
        DCPTime const ph = fv->position ();
        bool any_over_ph = false;
        BOOST_FOREACH (shared_ptr<const Content> i, _parent->selected ()) {
-               if (i->position() <= ph && ph < i->end()) {
+               if (i->position() <= ph && ph < i->end(_parent->film())) {
                        any_over_ph = true;
                }
        }
                        any_over_ph = true;
                }
        }
@@ -601,8 +601,8 @@ TimingPanel::move_to_start_of_reel_clicked ()
        MoveToDialog* d = new MoveToDialog (this, position, _parent->film());
 
        if (d->ShowModal() == wxID_OK) {
        MoveToDialog* d = new MoveToDialog (this, position, _parent->film());
 
        if (d->ShowModal() == wxID_OK) {
-               BOOST_FOREACH (shared_ptr<Content> i, _parent->selected ()) {
-                       i->set_position (d->position ());
+               BOOST_FOREACH (shared_ptr<Content> i, _parent->selected()) {
+                       i->set_position (_parent->film(), d->position());
                }
        }
        d->Destroy ();
                }
        }
        d->Destroy ();
index c525c10036d7dfba6479bdabc69c09f84a24efe4..55c0984a35b65e947ca839d4e9ae5ea9814bb6e5 100644 (file)
@@ -361,8 +361,8 @@ VideoPanel::film_content_changed (int property)
 
                if (check.size() == 1) {
                        _fade_in->set (
 
                if (check.size() == 1) {
                        _fade_in->set (
-                               ContentTime::from_frames (vc.front()->video->fade_in (), vc.front()->active_video_frame_rate ()),
-                               vc.front()->active_video_frame_rate ()
+                               ContentTime::from_frames (vc.front()->video->fade_in(), vc.front()->active_video_frame_rate(_parent->film())),
+                               vc.front()->active_video_frame_rate(_parent->film())
                                );
                } else {
                        _fade_in->clear ();
                                );
                } else {
                        _fade_in->clear ();
@@ -375,8 +375,8 @@ VideoPanel::film_content_changed (int property)
 
                if (check.size() == 1) {
                        _fade_out->set (
 
                if (check.size() == 1) {
                        _fade_out->set (
-                               ContentTime::from_frames (vc.front()->video->fade_out (), vc.front()->active_video_frame_rate ()),
-                               vc.front()->active_video_frame_rate ()
+                               ContentTime::from_frames (vc.front()->video->fade_out(), vc.front()->active_video_frame_rate(_parent->film())),
+                               vc.front()->active_video_frame_rate(_parent->film())
                                );
                } else {
                        _fade_out->clear ();
                                );
                } else {
                        _fade_out->clear ();
@@ -420,7 +420,7 @@ VideoPanel::setup_description ()
                return;
        }
 
                return;
        }
 
-       string d = vc.front()->video->processing_description ();
+       string d = vc.front()->video->processing_description (_parent->film());
        size_t lines = count (d.begin(), d.end(), '\n');
 
        for (int i = lines; i < 6; ++i) {
        size_t lines = count (d.begin(), d.end(), '\n');
 
        for (int i = lines; i < 6; ++i) {
@@ -504,7 +504,7 @@ VideoPanel::setup_sensitivity ()
        }
 
        string why_not;
        }
 
        string why_not;
-       bool const can_reference = dcp && dcp->can_reference_video (why_not);
+       bool const can_reference = dcp && dcp->can_reference_video (_parent->film(), why_not);
        setup_refer_button (_reference, _reference_note, dcp, can_reference, why_not);
 
        if (_reference->GetValue ()) {
        setup_refer_button (_reference, _reference_note, dcp, can_reference, why_not);
 
        if (_reference->GetValue ()) {
index e6e2cc7ce3a2401c848d328434cd2368dee18fda..da3fdf0201da913c676dae7eb4e7e2901493f3c6 100644 (file)
@@ -41,7 +41,7 @@ BOOST_AUTO_TEST_CASE (fourk_test)
 {
        shared_ptr<Film> film = new_test_film ("4k_test");
        film->set_name ("4k_test");
 {
        shared_ptr<Film> film = new_test_film ("4k_test");
        film->set_name ("4k_test");
-       shared_ptr<FFmpegContent> c (new FFmpegContent (film, "test/data/test.mp4"));
+       shared_ptr<FFmpegContent> c (new FFmpegContent("test/data/test.mp4"));
        film->set_resolution (RESOLUTION_4K);
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("FTR"));
        film->set_container (Ratio::from_id ("185"));
        film->set_resolution (RESOLUTION_4K);
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("FTR"));
        film->set_container (Ratio::from_id ("185"));
index a49987125e2eed6d7b3943c1e4829140c8273d6a..2fbaef7eaeab7c982ec6be08bcc419ab67cf8534 100644 (file)
@@ -112,7 +112,7 @@ BOOST_AUTO_TEST_CASE (audio_analysis_test)
        film->set_name ("audio_analysis_test");
        boost::filesystem::path p = private_data / "betty_L.wav";
 
        film->set_name ("audio_analysis_test");
        boost::filesystem::path p = private_data / "betty_L.wav";
 
-       shared_ptr<FFmpegContent> c (new FFmpegContent (film, p));
+       shared_ptr<FFmpegContent> c (new FFmpegContent(p));
        film->examine_and_add_content (c);
        wait_for_jobs ();
 
        film->examine_and_add_content (c);
        wait_for_jobs ();
 
@@ -127,7 +127,7 @@ BOOST_AUTO_TEST_CASE (audio_analysis_negative_delay_test)
 {
        shared_ptr<Film> film = new_test_film ("audio_analysis_negative_delay_test");
        film->set_name ("audio_analysis_negative_delay_test");
 {
        shared_ptr<Film> film = new_test_film ("audio_analysis_negative_delay_test");
        film->set_name ("audio_analysis_negative_delay_test");
-       shared_ptr<FFmpegContent> c (new FFmpegContent (film, private_data / "boon_telly.mkv"));
+       shared_ptr<FFmpegContent> c (new FFmpegContent(private_data / "boon_telly.mkv"));
        film->examine_and_add_content (c);
        wait_for_jobs ();
 
        film->examine_and_add_content (c);
        wait_for_jobs ();
 
@@ -144,7 +144,7 @@ BOOST_AUTO_TEST_CASE (audio_analysis_test2)
 {
        shared_ptr<Film> film = new_test_film ("audio_analysis_test2");
        film->set_name ("audio_analysis_test2");
 {
        shared_ptr<Film> film = new_test_film ("audio_analysis_test2");
        film->set_name ("audio_analysis_test2");
-       shared_ptr<FFmpegContent> c (new FFmpegContent (film, private_data / "3d_thx_broadway_2010_lossless.m2ts"));
+       shared_ptr<FFmpegContent> c (new FFmpegContent(private_data / "3d_thx_broadway_2010_lossless.m2ts"));
        film->examine_and_add_content (c);
        wait_for_jobs ();
 
        film->examine_and_add_content (c);
        wait_for_jobs ();
 
@@ -173,7 +173,7 @@ BOOST_AUTO_TEST_CASE (audio_analysis_test3)
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR"));
        film->set_name ("frobozz");
 
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR"));
        film->set_name ("frobozz");
 
-       shared_ptr<FFmpegContent> content (new FFmpegContent (film, "test/data/white.wav"));
+       shared_ptr<FFmpegContent> content (new FFmpegContent("test/data/white.wav"));
        film->examine_and_add_content (content);
        wait_for_jobs ();
 
        film->examine_and_add_content (content);
        wait_for_jobs ();
 
@@ -191,12 +191,12 @@ BOOST_AUTO_TEST_CASE (analyse_audio_test4)
        film->set_container (Ratio::from_id ("185"));
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR"));
        film->set_name ("frobozz");
        film->set_container (Ratio::from_id ("185"));
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR"));
        film->set_name ("frobozz");
-       shared_ptr<Content> content = content_factory(film, private_data / "20 The Wedding Convoy Song.m4a").front();
+       shared_ptr<Content> content = content_factory(private_data / "20 The Wedding Convoy Song.m4a").front();
        film->examine_and_add_content (content);
        wait_for_jobs ();
 
        shared_ptr<Playlist> playlist (new Playlist);
        film->examine_and_add_content (content);
        wait_for_jobs ();
 
        shared_ptr<Playlist> playlist (new Playlist);
-       playlist->add (content);
+       playlist->add (film, content);
        boost::signals2::connection c;
        JobManager::instance()->analyse_audio (film, playlist, false, c, boost::bind (&finished));
        BOOST_CHECK (!wait_for_jobs ());
        boost::signals2::connection c;
        JobManager::instance()->analyse_audio (film, playlist, false, c, boost::bind (&finished));
        BOOST_CHECK (!wait_for_jobs ());
index db64bc7c8fab70a4f91bc00bd180464c07fde297..d486364f20f68c0678f2cbbb007dcb538292c3b5 100644 (file)
@@ -58,7 +58,7 @@ void test_audio_delay (int delay_in_ms)
        film->set_container (Ratio::from_id ("185"));
        film->set_name (film_name);
 
        film->set_container (Ratio::from_id ("185"));
        film->set_name (film_name);
 
-       shared_ptr<FFmpegContent> content (new FFmpegContent (film, "test/data/staircase.wav"));
+       shared_ptr<FFmpegContent> content (new FFmpegContent("test/data/staircase.wav"));
        film->examine_and_add_content (content);
        wait_for_jobs ();
        content->audio->set_delay (delay_in_ms);
        film->examine_and_add_content (content);
        wait_for_jobs ();
        content->audio->set_delay (delay_in_ms);
index de212f611352abf7ba51de08d1ed8a1f9fe08231..9c790833ca904dcd33a7bb7b390dfa69b9286532 100644 (file)
@@ -39,7 +39,7 @@ BOOST_AUTO_TEST_CASE (audio_processor_test)
 {
        shared_ptr<Film> film = new_test_film ("audio_processor_test");
        film->set_name ("audio_processor_test");
 {
        shared_ptr<Film> film = new_test_film ("audio_processor_test");
        film->set_name ("audio_processor_test");
-       shared_ptr<FFmpegContent> c (new FFmpegContent (film, "test/data/white.wav"));
+       shared_ptr<FFmpegContent> c (new FFmpegContent("test/data/white.wav"));
        film->examine_and_add_content (c);
        wait_for_jobs ();
 
        film->examine_and_add_content (c);
        wait_for_jobs ();
 
index 0ee06c1acd694ef084457887de4efef4f96faeb9..a453bd85858c32456d0f35cb5b47ec3be4c4f7e8 100644 (file)
@@ -37,9 +37,9 @@ BOOST_AUTO_TEST_CASE (butler_test1)
        film->set_name ("butler_test1");
        film->set_container (Ratio::from_id ("185"));
 
        film->set_name ("butler_test1");
        film->set_container (Ratio::from_id ("185"));
 
-       shared_ptr<Content> video = content_factory(film, "test/data/flat_red.png").front ();
+       shared_ptr<Content> video = content_factory("test/data/flat_red.png").front ();
        film->examine_and_add_content (video);
        film->examine_and_add_content (video);
-       shared_ptr<Content> audio = content_factory(film, "test/data/staircase.wav").front ();
+       shared_ptr<Content> audio = content_factory("test/data/staircase.wav").front ();
        film->examine_and_add_content (audio);
        BOOST_REQUIRE (!wait_for_jobs ());
 
        film->examine_and_add_content (audio);
        BOOST_REQUIRE (!wait_for_jobs ());
 
index 0409d5849f1e9156b37e9df6a8ff24079c61cf07..b50430d4819e6e3a51b26560183e31f36ff95ac5 100644 (file)
@@ -35,7 +35,7 @@ using boost::shared_ptr;
 BOOST_AUTO_TEST_CASE (closed_caption_test1)
 {
        shared_ptr<Film> film = new_test_film2 ("closed_caption_test1");
 BOOST_AUTO_TEST_CASE (closed_caption_test1)
 {
        shared_ptr<Film> film = new_test_film2 ("closed_caption_test1");
-       shared_ptr<StringTextFileContent> content (new StringTextFileContent (film, "test/data/subrip.srt"));
+       shared_ptr<StringTextFileContent> content (new StringTextFileContent("test/data/subrip.srt"));
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs ());
 
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs ());
 
@@ -60,11 +60,11 @@ BOOST_AUTO_TEST_CASE (closed_caption_test1)
 BOOST_AUTO_TEST_CASE (closed_caption_test2)
 {
        shared_ptr<Film> film = new_test_film2 ("closed_caption_test2");
 BOOST_AUTO_TEST_CASE (closed_caption_test2)
 {
        shared_ptr<Film> film = new_test_film2 ("closed_caption_test2");
-       shared_ptr<StringTextFileContent> content1 (new StringTextFileContent (film, "test/data/subrip.srt"));
+       shared_ptr<StringTextFileContent> content1 (new StringTextFileContent("test/data/subrip.srt"));
        film->examine_and_add_content (content1);
        film->examine_and_add_content (content1);
-       shared_ptr<StringTextFileContent> content2 (new StringTextFileContent (film, "test/data/subrip2.srt"));
+       shared_ptr<StringTextFileContent> content2 (new StringTextFileContent("test/data/subrip2.srt"));
        film->examine_and_add_content (content2);
        film->examine_and_add_content (content2);
-       shared_ptr<StringTextFileContent> content3 (new StringTextFileContent (film, "test/data/subrip3.srt"));
+       shared_ptr<StringTextFileContent> content3 (new StringTextFileContent("test/data/subrip3.srt"));
        film->examine_and_add_content (content3);
        BOOST_REQUIRE (!wait_for_jobs ());
 
        film->examine_and_add_content (content3);
        BOOST_REQUIRE (!wait_for_jobs ());
 
index 398c88be26f7aa7b0a39729e80aac313cbd013d5..55e34ac5f0fb170596494dccb184d865f772078d 100644 (file)
@@ -41,7 +41,7 @@ BOOST_AUTO_TEST_CASE (content_test1)
        film->set_name ("content_test1");
        film->set_container (Ratio::from_id ("185"));
 
        film->set_name ("content_test1");
        film->set_container (Ratio::from_id ("185"));
 
-       shared_ptr<Content> content = content_factory(film, private_data / "demo_sound_bug.mkv").front ();
+       shared_ptr<Content> content = content_factory(private_data / "demo_sound_bug.mkv").front ();
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs ());
        film->make_dcp ();
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs ());
        film->make_dcp ();
@@ -69,7 +69,7 @@ BOOST_AUTO_TEST_CASE (content_test2)
 {
        shared_ptr<Film> film = new_test_film2 ("content_test2");
 
 {
        shared_ptr<Film> film = new_test_film2 ("content_test2");
 
-       shared_ptr<Content> content = content_factory(film, "test/data/red_23976.mp4").front();
+       shared_ptr<Content> content = content_factory("test/data/red_23976.mp4").front();
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs ());
        content->set_trim_start(ContentTime::from_seconds(0.5));
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs ());
        content->set_trim_start(ContentTime::from_seconds(0.5));
@@ -83,7 +83,7 @@ BOOST_AUTO_TEST_CASE (content_test3)
        shared_ptr<Film> film = new_test_film2 ("content_test3");
        film->set_sequence (false);
 
        shared_ptr<Film> film = new_test_film2 ("content_test3");
        film->set_sequence (false);
 
-       shared_ptr<Content> content = content_factory(film, "test/data/red_24.mp4").front();
+       shared_ptr<Content> content = content_factory("test/data/red_24.mp4").front();
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs ());
 
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs ());
 
@@ -104,15 +104,15 @@ BOOST_AUTO_TEST_CASE (content_test3)
        /* Position */
 
        /* 12 frames */
        /* Position */
 
        /* 12 frames */
-       content->set_position (DCPTime::from_seconds (12.0 / 24.0));
+       content->set_position (film, DCPTime::from_seconds(12.0 / 24.0));
        BOOST_CHECK (content->position() == DCPTime::from_seconds (12.0 / 24.0));
 
        /* 11.2 frames */
        BOOST_CHECK (content->position() == DCPTime::from_seconds (12.0 / 24.0));
 
        /* 11.2 frames */
-       content->set_position (DCPTime::from_seconds (11.2 / 24.0));
+       content->set_position (film, DCPTime::from_seconds(11.2 / 24.0));
        BOOST_CHECK (content->position() == DCPTime::from_seconds (11.0 / 24.0));
 
        /* 13.9 frames */
        BOOST_CHECK (content->position() == DCPTime::from_seconds (11.0 / 24.0));
 
        /* 13.9 frames */
-       content->set_position (DCPTime::from_seconds (13.9 / 24.0));
+       content->set_position (film, DCPTime::from_seconds(13.9 / 24.0));
        BOOST_CHECK (content->position() == DCPTime::from_seconds (14.0 / 24.0));
 
        content->set_video_frame_rate (25);
        BOOST_CHECK (content->position() == DCPTime::from_seconds (14.0 / 24.0));
 
        content->set_video_frame_rate (25);
index 3e3ffe089cfa630251a347a95010078c39815c5d..4bb4d5a5dd67151d8841a4a930a8367b2e1a2cb0 100644 (file)
@@ -33,7 +33,7 @@ using boost::optional;
 BOOST_AUTO_TEST_CASE (dcp_playback_test)
 {
        shared_ptr<Film> film = new_test_film ("dcp_playback_test");
 BOOST_AUTO_TEST_CASE (dcp_playback_test)
 {
        shared_ptr<Film> film = new_test_film ("dcp_playback_test");
-       shared_ptr<DCPContent> content (new DCPContent(film, private_data / "JourneyToJah_TLR-1_F_EN-DE-FR_CH_51_2K_LOK_20140225_DGL_SMPTE_OV"));
+       shared_ptr<DCPContent> content (new DCPContent(private_data / "JourneyToJah_TLR-1_F_EN-DE-FR_CH_51_2K_LOK_20140225_DGL_SMPTE_OV"));
        film->examine_and_add_content (content);
        wait_for_jobs ();
 
        film->examine_and_add_content (content);
        wait_for_jobs ();
 
index 47938d30922395e9b82ee61343436167069da2ab..5a1cf4391123eacee35b2db6e0e3b3cbeeb155c4 100644 (file)
@@ -65,11 +65,11 @@ BOOST_AUTO_TEST_CASE (dcp_subtitle_test)
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR"));
        film->set_name ("frobozz");
        film->set_interop (false);
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR"));
        film->set_name ("frobozz");
        film->set_interop (false);
-       shared_ptr<DCPSubtitleContent> content (new DCPSubtitleContent (film, "test/data/dcp_sub.xml"));
+       shared_ptr<DCPSubtitleContent> content (new DCPSubtitleContent ("test/data/dcp_sub.xml"));
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs ());
 
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs ());
 
-       BOOST_CHECK_EQUAL (content->full_length().get(), DCPTime::from_seconds(2).get());
+       BOOST_CHECK_EQUAL (content->full_length(film).get(), DCPTime::from_seconds(2).get());
 
        content->only_text()->set_use (true);
        content->only_text()->set_burn (false);
 
        content->only_text()->set_use (true);
        content->only_text()->set_burn (false);
@@ -86,15 +86,15 @@ BOOST_AUTO_TEST_CASE (dcp_subtitle_within_dcp_test)
        film->set_container (Ratio::from_id ("185"));
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR"));
        film->set_name ("frobozz");
        film->set_container (Ratio::from_id ("185"));
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR"));
        film->set_name ("frobozz");
-       shared_ptr<DCPContent> content (new DCPContent (film, private_data / "JourneyToJah_TLR-1_F_EN-DE-FR_CH_51_2K_LOK_20140225_DGL_SMPTE_OV"));
+       shared_ptr<DCPContent> content (new DCPContent(private_data / "JourneyToJah_TLR-1_F_EN-DE-FR_CH_51_2K_LOK_20140225_DGL_SMPTE_OV"));
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs ());
 
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs ());
 
-       shared_ptr<DCPDecoder> decoder (new DCPDecoder (content, film->log(), false));
+       shared_ptr<DCPDecoder> decoder (new DCPDecoder (content, false));
        decoder->only_text()->PlainStart.connect (bind (store, _1));
 
        stored = optional<ContentStringText> ();
        decoder->only_text()->PlainStart.connect (bind (store, _1));
 
        stored = optional<ContentStringText> ();
-       while (!decoder->pass() && !stored) {}
+       while (!decoder->pass(film) && !stored) {}
 
        BOOST_REQUIRE (stored);
        BOOST_REQUIRE_EQUAL (stored->subs.size(), 2);
 
        BOOST_REQUIRE (stored);
        BOOST_REQUIRE_EQUAL (stored->subs.size(), 2);
@@ -109,15 +109,15 @@ BOOST_AUTO_TEST_CASE (dcp_subtitle_test2)
        film->set_container (Ratio::from_id ("185"));
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR"));
        film->set_name ("frobozz");
        film->set_container (Ratio::from_id ("185"));
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR"));
        film->set_name ("frobozz");
-       shared_ptr<DCPSubtitleContent> content (new DCPSubtitleContent (film, "test/data/dcp_sub2.xml"));
+       shared_ptr<DCPSubtitleContent> content (new DCPSubtitleContent("test/data/dcp_sub2.xml"));
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs ());
 
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs ());
 
-       shared_ptr<DCPSubtitleDecoder> decoder (new DCPSubtitleDecoder (content, film->log()));
+       shared_ptr<DCPSubtitleDecoder> decoder (new DCPSubtitleDecoder(content));
        decoder->only_text()->PlainStart.connect (bind (store, _1));
 
        stored = optional<ContentStringText> ();
        decoder->only_text()->PlainStart.connect (bind (store, _1));
 
        stored = optional<ContentStringText> ();
-       while (!decoder->pass ()) {
+       while (!decoder->pass(film)) {
                if (stored && stored->from() == ContentTime(0)) {
                        BOOST_CHECK_EQUAL (stored->subs.front().text(), "&lt;b&gt;Hello world!&lt;/b&gt;");
                }
                if (stored && stored->from() == ContentTime(0)) {
                        BOOST_CHECK_EQUAL (stored->subs.front().text(), "&lt;b&gt;Hello world!&lt;/b&gt;");
                }
@@ -132,16 +132,16 @@ BOOST_AUTO_TEST_CASE (dcp_subtitle_test3)
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR"));
        film->set_name ("frobozz");
        film->set_interop (true);
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR"));
        film->set_name ("frobozz");
        film->set_interop (true);
-       shared_ptr<DCPSubtitleContent> content (new DCPSubtitleContent (film, "test/data/dcp_sub3.xml"));
+       shared_ptr<DCPSubtitleContent> content (new DCPSubtitleContent ("test/data/dcp_sub3.xml"));
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs ());
 
        film->make_dcp ();
        BOOST_REQUIRE (!wait_for_jobs ());
 
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs ());
 
        film->make_dcp ();
        BOOST_REQUIRE (!wait_for_jobs ());
 
-       shared_ptr<DCPSubtitleDecoder> decoder (new DCPSubtitleDecoder (content, film->log()));
+       shared_ptr<DCPSubtitleDecoder> decoder (new DCPSubtitleDecoder (content));
        stored = optional<ContentStringText> ();
        stored = optional<ContentStringText> ();
-       while (!decoder->pass ()) {
+       while (!decoder->pass (film)) {
                decoder->only_text()->PlainStart.connect (bind (store, _1));
                if (stored && stored->from() == ContentTime::from_seconds(0.08)) {
                        list<dcp::SubtitleString> s = stored->subs;
                decoder->only_text()->PlainStart.connect (bind (store, _1));
                if (stored && stored->from() == ContentTime::from_seconds(0.08)) {
                        list<dcp::SubtitleString> s = stored->subs;
@@ -165,9 +165,9 @@ BOOST_AUTO_TEST_CASE (dcp_subtitle_test4)
        shared_ptr<Film> film = new_test_film2 ("dcp_subtitle_test4");
        film->set_interop (true);
 
        shared_ptr<Film> film = new_test_film2 ("dcp_subtitle_test4");
        film->set_interop (true);
 
-       shared_ptr<DCPSubtitleContent> content (new DCPSubtitleContent (film, "test/data/dcp_sub3.xml"));
+       shared_ptr<DCPSubtitleContent> content (new DCPSubtitleContent ("test/data/dcp_sub3.xml"));
        film->examine_and_add_content (content);
        film->examine_and_add_content (content);
-       shared_ptr<DCPSubtitleContent> content2 (new DCPSubtitleContent (film, "test/data/dcp_sub3.xml"));
+       shared_ptr<DCPSubtitleContent> content2 (new DCPSubtitleContent ("test/data/dcp_sub3.xml"));
        film->examine_and_add_content (content2);
        BOOST_REQUIRE (!wait_for_jobs ());
 
        film->examine_and_add_content (content2);
        BOOST_REQUIRE (!wait_for_jobs ());
 
index 33eb00bf1826b960cd2ef1134691a47aca97cbc5..a3fd6c81b89e0ed5bc948b046783ee2e595783e6 100644 (file)
@@ -63,9 +63,9 @@ BOOST_AUTO_TEST_CASE (digest_test)
        shared_ptr<Film> film = new_test_film ("digest_test");
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TST"));
        film->set_name ("digest_test");
        shared_ptr<Film> film = new_test_film ("digest_test");
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TST"));
        film->set_name ("digest_test");
-       shared_ptr<ImageContent> r (new ImageContent (film, "test/data/flat_red.png"));
-       shared_ptr<ImageContent> g (new ImageContent (film, "test/data/flat_green.png"));
-       shared_ptr<ImageContent> b (new ImageContent (film, "test/data/flat_blue.png"));
+       shared_ptr<ImageContent> r (new ImageContent("test/data/flat_red.png"));
+       shared_ptr<ImageContent> g (new ImageContent("test/data/flat_green.png"));
+       shared_ptr<ImageContent> b (new ImageContent("test/data/flat_blue.png"));
        film->examine_and_add_content (r);
        film->examine_and_add_content (g);
        film->examine_and_add_content (b);
        film->examine_and_add_content (r);
        film->examine_and_add_content (g);
        film->examine_and_add_content (b);
index 576577b97e1cba5701575a9267f926e42ac8e526..890185267d7a61636375396d6f7c4f7cdf25ee26 100644 (file)
@@ -44,8 +44,8 @@ BOOST_AUTO_TEST_CASE (empty_test1)
        film->set_name ("empty_test1");
        film->set_container (Ratio::from_id ("185"));
        film->set_sequence (false);
        film->set_name ("empty_test1");
        film->set_container (Ratio::from_id ("185"));
        film->set_sequence (false);
-       shared_ptr<ImageContent> contentA (new ImageContent (film, "test/data/simple_testcard_640x480.png"));
-       shared_ptr<ImageContent> contentB (new ImageContent (film, "test/data/simple_testcard_640x480.png"));
+       shared_ptr<ImageContent> contentA (new ImageContent("test/data/simple_testcard_640x480.png"));
+       shared_ptr<ImageContent> contentB (new ImageContent("test/data/simple_testcard_640x480.png"));
 
        film->examine_and_add_content (contentA);
        film->examine_and_add_content (contentB);
 
        film->examine_and_add_content (contentA);
        film->examine_and_add_content (contentB);
@@ -55,13 +55,13 @@ BOOST_AUTO_TEST_CASE (empty_test1)
 
        contentA->video->set_scale (VideoContentScale (Ratio::from_id ("185")));
        contentA->video->set_length (3);
 
        contentA->video->set_scale (VideoContentScale (Ratio::from_id ("185")));
        contentA->video->set_length (3);
-       contentA->set_position (DCPTime::from_frames (2, vfr));
+       contentA->set_position (film, DCPTime::from_frames (2, vfr));
        contentB->video->set_scale (VideoContentScale (Ratio::from_id ("185")));
        contentB->video->set_length (1);
        contentB->video->set_scale (VideoContentScale (Ratio::from_id ("185")));
        contentB->video->set_length (1);
-       contentB->set_position (DCPTime::from_frames (7, vfr));
+       contentB->set_position (film, DCPTime::from_frames (7, vfr));
 
        shared_ptr<Player> player (new Player(film, film->playlist()));
 
        shared_ptr<Player> player (new Player(film, film->playlist()));
-       Empty black (player->_pieces, film->length(), bind(&has_video, _1));
+       Empty black (film, player->_pieces, bind(&has_video, _1));
        BOOST_REQUIRE_EQUAL (black._periods.size(), 2);
        BOOST_CHECK (black._periods.front().from == DCPTime());
        BOOST_CHECK (black._periods.front().to == DCPTime::from_frames(2, vfr));
        BOOST_REQUIRE_EQUAL (black._periods.size(), 2);
        BOOST_CHECK (black._periods.front().from == DCPTime());
        BOOST_CHECK (black._periods.front().to == DCPTime::from_frames(2, vfr));
@@ -77,8 +77,8 @@ BOOST_AUTO_TEST_CASE (empty_test2)
        film->set_name ("empty_test1");
        film->set_container (Ratio::from_id ("185"));
        film->set_sequence (false);
        film->set_name ("empty_test1");
        film->set_container (Ratio::from_id ("185"));
        film->set_sequence (false);
-       shared_ptr<ImageContent> contentA (new ImageContent (film, "test/data/simple_testcard_640x480.png"));
-       shared_ptr<ImageContent> contentB (new ImageContent (film, "test/data/simple_testcard_640x480.png"));
+       shared_ptr<ImageContent> contentA (new ImageContent("test/data/simple_testcard_640x480.png"));
+       shared_ptr<ImageContent> contentB (new ImageContent("test/data/simple_testcard_640x480.png"));
 
        film->examine_and_add_content (contentA);
        film->examine_and_add_content (contentB);
 
        film->examine_and_add_content (contentA);
        film->examine_and_add_content (contentB);
@@ -88,13 +88,13 @@ BOOST_AUTO_TEST_CASE (empty_test2)
 
        contentA->video->set_scale (VideoContentScale (Ratio::from_id ("185")));
        contentA->video->set_length (3);
 
        contentA->video->set_scale (VideoContentScale (Ratio::from_id ("185")));
        contentA->video->set_length (3);
-       contentA->set_position (DCPTime(0));
+       contentA->set_position (film, DCPTime(0));
        contentB->video->set_scale (VideoContentScale (Ratio::from_id ("185")));
        contentB->video->set_length (1);
        contentB->video->set_scale (VideoContentScale (Ratio::from_id ("185")));
        contentB->video->set_length (1);
-       contentB->set_position (DCPTime::from_frames (7, vfr));
+       contentB->set_position (film, DCPTime::from_frames(7, vfr));
 
        shared_ptr<Player> player (new Player(film, film->playlist()));
 
        shared_ptr<Player> player (new Player(film, film->playlist()));
-       Empty black (player->_pieces, film->length(), bind(&has_video, _1));
+       Empty black (film, player->_pieces, bind(&has_video, _1));
        BOOST_REQUIRE_EQUAL (black._periods.size(), 1);
        BOOST_CHECK (black._periods.front().from == DCPTime::from_frames(3, vfr));
        BOOST_CHECK (black._periods.front().to == DCPTime::from_frames(7, vfr));
        BOOST_REQUIRE_EQUAL (black._periods.size(), 1);
        BOOST_CHECK (black._periods.front().from == DCPTime::from_frames(3, vfr));
        BOOST_CHECK (black._periods.front().to == DCPTime::from_frames(7, vfr));
index e3c90cba984e25700189ead6752899142662eeaa..8e2993e9650ebf1d75bbc568762e7d8f3688440d 100644 (file)
@@ -72,7 +72,7 @@ test (boost::filesystem::path file)
        shared_ptr<Film> film = new_test_film ("ffmpeg_audio_only_test");
        film->set_name ("test_film");
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TST"));
        shared_ptr<Film> film = new_test_film ("ffmpeg_audio_only_test");
        film->set_name ("test_film");
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TST"));
-       shared_ptr<FFmpegContent> c (new FFmpegContent (film, file));
+       shared_ptr<FFmpegContent> c (new FFmpegContent(file));
        film->examine_and_add_content (c);
        wait_for_jobs ();
        film->write_metadata ();
        film->examine_and_add_content (c);
        wait_for_jobs ();
        film->write_metadata ();
index 0aafb505fd9bcd65cf8f3b1333842b207619bd8e..7a21ced06f14150840e2eba3325910c607fc9d60 100644 (file)
@@ -48,7 +48,7 @@ BOOST_AUTO_TEST_CASE (ffmpeg_audio_test)
 {
        shared_ptr<Film> film = new_test_film ("ffmpeg_audio_test");
        film->set_name ("ffmpeg_audio_test");
 {
        shared_ptr<Film> film = new_test_film ("ffmpeg_audio_test");
        film->set_name ("ffmpeg_audio_test");
-       shared_ptr<FFmpegContent> c (new FFmpegContent (film, "test/data/staircase.mov"));
+       shared_ptr<FFmpegContent> c (new FFmpegContent ("test/data/staircase.mov"));
        film->examine_and_add_content (c);
 
        wait_for_jobs ();
        film->examine_and_add_content (c);
 
        wait_for_jobs ();
@@ -130,7 +130,7 @@ BOOST_AUTO_TEST_CASE (ffmpeg_audio_test)
 BOOST_AUTO_TEST_CASE (ffmpeg_audio_test2)
 {
        shared_ptr<Film> film = new_test_film2 ("ffmpeg_audio_test2");
 BOOST_AUTO_TEST_CASE (ffmpeg_audio_test2)
 {
        shared_ptr<Film> film = new_test_film2 ("ffmpeg_audio_test2");
-       shared_ptr<Content> content = content_factory(film, private_data / "wayne.mkv").front();
+       shared_ptr<Content> content = content_factory(private_data / "wayne.mkv").front();
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs ());
 
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs ());
 
@@ -142,7 +142,7 @@ BOOST_AUTO_TEST_CASE (ffmpeg_audio_test2)
 BOOST_AUTO_TEST_CASE (ffmpeg_audio_test3)
 {
        shared_ptr<Film> film = new_test_film2 ("ffmpeg_audio_test2");
 BOOST_AUTO_TEST_CASE (ffmpeg_audio_test3)
 {
        shared_ptr<Film> film = new_test_film2 ("ffmpeg_audio_test2");
-       shared_ptr<Content> content = content_factory(film, private_data / "wayne.mkv").front();
+       shared_ptr<Content> content = content_factory(private_data / "wayne.mkv").front();
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs ());
 
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs ());
 
index 7cdecb22f32ce6a302db6492be27623e04b2b79e..4b2388bcde3486ca71dd998a8d32157b807b1b38 100644 (file)
@@ -41,7 +41,7 @@ BOOST_AUTO_TEST_CASE (ffmpeg_dcp_test)
 {
        shared_ptr<Film> film = new_test_film ("ffmpeg_dcp_test");
        film->set_name ("test_film2");
 {
        shared_ptr<Film> film = new_test_film ("ffmpeg_dcp_test");
        film->set_name ("test_film2");
-       shared_ptr<FFmpegContent> c (new FFmpegContent (film, "test/data/test.mp4"));
+       shared_ptr<FFmpegContent> c (new FFmpegContent("test/data/test.mp4"));
        film->examine_and_add_content (c);
 
        wait_for_jobs ();
        film->examine_and_add_content (c);
 
        wait_for_jobs ();
index c09fd02f37d6769e5401f90a8a48267976571805..c6fae48cda4b2a1f9c33dbd2515f3adcae4efff5 100644 (file)
@@ -54,12 +54,12 @@ store (ContentVideo v)
 }
 
 static void
 }
 
 static void
-check (shared_ptr<FFmpegDecoder> decoder, int frame)
+check (shared_ptr<const Film> film, shared_ptr<FFmpegDecoder> decoder, int frame)
 {
        BOOST_REQUIRE (decoder->ffmpeg_content()->video_frame_rate ());
 {
        BOOST_REQUIRE (decoder->ffmpeg_content()->video_frame_rate ());
-       decoder->seek (ContentTime::from_frames (frame, decoder->ffmpeg_content()->video_frame_rate().get()), true);
+       decoder->seek (film, ContentTime::from_frames (frame, decoder->ffmpeg_content()->video_frame_rate().get()), true);
        stored = optional<ContentVideo> ();
        stored = optional<ContentVideo> ();
-       while (!decoder->pass() && !stored) {}
+       while (!decoder->pass(film) && !stored) {}
        BOOST_CHECK (stored->frame <= frame);
 }
 
        BOOST_CHECK (stored->frame <= frame);
 }
 
@@ -70,15 +70,14 @@ test (boost::filesystem::path file, vector<int> frames)
        BOOST_REQUIRE (boost::filesystem::exists (path));
 
        shared_ptr<Film> film = new_test_film ("ffmpeg_decoder_seek_test_" + file.string());
        BOOST_REQUIRE (boost::filesystem::exists (path));
 
        shared_ptr<Film> film = new_test_film ("ffmpeg_decoder_seek_test_" + file.string());
-       shared_ptr<FFmpegContent> content (new FFmpegContent (film, path));
+       shared_ptr<FFmpegContent> content (new FFmpegContent (path));
        film->examine_and_add_content (content);
        wait_for_jobs ();
        film->examine_and_add_content (content);
        wait_for_jobs ();
-       shared_ptr<Log> log (new NullLog);
-       shared_ptr<FFmpegDecoder> decoder (new FFmpegDecoder (content, log, false));
+       shared_ptr<FFmpegDecoder> decoder (new FFmpegDecoder (film, content, false));
        decoder->video->Data.connect (bind (&store, _1));
 
        for (vector<int>::const_iterator i = frames.begin(); i != frames.end(); ++i) {
        decoder->video->Data.connect (bind (&store, _1));
 
        for (vector<int>::const_iterator i = frames.begin(); i != frames.end(); ++i) {
-               check (decoder, *i);
+               check (film, decoder, *i);
        }
 }
 
        }
 }
 
index 81dd07784d958bfc7b1fed762e3379e93ff73822..50c96afed6e3cdd0c2a032500817581cb3f4e259 100644 (file)
@@ -61,7 +61,7 @@ ffmpeg_decoder_sequential_test_one (boost::filesystem::path file, float fps, int
        BOOST_REQUIRE (boost::filesystem::exists (path));
 
        shared_ptr<Film> film = new_test_film ("ffmpeg_decoder_sequential_test_" + file.string());
        BOOST_REQUIRE (boost::filesystem::exists (path));
 
        shared_ptr<Film> film = new_test_film ("ffmpeg_decoder_sequential_test_" + file.string());
-       shared_ptr<FFmpegContent> content (new FFmpegContent (film, path));
+       shared_ptr<FFmpegContent> content (new FFmpegContent(path));
        film->examine_and_add_content (content);
        wait_for_jobs ();
        film->write_metadata ();
        film->examine_and_add_content (content);
        wait_for_jobs ();
        film->write_metadata ();
index 4b323c5bf4cb79eae724b10f85f6cf67db9c6bba..4f7725f0b2c69159bda428dec0b209d6db4d118c 100644 (file)
@@ -56,7 +56,7 @@ ffmpeg_content_test (int number, boost::filesystem::path content, ExportFormat f
 
        shared_ptr<Film> film = new_test_film (name);
        film->set_name (name);
 
        shared_ptr<Film> film = new_test_film (name);
        film->set_name (name);
-       shared_ptr<FFmpegContent> c (new FFmpegContent (film, content));
+       shared_ptr<FFmpegContent> c (new FFmpegContent(content));
        film->set_container (Ratio::from_id ("185"));
        film->set_audio_channels (6);
 
        film->set_container (Ratio::from_id ("185"));
        film->set_audio_channels (6);
 
@@ -98,7 +98,7 @@ BOOST_AUTO_TEST_CASE (ffmpeg_encoder_prores_test5)
 {
        shared_ptr<Film> film = new_test_film ("ffmpeg_encoder_prores_test5");
        film->set_name ("ffmpeg_encoder_prores_test5");
 {
        shared_ptr<Film> film = new_test_film ("ffmpeg_encoder_prores_test5");
        film->set_name ("ffmpeg_encoder_prores_test5");
-       shared_ptr<ImageContent> c (new ImageContent (film, private_data / "bbc405.png"));
+       shared_ptr<ImageContent> c (new ImageContent(private_data / "bbc405.png"));
        film->set_container (Ratio::from_id ("185"));
        film->set_audio_channels (6);
 
        film->set_container (Ratio::from_id ("185"));
        film->set_audio_channels (6);
 
@@ -121,7 +121,7 @@ BOOST_AUTO_TEST_CASE (ffmpeg_encoder_prores_test6)
        film->set_container (Ratio::from_id ("185"));
        film->set_audio_channels (6);
 
        film->set_container (Ratio::from_id ("185"));
        film->set_audio_channels (6);
 
-       shared_ptr<StringTextFileContent> s (new StringTextFileContent (film, "test/data/subrip2.srt"));
+       shared_ptr<StringTextFileContent> s (new StringTextFileContent("test/data/subrip2.srt"));
        film->examine_and_add_content (s);
        BOOST_REQUIRE (!wait_for_jobs ());
        s->only_text()->set_colour (dcp::Colour (255, 255, 0));
        film->examine_and_add_content (s);
        BOOST_REQUIRE (!wait_for_jobs ());
        s->only_text()->set_colour (dcp::Colour (255, 255, 0));
@@ -142,11 +142,11 @@ BOOST_AUTO_TEST_CASE (ffmpeg_encoder_prores_test7)
        film->set_container (Ratio::from_id ("185"));
        film->set_audio_channels (6);
 
        film->set_container (Ratio::from_id ("185"));
        film->set_audio_channels (6);
 
-       shared_ptr<FFmpegContent> c (new FFmpegContent (film, "test/data/test.mp4"));
+       shared_ptr<FFmpegContent> c (new FFmpegContent("test/data/test.mp4"));
        film->examine_and_add_content (c);
        BOOST_REQUIRE (!wait_for_jobs ());
 
        film->examine_and_add_content (c);
        BOOST_REQUIRE (!wait_for_jobs ());
 
-       shared_ptr<StringTextFileContent> s (new StringTextFileContent (film, "test/data/subrip.srt"));
+       shared_ptr<StringTextFileContent> s (new StringTextFileContent("test/data/subrip.srt"));
        film->examine_and_add_content (s);
        BOOST_REQUIRE (!wait_for_jobs ());
        s->only_text()->set_colour (dcp::Colour (255, 255, 0));
        film->examine_and_add_content (s);
        BOOST_REQUIRE (!wait_for_jobs ());
        s->only_text()->set_colour (dcp::Colour (255, 255, 0));
@@ -172,7 +172,7 @@ BOOST_AUTO_TEST_CASE (ffmpeg_encoder_h264_test2)
        film->set_container (Ratio::from_id ("185"));
        film->set_audio_channels (6);
 
        film->set_container (Ratio::from_id ("185"));
        film->set_audio_channels (6);
 
-       shared_ptr<StringTextFileContent> s (new StringTextFileContent (film, "test/data/subrip2.srt"));
+       shared_ptr<StringTextFileContent> s (new StringTextFileContent("test/data/subrip2.srt"));
        film->examine_and_add_content (s);
        BOOST_REQUIRE (!wait_for_jobs ());
        s->only_text()->set_colour (dcp::Colour (255, 255, 0));
        film->examine_and_add_content (s);
        BOOST_REQUIRE (!wait_for_jobs ());
        s->only_text()->set_colour (dcp::Colour (255, 255, 0));
@@ -193,11 +193,11 @@ BOOST_AUTO_TEST_CASE (ffmpeg_encoder_h264_test3)
        film->set_container (Ratio::from_id ("185"));
        film->set_audio_channels (6);
 
        film->set_container (Ratio::from_id ("185"));
        film->set_audio_channels (6);
 
-       shared_ptr<FFmpegContent> c (new FFmpegContent (film, "test/data/test.mp4"));
+       shared_ptr<FFmpegContent> c (new FFmpegContent("test/data/test.mp4"));
        film->examine_and_add_content (c);
        BOOST_REQUIRE (!wait_for_jobs ());
 
        film->examine_and_add_content (c);
        BOOST_REQUIRE (!wait_for_jobs ());
 
-       shared_ptr<StringTextFileContent> s (new StringTextFileContent (film, "test/data/subrip.srt"));
+       shared_ptr<StringTextFileContent> s (new StringTextFileContent("test/data/subrip.srt"));
        film->examine_and_add_content (s);
        BOOST_REQUIRE (!wait_for_jobs ());
        s->only_text()->set_colour (dcp::Colour (255, 255, 0));
        film->examine_and_add_content (s);
        BOOST_REQUIRE (!wait_for_jobs ());
        s->only_text()->set_colour (dcp::Colour (255, 255, 0));
@@ -214,7 +214,7 @@ BOOST_AUTO_TEST_CASE (ffmpeg_encoder_h264_test3)
 BOOST_AUTO_TEST_CASE (ffmpeg_encoder_h264_test4)
 {
        shared_ptr<Film> film = new_test_film2("ffmpeg_encoder_h264_test4");
 BOOST_AUTO_TEST_CASE (ffmpeg_encoder_h264_test4)
 {
        shared_ptr<Film> film = new_test_film2("ffmpeg_encoder_h264_test4");
-       film->examine_and_add_content(shared_ptr<DCPContent>(new DCPContent(film, "test/data/scope_dcp")));
+       film->examine_and_add_content(shared_ptr<DCPContent>(new DCPContent("test/data/scope_dcp")));
        BOOST_REQUIRE(!wait_for_jobs());
 
        film->set_container(Ratio::from_id("185"));
        BOOST_REQUIRE(!wait_for_jobs());
 
        film->set_container(Ratio::from_id("185"));
@@ -232,43 +232,43 @@ BOOST_AUTO_TEST_CASE (ffmpeg_encoder_h264_test5)
        film->set_container (Ratio::from_id ("185"));
        film->set_audio_channels (6);
 
        film->set_container (Ratio::from_id ("185"));
        film->set_audio_channels (6);
 
-       shared_ptr<FFmpegContent> L (new FFmpegContent (film, "test/data/L.wav"));
+       shared_ptr<FFmpegContent> L (new FFmpegContent("test/data/L.wav"));
        film->examine_and_add_content (L);
        film->examine_and_add_content (L);
-       shared_ptr<FFmpegContent> R (new FFmpegContent (film, "test/data/R.wav"));
+       shared_ptr<FFmpegContent> R (new FFmpegContent("test/data/R.wav"));
        film->examine_and_add_content (R);
        film->examine_and_add_content (R);
-       shared_ptr<FFmpegContent> C (new FFmpegContent (film, "test/data/C.wav"));
+       shared_ptr<FFmpegContent> C (new FFmpegContent("test/data/C.wav"));
        film->examine_and_add_content (C);
        film->examine_and_add_content (C);
-       shared_ptr<FFmpegContent> Ls (new FFmpegContent (film, "test/data/Ls.wav"));
+       shared_ptr<FFmpegContent> Ls (new FFmpegContent("test/data/Ls.wav"));
        film->examine_and_add_content (Ls);
        film->examine_and_add_content (Ls);
-       shared_ptr<FFmpegContent> Rs (new FFmpegContent (film, "test/data/Rs.wav"));
+       shared_ptr<FFmpegContent> Rs (new FFmpegContent("test/data/Rs.wav"));
        film->examine_and_add_content (Rs);
        film->examine_and_add_content (Rs);
-       shared_ptr<FFmpegContent> Lfe (new FFmpegContent (film, "test/data/Lfe.wav"));
+       shared_ptr<FFmpegContent> Lfe (new FFmpegContent("test/data/Lfe.wav"));
        film->examine_and_add_content (Lfe);
        BOOST_REQUIRE (!wait_for_jobs ());
 
        AudioMapping map (1, MAX_DCP_AUDIO_CHANNELS);
 
        film->examine_and_add_content (Lfe);
        BOOST_REQUIRE (!wait_for_jobs ());
 
        AudioMapping map (1, MAX_DCP_AUDIO_CHANNELS);
 
-       L->set_position (DCPTime::from_seconds (0));
+       L->set_position (film, DCPTime::from_seconds(0));
        map.make_zero ();
        map.set (0, 0, 1);
        L->audio->set_mapping (map);
        map.make_zero ();
        map.set (0, 0, 1);
        L->audio->set_mapping (map);
-       R->set_position (DCPTime::from_seconds (1));
+       R->set_position (film, DCPTime::from_seconds(1));
        map.make_zero ();
        map.set (0, 1, 1);
        R->audio->set_mapping (map);
        map.make_zero ();
        map.set (0, 1, 1);
        R->audio->set_mapping (map);
-       C->set_position (DCPTime::from_seconds (2));
+       C->set_position (film, DCPTime::from_seconds(2));
        map.make_zero ();
        map.set (0, 2, 1);
        C->audio->set_mapping (map);
        map.make_zero ();
        map.set (0, 2, 1);
        C->audio->set_mapping (map);
-       Lfe->set_position (DCPTime::from_seconds (3));
+       Lfe->set_position (film, DCPTime::from_seconds(3));
        map.make_zero ();
        map.set (0, 3, 1);
        Lfe->audio->set_mapping (map);
        map.make_zero ();
        map.set (0, 3, 1);
        Lfe->audio->set_mapping (map);
-       Ls->set_position (DCPTime::from_seconds (4));
+       Ls->set_position (film, DCPTime::from_seconds(4));
        map.make_zero ();
        map.set (0, 4, 1);
        Ls->audio->set_mapping (map);
        map.make_zero ();
        map.set (0, 4, 1);
        Ls->audio->set_mapping (map);
-       Rs->set_position (DCPTime::from_seconds (5));
+       Rs->set_position (film, DCPTime::from_seconds(5));
        map.make_zero ();
        map.set (0, 5, 1);
        Rs->audio->set_mapping (map);
        map.make_zero ();
        map.set (0, 5, 1);
        Rs->audio->set_mapping (map);
index 0233db1f0b51538eece2136f03d91ecf12ef854c..d4614e226cceb84246b40019c7a09a0906e0fd9f 100644 (file)
@@ -35,7 +35,7 @@ using boost::shared_ptr;
 BOOST_AUTO_TEST_CASE (ffmpeg_examiner_test)
 {
        shared_ptr<Film> film = new_test_film ("ffmpeg_examiner_test");
 BOOST_AUTO_TEST_CASE (ffmpeg_examiner_test)
 {
        shared_ptr<Film> film = new_test_film ("ffmpeg_examiner_test");
-       shared_ptr<FFmpegContent> content (new FFmpegContent (film, "test/data/count300bd24.m2ts"));
+       shared_ptr<FFmpegContent> content (new FFmpegContent ("test/data/count300bd24.m2ts"));
        shared_ptr<FFmpegExaminer> examiner (new FFmpegExaminer (content));
 
        BOOST_CHECK_EQUAL (examiner->first_video().get().get(), ContentTime::from_seconds(600).get());
        shared_ptr<FFmpegExaminer> examiner (new FFmpegExaminer (content));
 
        BOOST_CHECK_EQUAL (examiner->first_video().get().get(), ContentTime::from_seconds(600).get());
index bdc46f6d91834474f9d125dfc609b4de06640b64..1d36192194e597bb96e117802fffe44f20609cbb 100644 (file)
@@ -36,7 +36,7 @@ using boost::shared_ptr;
 BOOST_AUTO_TEST_CASE (ffmpeg_pts_offset_test)
 {
        shared_ptr<Film> film = new_test_film ("ffmpeg_pts_offset_test");
 BOOST_AUTO_TEST_CASE (ffmpeg_pts_offset_test)
 {
        shared_ptr<Film> film = new_test_film ("ffmpeg_pts_offset_test");
-       shared_ptr<FFmpegContent> content (new FFmpegContent (film, "test/data/test.mp4"));
+       shared_ptr<FFmpegContent> content (new FFmpegContent ("test/data/test.mp4"));
        film->examine_and_add_content (content);
        wait_for_jobs ();
 
        film->examine_and_add_content (content);
        wait_for_jobs ();
 
@@ -48,7 +48,7 @@ BOOST_AUTO_TEST_CASE (ffmpeg_pts_offset_test)
                /* Sound == video so no offset required */
                content->_first_video = ContentTime ();
                content->ffmpeg_audio_streams().front()->first_audio = ContentTime ();
                /* Sound == video so no offset required */
                content->_first_video = ContentTime ();
                content->ffmpeg_audio_streams().front()->first_audio = ContentTime ();
-               FFmpegDecoder decoder (content, film->log(), false);
+               FFmpegDecoder decoder (film, content, false);
                BOOST_CHECK_EQUAL (decoder._pts_offset.get(), 0);
        }
 
                BOOST_CHECK_EQUAL (decoder._pts_offset.get(), 0);
        }
 
@@ -56,7 +56,7 @@ BOOST_AUTO_TEST_CASE (ffmpeg_pts_offset_test)
                /* Common offset should be removed */
                content->_first_video = ContentTime::from_seconds (600);
                content->ffmpeg_audio_streams().front()->first_audio = ContentTime::from_seconds (600);
                /* Common offset should be removed */
                content->_first_video = ContentTime::from_seconds (600);
                content->ffmpeg_audio_streams().front()->first_audio = ContentTime::from_seconds (600);
-               FFmpegDecoder decoder (content, film->log(), false);
+               FFmpegDecoder decoder (film, content, false);
                BOOST_CHECK_EQUAL (decoder._pts_offset.get(), ContentTime::from_seconds(-600).get());
        }
 
                BOOST_CHECK_EQUAL (decoder._pts_offset.get(), ContentTime::from_seconds(-600).get());
        }
 
@@ -64,7 +64,7 @@ BOOST_AUTO_TEST_CASE (ffmpeg_pts_offset_test)
                /* Video is on a frame boundary */
                content->_first_video = ContentTime::from_frames (1, 24);
                content->ffmpeg_audio_streams().front()->first_audio = ContentTime ();
                /* Video is on a frame boundary */
                content->_first_video = ContentTime::from_frames (1, 24);
                content->ffmpeg_audio_streams().front()->first_audio = ContentTime ();
-               FFmpegDecoder decoder (content, film->log(), false);
+               FFmpegDecoder decoder (film, content, false);
                BOOST_CHECK_EQUAL (decoder._pts_offset.get(), 0);
        }
 
                BOOST_CHECK_EQUAL (decoder._pts_offset.get(), 0);
        }
 
@@ -73,7 +73,7 @@ BOOST_AUTO_TEST_CASE (ffmpeg_pts_offset_test)
                double const frame = 1.0 / 24.0;
                content->_first_video = ContentTime::from_seconds (frame + 0.0215);
                content->ffmpeg_audio_streams().front()->first_audio = ContentTime ();
                double const frame = 1.0 / 24.0;
                content->_first_video = ContentTime::from_seconds (frame + 0.0215);
                content->ffmpeg_audio_streams().front()->first_audio = ContentTime ();
-               FFmpegDecoder decoder (content, film->log(), false);
+               FFmpegDecoder decoder (film, content, false);
                BOOST_CHECK_CLOSE (decoder._pts_offset.seconds(), (frame - 0.0215), 0.00001);
        }
 
                BOOST_CHECK_CLOSE (decoder._pts_offset.seconds(), (frame - 0.0215), 0.00001);
        }
 
@@ -82,7 +82,7 @@ BOOST_AUTO_TEST_CASE (ffmpeg_pts_offset_test)
                double const frame = 1.0 / 24.0;
                content->_first_video = ContentTime::from_seconds (frame + 0.0215 + 4.1);
                content->ffmpeg_audio_streams().front()->first_audio = ContentTime::from_seconds (4.1);
                double const frame = 1.0 / 24.0;
                content->_first_video = ContentTime::from_seconds (frame + 0.0215 + 4.1);
                content->ffmpeg_audio_streams().front()->first_audio = ContentTime::from_seconds (4.1);
-               FFmpegDecoder decoder (content, film->log(), false);
+               FFmpegDecoder decoder (film, content, false);
                BOOST_CHECK_CLOSE (decoder._pts_offset.seconds(), (frame - 0.0215) - 4.1, 0.1);
        }
 }
                BOOST_CHECK_CLOSE (decoder._pts_offset.seconds(), (frame - 0.0215) - 4.1, 0.1);
        }
 }
index bd7efb0d9895102937ce66687829171f27b93cd3..f06fdfa42fa211f6fa2f85353e56cecce9b44153 100644 (file)
@@ -59,11 +59,11 @@ BOOST_AUTO_TEST_CASE (file_naming_test)
        shared_ptr<Film> film = new_test_film ("file_naming_test");
        film->set_name ("file_naming_test");
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("FTR"));
        shared_ptr<Film> film = new_test_film ("file_naming_test");
        film->set_name ("file_naming_test");
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("FTR"));
-       shared_ptr<FFmpegContent> r (new FFmpegContent (film, "test/data/flat_red.png"));
+       shared_ptr<FFmpegContent> r (new FFmpegContent("test/data/flat_red.png"));
        film->examine_and_add_content (r);
        film->examine_and_add_content (r);
-       shared_ptr<FFmpegContent> g (new FFmpegContent (film, "test/data/flat_green.png"));
+       shared_ptr<FFmpegContent> g (new FFmpegContent("test/data/flat_green.png"));
        film->examine_and_add_content (g);
        film->examine_and_add_content (g);
-       shared_ptr<FFmpegContent> b (new FFmpegContent (film, "test/data/flat_blue.png"));
+       shared_ptr<FFmpegContent> b (new FFmpegContent("test/data/flat_blue.png"));
        film->examine_and_add_content (b);
        wait_for_jobs ();
 
        film->examine_and_add_content (b);
        wait_for_jobs ();
 
@@ -98,11 +98,11 @@ BOOST_AUTO_TEST_CASE (file_naming_test2)
        shared_ptr<Film> film = new_test_film ("file_naming_test2");
        film->set_name ("file_naming_test2");
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("FTR"));
        shared_ptr<Film> film = new_test_film ("file_naming_test2");
        film->set_name ("file_naming_test2");
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("FTR"));
-       shared_ptr<FFmpegContent> r (new FFmpegContent (film, "test/data/flät_red.png"));
+       shared_ptr<FFmpegContent> r (new FFmpegContent("test/data/flät_red.png"));
        film->examine_and_add_content (r);
        film->examine_and_add_content (r);
-       shared_ptr<FFmpegContent> g (new FFmpegContent (film, "test/data/flat_green.png"));
+       shared_ptr<FFmpegContent> g (new FFmpegContent("test/data/flat_green.png"));
        film->examine_and_add_content (g);
        film->examine_and_add_content (g);
-       shared_ptr<FFmpegContent> b (new FFmpegContent (film, "test/data/flat_blue.png"));
+       shared_ptr<FFmpegContent> b (new FFmpegContent("test/data/flat_blue.png"));
        film->examine_and_add_content (b);
        wait_for_jobs ();
 
        film->examine_and_add_content (b);
        wait_for_jobs ();
 
index 9521e3909f750fa7412284279b4351a74141c73b..4192ce5e2d3da0ce88207d659c5483f346b04ac4 100644 (file)
@@ -44,7 +44,7 @@ BOOST_AUTO_TEST_CASE (best_dcp_frame_rate_test_single)
 {
        shared_ptr<Film> film = new_test_film ("best_dcp_frame_rate_test_single");
        /* Get any piece of content, it doesn't matter what */
 {
        shared_ptr<Film> film = new_test_film ("best_dcp_frame_rate_test_single");
        /* Get any piece of content, it doesn't matter what */
-       shared_ptr<FFmpegContent> content (new FFmpegContent (film, "test/data/test.mp4"));
+       shared_ptr<FFmpegContent> content (new FFmpegContent("test/data/test.mp4"));
        film->examine_and_add_content (content);
        wait_for_jobs ();
 
        film->examine_and_add_content (content);
        wait_for_jobs ();
 
@@ -222,9 +222,9 @@ BOOST_AUTO_TEST_CASE (best_dcp_frame_rate_test_double)
 {
        shared_ptr<Film> film = new_test_film ("best_dcp_frame_rate_test_double");
        /* Get any old content, it doesn't matter what */
 {
        shared_ptr<Film> film = new_test_film ("best_dcp_frame_rate_test_double");
        /* Get any old content, it doesn't matter what */
-       shared_ptr<FFmpegContent> A (new FFmpegContent (film, "test/data/test.mp4"));
+       shared_ptr<FFmpegContent> A (new FFmpegContent("test/data/test.mp4"));
        film->examine_and_add_content (A);
        film->examine_and_add_content (A);
-       shared_ptr<FFmpegContent> B (new FFmpegContent (film, "test/data/test.mp4"));
+       shared_ptr<FFmpegContent> B (new FFmpegContent("test/data/test.mp4"));
        film->examine_and_add_content (B);
        wait_for_jobs ();
 
        film->examine_and_add_content (B);
        wait_for_jobs ();
 
@@ -253,7 +253,7 @@ BOOST_AUTO_TEST_CASE (audio_sampling_rate_test)
 {
        shared_ptr<Film> film = new_test_film ("audio_sampling_rate_test");
        /* Get any piece of content, it doesn't matter what */
 {
        shared_ptr<Film> film = new_test_film ("audio_sampling_rate_test");
        /* Get any piece of content, it doesn't matter what */
-       shared_ptr<FFmpegContent> content (new FFmpegContent (film, "test/data/test.mp4"));
+       shared_ptr<FFmpegContent> content (new FFmpegContent("test/data/test.mp4"));
        film->examine_and_add_content (content);
        wait_for_jobs ();
 
        film->examine_and_add_content (content);
        wait_for_jobs ();
 
@@ -269,34 +269,34 @@ BOOST_AUTO_TEST_CASE (audio_sampling_rate_test)
        content->_video_frame_rate = 24;
        film->set_video_frame_rate (24);
        stream->_frame_rate = 48000;
        content->_video_frame_rate = 24;
        film->set_video_frame_rate (24);
        stream->_frame_rate = 48000;
-       BOOST_CHECK_EQUAL (content->audio->resampled_frame_rate(), 48000);
+       BOOST_CHECK_EQUAL (content->audio->resampled_frame_rate(film), 48000);
 
        stream->_frame_rate = 44100;
 
        stream->_frame_rate = 44100;
-       BOOST_CHECK_EQUAL (content->audio->resampled_frame_rate(), 48000);
+       BOOST_CHECK_EQUAL (content->audio->resampled_frame_rate(film), 48000);
 
        stream->_frame_rate = 80000;
 
        stream->_frame_rate = 80000;
-       BOOST_CHECK_EQUAL (content->audio->resampled_frame_rate(), 96000);
+       BOOST_CHECK_EQUAL (content->audio->resampled_frame_rate(film), 96000);
 
        content->_video_frame_rate = 23.976;
        film->set_video_frame_rate (24);
        stream->_frame_rate = 48000;
 
        content->_video_frame_rate = 23.976;
        film->set_video_frame_rate (24);
        stream->_frame_rate = 48000;
-       BOOST_CHECK_EQUAL (content->audio->resampled_frame_rate(), 47952);
+       BOOST_CHECK_EQUAL (content->audio->resampled_frame_rate(film), 47952);
 
        content->_video_frame_rate = 29.97;
        film->set_video_frame_rate (30);
        BOOST_CHECK_EQUAL (film->video_frame_rate (), 30);
        stream->_frame_rate = 48000;
 
        content->_video_frame_rate = 29.97;
        film->set_video_frame_rate (30);
        BOOST_CHECK_EQUAL (film->video_frame_rate (), 30);
        stream->_frame_rate = 48000;
-       BOOST_CHECK_EQUAL (content->audio->resampled_frame_rate(), 47952);
+       BOOST_CHECK_EQUAL (content->audio->resampled_frame_rate(film), 47952);
 
        content->_video_frame_rate = 25;
        film->set_video_frame_rate (24);
        stream->_frame_rate = 48000;
 
        content->_video_frame_rate = 25;
        film->set_video_frame_rate (24);
        stream->_frame_rate = 48000;
-       BOOST_CHECK_EQUAL (content->audio->resampled_frame_rate(), 50000);
+       BOOST_CHECK_EQUAL (content->audio->resampled_frame_rate(film), 50000);
 
        content->_video_frame_rate = 25;
        film->set_video_frame_rate (24);
        stream->_frame_rate = 44100;
 
        content->_video_frame_rate = 25;
        film->set_video_frame_rate (24);
        stream->_frame_rate = 44100;
-       BOOST_CHECK_EQUAL (content->audio->resampled_frame_rate(), 50000);
+       BOOST_CHECK_EQUAL (content->audio->resampled_frame_rate(film), 50000);
 
        /* Check some out-there conversions (not the best) */
 
 
        /* Check some out-there conversions (not the best) */
 
@@ -306,5 +306,5 @@ BOOST_AUTO_TEST_CASE (audio_sampling_rate_test)
        /* The FrameRateChange within resampled_frame_rate should choose to double-up
           the 14.99 fps video to 30 and then run it slow at 25.
        */
        /* The FrameRateChange within resampled_frame_rate should choose to double-up
           the 14.99 fps video to 30 and then run it slow at 25.
        */
-       BOOST_CHECK_EQUAL (content->audio->resampled_frame_rate(), lrint (48000 * 2 * 14.99 / 25));
+       BOOST_CHECK_EQUAL (content->audio->resampled_frame_rate(film), lrint (48000 * 2 * 14.99 / 25));
 }
 }
index 9bec4535484ecbfea578292535376508de2ed448..71689f613c6f2663b377dcbc234079ce3d0275ed 100644 (file)
@@ -51,7 +51,7 @@ BOOST_AUTO_TEST_CASE (import_dcp_test)
        A->set_name ("frobozz");
        A->set_interop (false);
 
        A->set_name ("frobozz");
        A->set_interop (false);
 
-       shared_ptr<FFmpegContent> c (new FFmpegContent (A, "test/data/test.mp4"));
+       shared_ptr<FFmpegContent> c (new FFmpegContent("test/data/test.mp4"));
        A->examine_and_add_content (c);
        A->set_encrypted (true);
        BOOST_CHECK (!wait_for_jobs ());
        A->examine_and_add_content (c);
        A->set_encrypted (true);
        BOOST_CHECK (!wait_for_jobs ());
@@ -80,7 +80,7 @@ BOOST_AUTO_TEST_CASE (import_dcp_test)
        B->set_name ("frobozz");
        B->set_interop (false);
 
        B->set_name ("frobozz");
        B->set_interop (false);
 
-       shared_ptr<DCPContent> d (new DCPContent (B, "build/test/import_dcp_test/" + A->dcp_name()));
+       shared_ptr<DCPContent> d (new DCPContent("build/test/import_dcp_test/" + A->dcp_name()));
        B->examine_and_add_content (d);
        BOOST_CHECK (!wait_for_jobs ());
        d->add_kdm (kdm);
        B->examine_and_add_content (d);
        BOOST_CHECK (!wait_for_jobs ());
        d->add_kdm (kdm);
index 3b5717f165acab4eebe56e19d394558007083c39..20a4424282f6d5891f7c53bcb501c4aec28d97b0 100644 (file)
@@ -45,7 +45,7 @@ BOOST_AUTO_TEST_CASE (interrupt_encoder_test)
        film->set_container (Ratio::from_id ("185"));
        film->set_name ("interrupt_encoder_test");
 
        film->set_container (Ratio::from_id ("185"));
        film->set_name ("interrupt_encoder_test");
 
-       shared_ptr<FFmpegContent> content (new FFmpegContent (film, private_data / "prophet_long_clip.mkv"));
+       shared_ptr<FFmpegContent> content (new FFmpegContent(private_data / "prophet_long_clip.mkv"));
        film->examine_and_add_content (content);
        wait_for_jobs ();
 
        film->examine_and_add_content (content);
        wait_for_jobs ();
 
index 52a1cd29a53b51352c024cda21cb6acaa55495fa..a33a6a460d12a558b0f6d99a40e72bc525d95d88 100644 (file)
@@ -88,7 +88,7 @@ BOOST_AUTO_TEST_CASE (isdcf_name_test)
 
        /* Test interior aspect ratio: shouldn't be shown with trailers */
 
 
        /* Test interior aspect ratio: shouldn't be shown with trailers */
 
-       shared_ptr<ImageContent> content (new ImageContent (film, "test/data/simple_testcard_640x480.png"));
+       shared_ptr<ImageContent> content (new ImageContent ("test/data/simple_testcard_640x480.png"));
        film->examine_and_add_content (content);
        wait_for_jobs ();
        content->video->set_scale (VideoContentScale (Ratio::from_id ("133")));
        film->examine_and_add_content (content);
        wait_for_jobs ();
        content->video->set_scale (VideoContentScale (Ratio::from_id ("133")));
@@ -149,7 +149,7 @@ BOOST_AUTO_TEST_CASE (isdcf_name_test)
        /* Test audio channel markup */
 
        film->set_audio_channels (6);
        /* Test audio channel markup */
 
        film->set_audio_channels (6);
-       shared_ptr<FFmpegContent> sound (new FFmpegContent (film, "test/data/sine_440.wav"));
+       shared_ptr<FFmpegContent> sound (new FFmpegContent("test/data/sine_440.wav"));
        film->examine_and_add_content (sound);
        wait_for_jobs ();
        BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_10_4K_DI_20140704_PP_SMPTE_OV");
        film->examine_and_add_content (sound);
        wait_for_jobs ();
        BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_10_4K_DI_20140704_PP_SMPTE_OV");
index a941b4ae67097bf426adb76e1ea2ae644c1515dc..92f6f90d821e1413256f68f50a457f61fb47a37e 100644 (file)
@@ -45,7 +45,7 @@ check (int target_bits_per_second)
        film->set_name (name);
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("FTR"));
        film->set_j2k_bandwidth (target_bits_per_second);
        film->set_name (name);
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("FTR"));
        film->set_j2k_bandwidth (target_bits_per_second);
-       shared_ptr<ImageContent> content (new ImageContent (film, private_data / "prophet_frame.tiff"));
+       shared_ptr<ImageContent> content (new ImageContent(private_data / "prophet_frame.tiff"));
        film->examine_and_add_content (content);
        wait_for_jobs ();
        content->video->set_length (24 * duration);
        film->examine_and_add_content (content);
        wait_for_jobs ();
        content->video->set_length (24 * duration);
index b939d29149fd95c28c20da419ce37cf49d7d514d..3e69c95b6173da4d717964a7ba15f037dbb94156 100644 (file)
@@ -75,7 +75,7 @@ BOOST_AUTO_TEST_CASE (optimise_stills_test1)
        film->set_container (Ratio::from_id ("185"));
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR"));
        film->set_name ("frobozz");
        film->set_container (Ratio::from_id ("185"));
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR"));
        film->set_name ("frobozz");
-       shared_ptr<Content> content = content_factory(film, "test/data/flat_red.png").front ();
+       shared_ptr<Content> content = content_factory("test/data/flat_red.png").front ();
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs ());
        film->make_dcp ();
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs ());
        film->make_dcp ();
@@ -91,7 +91,7 @@ BOOST_AUTO_TEST_CASE (optimise_stills_test2)
        film->set_container (Ratio::from_id ("185"));
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR"));
        film->set_name ("frobozz");
        film->set_container (Ratio::from_id ("185"));
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR"));
        film->set_name ("frobozz");
-       shared_ptr<Content> content = content_factory(film, "test/data/flat_red.png").front ();
+       shared_ptr<Content> content = content_factory("test/data/flat_red.png").front ();
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs ());
        content->video->set_frame_type (VIDEO_FRAME_TYPE_3D_LEFT_RIGHT);
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs ());
        content->video->set_frame_type (VIDEO_FRAME_TYPE_3D_LEFT_RIGHT);
index 598e7a01a7a40d1acbfe0d7bec61b64dab104685..2ebcec4bfcb808b5858fb4dbc6ed3a0b0a4e4c40 100644 (file)
@@ -62,7 +62,7 @@ BOOST_AUTO_TEST_CASE (player_silence_padding_test)
 {
        shared_ptr<Film> film = new_test_film ("player_silence_padding_test");
        film->set_name ("player_silence_padding_test");
 {
        shared_ptr<Film> film = new_test_film ("player_silence_padding_test");
        film->set_name ("player_silence_padding_test");
-       shared_ptr<FFmpegContent> c (new FFmpegContent (film, "test/data/test.mp4"));
+       shared_ptr<FFmpegContent> c (new FFmpegContent("test/data/test.mp4"));
        film->set_container (Ratio::from_id ("185"));
        film->set_audio_channels (6);
 
        film->set_container (Ratio::from_id ("185"));
        film->set_audio_channels (6);
 
@@ -93,8 +93,8 @@ BOOST_AUTO_TEST_CASE (player_black_fill_test)
        film->set_container (Ratio::from_id ("185"));
        film->set_sequence (false);
        film->set_interop (false);
        film->set_container (Ratio::from_id ("185"));
        film->set_sequence (false);
        film->set_interop (false);
-       shared_ptr<ImageContent> contentA (new ImageContent (film, "test/data/simple_testcard_640x480.png"));
-       shared_ptr<ImageContent> contentB (new ImageContent (film, "test/data/simple_testcard_640x480.png"));
+       shared_ptr<ImageContent> contentA (new ImageContent("test/data/simple_testcard_640x480.png"));
+       shared_ptr<ImageContent> contentB (new ImageContent("test/data/simple_testcard_640x480.png"));
 
        film->examine_and_add_content (contentA);
        film->examine_and_add_content (contentB);
 
        film->examine_and_add_content (contentA);
        film->examine_and_add_content (contentB);
@@ -102,10 +102,10 @@ BOOST_AUTO_TEST_CASE (player_black_fill_test)
 
        contentA->video->set_scale (VideoContentScale (Ratio::from_id ("185")));
        contentA->video->set_length (3);
 
        contentA->video->set_scale (VideoContentScale (Ratio::from_id ("185")));
        contentA->video->set_length (3);
-       contentA->set_position (DCPTime::from_frames (2, film->video_frame_rate ()));
+       contentA->set_position (film, DCPTime::from_frames(2, film->video_frame_rate()));
        contentB->video->set_scale (VideoContentScale (Ratio::from_id ("185")));
        contentB->video->set_length (1);
        contentB->video->set_scale (VideoContentScale (Ratio::from_id ("185")));
        contentB->video->set_length (1);
-       contentB->set_position (DCPTime::from_frames (7, film->video_frame_rate ()));
+       contentB->set_position (film, DCPTime::from_frames(7, film->video_frame_rate()));
 
        film->make_dcp ();
 
 
        film->make_dcp ();
 
@@ -132,17 +132,17 @@ BOOST_AUTO_TEST_CASE (player_subframe_test)
        film->set_name ("reels_test7");
        film->set_container (Ratio::from_id ("185"));
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TST"));
        film->set_name ("reels_test7");
        film->set_container (Ratio::from_id ("185"));
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TST"));
-       shared_ptr<Content> A = content_factory(film, "test/data/flat_red.png").front();
+       shared_ptr<Content> A = content_factory("test/data/flat_red.png").front();
        film->examine_and_add_content (A);
        BOOST_REQUIRE (!wait_for_jobs ());
        film->examine_and_add_content (A);
        BOOST_REQUIRE (!wait_for_jobs ());
-       shared_ptr<Content> B = content_factory(film, "test/data/awkward_length.wav").front();
+       shared_ptr<Content> B = content_factory("test/data/awkward_length.wav").front();
        film->examine_and_add_content (B);
        BOOST_REQUIRE (!wait_for_jobs ());
        film->set_video_frame_rate (24);
        A->video->set_length (3 * 24);
 
        film->examine_and_add_content (B);
        BOOST_REQUIRE (!wait_for_jobs ());
        film->set_video_frame_rate (24);
        A->video->set_length (3 * 24);
 
-       BOOST_CHECK (A->full_length() == DCPTime::from_frames(3 * 24, 24));
-       BOOST_CHECK (B->full_length() == DCPTime(289920));
+       BOOST_CHECK (A->full_length(film) == DCPTime::from_frames(3 * 24, 24));
+       BOOST_CHECK (B->full_length(film) == DCPTime(289920));
        /* Length should be rounded up from B's length to the next video frame */
        BOOST_CHECK (film->length() == DCPTime::from_frames(3 * 24 + 1, 24));
 
        /* Length should be rounded up from B's length to the next video frame */
        BOOST_CHECK (film->length() == DCPTime::from_frames(3 * 24 + 1, 24));
 
@@ -177,11 +177,11 @@ BOOST_AUTO_TEST_CASE (player_interleave_test)
        film->set_container (Ratio::from_id ("185"));
        film->set_audio_channels (6);
 
        film->set_container (Ratio::from_id ("185"));
        film->set_audio_channels (6);
 
-       shared_ptr<FFmpegContent> c (new FFmpegContent (film, "test/data/test.mp4"));
+       shared_ptr<FFmpegContent> c (new FFmpegContent("test/data/test.mp4"));
        film->examine_and_add_content (c);
        BOOST_REQUIRE (!wait_for_jobs ());
 
        film->examine_and_add_content (c);
        BOOST_REQUIRE (!wait_for_jobs ());
 
-       shared_ptr<StringTextFileContent> s (new StringTextFileContent (film, "test/data/subrip.srt"));
+       shared_ptr<StringTextFileContent> s (new StringTextFileContent("test/data/subrip.srt"));
        film->examine_and_add_content (s);
        BOOST_REQUIRE (!wait_for_jobs ());
 
        film->examine_and_add_content (s);
        BOOST_REQUIRE (!wait_for_jobs ());
 
@@ -202,7 +202,7 @@ BOOST_AUTO_TEST_CASE (player_interleave_test)
 BOOST_AUTO_TEST_CASE (player_seek_test)
 {
        shared_ptr<Film> film (new Film (optional<boost::filesystem::path>()));
 BOOST_AUTO_TEST_CASE (player_seek_test)
 {
        shared_ptr<Film> film (new Film (optional<boost::filesystem::path>()));
-       shared_ptr<DCPContent> dcp (new DCPContent (film, private_data / "awkward_subs"));
+       shared_ptr<DCPContent> dcp (new DCPContent(private_data / "awkward_subs"));
        film->examine_and_add_content (dcp, true);
        BOOST_REQUIRE (!wait_for_jobs ());
        dcp->only_text()->set_use (true);
        film->examine_and_add_content (dcp, true);
        BOOST_REQUIRE (!wait_for_jobs ());
        dcp->only_text()->set_use (true);
@@ -233,7 +233,7 @@ BOOST_AUTO_TEST_CASE (player_seek_test)
 BOOST_AUTO_TEST_CASE (player_seek_test2)
 {
        shared_ptr<Film> film (new Film (optional<boost::filesystem::path>()));
 BOOST_AUTO_TEST_CASE (player_seek_test2)
 {
        shared_ptr<Film> film (new Film (optional<boost::filesystem::path>()));
-       shared_ptr<DCPContent> dcp (new DCPContent (film, private_data / "awkward_subs2"));
+       shared_ptr<DCPContent> dcp (new DCPContent(private_data / "awkward_subs2"));
        film->examine_and_add_content (dcp, true);
        BOOST_REQUIRE (!wait_for_jobs ());
        dcp->only_text()->set_use (true);
        film->examine_and_add_content (dcp, true);
        BOOST_REQUIRE (!wait_for_jobs ());
        dcp->only_text()->set_use (true);
@@ -262,15 +262,15 @@ BOOST_AUTO_TEST_CASE (player_seek_test2)
 BOOST_AUTO_TEST_CASE (player_trim_test)
 {
        shared_ptr<Film> film = new_test_film2 ("player_trim_test");
 BOOST_AUTO_TEST_CASE (player_trim_test)
 {
        shared_ptr<Film> film = new_test_film2 ("player_trim_test");
-       shared_ptr<Content> A = content_factory(film, "test/data/flat_red.png").front();
+       shared_ptr<Content> A = content_factory("test/data/flat_red.png").front();
        film->examine_and_add_content (A);
        BOOST_REQUIRE (!wait_for_jobs ());
        A->video->set_length (10 * 24);
        film->examine_and_add_content (A);
        BOOST_REQUIRE (!wait_for_jobs ());
        A->video->set_length (10 * 24);
-       shared_ptr<Content> B = content_factory(film, "test/data/flat_red.png").front();
+       shared_ptr<Content> B = content_factory("test/data/flat_red.png").front();
        film->examine_and_add_content (B);
        BOOST_REQUIRE (!wait_for_jobs ());
        B->video->set_length (10 * 24);
        film->examine_and_add_content (B);
        BOOST_REQUIRE (!wait_for_jobs ());
        B->video->set_length (10 * 24);
-       B->set_position (DCPTime::from_seconds (10));
+       B->set_position (film, DCPTime::from_seconds(10));
        B->set_trim_start (ContentTime::from_seconds (2));
 
        film->make_dcp ();
        B->set_trim_start (ContentTime::from_seconds (2));
 
        film->make_dcp ();
@@ -299,9 +299,9 @@ store (list<Sub>* out, PlayerText text, TextType type, optional<DCPTextTrack> tr
 BOOST_AUTO_TEST_CASE (player_ignore_video_and_audio_test)
 {
        shared_ptr<Film> film = new_test_film2 ("player_ignore_video_and_audio_test");
 BOOST_AUTO_TEST_CASE (player_ignore_video_and_audio_test)
 {
        shared_ptr<Film> film = new_test_film2 ("player_ignore_video_and_audio_test");
-       shared_ptr<Content> ff = content_factory(film, private_data / "boon_telly.mkv").front();
+       shared_ptr<Content> ff = content_factory(private_data / "boon_telly.mkv").front();
        film->examine_and_add_content (ff);
        film->examine_and_add_content (ff);
-       shared_ptr<Content> text = content_factory(film, "test/data/subrip.srt").front();
+       shared_ptr<Content> text = content_factory("test/data/subrip.srt").front();
        film->examine_and_add_content (text);
        BOOST_REQUIRE (!wait_for_jobs());
        text->only_text()->set_type (TEXT_CLOSED_CAPTION);
        film->examine_and_add_content (text);
        BOOST_REQUIRE (!wait_for_jobs());
        text->only_text()->set_type (TEXT_CLOSED_CAPTION);
index 4222426c3ce9341d6e92bf58e363bedf3705b68c..017c019274af0b69254cd65331b1b6667118609c 100644 (file)
@@ -55,7 +55,7 @@ BOOST_AUTO_TEST_CASE (recover_test_2d)
        film->set_container (Ratio::from_id ("185"));
        film->set_name ("recover_test");
 
        film->set_container (Ratio::from_id ("185"));
        film->set_name ("recover_test");
 
-       shared_ptr<FFmpegContent> content (new FFmpegContent (film, "test/data/count300bd24.m2ts"));
+       shared_ptr<FFmpegContent> content (new FFmpegContent("test/data/count300bd24.m2ts"));
        film->examine_and_add_content (content);
        wait_for_jobs ();
 
        film->examine_and_add_content (content);
        wait_for_jobs ();
 
@@ -89,7 +89,7 @@ BOOST_AUTO_TEST_CASE (recover_test_3d)
        film->set_name ("recover_test");
        film->set_three_d (true);
 
        film->set_name ("recover_test");
        film->set_three_d (true);
 
-       shared_ptr<ImageContent> content (new ImageContent (film, "test/data/3d_test"));
+       shared_ptr<ImageContent> content (new ImageContent("test/data/3d_test"));
        content->video->set_frame_type (VIDEO_FRAME_TYPE_3D_LEFT_RIGHT);
        film->examine_and_add_content (content);
        wait_for_jobs ();
        content->video->set_frame_type (VIDEO_FRAME_TYPE_3D_LEFT_RIGHT);
        film->examine_and_add_content (content);
        wait_for_jobs ();
@@ -126,7 +126,7 @@ BOOST_AUTO_TEST_CASE (recover_test_2d_encrypted)
        film->set_name ("recover_test");
        film->set_encrypted (true);
 
        film->set_name ("recover_test");
        film->set_encrypted (true);
 
-       shared_ptr<FFmpegContent> content (new FFmpegContent (film, "test/data/count300bd24.m2ts"));
+       shared_ptr<FFmpegContent> content (new FFmpegContent("test/data/count300bd24.m2ts"));
        film->examine_and_add_content (content);
        wait_for_jobs ();
 
        film->examine_and_add_content (content);
        wait_for_jobs ();
 
index 76dbb61ed82e3956a8bce1e9117e652c4f23f99b..c27762fdb3fe4d3c661e51e1fcf3dae5295e6501 100644 (file)
@@ -45,12 +45,12 @@ BOOST_AUTO_TEST_CASE (reels_test1)
 {
        shared_ptr<Film> film = new_test_film ("reels_test1");
        film->set_container (Ratio::from_id ("185"));
 {
        shared_ptr<Film> film = new_test_film ("reels_test1");
        film->set_container (Ratio::from_id ("185"));
-       shared_ptr<FFmpegContent> A (new FFmpegContent (film, "test/data/test.mp4"));
+       shared_ptr<FFmpegContent> A (new FFmpegContent("test/data/test.mp4"));
        film->examine_and_add_content (A);
        film->examine_and_add_content (A);
-       shared_ptr<FFmpegContent> B (new FFmpegContent (film, "test/data/test.mp4"));
+       shared_ptr<FFmpegContent> B (new FFmpegContent("test/data/test.mp4"));
        film->examine_and_add_content (B);
        wait_for_jobs ();
        film->examine_and_add_content (B);
        wait_for_jobs ();
-       BOOST_CHECK_EQUAL (A->full_length().get(), 288000);
+       BOOST_CHECK_EQUAL (A->full_length(film).get(), 288000);
 
        film->set_reel_type (REELTYPE_SINGLE);
        list<DCPTimePeriod> r = film->reels ();
 
        film->set_reel_type (REELTYPE_SINGLE);
        list<DCPTimePeriod> r = film->reels ();
@@ -95,21 +95,21 @@ BOOST_AUTO_TEST_CASE (reels_test2)
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TST"));
 
        {
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TST"));
 
        {
-               shared_ptr<ImageContent> c (new ImageContent (film, "test/data/flat_red.png"));
+               shared_ptr<ImageContent> c (new ImageContent("test/data/flat_red.png"));
                film->examine_and_add_content (c);
                wait_for_jobs ();
                c->video->set_length (24);
        }
 
        {
                film->examine_and_add_content (c);
                wait_for_jobs ();
                c->video->set_length (24);
        }
 
        {
-               shared_ptr<ImageContent> c (new ImageContent (film, "test/data/flat_green.png"));
+               shared_ptr<ImageContent> c (new ImageContent("test/data/flat_green.png"));
                film->examine_and_add_content (c);
                wait_for_jobs ();
                c->video->set_length (24);
        }
 
        {
                film->examine_and_add_content (c);
                wait_for_jobs ();
                c->video->set_length (24);
        }
 
        {
-               shared_ptr<ImageContent> c (new ImageContent (film, "test/data/flat_blue.png"));
+               shared_ptr<ImageContent> c (new ImageContent("test/data/flat_blue.png"));
                film->examine_and_add_content (c);
                wait_for_jobs ();
                c->video->set_length (24);
                film->examine_and_add_content (c);
                wait_for_jobs ();
                c->video->set_length (24);
@@ -129,7 +129,7 @@ BOOST_AUTO_TEST_CASE (reels_test2)
        film2->set_dcp_content_type (DCPContentType::from_isdcf_name ("TST"));
        film2->set_reel_type (REELTYPE_BY_VIDEO_CONTENT);
 
        film2->set_dcp_content_type (DCPContentType::from_isdcf_name ("TST"));
        film2->set_reel_type (REELTYPE_BY_VIDEO_CONTENT);
 
-       shared_ptr<DCPContent> c (new DCPContent (film2, film->dir (film->dcp_name ())));
+       shared_ptr<DCPContent> c (new DCPContent(film->dir(film->dcp_name())));
        film2->examine_and_add_content (c);
        BOOST_REQUIRE (!wait_for_jobs ());
 
        film2->examine_and_add_content (c);
        BOOST_REQUIRE (!wait_for_jobs ());
 
@@ -163,9 +163,9 @@ BOOST_AUTO_TEST_CASE (reels_test3)
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TST"));
        film->set_reel_type (REELTYPE_BY_VIDEO_CONTENT);
 
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TST"));
        film->set_reel_type (REELTYPE_BY_VIDEO_CONTENT);
 
-       shared_ptr<Content> dcp (new DCPContent (film, "test/data/reels_test2"));
+       shared_ptr<Content> dcp (new DCPContent("test/data/reels_test2"));
        film->examine_and_add_content (dcp);
        film->examine_and_add_content (dcp);
-       shared_ptr<Content> sub (new StringTextFileContent (film, "test/data/subrip.srt"));
+       shared_ptr<Content> sub (new StringTextFileContent("test/data/subrip.srt"));
        film->examine_and_add_content (sub);
        wait_for_jobs ();
 
        film->examine_and_add_content (sub);
        wait_for_jobs ();
 
@@ -182,7 +182,7 @@ BOOST_AUTO_TEST_CASE (reels_test3)
        BOOST_CHECK_EQUAL (i->to.get(), 96000 * 3);
        ++i;
        BOOST_CHECK_EQUAL (i->from.get(), 96000 * 3);
        BOOST_CHECK_EQUAL (i->to.get(), 96000 * 3);
        ++i;
        BOOST_CHECK_EQUAL (i->from.get(), 96000 * 3);
-       BOOST_CHECK_EQUAL (i->to.get(), sub->full_length().ceil(film->video_frame_rate()).get());
+       BOOST_CHECK_EQUAL (i->to.get(), sub->full_length(film).ceil(film->video_frame_rate()).get());
 }
 
 /** Check creation of a multi-reel DCP with a single .srt subtitle file;
 }
 
 /** Check creation of a multi-reel DCP with a single .srt subtitle file;
@@ -200,13 +200,13 @@ BOOST_AUTO_TEST_CASE (reels_test4)
        /* 4 piece of 1s-long content */
        shared_ptr<ImageContent> content[4];
        for (int i = 0; i < 4; ++i) {
        /* 4 piece of 1s-long content */
        shared_ptr<ImageContent> content[4];
        for (int i = 0; i < 4; ++i) {
-               content[i].reset (new ImageContent (film, "test/data/flat_green.png"));
+               content[i].reset (new ImageContent("test/data/flat_green.png"));
                film->examine_and_add_content (content[i]);
                wait_for_jobs ();
                content[i]->video->set_length (24);
        }
 
                film->examine_and_add_content (content[i]);
                wait_for_jobs ();
                content[i]->video->set_length (24);
        }
 
-       shared_ptr<StringTextFileContent> subs (new StringTextFileContent (film, "test/data/subrip3.srt"));
+       shared_ptr<StringTextFileContent> subs (new StringTextFileContent("test/data/subrip3.srt"));
        film->examine_and_add_content (subs);
        wait_for_jobs ();
 
        film->examine_and_add_content (subs);
        wait_for_jobs ();
 
@@ -235,15 +235,15 @@ BOOST_AUTO_TEST_CASE (reels_test5)
 {
        shared_ptr<Film> film = new_test_film ("reels_test5");
        film->set_sequence (false);
 {
        shared_ptr<Film> film = new_test_film ("reels_test5");
        film->set_sequence (false);
-       shared_ptr<DCPContent> dcp (new DCPContent (film, "test/data/reels_test4"));
+       shared_ptr<DCPContent> dcp (new DCPContent("test/data/reels_test4"));
        film->examine_and_add_content (dcp);
        BOOST_REQUIRE (!wait_for_jobs ());
 
        /* Set to 2123 but it will be rounded up to the next frame (4000) */
        film->examine_and_add_content (dcp);
        BOOST_REQUIRE (!wait_for_jobs ());
 
        /* Set to 2123 but it will be rounded up to the next frame (4000) */
-       dcp->set_position(DCPTime(2123));
+       dcp->set_position(film, DCPTime(2123));
 
        {
 
        {
-               list<DCPTimePeriod> p = dcp->reels ();
+               list<DCPTimePeriod> p = dcp->reels (film);
                BOOST_REQUIRE_EQUAL (p.size(), 4);
                list<DCPTimePeriod>::const_iterator i = p.begin();
                BOOST_CHECK (*i++ == DCPTimePeriod (DCPTime(4000 + 0), DCPTime(4000 + 96000)));
                BOOST_REQUIRE_EQUAL (p.size(), 4);
                list<DCPTimePeriod>::const_iterator i = p.begin();
                BOOST_CHECK (*i++ == DCPTimePeriod (DCPTime(4000 + 0), DCPTime(4000 + 96000)));
@@ -254,7 +254,7 @@ BOOST_AUTO_TEST_CASE (reels_test5)
 
        {
                dcp->set_trim_start (ContentTime::from_seconds (0.5));
 
        {
                dcp->set_trim_start (ContentTime::from_seconds (0.5));
-               list<DCPTimePeriod> p = dcp->reels ();
+               list<DCPTimePeriod> p = dcp->reels (film);
                BOOST_REQUIRE_EQUAL (p.size(), 4);
                list<DCPTimePeriod>::const_iterator i = p.begin();
                BOOST_CHECK (*i++ == DCPTimePeriod (DCPTime(4000 + 0), DCPTime(4000 + 48000)));
                BOOST_REQUIRE_EQUAL (p.size(), 4);
                list<DCPTimePeriod>::const_iterator i = p.begin();
                BOOST_CHECK (*i++ == DCPTimePeriod (DCPTime(4000 + 0), DCPTime(4000 + 48000)));
@@ -265,7 +265,7 @@ BOOST_AUTO_TEST_CASE (reels_test5)
 
        {
                dcp->set_trim_end (ContentTime::from_seconds (0.5));
 
        {
                dcp->set_trim_end (ContentTime::from_seconds (0.5));
-               list<DCPTimePeriod> p = dcp->reels ();
+               list<DCPTimePeriod> p = dcp->reels (film);
                BOOST_REQUIRE_EQUAL (p.size(), 4);
                list<DCPTimePeriod>::const_iterator i = p.begin();
                BOOST_CHECK (*i++ == DCPTimePeriod (DCPTime(4000 + 0), DCPTime(4000 + 48000)));
                BOOST_REQUIRE_EQUAL (p.size(), 4);
                list<DCPTimePeriod>::const_iterator i = p.begin();
                BOOST_CHECK (*i++ == DCPTimePeriod (DCPTime(4000 + 0), DCPTime(4000 + 48000)));
@@ -276,7 +276,7 @@ BOOST_AUTO_TEST_CASE (reels_test5)
 
        {
                dcp->set_trim_start (ContentTime::from_seconds (1.5));
 
        {
                dcp->set_trim_start (ContentTime::from_seconds (1.5));
-               list<DCPTimePeriod> p = dcp->reels ();
+               list<DCPTimePeriod> p = dcp->reels (film);
                BOOST_REQUIRE_EQUAL (p.size(), 3);
                list<DCPTimePeriod>::const_iterator i = p.begin();
                BOOST_CHECK (*i++ == DCPTimePeriod (DCPTime(4000 + 0), DCPTime(4000 + 48000)));
                BOOST_REQUIRE_EQUAL (p.size(), 3);
                list<DCPTimePeriod>::const_iterator i = p.begin();
                BOOST_CHECK (*i++ == DCPTimePeriod (DCPTime(4000 + 0), DCPTime(4000 + 48000)));
@@ -292,7 +292,7 @@ BOOST_AUTO_TEST_CASE (reels_test6)
        film->set_name ("reels_test6");
        film->set_container (Ratio::from_id ("185"));
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TST"));
        film->set_name ("reels_test6");
        film->set_container (Ratio::from_id ("185"));
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TST"));
-       shared_ptr<FFmpegContent> A (new FFmpegContent (film, "test/data/test2.mp4"));
+       shared_ptr<FFmpegContent> A (new FFmpegContent("test/data/test2.mp4"));
        film->examine_and_add_content (A);
        BOOST_REQUIRE (!wait_for_jobs ());
 
        film->examine_and_add_content (A);
        BOOST_REQUIRE (!wait_for_jobs ());
 
@@ -313,10 +313,10 @@ BOOST_AUTO_TEST_CASE (reels_test7)
        film->set_name ("reels_test7");
        film->set_container (Ratio::from_id ("185"));
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TST"));
        film->set_name ("reels_test7");
        film->set_container (Ratio::from_id ("185"));
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TST"));
-       shared_ptr<Content> A = content_factory(film, "test/data/flat_red.png").front();
+       shared_ptr<Content> A = content_factory("test/data/flat_red.png").front();
        film->examine_and_add_content (A);
        BOOST_REQUIRE (!wait_for_jobs ());
        film->examine_and_add_content (A);
        BOOST_REQUIRE (!wait_for_jobs ());
-       shared_ptr<Content> B = content_factory(film, "test/data/awkward_length.wav").front();
+       shared_ptr<Content> B = content_factory("test/data/awkward_length.wav").front();
        film->examine_and_add_content (B);
        BOOST_REQUIRE (!wait_for_jobs ());
        film->set_video_frame_rate (24);
        film->examine_and_add_content (B);
        BOOST_REQUIRE (!wait_for_jobs ());
        film->set_video_frame_rate (24);
@@ -338,7 +338,7 @@ BOOST_AUTO_TEST_CASE (reels_test8)
        film->set_name ("reels_test8");
        film->set_container (Ratio::from_id ("185"));
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TST"));
        film->set_name ("reels_test8");
        film->set_container (Ratio::from_id ("185"));
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TST"));
-       shared_ptr<FFmpegContent> A (new FFmpegContent (film, "test/data/test2.mp4"));
+       shared_ptr<FFmpegContent> A (new FFmpegContent("test/data/test2.mp4"));
        film->examine_and_add_content (A);
        BOOST_REQUIRE (!wait_for_jobs ());
 
        film->examine_and_add_content (A);
        BOOST_REQUIRE (!wait_for_jobs ());
 
@@ -351,7 +351,7 @@ BOOST_AUTO_TEST_CASE (reels_test8)
 BOOST_AUTO_TEST_CASE (reels_test9)
 {
        shared_ptr<Film> film = new_test_film2("reels_test9a");
 BOOST_AUTO_TEST_CASE (reels_test9)
 {
        shared_ptr<Film> film = new_test_film2("reels_test9a");
-       shared_ptr<FFmpegContent> A(new FFmpegContent(film, "test/data/flat_red.png"));
+       shared_ptr<FFmpegContent> A(new FFmpegContent("test/data/flat_red.png"));
        film->examine_and_add_content(A);
        BOOST_REQUIRE(!wait_for_jobs());
        A->video->set_length(5 * 24);
        film->examine_and_add_content(A);
        BOOST_REQUIRE(!wait_for_jobs());
        A->video->set_length(5 * 24);
@@ -360,9 +360,9 @@ BOOST_AUTO_TEST_CASE (reels_test9)
        BOOST_REQUIRE(!wait_for_jobs());
 
        shared_ptr<Film> film2 = new_test_film2("reels_test9b");
        BOOST_REQUIRE(!wait_for_jobs());
 
        shared_ptr<Film> film2 = new_test_film2("reels_test9b");
-       shared_ptr<DCPContent> B(new DCPContent(film2, film->dir(film->dcp_name())));
+       shared_ptr<DCPContent> B(new DCPContent(film->dir(film->dcp_name())));
        film2->examine_and_add_content(B);
        film2->examine_and_add_content(B);
-       film2->examine_and_add_content(content_factory(film, "test/data/dcp_sub4.xml").front());
+       film2->examine_and_add_content(content_factory("test/data/dcp_sub4.xml").front());
        B->set_reference_video(true);
        B->set_reference_audio(true);
        BOOST_REQUIRE(!wait_for_jobs());
        B->set_reference_video(true);
        B->set_reference_audio(true);
        BOOST_REQUIRE(!wait_for_jobs());
index ac1bfbe14dcd92198825de1905b8c50ce25d928f..349884f919e4a03012592b59c2330b8e7feed276 100644 (file)
@@ -43,7 +43,7 @@ BOOST_AUTO_TEST_CASE (remake_id_test1)
 {
        /* Make a DCP */
        shared_ptr<Film> film = new_test_film2 ("remake_id_test1_1");
 {
        /* Make a DCP */
        shared_ptr<Film> film = new_test_film2 ("remake_id_test1_1");
-       shared_ptr<Content> content = content_factory(film, "test/data/flat_red.png").front();
+       shared_ptr<Content> content = content_factory("test/data/flat_red.png").front();
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs ());
        film->make_dcp ();
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs ());
        film->make_dcp ();
@@ -67,7 +67,7 @@ BOOST_AUTO_TEST_CASE (remake_id_test2)
 {
        /* Make a DCP */
        shared_ptr<Film> film = new_test_film2 ("remake_id_test2_1");
 {
        /* Make a DCP */
        shared_ptr<Film> film = new_test_film2 ("remake_id_test2_1");
-       shared_ptr<Content> content = content_factory(film, "test/data/flat_red.png").front();
+       shared_ptr<Content> content = content_factory("test/data/flat_red.png").front();
        film->examine_and_add_content (content);
        film->set_encrypted (true);
        BOOST_REQUIRE (!wait_for_jobs ());
        film->examine_and_add_content (content);
        film->set_encrypted (true);
        BOOST_REQUIRE (!wait_for_jobs ());
@@ -102,7 +102,7 @@ BOOST_AUTO_TEST_CASE (remake_id_test2)
 
        /* Import the DCP into a new film */
        shared_ptr<Film> film2 = new_test_film2("remake_id_test2_2");
 
        /* Import the DCP into a new film */
        shared_ptr<Film> film2 = new_test_film2("remake_id_test2_2");
-       shared_ptr<DCPContent> dcp_content(new DCPContent(film2, film->dir(film->dcp_name())));
+       shared_ptr<DCPContent> dcp_content(new DCPContent(film->dir(film->dcp_name())));
        film2->examine_and_add_content(dcp_content);
        BOOST_REQUIRE(!wait_for_jobs());
        dcp_content->add_kdm(kdm);
        film2->examine_and_add_content(dcp_content);
        BOOST_REQUIRE(!wait_for_jobs());
        dcp_content->add_kdm(kdm);
index c54dee61fd205b001fc5bf5939de6f63356aa44f..399796698dc646c0dc2a1d60e92717d83e2a5f73 100644 (file)
@@ -34,7 +34,7 @@ using boost::dynamic_pointer_cast;
 BOOST_AUTO_TEST_CASE (remake_with_subtitle_test)
 {
        shared_ptr<Film> film = new_test_film2 ("remake_with_subtitle_test");
 BOOST_AUTO_TEST_CASE (remake_with_subtitle_test)
 {
        shared_ptr<Film> film = new_test_film2 ("remake_with_subtitle_test");
-       shared_ptr<FFmpegContent> content = dynamic_pointer_cast<FFmpegContent>(content_factory(film, private_data / "prophet_short_clip.mkv").front());
+       shared_ptr<FFmpegContent> content = dynamic_pointer_cast<FFmpegContent>(content_factory(private_data / "prophet_short_clip.mkv").front());
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs ());
        content->only_text()->set_burn (true);
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs ());
        content->only_text()->set_burn (true);
index fd64ba018cbf47746798220f5438de28d9b17c5b..badf5d9ff20eef1638ecfeb76fa895cd7cafeda3 100644 (file)
@@ -43,7 +43,7 @@ BOOST_AUTO_TEST_CASE (repeat_frame_test)
        film->set_container (Ratio::from_id ("185"));
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TST"));
        film->set_interop (false);
        film->set_container (Ratio::from_id ("185"));
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TST"));
        film->set_interop (false);
-       shared_ptr<FFmpegContent> c (new FFmpegContent (film, "test/data/red_24.mp4"));
+       shared_ptr<FFmpegContent> c (new FFmpegContent("test/data/red_24.mp4"));
        film->examine_and_add_content (c);
 
        wait_for_jobs ();
        film->examine_and_add_content (c);
 
        wait_for_jobs ();
index bcb53bdaf71534acd3372f49e70d7c9020ca595f..812b35ff8ec96568626d446c8928bd17fd8b7fb2 100644 (file)
@@ -43,10 +43,10 @@ BOOST_AUTO_TEST_CASE (required_disk_space_test)
        shared_ptr<Film> film = new_test_film ("required_disk_space_test");
        film->set_j2k_bandwidth (100000000);
        film->set_audio_channels (6);
        shared_ptr<Film> film = new_test_film ("required_disk_space_test");
        film->set_j2k_bandwidth (100000000);
        film->set_audio_channels (6);
-       shared_ptr<Content> content_a = content_factory(film, "test/data/flat_blue.png").front();
+       shared_ptr<Content> content_a = content_factory("test/data/flat_blue.png").front();
        BOOST_REQUIRE (content_a);
        film->examine_and_add_content (content_a);
        BOOST_REQUIRE (content_a);
        film->examine_and_add_content (content_a);
-       shared_ptr<DCPContent> content_b (new DCPContent (film, "test/data/burnt_subtitle_test_dcp"));
+       shared_ptr<DCPContent> content_b (new DCPContent("test/data/burnt_subtitle_test_dcp"));
        film->examine_and_add_content (content_b);
        wait_for_jobs ();
        film->write_metadata ();
        film->examine_and_add_content (content_b);
        wait_for_jobs ();
        film->write_metadata ();
index ed0461005f12376ba00e1b13fef07c3edd83c573..d2f886736625237c88d1507f6dfe29ac4b3274cc 100644 (file)
@@ -62,7 +62,7 @@ BOOST_AUTO_TEST_CASE (scaling_test)
        shared_ptr<Film> film = new_test_film ("scaling_test");
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("FTR"));
        film->set_name ("scaling_test");
        shared_ptr<Film> film = new_test_film ("scaling_test");
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("FTR"));
        film->set_name ("scaling_test");
-       shared_ptr<ImageContent> imc (new ImageContent (film, "test/data/simple_testcard_640x480.png"));
+       shared_ptr<ImageContent> imc (new ImageContent("test/data/simple_testcard_640x480.png"));
 
        film->examine_and_add_content (imc);
 
 
        film->examine_and_add_content (imc);
 
index 6c7d0b5ff79ec2721eafe469a477556cf67927a1..2bc0c3bb66c3bfacad9471342deaa5423cf2431b 100644 (file)
@@ -50,7 +50,7 @@ test_silence_padding (int channels)
        film->set_container (Ratio::from_id ("185"));
        film->set_name (film_name);
 
        film->set_container (Ratio::from_id ("185"));
        film->set_name (film_name);
 
-       shared_ptr<FFmpegContent> content (new FFmpegContent (film, "test/data/staircase.wav"));
+       shared_ptr<FFmpegContent> content (new FFmpegContent("test/data/staircase.wav"));
        film->examine_and_add_content (content);
        wait_for_jobs ();
 
        film->examine_and_add_content (content);
        wait_for_jobs ();
 
index fdea35849eafdf21c156b575afe7c1241ec634b1..6c08291e117e81df02825b2022d49250f130a683 100644 (file)
@@ -43,7 +43,7 @@ BOOST_AUTO_TEST_CASE (skip_frame_test)
        film->set_container (Ratio::from_id ("185"));
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TST"));
        film->set_interop (false);
        film->set_container (Ratio::from_id ("185"));
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TST"));
        film->set_interop (false);
-       shared_ptr<FFmpegContent> c (new FFmpegContent (film, "test/data/count300bd48.m2ts"));
+       shared_ptr<FFmpegContent> c (new FFmpegContent("test/data/count300bd48.m2ts"));
        film->examine_and_add_content (c);
 
        wait_for_jobs ();
        film->examine_and_add_content (c);
 
        wait_for_jobs ();
index c4bdd76d1c71efdac4aae6bf645f93f02f5bd2aa..31a082015e0d9f4de66d78034cebd81d9fcbda1e 100644 (file)
@@ -47,7 +47,7 @@ BOOST_AUTO_TEST_CASE (srt_subtitle_test)
        film->set_name ("frobozz");
        film->set_audio_channels (6);
        film->set_interop (false);
        film->set_name ("frobozz");
        film->set_audio_channels (6);
        film->set_interop (false);
-       shared_ptr<StringTextFileContent> content (new StringTextFileContent (film, "test/data/subrip2.srt"));
+       shared_ptr<StringTextFileContent> content (new StringTextFileContent("test/data/subrip2.srt"));
        film->examine_and_add_content (content);
        wait_for_jobs ();
 
        film->examine_and_add_content (content);
        wait_for_jobs ();
 
@@ -69,7 +69,7 @@ BOOST_AUTO_TEST_CASE (srt_subtitle_test2)
        film->set_name ("frobozz");
        film->set_audio_channels (6);
        film->set_interop (false);
        film->set_name ("frobozz");
        film->set_audio_channels (6);
        film->set_interop (false);
-       shared_ptr<StringTextFileContent> content (new StringTextFileContent (film, "test/data/subrip2.srt"));
+       shared_ptr<StringTextFileContent> content (new StringTextFileContent ("test/data/subrip2.srt"));
        film->examine_and_add_content (content);
        wait_for_jobs ();
 
        film->examine_and_add_content (content);
        wait_for_jobs ();
 
@@ -104,7 +104,7 @@ BOOST_AUTO_TEST_CASE (srt_subtitle_test3)
        film->set_name ("frobozz");
        film->set_interop (true);
        film->set_audio_channels (6);
        film->set_name ("frobozz");
        film->set_interop (true);
        film->set_audio_channels (6);
-       shared_ptr<StringTextFileContent> content (new StringTextFileContent (film, private_data / "Ankoemmling_short.srt"));
+       shared_ptr<StringTextFileContent> content (new StringTextFileContent(private_data / "Ankoemmling_short.srt"));
        film->examine_and_add_content (content);
        wait_for_jobs ();
 
        film->examine_and_add_content (content);
        wait_for_jobs ();
 
@@ -125,7 +125,7 @@ BOOST_AUTO_TEST_CASE (srt_subtitle_test4)
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR"));
        film->set_name ("frobozz");
        film->set_interop (false);
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR"));
        film->set_name ("frobozz");
        film->set_interop (false);
-       shared_ptr<StringTextFileContent> content (new StringTextFileContent (film, "test/data/subrip2.srt"));
+       shared_ptr<StringTextFileContent> content (new StringTextFileContent("test/data/subrip2.srt"));
        content->only_text()->set_use (true);
        content->only_text()->set_burn (false);
        film->examine_and_add_content (content);
        content->only_text()->set_use (true);
        content->only_text()->set_burn (false);
        film->examine_and_add_content (content);
@@ -146,13 +146,13 @@ BOOST_AUTO_TEST_CASE (srt_subtitle_test5)
        film->set_name ("frobozz");
        film->set_interop (true);
        film->set_sequence (false);
        film->set_name ("frobozz");
        film->set_interop (true);
        film->set_sequence (false);
-       shared_ptr<StringTextFileContent> content (new StringTextFileContent (film, "test/data/subrip2.srt"));
+       shared_ptr<StringTextFileContent> content (new StringTextFileContent("test/data/subrip2.srt"));
        content->only_text()->set_use (true);
        content->only_text()->set_burn (false);
        film->examine_and_add_content (content);
        film->examine_and_add_content (content);
        wait_for_jobs ();
        content->only_text()->set_use (true);
        content->only_text()->set_burn (false);
        film->examine_and_add_content (content);
        film->examine_and_add_content (content);
        wait_for_jobs ();
-       content->set_position (DCPTime (0));
+       content->set_position (film, DCPTime());
        film->make_dcp ();
        wait_for_jobs ();
        film->write_metadata ();
        film->make_dcp ();
        wait_for_jobs ();
        film->write_metadata ();
@@ -164,7 +164,7 @@ BOOST_AUTO_TEST_CASE (srt_subtitle_test6)
 {
        shared_ptr<Film> film = new_test_film2 ("srt_subtitle_test6");
        film->set_interop (false);
 {
        shared_ptr<Film> film = new_test_film2 ("srt_subtitle_test6");
        film->set_interop (false);
-       shared_ptr<StringTextFileContent> content (new StringTextFileContent (film, "test/data/frames.srt"));
+       shared_ptr<StringTextFileContent> content (new StringTextFileContent("test/data/frames.srt"));
        content->only_text()->set_use (true);
        content->only_text()->set_burn (false);
        film->examine_and_add_content (content);
        content->only_text()->set_use (true);
        content->only_text()->set_burn (false);
        film->examine_and_add_content (content);
@@ -185,7 +185,7 @@ BOOST_AUTO_TEST_CASE (srt_subtitle_test6)
 BOOST_AUTO_TEST_CASE (srt_subtitle_test4)
 {
        shared_ptr<Film> film = new_test_film ("subrip_render_test");
 BOOST_AUTO_TEST_CASE (srt_subtitle_test4)
 {
        shared_ptr<Film> film = new_test_film ("subrip_render_test");
-       shared_ptr<StringTextFile> content (new StringTextFile (film, "test/data/subrip.srt"));
+       shared_ptr<StringTextFile> content (new StringTextFile("test/data/subrip.srt"));
        content->examine (shared_ptr<Job> (), true);
        BOOST_CHECK_EQUAL (content->full_length(), DCPTime::from_seconds ((3 * 60) + 56.471));
 
        content->examine (shared_ptr<Job> (), true);
        BOOST_CHECK_EQUAL (content->full_length(), DCPTime::from_seconds ((3 * 60) + 56.471));
 
index cd22450a62d41d655500e0525bec9537e69b46a7..c1524bc2916046322b8c15ca17ceb6fafa9c7f47 100644 (file)
@@ -47,7 +47,7 @@ BOOST_AUTO_TEST_CASE (ssa_subtitle_test1)
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR"));
        film->set_name ("frobozz");
        film->set_interop (true);
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR"));
        film->set_name ("frobozz");
        film->set_interop (true);
-       shared_ptr<StringTextFileContent> content (new StringTextFileContent (film, private_data / "DKH_UT_EN20160601def.ssa"));
+       shared_ptr<StringTextFileContent> content (new StringTextFileContent(private_data / "DKH_UT_EN20160601def.ssa"));
        film->examine_and_add_content (content);
        wait_for_jobs ();
 
        film->examine_and_add_content (content);
        wait_for_jobs ();
 
index 9c61b83f4d12973356112505b9b03eee929db67e..29dabe4bb5802a6f6ae105e1c746bf6f3d750cff 100644 (file)
@@ -33,7 +33,7 @@ using boost::dynamic_pointer_cast;
 BOOST_AUTO_TEST_CASE (subtitle_charset_test1)
 {
        shared_ptr<Film> film = new_test_film2 ("subtitle_charset_test1");
 BOOST_AUTO_TEST_CASE (subtitle_charset_test1)
 {
        shared_ptr<Film> film = new_test_film2 ("subtitle_charset_test1");
-       shared_ptr<Content> content = content_factory (film, private_data / "PADDINGTON soustitresVFdef.srt").front ();
+       shared_ptr<Content> content = content_factory (private_data / "PADDINGTON soustitresVFdef.srt").front();
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs ());
 }
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs ());
 }
@@ -42,11 +42,11 @@ BOOST_AUTO_TEST_CASE (subtitle_charset_test1)
 BOOST_AUTO_TEST_CASE (subtitle_charset_test2)
 {
        shared_ptr<Film> film = new_test_film2 ("subtitle_charset_test2");
 BOOST_AUTO_TEST_CASE (subtitle_charset_test2)
 {
        shared_ptr<Film> film = new_test_film2 ("subtitle_charset_test2");
-       shared_ptr<Content> content = content_factory (film, "test/data/osx.srt").front ();
+       shared_ptr<Content> content = content_factory ("test/data/osx.srt").front();
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs ());
        shared_ptr<StringTextFileContent> ts = dynamic_pointer_cast<StringTextFileContent> (content);
        BOOST_REQUIRE (ts);
        /* Make sure we got the subtitle data from the file */
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs ());
        shared_ptr<StringTextFileContent> ts = dynamic_pointer_cast<StringTextFileContent> (content);
        BOOST_REQUIRE (ts);
        /* Make sure we got the subtitle data from the file */
-       BOOST_REQUIRE_EQUAL (content->full_length().get(), 6052032);
+       BOOST_REQUIRE_EQUAL (content->full_length(film).get(), 6052032);
 }
 }
index f02920b7f5ed43620e66177561897a8db08f03d3..0726ee2e418bcb76310669b52a0eba07c2e50b09 100644 (file)
@@ -43,7 +43,7 @@ BOOST_AUTO_TEST_CASE (subtitle_reel_number_test)
        film->set_container (Ratio::from_id ("185"));
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR"));
        film->set_name ("frobozz");
        film->set_container (Ratio::from_id ("185"));
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR"));
        film->set_name ("frobozz");
-       shared_ptr<StringTextFileContent> content (new StringTextFileContent (film, "test/data/subrip5.srt"));
+       shared_ptr<StringTextFileContent> content (new StringTextFileContent("test/data/subrip5.srt"));
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs ());
        content->only_text()->set_use (true);
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs ());
        content->only_text()->set_use (true);
index 33bcf823f2deb69aec1963c58da1f54f778b9d76..2380449d8a4d9c8cee6aa345e41864df95d3ea3d 100644 (file)
@@ -29,7 +29,7 @@ using boost::shared_ptr;
 BOOST_AUTO_TEST_CASE (subtitle_trim_test1)
 {
        shared_ptr<Film> film = new_test_film2 ("subtitle_trim_test1");
 BOOST_AUTO_TEST_CASE (subtitle_trim_test1)
 {
        shared_ptr<Film> film = new_test_film2 ("subtitle_trim_test1");
-       shared_ptr<DCPSubtitleContent> content (new DCPSubtitleContent (film, "test/data/dcp_sub5.xml"));
+       shared_ptr<DCPSubtitleContent> content (new DCPSubtitleContent ("test/data/dcp_sub5.xml"));
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs ());
 
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs ());
 
index 41d92bc2f9aa9b6e9f699d17ee131177eaa678a9..a8d3f8a00f737d03fcecb941fc531b65ee41e462 100644 (file)
@@ -40,7 +40,7 @@ BOOST_AUTO_TEST_CASE (threed_test1)
 {
        shared_ptr<Film> film = new_test_film ("threed_test1");
        film->set_name ("test_film1");
 {
        shared_ptr<Film> film = new_test_film ("threed_test1");
        film->set_name ("test_film1");
-       shared_ptr<FFmpegContent> c (new FFmpegContent (film, "test/data/test.mp4"));
+       shared_ptr<FFmpegContent> c (new FFmpegContent("test/data/test.mp4"));
        film->examine_and_add_content (c);
        wait_for_jobs ();
 
        film->examine_and_add_content (c);
        wait_for_jobs ();
 
@@ -63,7 +63,7 @@ BOOST_AUTO_TEST_CASE (threed_test2)
 {
        shared_ptr<Film> film = new_test_film ("threed_test2");
        film->set_name ("test_film2");
 {
        shared_ptr<Film> film = new_test_film ("threed_test2");
        film->set_name ("test_film2");
-       shared_ptr<FFmpegContent> c (new FFmpegContent (film, "test/data/test.mp4"));
+       shared_ptr<FFmpegContent> c (new FFmpegContent("test/data/test.mp4"));
        film->examine_and_add_content (c);
        wait_for_jobs ();
 
        film->examine_and_add_content (c);
        wait_for_jobs ();
 
@@ -85,9 +85,9 @@ BOOST_AUTO_TEST_CASE (threed_test2)
 BOOST_AUTO_TEST_CASE (threed_test3)
 {
        shared_ptr<Film> film = new_test_film2 ("threed_test3");
 BOOST_AUTO_TEST_CASE (threed_test3)
 {
        shared_ptr<Film> film = new_test_film2 ("threed_test3");
-       shared_ptr<FFmpegContent> L (new FFmpegContent (film, "test/data/test.mp4"));
+       shared_ptr<FFmpegContent> L (new FFmpegContent("test/data/test.mp4"));
        film->examine_and_add_content (L);
        film->examine_and_add_content (L);
-       shared_ptr<FFmpegContent> R (new FFmpegContent (film, "test/data/test.mp4"));
+       shared_ptr<FFmpegContent> R (new FFmpegContent("test/data/test.mp4"));
        film->examine_and_add_content (R);
        wait_for_jobs ();
 
        film->examine_and_add_content (R);
        wait_for_jobs ();
 
@@ -104,9 +104,9 @@ BOOST_AUTO_TEST_CASE (threed_test3)
 BOOST_AUTO_TEST_CASE (threed_test4)
 {
        shared_ptr<Film> film = new_test_film2 ("threed_test4");
 BOOST_AUTO_TEST_CASE (threed_test4)
 {
        shared_ptr<Film> film = new_test_film2 ("threed_test4");
-       shared_ptr<FFmpegContent> L (new FFmpegContent (film, private_data / "LEFT_TEST_DCP3D4K.mov"));
+       shared_ptr<FFmpegContent> L (new FFmpegContent(private_data / "LEFT_TEST_DCP3D4K.mov"));
        film->examine_and_add_content (L);
        film->examine_and_add_content (L);
-       shared_ptr<FFmpegContent> R (new FFmpegContent (film, private_data / "RIGHT_TEST_DCP3D4K.mov"));
+       shared_ptr<FFmpegContent> R (new FFmpegContent(private_data / "RIGHT_TEST_DCP3D4K.mov"));
        film->examine_and_add_content (R);
        wait_for_jobs ();
 
        film->examine_and_add_content (R);
        wait_for_jobs ();
 
@@ -123,9 +123,9 @@ BOOST_AUTO_TEST_CASE (threed_test4)
 BOOST_AUTO_TEST_CASE (threed_test5)
 {
        shared_ptr<Film> film = new_test_film2 ("threed_test5");
 BOOST_AUTO_TEST_CASE (threed_test5)
 {
        shared_ptr<Film> film = new_test_film2 ("threed_test5");
-       shared_ptr<FFmpegContent> L (new FFmpegContent (film, private_data / "boon_telly.mkv"));
+       shared_ptr<FFmpegContent> L (new FFmpegContent(private_data / "boon_telly.mkv"));
        film->examine_and_add_content (L);
        film->examine_and_add_content (L);
-       shared_ptr<FFmpegContent> R (new FFmpegContent (film, private_data / "boon_telly.mkv"));
+       shared_ptr<FFmpegContent> R (new FFmpegContent(private_data / "boon_telly.mkv"));
        film->examine_and_add_content (R);
        wait_for_jobs ();
 
        film->examine_and_add_content (R);
        wait_for_jobs ();
 
index 86b702f376ed41d02692377448a7a0b1472b4d78..e995a4ed00693a8f7d0e32dec33cfb170553d165 100644 (file)
@@ -132,23 +132,23 @@ BOOST_AUTO_TEST_CASE (ffmpeg_time_calculation_test)
        doc->read_string (xml);
 
        list<string> notes;
        doc->read_string (xml);
 
        list<string> notes;
-       shared_ptr<FFmpegContent> content (new FFmpegContent (film, doc, film->state_version(), notes));
+       shared_ptr<FFmpegContent> content (new FFmpegContent(doc, film->state_version(), notes));
 
        /* 25fps content, 25fps DCP */
        film->set_video_frame_rate (25);
 
        /* 25fps content, 25fps DCP */
        film->set_video_frame_rate (25);
-       BOOST_CHECK_EQUAL (content->full_length().get(), DCPTime::from_seconds(content->video->length() / 25.0).get());
+       BOOST_CHECK_EQUAL (content->full_length(film).get(), DCPTime::from_seconds(content->video->length() / 25.0).get());
        /* 25fps content, 24fps DCP; length should be increased */
        film->set_video_frame_rate (24);
        /* 25fps content, 24fps DCP; length should be increased */
        film->set_video_frame_rate (24);
-       BOOST_CHECK_EQUAL (content->full_length().get(), DCPTime::from_seconds(content->video->length() / 24.0).get());
+       BOOST_CHECK_EQUAL (content->full_length(film).get(), DCPTime::from_seconds(content->video->length() / 24.0).get());
        /* 25fps content, 30fps DCP; length should be decreased */
        film->set_video_frame_rate (30);
        /* 25fps content, 30fps DCP; length should be decreased */
        film->set_video_frame_rate (30);
-       BOOST_CHECK_EQUAL (content->full_length().get(), DCPTime::from_seconds(content->video->length() / 30.0).get());
+       BOOST_CHECK_EQUAL (content->full_length(film).get(), DCPTime::from_seconds(content->video->length() / 30.0).get());
        /* 25fps content, 50fps DCP; length should be the same */
        film->set_video_frame_rate (50);
        /* 25fps content, 50fps DCP; length should be the same */
        film->set_video_frame_rate (50);
-       BOOST_CHECK_EQUAL (content->full_length().get(), DCPTime::from_seconds(content->video->length() / 25.0).get());
+       BOOST_CHECK_EQUAL (content->full_length(film).get(), DCPTime::from_seconds(content->video->length() / 25.0).get());
        /* 25fps content, 60fps DCP; length should be decreased */
        film->set_video_frame_rate (60);
        /* 25fps content, 60fps DCP; length should be decreased */
        film->set_video_frame_rate (60);
-       BOOST_CHECK_EQUAL (content->full_length().get(), DCPTime::from_seconds(content->video->length() * (50.0 / 60) / 25.0).get());
+       BOOST_CHECK_EQUAL (content->full_length(film).get(), DCPTime::from_seconds(content->video->length() * (50.0 / 60) / 25.0).get());
 
        /* Make the content audio-only */
        content->video.reset ();
 
        /* Make the content audio-only */
        content->video.reset ();
@@ -156,23 +156,23 @@ BOOST_AUTO_TEST_CASE (ffmpeg_time_calculation_test)
        /* 24fps content, 24fps DCP */
        film->set_video_frame_rate (24);
        content->set_video_frame_rate (24);
        /* 24fps content, 24fps DCP */
        film->set_video_frame_rate (24);
        content->set_video_frame_rate (24);
-       BOOST_CHECK_EQUAL (content->full_length().get(), DCPTime::from_seconds(1).get());
+       BOOST_CHECK_EQUAL (content->full_length(film).get(), DCPTime::from_seconds(1).get());
        /* 25fps content, 25fps DCP */
        film->set_video_frame_rate (25);
        content->set_video_frame_rate (25);
        /* 25fps content, 25fps DCP */
        film->set_video_frame_rate (25);
        content->set_video_frame_rate (25);
-       BOOST_CHECK_EQUAL (content->full_length().get(), DCPTime::from_seconds(1).get());
+       BOOST_CHECK_EQUAL (content->full_length(film).get(), DCPTime::from_seconds(1).get());
        /* 25fps content, 24fps DCP; length should be increased */
        film->set_video_frame_rate (24);
        /* 25fps content, 24fps DCP; length should be increased */
        film->set_video_frame_rate (24);
-       BOOST_CHECK_SMALL (labs (content->full_length().get() - DCPTime::from_seconds(25.0 / 24).get()), 2L);
+       BOOST_CHECK_SMALL (labs (content->full_length(film).get() - DCPTime::from_seconds(25.0 / 24).get()), 2L);
        /* 25fps content, 30fps DCP; length should be decreased */
        film->set_video_frame_rate (30);
        /* 25fps content, 30fps DCP; length should be decreased */
        film->set_video_frame_rate (30);
-       BOOST_CHECK_EQUAL (content->full_length().get(), DCPTime::from_seconds(25.0 / 30).get());
+       BOOST_CHECK_EQUAL (content->full_length(film).get(), DCPTime::from_seconds(25.0 / 30).get());
        /* 25fps content, 50fps DCP; length should be the same */
        film->set_video_frame_rate (50);
        /* 25fps content, 50fps DCP; length should be the same */
        film->set_video_frame_rate (50);
-       BOOST_CHECK_EQUAL (content->full_length().get(), DCPTime::from_seconds(1).get());
+       BOOST_CHECK_EQUAL (content->full_length(film).get(), DCPTime::from_seconds(1).get());
        /* 25fps content, 60fps DCP; length should be decreased */
        film->set_video_frame_rate (60);
        /* 25fps content, 60fps DCP; length should be decreased */
        film->set_video_frame_rate (60);
-       BOOST_CHECK_EQUAL (content->full_length().get(), DCPTime::from_seconds(50.0 / 60).get());
+       BOOST_CHECK_EQUAL (content->full_length(film).get(), DCPTime::from_seconds(50.0 / 60).get());
 
 }
 
 
 }
 
@@ -185,14 +185,14 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1)
        doc->read_string (xml);
 
        list<string> notes;
        doc->read_string (xml);
 
        list<string> notes;
-       shared_ptr<FFmpegContent> content (new FFmpegContent (film, doc, film->state_version(), notes));
+       shared_ptr<FFmpegContent> content (new FFmpegContent(doc, film->state_version(), notes));
        film->set_sequence (false);
        film->add_content (content);
 
        shared_ptr<Player> player (new Player (film, film->playlist ()));
 
        /* Position 0, no trim, content rate = DCP rate */
        film->set_sequence (false);
        film->add_content (content);
 
        shared_ptr<Player> player (new Player (film, film->playlist ()));
 
        /* Position 0, no trim, content rate = DCP rate */
-       content->set_position (DCPTime ());
+       content->set_position (film, DCPTime());
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
@@ -204,7 +204,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1)
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime::from_seconds (3.0)), 72);
 
        /* Position 3s, no trim, content rate = DCP rate */
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime::from_seconds (3.0)), 72);
 
        /* Position 3s, no trim, content rate = DCP rate */
-       content->set_position (DCPTime::from_seconds (3));
+       content->set_position (film, DCPTime::from_seconds(3));
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
@@ -218,7 +218,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1)
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime::from_seconds (9.75)), 162);
 
        /* Position 3s, 1.5s trim, content rate = DCP rate */
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime::from_seconds (9.75)), 162);
 
        /* Position 3s, 1.5s trim, content rate = DCP rate */
-       content->set_position (DCPTime::from_seconds (3));
+       content->set_position (film, DCPTime::from_seconds(3));
        content->set_trim_start (ContentTime::from_seconds (1.5));
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
        content->set_trim_start (ContentTime::from_seconds (1.5));
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
@@ -235,7 +235,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1)
           Now, for example, a DCPTime position of 3s means 3s at 25fps.  Since we run the video
           fast (at 25fps) in this case, this means 75 frames of content video will be used.
        */
           Now, for example, a DCPTime position of 3s means 3s at 25fps.  Since we run the video
           fast (at 25fps) in this case, this means 75 frames of content video will be used.
        */
-       content->set_position (DCPTime ());
+       content->set_position (film, DCPTime());
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (25);
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (25);
@@ -247,7 +247,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1)
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime::from_seconds (3.0)), 75);
 
        /* Position 3s, no trim, content rate 24, DCP rate 25 */
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime::from_seconds (3.0)), 75);
 
        /* Position 3s, no trim, content rate 24, DCP rate 25 */
-       content->set_position (DCPTime::from_seconds (3));
+       content->set_position (film, DCPTime::from_seconds(3));
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (25);
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (25);
@@ -264,7 +264,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1)
           so it's 1.6s at 24fps.  Note that trims are rounded to the nearest video frame, so
           some of these results are not quite what you'd perhaps expect.
         */
           so it's 1.6s at 24fps.  Note that trims are rounded to the nearest video frame, so
           some of these results are not quite what you'd perhaps expect.
         */
-       content->set_position (DCPTime::from_seconds (3));
+       content->set_position (film, DCPTime::from_seconds(3));
        content->set_trim_start (ContentTime::from_seconds (1.6));
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (25);
        content->set_trim_start (ContentTime::from_seconds (1.6));
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (25);
@@ -283,7 +283,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1)
           be used to make 3 * 48 frames of DCP video.  The results should be the same as the
           content rate = DCP rate case.
        */
           be used to make 3 * 48 frames of DCP video.  The results should be the same as the
           content rate = DCP rate case.
        */
-       content->set_position (DCPTime ());
+       content->set_position (film, DCPTime());
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (48);
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (48);
@@ -295,7 +295,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1)
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime::from_seconds (3.0)), 72);
 
        /* Position 3s, no trim, content rate 24, DCP rate 48 */
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime::from_seconds (3.0)), 72);
 
        /* Position 3s, no trim, content rate 24, DCP rate 48 */
-       content->set_position (DCPTime::from_seconds (3));
+       content->set_position (film, DCPTime::from_seconds(3));
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (48);
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (48);
@@ -309,7 +309,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1)
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime::from_seconds (9.75)), 162);
 
        /* Position 3s, 1.5s trim, content rate 24, DCP rate 48 */
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime::from_seconds (9.75)), 162);
 
        /* Position 3s, 1.5s trim, content rate 24, DCP rate 48 */
-       content->set_position (DCPTime::from_seconds (3));
+       content->set_position (film, DCPTime::from_seconds(3));
        content->set_trim_start (ContentTime::from_seconds (1.5));
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (48);
        content->set_trim_start (ContentTime::from_seconds (1.5));
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (48);
@@ -327,7 +327,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1)
           with skipped frames in this case, 3 * 48 frames of content video will
           be used to make 3 * 24 frames of DCP video.
        */
           with skipped frames in this case, 3 * 48 frames of content video will
           be used to make 3 * 24 frames of DCP video.
        */
-       content->set_position (DCPTime ());
+       content->set_position (film, DCPTime());
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (48);
        film->set_video_frame_rate (24);
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (48);
        film->set_video_frame_rate (24);
@@ -339,7 +339,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1)
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime::from_seconds (3.0)), 144);
 
        /* Position 3s, no trim, content rate 24, DCP rate 48 */
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime::from_seconds (3.0)), 144);
 
        /* Position 3s, no trim, content rate 24, DCP rate 48 */
-       content->set_position (DCPTime::from_seconds (3));
+       content->set_position (film, DCPTime::from_seconds(3));
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (48);
        film->set_video_frame_rate (24);
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (48);
        film->set_video_frame_rate (24);
@@ -353,7 +353,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1)
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime::from_seconds (9.75)), 324);
 
        /* Position 3s, 1.5s trim, content rate 24, DCP rate 48 */
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime::from_seconds (9.75)), 324);
 
        /* Position 3s, 1.5s trim, content rate 24, DCP rate 48 */
-       content->set_position (DCPTime::from_seconds (3));
+       content->set_position (film, DCPTime::from_seconds(3));
        content->set_trim_start (ContentTime::from_seconds (1.5));
        content->set_video_frame_rate (48);
        film->set_video_frame_rate (24);
        content->set_trim_start (ContentTime::from_seconds (1.5));
        content->set_video_frame_rate (48);
        film->set_video_frame_rate (24);
@@ -367,7 +367,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1)
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime::from_seconds (9.75)), 396);
 
        /* Position 0s, no trim, content rate 29.9978733, DCP rate 30 */
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime::from_seconds (9.75)), 396);
 
        /* Position 0s, no trim, content rate 29.9978733, DCP rate 30 */
-       content->set_position (DCPTime::from_seconds (0));
+       content->set_position (film, DCPTime::from_seconds(0));
        content->set_trim_start (ContentTime::from_seconds (0));
        content->set_video_frame_rate (29.9978733);
        film->set_video_frame_rate (30);
        content->set_trim_start (ContentTime::from_seconds (0));
        content->set_video_frame_rate (29.9978733);
        film->set_video_frame_rate (30);
@@ -391,14 +391,14 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test2)
        doc->read_string (xml);
 
        list<string> notes;
        doc->read_string (xml);
 
        list<string> notes;
-       shared_ptr<FFmpegContent> content (new FFmpegContent (film, doc, film->state_version(), notes));
+       shared_ptr<FFmpegContent> content (new FFmpegContent(doc, film->state_version(), notes));
        film->set_sequence (false);
        film->add_content (content);
 
        shared_ptr<Player> player (new Player (film, film->playlist ()));
 
        /* Position 0, no trim, content rate = DCP rate */
        film->set_sequence (false);
        film->add_content (content);
 
        shared_ptr<Player> player (new Player (film, film->playlist ()));
 
        /* Position 0, no trim, content rate = DCP rate */
-       content->set_position (DCPTime ());
+       content->set_position (film, DCPTime());
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
@@ -410,7 +410,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test2)
        BOOST_CHECK_EQUAL (player->content_video_to_dcp (piece, 72).get(), DCPTime::from_seconds(3.0).get());
 
        /* Position 3s, no trim, content rate = DCP rate */
        BOOST_CHECK_EQUAL (player->content_video_to_dcp (piece, 72).get(), DCPTime::from_seconds(3.0).get());
 
        /* Position 3s, no trim, content rate = DCP rate */
-       content->set_position (DCPTime::from_seconds (3));
+       content->set_position (film, DCPTime::from_seconds(3));
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
@@ -422,7 +422,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test2)
        BOOST_CHECK_EQUAL (player->content_video_to_dcp(piece, 162).get(), DCPTime::from_seconds(9.75).get());
 
        /* Position 3s, 1.5s trim, content rate = DCP rate */
        BOOST_CHECK_EQUAL (player->content_video_to_dcp(piece, 162).get(), DCPTime::from_seconds(9.75).get());
 
        /* Position 3s, 1.5s trim, content rate = DCP rate */
-       content->set_position (DCPTime::from_seconds (3));
+       content->set_position (film, DCPTime::from_seconds(3));
        content->set_trim_start (ContentTime::from_seconds (1.5));
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
        content->set_trim_start (ContentTime::from_seconds (1.5));
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
@@ -438,7 +438,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test2)
           Now, for example, a DCPTime position of 3s means 3s at 25fps.  Since we run the video
           fast (at 25fps) in this case, this means 75 frames of content video will be used.
        */
           Now, for example, a DCPTime position of 3s means 3s at 25fps.  Since we run the video
           fast (at 25fps) in this case, this means 75 frames of content video will be used.
        */
-       content->set_position (DCPTime ());
+       content->set_position (film, DCPTime());
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (25);
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (25);
@@ -450,7 +450,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test2)
        BOOST_CHECK_EQUAL (player->content_video_to_dcp(piece, 75).get(), DCPTime::from_seconds(3.0).get());
 
        /* Position 3s, no trim, content rate 24, DCP rate 25 */
        BOOST_CHECK_EQUAL (player->content_video_to_dcp(piece, 75).get(), DCPTime::from_seconds(3.0).get());
 
        /* Position 3s, no trim, content rate 24, DCP rate 25 */
-       content->set_position (DCPTime::from_seconds (3));
+       content->set_position (film, DCPTime::from_seconds(3));
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (25);
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (25);
@@ -462,7 +462,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test2)
        BOOST_CHECK_EQUAL (player->content_video_to_dcp(piece, 169).get(), DCPTime::from_seconds(9.76).get());
 
        /* Position 3s, 1.6s trim, content rate 24, DCP rate 25, so the 1.6s trim is at 24fps */
        BOOST_CHECK_EQUAL (player->content_video_to_dcp(piece, 169).get(), DCPTime::from_seconds(9.76).get());
 
        /* Position 3s, 1.6s trim, content rate 24, DCP rate 25, so the 1.6s trim is at 24fps */
-       content->set_position (DCPTime::from_seconds (3));
+       content->set_position (film, DCPTime::from_seconds(3));
        content->set_trim_start (ContentTime::from_seconds (1.6));
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (25);
        content->set_trim_start (ContentTime::from_seconds (1.6));
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (25);
@@ -480,7 +480,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test2)
           be used to make 3 * 48 frames of DCP video.  The results should be the same as the
           content rate = DCP rate case.
        */
           be used to make 3 * 48 frames of DCP video.  The results should be the same as the
           content rate = DCP rate case.
        */
-       content->set_position (DCPTime ());
+       content->set_position (film, DCPTime());
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (48);
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (48);
@@ -492,7 +492,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test2)
        BOOST_CHECK_EQUAL (player->content_video_to_dcp(piece, 72).get(), DCPTime::from_seconds(3.0).get());
 
        /* Position 3s, no trim, content rate 24, DCP rate 48 */
        BOOST_CHECK_EQUAL (player->content_video_to_dcp(piece, 72).get(), DCPTime::from_seconds(3.0).get());
 
        /* Position 3s, no trim, content rate 24, DCP rate 48 */
-       content->set_position (DCPTime::from_seconds (3));
+       content->set_position (film, DCPTime::from_seconds(3));
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (48);
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (48);
@@ -504,7 +504,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test2)
        BOOST_CHECK_EQUAL (player->content_video_to_dcp(piece, 162).get(), DCPTime::from_seconds(9.75).get());
 
        /* Position 3s, 1.5s trim, content rate 24, DCP rate 48 */
        BOOST_CHECK_EQUAL (player->content_video_to_dcp(piece, 162).get(), DCPTime::from_seconds(9.75).get());
 
        /* Position 3s, 1.5s trim, content rate 24, DCP rate 48 */
-       content->set_position (DCPTime::from_seconds (3));
+       content->set_position (film, DCPTime::from_seconds(3));
        content->set_trim_start (ContentTime::from_seconds (1.5));
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (48);
        content->set_trim_start (ContentTime::from_seconds (1.5));
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (48);
@@ -521,7 +521,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test2)
           with skipped frames in this case, 3 * 48 frames of content video will
           be used to make 3 * 24 frames of DCP video.
        */
           with skipped frames in this case, 3 * 48 frames of content video will
           be used to make 3 * 24 frames of DCP video.
        */
-       content->set_position (DCPTime ());
+       content->set_position (film, DCPTime());
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (48);
        film->set_video_frame_rate (24);
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (48);
        film->set_video_frame_rate (24);
@@ -533,7 +533,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test2)
        BOOST_CHECK_EQUAL (player->content_video_to_dcp(piece, 144).get(), DCPTime::from_seconds(3.0).get());
 
        /* Position 3s, no trim, content rate 24, DCP rate 48 */
        BOOST_CHECK_EQUAL (player->content_video_to_dcp(piece, 144).get(), DCPTime::from_seconds(3.0).get());
 
        /* Position 3s, no trim, content rate 24, DCP rate 48 */
-       content->set_position (DCPTime::from_seconds (3));
+       content->set_position (film, DCPTime::from_seconds(3));
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (48);
        film->set_video_frame_rate (24);
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (48);
        film->set_video_frame_rate (24);
@@ -545,7 +545,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test2)
        BOOST_CHECK_EQUAL (player->content_video_to_dcp(piece, 324).get(), DCPTime::from_seconds(9.75).get());
 
        /* Position 3s, 1.5s trim, content rate 24, DCP rate 48 */
        BOOST_CHECK_EQUAL (player->content_video_to_dcp(piece, 324).get(), DCPTime::from_seconds(9.75).get());
 
        /* Position 3s, 1.5s trim, content rate 24, DCP rate 48 */
-       content->set_position (DCPTime::from_seconds (3));
+       content->set_position (film, DCPTime::from_seconds(3));
        content->set_trim_start (ContentTime::from_seconds (1.5));
        content->set_video_frame_rate (48);
        film->set_video_frame_rate (24);
        content->set_trim_start (ContentTime::from_seconds (1.5));
        content->set_video_frame_rate (48);
        film->set_video_frame_rate (24);
@@ -567,7 +567,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3)
        doc->read_string (xml);
 
        list<string> notes;
        doc->read_string (xml);
 
        list<string> notes;
-       shared_ptr<FFmpegContent> content (new FFmpegContent (film, doc, film->state_version(), notes));
+       shared_ptr<FFmpegContent> content (new FFmpegContent(doc, film->state_version(), notes));
        AudioStreamPtr stream = content->audio->streams().front();
        film->set_sequence (false);
        film->add_content (content);
        AudioStreamPtr stream = content->audio->streams().front();
        film->set_sequence (false);
        film->add_content (content);
@@ -575,7 +575,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3)
        shared_ptr<Player> player (new Player (film, film->playlist ()));
 
        /* Position 0, no trim, video/audio content rate = video/audio DCP rate */
        shared_ptr<Player> player (new Player (film, film->playlist ()));
 
        /* Position 0, no trim, video/audio content rate = video/audio DCP rate */
-       content->set_position (DCPTime ());
+       content->set_position (film, DCPTime());
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
@@ -588,7 +588,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3)
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (3.0)), 144000);
 
        /* Position 3s, no trim, video/audio content rate = video/audio DCP rate */
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (3.0)), 144000);
 
        /* Position 3s, no trim, video/audio content rate = video/audio DCP rate */
-       content->set_position (DCPTime::from_seconds (3));
+       content->set_position (film, DCPTime::from_seconds (3));
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
@@ -603,7 +603,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3)
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (9.75)), 324000);
 
        /* Position 3s, 1.5s trim, video/audio content rate = video/audio DCP rate */
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (9.75)), 324000);
 
        /* Position 3s, 1.5s trim, video/audio content rate = video/audio DCP rate */
-       content->set_position (DCPTime::from_seconds (3));
+       content->set_position (film, DCPTime::from_seconds (3));
        content->set_trim_start (ContentTime::from_seconds (1.5));
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
        content->set_trim_start (ContentTime::from_seconds (1.5));
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
@@ -618,7 +618,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3)
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (9.75)), 396000);
 
        /* Position 0, no trim, content video rate 24, DCP video rate 25, both audio rates still 48k */
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (9.75)), 396000);
 
        /* Position 0, no trim, content video rate 24, DCP video rate 25, both audio rates still 48k */
-       content->set_position (DCPTime ());
+       content->set_position (film, DCPTime());
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (25);
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (25);
@@ -631,7 +631,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3)
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (3.0)), 144000);
 
        /* Position 3s, no trim, content video rate 24, DCP rate 25, both audio rates still 48k. */
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (3.0)), 144000);
 
        /* Position 3s, no trim, content video rate 24, DCP rate 25, both audio rates still 48k. */
-       content->set_position (DCPTime::from_seconds (3));
+       content->set_position (film, DCPTime::from_seconds(3));
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (25);
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (25);
@@ -648,7 +648,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3)
        /* Position 3s, 1.6s trim, content rate 24, DCP rate 25, both audio rates still 48k.
           1s of content is 46080 samples after resampling.
        */
        /* Position 3s, 1.6s trim, content rate 24, DCP rate 25, both audio rates still 48k.
           1s of content is 46080 samples after resampling.
        */
-       content->set_position (DCPTime::from_seconds (3));
+       content->set_position (film, DCPTime::from_seconds(3));
        content->set_trim_start (ContentTime::from_seconds (1.6));
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (25);
        content->set_trim_start (ContentTime::from_seconds (1.6));
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (25);
@@ -667,7 +667,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3)
           with repeated frames in this case, audio samples will map straight through.
           The results should be the same as the content rate = DCP rate case.
        */
           with repeated frames in this case, audio samples will map straight through.
           The results should be the same as the content rate = DCP rate case.
        */
-       content->set_position (DCPTime ());
+       content->set_position (film, DCPTime());
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (48);
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (48);
@@ -680,7 +680,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3)
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (3.0)), 144000);
 
        /* Position 3s, no trim, content rate 24, DCP rate 48 */
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (3.0)), 144000);
 
        /* Position 3s, no trim, content rate 24, DCP rate 48 */
-       content->set_position (DCPTime::from_seconds (3));
+       content->set_position (film, DCPTime::from_seconds(3));
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
@@ -695,7 +695,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3)
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (9.75)), 324000);
 
        /* Position 3s, 1.5s trim, content rate 24, DCP rate 48 */
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (9.75)), 324000);
 
        /* Position 3s, 1.5s trim, content rate 24, DCP rate 48 */
-       content->set_position (DCPTime::from_seconds (3));
+       content->set_position (film, DCPTime::from_seconds(3));
        content->set_trim_start (ContentTime::from_seconds (1.5));
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
        content->set_trim_start (ContentTime::from_seconds (1.5));
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
@@ -713,7 +713,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3)
           Now, for example, a DCPTime position of 3s means 3s at 24fps.  Since we run the video
           with skipped frames in this case, audio samples should map straight through.
        */
           Now, for example, a DCPTime position of 3s means 3s at 24fps.  Since we run the video
           with skipped frames in this case, audio samples should map straight through.
        */
-       content->set_position (DCPTime ());
+       content->set_position (film, DCPTime());
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (48);
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (48);
@@ -726,7 +726,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3)
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (3.0)), 144000);
 
        /* Position 3s, no trim, content rate 24, DCP rate 48 */
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (3.0)), 144000);
 
        /* Position 3s, no trim, content rate 24, DCP rate 48 */
-       content->set_position (DCPTime::from_seconds (3));
+       content->set_position (film, DCPTime::from_seconds(3));
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
@@ -741,7 +741,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3)
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (9.75)), 324000);
 
        /* Position 3s, 1.5s trim, content rate 24, DCP rate 48 */
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (9.75)), 324000);
 
        /* Position 3s, 1.5s trim, content rate 24, DCP rate 48 */
-       content->set_position (DCPTime::from_seconds (3));
+       content->set_position (film, DCPTime::from_seconds(3));
        content->set_trim_start (ContentTime::from_seconds (1.5));
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
        content->set_trim_start (ContentTime::from_seconds (1.5));
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
@@ -756,7 +756,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3)
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (9.75)), 396000);
 
        /* Position 0, no trim, video content rate = video DCP rate, content audio rate = 44.1k */
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (9.75)), 396000);
 
        /* Position 0, no trim, video content rate = video DCP rate, content audio rate = 44.1k */
-       content->set_position (DCPTime ());
+       content->set_position (film, DCPTime());
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
@@ -769,7 +769,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3)
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (3.0)), 144000);
 
        /* Position 3s, no trim, video content rate = video DCP rate, content audio rate = 44.1k */
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (3.0)), 144000);
 
        /* Position 3s, no trim, video content rate = video DCP rate, content audio rate = 44.1k */
-       content->set_position (DCPTime::from_seconds (3));
+       content->set_position (film, DCPTime::from_seconds(3));
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
@@ -784,7 +784,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3)
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (9.75)), 324000);
 
        /* Position 3s, 1.5s trim, video content rate = video DCP rate, content audio rate = 44.1k */
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (9.75)), 324000);
 
        /* Position 3s, 1.5s trim, video content rate = video DCP rate, content audio rate = 44.1k */
-       content->set_position (DCPTime::from_seconds (3));
+       content->set_position (film, DCPTime::from_seconds(3));
        content->set_trim_start (ContentTime::from_seconds (1.5));
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
        content->set_trim_start (ContentTime::from_seconds (1.5));
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
@@ -799,7 +799,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3)
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (9.75)), 396000);
 
        /* Check with a large start trim */
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (9.75)), 396000);
 
        /* Check with a large start trim */
-       content->set_position (DCPTime::from_seconds (0));
+       content->set_position (film, DCPTime::from_seconds(0));
        content->set_trim_start (ContentTime::from_seconds (54143));
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
        content->set_trim_start (ContentTime::from_seconds (54143));
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
index 3736b3e65c2bff132c6b4c8996fe8fb0587a0a26..b6079096da6ca3494fe7d0b4136cad43a17094cc 100644 (file)
@@ -56,28 +56,28 @@ BOOST_AUTO_TEST_CASE (torture_test1)
        film->set_sequence (false);
 
        /* Staircase at an offset of 2000 samples, trimmed both start and end, with a gain of 6dB */
        film->set_sequence (false);
 
        /* Staircase at an offset of 2000 samples, trimmed both start and end, with a gain of 6dB */
-       shared_ptr<Content> staircase = content_factory(film, "test/data/staircase.wav").front ();
+       shared_ptr<Content> staircase = content_factory("test/data/staircase.wav").front ();
        film->examine_and_add_content (staircase);
        wait_for_jobs ();
        film->examine_and_add_content (staircase);
        wait_for_jobs ();
-       staircase->set_position (DCPTime::from_frames (2000, film->audio_frame_rate()));
+       staircase->set_position (film, DCPTime::from_frames (2000, film->audio_frame_rate()));
        staircase->set_trim_start (ContentTime::from_frames (12, 48000));
        staircase->set_trim_end (ContentTime::from_frames (35, 48000));
        staircase->audio->set_gain (20 * log10(2));
 
        /* And again at an offset of 50000 samples, trimmed both start and end, with a gain of 6dB */
        staircase->set_trim_start (ContentTime::from_frames (12, 48000));
        staircase->set_trim_end (ContentTime::from_frames (35, 48000));
        staircase->audio->set_gain (20 * log10(2));
 
        /* And again at an offset of 50000 samples, trimmed both start and end, with a gain of 6dB */
-       staircase = content_factory(film, "test/data/staircase.wav").front ();
+       staircase = content_factory("test/data/staircase.wav").front ();
        film->examine_and_add_content (staircase);
        wait_for_jobs ();
        film->examine_and_add_content (staircase);
        wait_for_jobs ();
-       staircase->set_position (DCPTime::from_frames (50000, film->audio_frame_rate()));
+       staircase->set_position (film, DCPTime::from_frames(50000, film->audio_frame_rate()));
        staircase->set_trim_start (ContentTime::from_frames (12, 48000));
        staircase->set_trim_end (ContentTime::from_frames (35, 48000));
        staircase->audio->set_gain (20 * log10(2));
 
        /* 1s of red at 5s in */
        staircase->set_trim_start (ContentTime::from_frames (12, 48000));
        staircase->set_trim_end (ContentTime::from_frames (35, 48000));
        staircase->audio->set_gain (20 * log10(2));
 
        /* 1s of red at 5s in */
-       shared_ptr<Content> red = content_factory(film, "test/data/flat_red.png").front ();
+       shared_ptr<Content> red = content_factory("test/data/flat_red.png").front ();
        film->examine_and_add_content (red);
        wait_for_jobs ();
        film->examine_and_add_content (red);
        wait_for_jobs ();
-       red->set_position (DCPTime::from_seconds (5));
+       red->set_position (film, DCPTime::from_seconds(5));
        red->video->set_length (24);
 
        film->set_video_frame_rate (24);
        red->video->set_length (24);
 
        film->set_video_frame_rate (24);
index 651ac7f38da9e2d5dc7ae959a3880643cc18c014..c89d3f29a90c56c6744e0cf4bb59dc0f95e3ada0 100644 (file)
@@ -62,7 +62,7 @@ BOOST_AUTO_TEST_CASE (upmixer_a_test)
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR"));
        film->set_name ("frobozz");
        film->set_audio_processor (AudioProcessor::from_id ("stereo-5.1-upmix-a"));
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR"));
        film->set_name ("frobozz");
        film->set_audio_processor (AudioProcessor::from_id ("stereo-5.1-upmix-a"));
-       shared_ptr<FFmpegContent> content (new FFmpegContent (film, "test/data/white.wav"));
+       shared_ptr<FFmpegContent> content (new FFmpegContent ("test/data/white.wav"));
        film->examine_and_add_content (content);
 
        wait_for_jobs ();
        film->examine_and_add_content (content);
 
        wait_for_jobs ();
index bbaa3d6d2c2163325b5387e812bd08a6e5db354c..9b48f9b28633a6876b5f32e213047956868d9136 100644 (file)
@@ -50,7 +50,7 @@ BOOST_AUTO_TEST_CASE (vf_kdm_test)
        A->set_name ("frobozz");
        A->set_interop (true);
 
        A->set_name ("frobozz");
        A->set_interop (true);
 
-       shared_ptr<FFmpegContent> c (new FFmpegContent (A, "test/data/test.mp4"));
+       shared_ptr<FFmpegContent> c (new FFmpegContent("test/data/test.mp4"));
        A->examine_and_add_content (c);
        A->set_encrypted (true);
        wait_for_jobs ();
        A->examine_and_add_content (c);
        A->set_encrypted (true);
        wait_for_jobs ();
@@ -80,7 +80,7 @@ BOOST_AUTO_TEST_CASE (vf_kdm_test)
        B->set_name ("frobozz");
        B->set_interop (true);
 
        B->set_name ("frobozz");
        B->set_interop (true);
 
-       shared_ptr<DCPContent> d (new DCPContent (B, "build/test/vf_kdm_test_ov/" + A->dcp_name()));
+       shared_ptr<DCPContent> d (new DCPContent ("build/test/vf_kdm_test_ov/" + A->dcp_name()));
        d->add_kdm (A_kdm);
        d->set_reference_video (true);
        B->examine_and_add_content (d);
        d->add_kdm (A_kdm);
        d->set_reference_video (true);
        B->examine_and_add_content (d);
@@ -112,7 +112,7 @@ BOOST_AUTO_TEST_CASE (vf_kdm_test)
        C->set_name ("frobozz");
        C->set_interop (true);
 
        C->set_name ("frobozz");
        C->set_interop (true);
 
-       shared_ptr<DCPContent> e (new DCPContent (C, "build/test/vf_kdm_test_vf/" + B->dcp_name()));
+       shared_ptr<DCPContent> e (new DCPContent ("build/test/vf_kdm_test_vf/" + B->dcp_name()));
        e->add_kdm (B_kdm);
        e->add_ov ("build/test/vf_kdm_test_ov/" + A->dcp_name());
        C->examine_and_add_content (e);
        e->add_kdm (B_kdm);
        e->add_ov ("build/test/vf_kdm_test_ov/" + A->dcp_name());
        C->examine_and_add_content (e);
index fa1e7cdab71c8990c8280ee67d4481cdb630dced..285139f7e4a8f03632158d9caebb83e70a3c59b3 100644 (file)
@@ -48,44 +48,44 @@ BOOST_AUTO_TEST_CASE (vf_test1)
 {
        shared_ptr<Film> film = new_test_film ("vf_test1");
        film->set_interop (false);
 {
        shared_ptr<Film> film = new_test_film ("vf_test1");
        film->set_interop (false);
-       shared_ptr<DCPContent> dcp (new DCPContent (film, "test/data/reels_test2"));
+       shared_ptr<DCPContent> dcp (new DCPContent ("test/data/reels_test2"));
        film->examine_and_add_content (dcp);
        wait_for_jobs ();
 
        /* Multi-reel DCP can't be referenced if we are using a single reel for the project */
        film->set_reel_type (REELTYPE_SINGLE);
        string why_not;
        film->examine_and_add_content (dcp);
        wait_for_jobs ();
 
        /* Multi-reel DCP can't be referenced if we are using a single reel for the project */
        film->set_reel_type (REELTYPE_SINGLE);
        string why_not;
-       BOOST_CHECK (!dcp->can_reference_video(why_not));
-       BOOST_CHECK (!dcp->can_reference_audio(why_not));
-       BOOST_CHECK (!dcp->can_reference_text(TEXT_OPEN_SUBTITLE, why_not));
-       BOOST_CHECK (!dcp->can_reference_text(TEXT_CLOSED_CAPTION, why_not));
+       BOOST_CHECK (!dcp->can_reference_video(film, why_not));
+       BOOST_CHECK (!dcp->can_reference_audio(film, why_not));
+       BOOST_CHECK (!dcp->can_reference_text(film, TEXT_OPEN_SUBTITLE, why_not));
+       BOOST_CHECK (!dcp->can_reference_text(film, TEXT_CLOSED_CAPTION, why_not));
 
        /* Multi-reel DCP can be referenced if we are using by-video-content */
        film->set_reel_type (REELTYPE_BY_VIDEO_CONTENT);
 
        /* Multi-reel DCP can be referenced if we are using by-video-content */
        film->set_reel_type (REELTYPE_BY_VIDEO_CONTENT);
-       BOOST_CHECK (dcp->can_reference_video(why_not));
-       BOOST_CHECK (dcp->can_reference_audio(why_not));
+       BOOST_CHECK (dcp->can_reference_video(film, why_not));
+       BOOST_CHECK (dcp->can_reference_audio(film, why_not));
        /* (but reels_test2 has no texts to reference) */
        /* (but reels_test2 has no texts to reference) */
-       BOOST_CHECK (!dcp->can_reference_text(TEXT_OPEN_SUBTITLE, why_not));
-       BOOST_CHECK (!dcp->can_reference_text(TEXT_CLOSED_CAPTION, why_not));
+       BOOST_CHECK (!dcp->can_reference_text(film, TEXT_OPEN_SUBTITLE, why_not));
+       BOOST_CHECK (!dcp->can_reference_text(film, TEXT_CLOSED_CAPTION, why_not));
 
 
-       shared_ptr<FFmpegContent> other (new FFmpegContent (film, "test/data/test.mp4"));
+       shared_ptr<FFmpegContent> other (new FFmpegContent("test/data/test.mp4"));
        film->examine_and_add_content (other);
        wait_for_jobs ();
 
        /* Not possible if there is overlap */
        film->examine_and_add_content (other);
        wait_for_jobs ();
 
        /* Not possible if there is overlap */
-       other->set_position (DCPTime (0));
-       BOOST_CHECK (!dcp->can_reference_video(why_not));
-       BOOST_CHECK (!dcp->can_reference_audio(why_not));
-       BOOST_CHECK (!dcp->can_reference_text(TEXT_OPEN_SUBTITLE, why_not));
-       BOOST_CHECK (!dcp->can_reference_text(TEXT_CLOSED_CAPTION, why_not));
+       other->set_position (film, DCPTime());
+       BOOST_CHECK (!dcp->can_reference_video(film, why_not));
+       BOOST_CHECK (!dcp->can_reference_audio(film, why_not));
+       BOOST_CHECK (!dcp->can_reference_text(film, TEXT_OPEN_SUBTITLE, why_not));
+       BOOST_CHECK (!dcp->can_reference_text(film, TEXT_CLOSED_CAPTION, why_not));
 
        /* This should not be considered an overlap */
 
        /* This should not be considered an overlap */
-       other->set_position (dcp->end ());
-       BOOST_CHECK (dcp->can_reference_video(why_not));
-       BOOST_CHECK (dcp->can_reference_audio(why_not));
+       other->set_position (film, dcp->end(film));
+       BOOST_CHECK (dcp->can_reference_video(film, why_not));
+       BOOST_CHECK (dcp->can_reference_audio(film, why_not));
        /* (reels_test2 has no texts to reference) */
        /* (reels_test2 has no texts to reference) */
-       BOOST_CHECK (!dcp->can_reference_text(TEXT_OPEN_SUBTITLE, why_not));
-       BOOST_CHECK (!dcp->can_reference_text(TEXT_CLOSED_CAPTION, why_not));
+       BOOST_CHECK (!dcp->can_reference_text(film, TEXT_OPEN_SUBTITLE, why_not));
+       BOOST_CHECK (!dcp->can_reference_text(film, TEXT_CLOSED_CAPTION, why_not));
 }
 
 /** Make a OV with video and audio and a VF referencing the OV and adding subs */
 }
 
 /** Make a OV with video and audio and a VF referencing the OV and adding subs */
@@ -95,11 +95,11 @@ BOOST_AUTO_TEST_CASE (vf_test2)
        shared_ptr<Film> ov = new_test_film ("vf_test2_ov");
        ov->set_dcp_content_type (DCPContentType::from_isdcf_name ("TST"));
        ov->set_name ("vf_test2_ov");
        shared_ptr<Film> ov = new_test_film ("vf_test2_ov");
        ov->set_dcp_content_type (DCPContentType::from_isdcf_name ("TST"));
        ov->set_name ("vf_test2_ov");
-       shared_ptr<Content> video = content_factory (ov, "test/data/flat_red.png").front();
+       shared_ptr<Content> video = content_factory ("test/data/flat_red.png").front();
        ov->examine_and_add_content (video);
        wait_for_jobs ();
        video->video->set_length (24 * 5);
        ov->examine_and_add_content (video);
        wait_for_jobs ();
        video->video->set_length (24 * 5);
-       shared_ptr<Content> audio = content_factory(ov, "test/data/white.wav").front();
+       shared_ptr<Content> audio = content_factory ("test/data/white.wav").front();
        ov->examine_and_add_content (audio);
        wait_for_jobs ();
        ov->make_dcp ();
        ov->examine_and_add_content (audio);
        wait_for_jobs ();
        ov->make_dcp ();
@@ -110,13 +110,13 @@ BOOST_AUTO_TEST_CASE (vf_test2)
        vf->set_name ("vf_test2_vf");
        vf->set_dcp_content_type (DCPContentType::from_isdcf_name ("TST"));
        vf->set_reel_type (REELTYPE_BY_VIDEO_CONTENT);
        vf->set_name ("vf_test2_vf");
        vf->set_dcp_content_type (DCPContentType::from_isdcf_name ("TST"));
        vf->set_reel_type (REELTYPE_BY_VIDEO_CONTENT);
-       shared_ptr<DCPContent> dcp (new DCPContent (vf, ov->dir (ov->dcp_name ())));
+       shared_ptr<DCPContent> dcp (new DCPContent(ov->dir (ov->dcp_name ())));
        BOOST_REQUIRE (dcp);
        vf->examine_and_add_content (dcp);
        wait_for_jobs ();
        dcp->set_reference_video (true);
        dcp->set_reference_audio (true);
        BOOST_REQUIRE (dcp);
        vf->examine_and_add_content (dcp);
        wait_for_jobs ();
        dcp->set_reference_video (true);
        dcp->set_reference_audio (true);
-       shared_ptr<Content> sub = content_factory(vf, "test/data/subrip4.srt").front();
+       shared_ptr<Content> sub = content_factory("test/data/subrip4.srt").front();
        vf->examine_and_add_content (sub);
        DCPOMATIC_ASSERT (!wait_for_jobs ());
        vf->make_dcp ();
        vf->examine_and_add_content (sub);
        DCPOMATIC_ASSERT (!wait_for_jobs ());
        vf->make_dcp ();
@@ -153,11 +153,11 @@ BOOST_AUTO_TEST_CASE (vf_test3)
        shared_ptr<Film> ov = new_test_film ("vf_test3_ov");
        ov->set_dcp_content_type (DCPContentType::from_isdcf_name ("TST"));
        ov->set_name ("vf_test3_ov");
        shared_ptr<Film> ov = new_test_film ("vf_test3_ov");
        ov->set_dcp_content_type (DCPContentType::from_isdcf_name ("TST"));
        ov->set_name ("vf_test3_ov");
-       shared_ptr<Content> video = content_factory(ov, "test/data/flat_red.png").front();
+       shared_ptr<Content> video = content_factory("test/data/flat_red.png").front();
        ov->examine_and_add_content (video);
        wait_for_jobs ();
        video->video->set_length (24 * 5);
        ov->examine_and_add_content (video);
        wait_for_jobs ();
        video->video->set_length (24 * 5);
-       shared_ptr<Content> audio = content_factory(ov, "test/data/white.wav").front();
+       shared_ptr<Content> audio = content_factory("test/data/white.wav").front();
        ov->examine_and_add_content (audio);
        wait_for_jobs ();
        ov->make_dcp ();
        ov->examine_and_add_content (audio);
        wait_for_jobs ();
        ov->make_dcp ();
@@ -168,7 +168,7 @@ BOOST_AUTO_TEST_CASE (vf_test3)
        vf->set_name ("vf_test3_vf");
        vf->set_dcp_content_type (DCPContentType::from_isdcf_name ("TST"));
        vf->set_reel_type (REELTYPE_BY_VIDEO_CONTENT);
        vf->set_name ("vf_test3_vf");
        vf->set_dcp_content_type (DCPContentType::from_isdcf_name ("TST"));
        vf->set_reel_type (REELTYPE_BY_VIDEO_CONTENT);
-       shared_ptr<DCPContent> dcp (new DCPContent (vf, ov->dir (ov->dcp_name ())));
+       shared_ptr<DCPContent> dcp (new DCPContent(ov->dir(ov->dcp_name())));
        BOOST_REQUIRE (dcp);
        dcp->set_trim_start (ContentTime::from_seconds (1));
        dcp->set_trim_end (ContentTime::from_seconds (1));
        BOOST_REQUIRE (dcp);
        dcp->set_trim_start (ContentTime::from_seconds (1));
        dcp->set_trim_end (ContentTime::from_seconds (1));
@@ -199,11 +199,11 @@ BOOST_AUTO_TEST_CASE (vf_test4)
        shared_ptr<Film> ov = new_test_film ("vf_test4_ov");
        ov->set_dcp_content_type (DCPContentType::from_isdcf_name ("TST"));
        ov->set_name ("vf_test4_ov");
        shared_ptr<Film> ov = new_test_film ("vf_test4_ov");
        ov->set_dcp_content_type (DCPContentType::from_isdcf_name ("TST"));
        ov->set_name ("vf_test4_ov");
-       shared_ptr<Content> video = content_factory (ov, "test/data/flat_red.png").front();
+       shared_ptr<Content> video = content_factory("test/data/flat_red.png").front();
        ov->examine_and_add_content (video);
        wait_for_jobs ();
        video->video->set_length (24 * 5);
        ov->examine_and_add_content (video);
        wait_for_jobs ();
        video->video->set_length (24 * 5);
-       shared_ptr<Content> audio = content_factory(ov, "test/data/white.wav").front();
+       shared_ptr<Content> audio = content_factory("test/data/white.wav").front();
        ov->examine_and_add_content (audio);
        wait_for_jobs ();
        ov->make_dcp ();
        ov->examine_and_add_content (audio);
        wait_for_jobs ();
        ov->make_dcp ();
@@ -215,17 +215,17 @@ BOOST_AUTO_TEST_CASE (vf_test4)
        vf->set_dcp_content_type (DCPContentType::from_isdcf_name ("TST"));
        vf->set_reel_type (REELTYPE_BY_VIDEO_CONTENT);
        vf->set_sequence (false);
        vf->set_dcp_content_type (DCPContentType::from_isdcf_name ("TST"));
        vf->set_reel_type (REELTYPE_BY_VIDEO_CONTENT);
        vf->set_sequence (false);
-       shared_ptr<DCPContent> dcp (new DCPContent (vf, ov->dir (ov->dcp_name ())));
+       shared_ptr<DCPContent> dcp (new DCPContent(ov->dir(ov->dcp_name())));
        BOOST_REQUIRE (dcp);
        vf->examine_and_add_content (dcp);
        wait_for_jobs ();
        BOOST_REQUIRE (dcp);
        vf->examine_and_add_content (dcp);
        wait_for_jobs ();
-       dcp->set_position(DCPTime::from_seconds(10));
+       dcp->set_position(vf, DCPTime::from_seconds(10));
        dcp->set_reference_video (true);
        dcp->set_reference_audio (true);
        dcp->set_reference_video (true);
        dcp->set_reference_audio (true);
-       shared_ptr<Content> more_video = content_factory(vf, "test/data/flat_red.png").front();
+       shared_ptr<Content> more_video = content_factory("test/data/flat_red.png").front();
        vf->examine_and_add_content (more_video);
        DCPOMATIC_ASSERT (!wait_for_jobs ());
        vf->examine_and_add_content (more_video);
        DCPOMATIC_ASSERT (!wait_for_jobs ());
-       more_video->set_position (DCPTime ());
+       more_video->set_position (vf, DCPTime());
        vf->write_metadata ();
        vf->make_dcp ();
        DCPOMATIC_ASSERT (!wait_for_jobs ());
        vf->write_metadata ();
        vf->make_dcp ();
        DCPOMATIC_ASSERT (!wait_for_jobs ());
index 35812df35cb5ba2a72aab167f7549076c6c1a33a..67bfda3e5afae3f6e2f6c81a091b949d53ac6f8e 100644 (file)
@@ -96,7 +96,7 @@ test (dcp::Size content_size, dcp::Size display_size, dcp::Size film_size, Crop
        doc->read_string (s);
 
        list<string> notes;
        doc->read_string (s);
 
        list<string> notes;
-       shared_ptr<FFmpegContent> vc (new FFmpegContent (film, doc, 10, notes));
+       shared_ptr<FFmpegContent> vc (new FFmpegContent (doc, 10, notes));
 
        optional<VideoContentScale> sc;
        if (ratio) {
 
        optional<VideoContentScale> sc;
        if (ratio) {
index 9104702b6dc5e0409769ea679edb0b865f65820d..5da7ad6418d91df2731d51911ff6493858db809f 100644 (file)
@@ -50,7 +50,7 @@ BOOST_AUTO_TEST_CASE (video_mxf_content_test)
        film->set_container (Ratio::from_id ("185"));
        film->set_name ("video_mxf_content_test");
 
        film->set_container (Ratio::from_id ("185"));
        film->set_name ("video_mxf_content_test");
 
-       shared_ptr<Content> content = content_factory(film, ref_mxf).front();
+       shared_ptr<Content> content = content_factory(ref_mxf).front();
        shared_ptr<VideoMXFContent> check = dynamic_pointer_cast<VideoMXFContent> (content);
        BOOST_REQUIRE (check);
        film->examine_and_add_content (content);
        shared_ptr<VideoMXFContent> check = dynamic_pointer_cast<VideoMXFContent> (content);
        BOOST_REQUIRE (check);
        film->examine_and_add_content (content);