diff options
| author | Carl Hetherington <cth@carlh.net> | 2014-07-09 10:17:49 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2014-07-09 10:17:49 +0100 |
| commit | 0dc52cd6e69890cd8a2c539e80389ea8bac5cc3c (patch) | |
| tree | 0dbf929df2936893ce4ba952fffc54e2c1303f37 /src/lib | |
| parent | 2cf3da72a017eebf741dfb9a5ec158df94a4e7b7 (diff) | |
Fix DCP name in editor; fix use of DCP entry points.
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/content.h | 3 | ||||
| -rw-r--r-- | src/lib/dcp_content.cc | 8 | ||||
| -rw-r--r-- | src/lib/dcp_content.h | 1 | ||||
| -rw-r--r-- | src/lib/dcp_decoder.cc | 7 | ||||
| -rw-r--r-- | src/lib/dcp_examiner.cc | 2 | ||||
| -rw-r--r-- | src/lib/dcp_examiner.h | 6 |
6 files changed, 22 insertions, 5 deletions
diff --git a/src/lib/content.h b/src/lib/content.h index 6bbf33b35..ab14dc6f5 100644 --- a/src/lib/content.h +++ b/src/lib/content.h @@ -65,6 +65,9 @@ public: virtual ~Content () {} virtual void examine (boost::shared_ptr<Job>); + /** @return Quick one-line summary of the content, as will be presented in the + * film editor. + */ virtual std::string summary () const = 0; /** @return Technical details of this content; these are written to logs to * help with debugging. diff --git a/src/lib/dcp_content.cc b/src/lib/dcp_content.cc index 663846e26..3d4a48b89 100644 --- a/src/lib/dcp_content.cc +++ b/src/lib/dcp_content.cc @@ -56,14 +56,18 @@ DCPContent::examine (shared_ptr<Job> job) { job->set_progress_unknown (); Content::examine (job); - shared_ptr<VideoExaminer> examiner (new DCPExaminer (shared_from_this ())); + shared_ptr<DCPExaminer> examiner (new DCPExaminer (shared_from_this ())); take_from_video_examiner (examiner); + + boost::mutex::scoped_lock lm (_mutex); + _name = examiner->name (); } string DCPContent::summary () const { - return String::compose (_("%1 [DCP]"), path_summary ()); + boost::mutex::scoped_lock lm (_mutex); + return String::compose (_("%1 [DCP]"), _name); } string diff --git a/src/lib/dcp_content.h b/src/lib/dcp_content.h index 7f3ac956d..22b5fa08d 100644 --- a/src/lib/dcp_content.h +++ b/src/lib/dcp_content.h @@ -46,4 +46,5 @@ private: void read_directory (boost::filesystem::path); boost::filesystem::path _directory; + std::string _name; }; diff --git a/src/lib/dcp_decoder.cc b/src/lib/dcp_decoder.cc index 14672a23b..1939fc1c9 100644 --- a/src/lib/dcp_decoder.cc +++ b/src/lib/dcp_decoder.cc @@ -62,20 +62,21 @@ DCPDecoder::pass () shared_ptr<dcp::PictureMXF> mxf = (*_reel)->main_picture()->mxf (); shared_ptr<dcp::MonoPictureMXF> mono = dynamic_pointer_cast<dcp::MonoPictureMXF> (mxf); shared_ptr<dcp::StereoPictureMXF> stereo = dynamic_pointer_cast<dcp::StereoPictureMXF> (mxf); + int64_t const ep = (*_reel)->main_picture()->entry_point (); if (mono) { shared_ptr<Image> image (new Image (PIX_FMT_RGB24, mxf->size(), false)); - mono->get_frame (_next.frames (vfr))->rgb_frame (image->data()[0]); + mono->get_frame (ep + _next.frames (vfr))->rgb_frame (image->data()[0]); shared_ptr<Image> aligned (new Image (image, true)); video (shared_ptr<ImageProxy> (new RawImageProxy (aligned, _log)), _next.frames (vfr)); } else { shared_ptr<Image> left (new Image (PIX_FMT_RGB24, mxf->size(), false)); - stereo->get_frame (_next.frames (vfr))->rgb_frame (dcp::EYE_LEFT, left->data()[0]); + stereo->get_frame (ep + _next.frames (vfr))->rgb_frame (dcp::EYE_LEFT, left->data()[0]); shared_ptr<Image> aligned_left (new Image (left, true)); video (shared_ptr<ImageProxy> (new RawImageProxy (aligned_left, _log)), _next.frames (vfr)); shared_ptr<Image> right (new Image (PIX_FMT_RGB24, mxf->size(), false)); - stereo->get_frame (_next.frames (vfr))->rgb_frame (dcp::EYE_RIGHT, right->data()[0]); + stereo->get_frame (ep + _next.frames (vfr))->rgb_frame (dcp::EYE_RIGHT, right->data()[0]); shared_ptr<Image> aligned_right (new Image (right, true)); video (shared_ptr<ImageProxy> (new RawImageProxy (aligned_right, _log)), _next.frames (vfr)); } diff --git a/src/lib/dcp_examiner.cc b/src/lib/dcp_examiner.cc index 7ce18c9f7..3051a4670 100644 --- a/src/lib/dcp_examiner.cc +++ b/src/lib/dcp_examiner.cc @@ -43,6 +43,8 @@ DCPExaminer::DCPExaminer (shared_ptr<const DCPContent> content) throw DCPError ("Multiple CPLs found in DCP"); } + _name = dcp.cpls().front()->content_title_text (); + list<shared_ptr<dcp::Reel> > reels = dcp.cpls().front()->reels (); for (list<shared_ptr<dcp::Reel> >::const_iterator i = reels.begin(); i != reels.end(); ++i) { diff --git a/src/lib/dcp_examiner.h b/src/lib/dcp_examiner.h index c8b0ef7da..a2793c788 100644 --- a/src/lib/dcp_examiner.h +++ b/src/lib/dcp_examiner.h @@ -38,10 +38,16 @@ public: return _video_length; } + std::string name () const { + return _name; + } + private: boost::optional<float> _video_frame_rate; boost::optional<dcp::Size> _video_size; ContentTime _video_length; + /* XXX: used? */ boost::optional<int> _audio_channels; boost::optional<int> _audio_frame_rate; + std::string _name; }; |
