Provide better information on what will happen to JPEG2000 content in inputs (part... j2k-passthru-information
authorCarl Hetherington <cth@carlh.net>
Tue, 14 Apr 2020 23:56:31 +0000 (01:56 +0200)
committerCarl Hetherington <cth@carlh.net>
Thu, 21 May 2020 22:27:06 +0000 (00:27 +0200)
src/lib/content.cc
src/lib/content.h
src/lib/dcp_content.cc
src/lib/dcp_content.h
src/lib/player_video.cc
src/wx/video_panel.cc

index 4242477d483a06fbfb877d90e8fa74c4f0f5db3c..79f50d985b01c318bebf5af49239749dfe932b57 100644 (file)
@@ -511,3 +511,18 @@ Content::add_path (boost::filesystem::path p)
        _paths.push_back (p);
        _last_write_times.push_back (boost::filesystem::last_write_time(p));
 }
+
+
+string
+Content::video_processing_description (boost::shared_ptr<const Film> film) const
+{
+       return video ? video->processing_description(film) : "";
+}
+
+
+string
+Content::audio_processing_description (boost::shared_ptr<const Film> film) const
+{
+       return audio ? audio->processing_description(film) : "";
+}
+
index a2d78aa68539423cca457abb2005f558e6ca68fa..543e3cba0be2afa4d5dc9b86c9ae65e19022c3e0 100644 (file)
@@ -98,6 +98,9 @@ public:
         */
        virtual std::list<dcpomatic::DCPTime> reel_split_points (boost::shared_ptr<const Film>) const;
 
+       virtual std::string video_processing_description (boost::shared_ptr<const Film> film) const;
+       virtual std::string audio_processing_description (boost::shared_ptr<const Film> film) const;
+
        boost::shared_ptr<Content> clone () const;
 
        void set_paths (std::vector<boost::filesystem::path> paths);
index ca210b5587ce45cbdd4eee40037649843246f41a..07bd946b0729937e8a687e6c18d5c8bc49f48449 100644 (file)
@@ -760,3 +760,31 @@ DCPContent::resolution () const
        return RESOLUTION_2K;
 }
 
+string
+DCPContent::video_processing_description (shared_ptr<const Film> film) const
+{
+       /* This and PlayerVideo::has_j2k() need to be kept in sync */
+
+       if (!video) {
+               return "";
+       }
+
+       string s = video->processing_description (film);
+
+       /* XXX: overlapping burnt subs... */
+
+       if (video->crop() != Crop()) {
+               s += _("JPEG2000 video will be re-compressed because the image is cropped.");
+       } else if (film->frame_size() != video->size()) {
+               s += _("JPEG2000 video will be re-compressed because the project's container is different to the DCP's.");
+       } else if (video->fade_in() || video->fade_out()) {
+               s += _("JPEG2000 video will be re-compressed because fades have been set up.");
+       } else if (video->colour_conversion()) {
+               s += _("JPEG2000 video will be re-compressed because the colour conversion is not set to 'None'");
+       } else {
+               s += _("JPEG2000 video will be passed through without any change.");
+       }
+
+       return s;
+}
+
index 6d707670f27eb6bc267d98cefe7bbcd487cdc31f..16c546e96c122a224c57b5d0019fc8361b08366c 100644 (file)
@@ -74,6 +74,8 @@ public:
        void set_default_colour_conversion ();
        std::list<dcpomatic::DCPTime> reel_split_points (boost::shared_ptr<const Film> film) const;
 
+       std::string video_processing_description (boost::shared_ptr<const Film> film) const;
+
        std::vector<boost::filesystem::path> directories () const;
 
        bool encrypted () const {
index 10e798ed510644a86e03d11249d737139268d3b0..1dd64540ac5ec4dc03e622bcdc2652f169df0d66 100644 (file)
@@ -224,6 +224,8 @@ PlayerVideo::has_j2k () const
 {
        /* XXX: maybe other things */
 
+       /* This and DCPContent::processing_description() need to be kept in sync */
+
        shared_ptr<const J2KImageProxy> j2k = dynamic_pointer_cast<const J2KImageProxy> (_in);
        if (!j2k) {
                return false;
index 4be9a741fd72b338a9fe7039595eb2fa480f6c4b..56d995e9c1fdb34a2fc1141acebc4ea6f5a05709 100644 (file)
@@ -398,6 +398,7 @@ VideoPanel::film_content_changed (int property)
                        } else {
                                checked_set (_colour_conversion, 0);
                        }
+                       setup_description ();
                } else if (check.size() > 1) {
                        /* Add a "many" entry and select it as an indication that multiple different
                         * colour conversions are present in the selection.
@@ -436,6 +437,7 @@ VideoPanel::film_content_changed (int property)
                } else {
                        _fade_in->clear ();
                }
+               setup_description ();
        } else if (property == VideoContentProperty::FADE_OUT) {
                set<Frame> check;
                BOOST_FOREACH (shared_ptr<const Content> i, vc) {
@@ -450,6 +452,7 @@ VideoPanel::film_content_changed (int property)
                } else {
                        _fade_out->clear ();
                }
+               setup_description ();
        } else if (property == DCPContentProperty::REFERENCE_VIDEO) {
                if (vc.size() == 1) {
                        shared_ptr<DCPContent> dcp = dynamic_pointer_cast<DCPContent> (vc.front ());
@@ -511,7 +514,7 @@ VideoPanel::setup_description ()
                return;
        }
 
-       string d = vc.front()->video->processing_description (_parent->film());
+       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) {