Fix DCP name in editor; fix use of DCP entry points.
authorCarl Hetherington <cth@carlh.net>
Wed, 9 Jul 2014 09:17:49 +0000 (10:17 +0100)
committerCarl Hetherington <cth@carlh.net>
Wed, 9 Jul 2014 09:17:49 +0000 (10:17 +0100)
src/lib/content.h
src/lib/dcp_content.cc
src/lib/dcp_content.h
src/lib/dcp_decoder.cc
src/lib/dcp_examiner.cc
src/lib/dcp_examiner.h

index 6bbf33b35cd4d4e10377bdda2ad77be6cf673f7c..ab14dc6f5d94ddc163dc5e4f83f3f04eec245d0f 100644 (file)
@@ -65,6 +65,9 @@ public:
        virtual ~Content () {}
        
        virtual void examine (boost::shared_ptr<Job>);
        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.
        virtual std::string summary () const = 0;
        /** @return Technical details of this content; these are written to logs to
         *  help with debugging.
index 663846e26400d2de65eb54d52c20f60d419af16c..3d4a48b89756b4a21ce5b85d4957e7ea4be5b931 100644 (file)
@@ -56,14 +56,18 @@ DCPContent::examine (shared_ptr<Job> job)
 {
        job->set_progress_unknown ();
        Content::examine (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);
        take_from_video_examiner (examiner);
+
+       boost::mutex::scoped_lock lm (_mutex);
+       _name = examiner->name ();
 }
 
 string
 DCPContent::summary () const
 {
 }
 
 string
 DCPContent::summary () const
 {
-       return String::compose (_("%1 [DCP]"), path_summary ());
+       boost::mutex::scoped_lock lm (_mutex);
+       return String::compose (_("%1 [DCP]"), _name);
 }
 
 string
 }
 
 string
index 7f3ac956d11480755c960e31075eedd6429d76b3..22b5fa08da0ba63d94818e30ea3ce77fa41d4f5f 100644 (file)
@@ -46,4 +46,5 @@ private:
        void read_directory (boost::filesystem::path);
 
        boost::filesystem::path _directory;
        void read_directory (boost::filesystem::path);
 
        boost::filesystem::path _directory;
+       std::string _name;
 };
 };
index 14672a23ba03d28a3fa680821f3028b1bca5fc07..1939fc1c9d21ef731467fb2d2d5075361855835c 100644 (file)
@@ -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);
                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));
                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));
                        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));
                        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));
                }
                        shared_ptr<Image> aligned_right (new Image (right, true));
                        video (shared_ptr<ImageProxy> (new RawImageProxy (aligned_right, _log)), _next.frames (vfr));
                }
index 7ce18c9f78e926422d11ff06ef75b5440d2c66cf..3051a46701265d714a4d6084226a1378f2eda183 100644 (file)
@@ -43,6 +43,8 @@ DCPExaminer::DCPExaminer (shared_ptr<const DCPContent> content)
                throw DCPError ("Multiple CPLs found in DCP");
        }
 
                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) {
 
        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) {
 
index c8b0ef7da37073b07f4f31abc8b14ee85674753b..a2793c7880ca907b99ddb8d242e2736e4ea16c40 100644 (file)
@@ -38,10 +38,16 @@ public:
                return _video_length;
        }
 
                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;
 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;
        boost::optional<int> _audio_channels;
        boost::optional<int> _audio_frame_rate;
+       std::string _name;
 };
 };