diff options
| author | Carl Hetherington <cth@carlh.net> | 2015-02-10 15:39:37 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2015-02-10 15:39:37 +0000 |
| commit | 35466aa2bf59544d436a5f576e81856c5e0d0311 (patch) | |
| tree | dcc142e196a859aa28d99110b2f5f5b54a18ba42 /src/lib | |
| parent | fec9cf2d1fb02d9a2f563cbe8e3de6cd479b35f2 (diff) | |
Default to no colour conversion for JPEG2000 and DCP content (#445).
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/dcp_content.cc | 2 | ||||
| -rw-r--r-- | src/lib/image_content.cc | 12 | ||||
| -rw-r--r-- | src/lib/video_content.cc | 6 | ||||
| -rw-r--r-- | src/lib/video_content.h | 2 |
4 files changed, 19 insertions, 3 deletions
diff --git a/src/lib/dcp_content.cc b/src/lib/dcp_content.cc index 3f3cb1b94..51c7f8549 100644 --- a/src/lib/dcp_content.cc +++ b/src/lib/dcp_content.cc @@ -47,6 +47,8 @@ DCPContent::DCPContent (shared_ptr<const Film> f, boost::filesystem::path p) , _kdm_valid (false) { read_directory (p); + /* Default to no colour conversion for DCPs */ + unset_colour_conversion (false); } DCPContent::DCPContent (shared_ptr<const Film> f, cxml::ConstNodePtr node, int version) diff --git a/src/lib/image_content.cc b/src/lib/image_content.cc index 1dbd7871b..4073cd52c 100644 --- a/src/lib/image_content.cc +++ b/src/lib/image_content.cc @@ -37,12 +37,19 @@ ImageContent::ImageContent (shared_ptr<const Film> f, boost::filesystem::path p) : Content (f) , VideoContent (f) { + bool have_j2k = false; if (boost::filesystem::is_regular_file (p)) { _paths.push_back (p); + if (valid_j2k_file (p)) { + have_j2k = true; + } } else { for (boost::filesystem::directory_iterator i(p); i != boost::filesystem::directory_iterator(); ++i) { if (boost::filesystem::is_regular_file (i->path()) && valid_image_file (i->path())) { _paths.push_back (i->path ()); + if (valid_j2k_file (i->path ())) { + have_j2k = true; + } } } @@ -52,6 +59,11 @@ ImageContent::ImageContent (shared_ptr<const Film> f, boost::filesystem::path p) sort (_paths.begin(), _paths.end()); } + + if (have_j2k) { + /* We default to no colour conversion if we have JPEG2000 files */ + unset_colour_conversion (); + } } diff --git a/src/lib/video_content.cc b/src/lib/video_content.cc index 823517bfc..64c51be99 100644 --- a/src/lib/video_content.cc +++ b/src/lib/video_content.cc @@ -393,14 +393,16 @@ VideoContent::video_size_after_3d_split () const } void -VideoContent::unset_colour_conversion () +VideoContent::unset_colour_conversion (bool signal) { { boost::mutex::scoped_lock lm (_mutex); _colour_conversion = boost::optional<ColourConversion> (); } - signal_changed (VideoContentProperty::COLOUR_CONVERSION); + if (signal) { + signal_changed (VideoContentProperty::COLOUR_CONVERSION); + } } void diff --git a/src/lib/video_content.h b/src/lib/video_content.h index 320926190..792929419 100644 --- a/src/lib/video_content.h +++ b/src/lib/video_content.h @@ -86,7 +86,7 @@ public: void set_bottom_crop (int); void set_scale (VideoContentScale); - void unset_colour_conversion (); + void unset_colour_conversion (bool signal = true); void set_colour_conversion (ColourConversion); void set_default_colour_conversion (bool signal = true); |
