diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-09-21 22:16:48 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-09-21 22:16:48 +0100 |
| commit | 8457b7c1066da4e14f00a76f3855e60d986b179f (patch) | |
| tree | bd05cf5865acb87eadff18daa7cb6ba46e272dd8 /src | |
| parent | 4f139c25251b177878e30dd62350a0ebd5e07e14 (diff) | |
Correctly spot that a DCP with unencrypted picture but encrypted sound/subtitle needs a KDM.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/dcp_content.cc | 20 | ||||
| -rw-r--r-- | src/lib/dcp_content.h | 3 | ||||
| -rw-r--r-- | src/lib/dcp_examiner.cc | 21 | ||||
| -rw-r--r-- | src/lib/player.cc | 3 | ||||
| -rw-r--r-- | src/wx/content_panel.cc | 2 |
5 files changed, 34 insertions, 15 deletions
diff --git a/src/lib/dcp_content.cc b/src/lib/dcp_content.cc index c180240c8..96e9f17a2 100644 --- a/src/lib/dcp_content.cc +++ b/src/lib/dcp_content.cc @@ -54,10 +54,11 @@ using boost::function; using boost::dynamic_pointer_cast; using dcp::raw_convert; -int const DCPContentProperty::CAN_BE_PLAYED = 600; -int const DCPContentProperty::REFERENCE_VIDEO = 601; -int const DCPContentProperty::REFERENCE_AUDIO = 602; -int const DCPContentProperty::REFERENCE_SUBTITLE = 603; +int const DCPContentProperty::NEEDS_ASSETS = 600; +int const DCPContentProperty::NEEDS_KDM = 601; +int const DCPContentProperty::REFERENCE_VIDEO = 602; +int const DCPContentProperty::REFERENCE_AUDIO = 603; +int const DCPContentProperty::REFERENCE_SUBTITLE = 604; DCPContent::DCPContent (shared_ptr<const Film> film, boost::filesystem::path p) : Content (film) @@ -135,7 +136,8 @@ DCPContent::read_directory (boost::filesystem::path p) void DCPContent::examine (shared_ptr<Job> job) { - bool const could_be_played = can_be_played (); + bool const needed_assets = needs_assets (); + bool const needed_kdm = needs_kdm (); job->set_progress_unknown (); Content::examine (job); @@ -170,8 +172,12 @@ DCPContent::examine (shared_ptr<Job> job) _cpl = examiner->cpl (); } - if (could_be_played != can_be_played ()) { - signal_changed (DCPContentProperty::CAN_BE_PLAYED); + if (needed_assets != needs_assets ()) { + signal_changed (DCPContentProperty::NEEDS_ASSETS); + } + + if (needed_kdm != needs_kdm ()) { + signal_changed (DCPContentProperty::NEEDS_KDM); } video->set_frame_type (_three_d ? VIDEO_FRAME_TYPE_3D : VIDEO_FRAME_TYPE_2D); diff --git a/src/lib/dcp_content.h b/src/lib/dcp_content.h index f97045484..93a207ed7 100644 --- a/src/lib/dcp_content.h +++ b/src/lib/dcp_content.h @@ -32,7 +32,8 @@ class DCPContentProperty { public: - static int const CAN_BE_PLAYED; + static int const NEEDS_KDM; + static int const NEEDS_ASSETS; static int const REFERENCE_VIDEO; static int const REFERENCE_AUDIO; static int const REFERENCE_SUBTITLE; diff --git a/src/lib/dcp_examiner.cc b/src/lib/dcp_examiner.cc index b2034890b..e25583cb6 100644 --- a/src/lib/dcp_examiner.cc +++ b/src/lib/dcp_examiner.cc @@ -35,6 +35,9 @@ #include <dcp/stereo_picture_asset.h> #include <dcp/stereo_picture_asset_reader.h> #include <dcp/stereo_picture_frame.h> +#include <dcp/sound_asset.h> +#include <dcp/sound_asset_reader.h> +#include <dcp/subtitle_asset.h> #include <dcp/reel_subtitle_asset.h> #include <dcp/sound_asset.h> #include <boost/foreach.hpp> @@ -165,12 +168,12 @@ DCPExaminer::DCPExaminer (shared_ptr<const DCPContent> content) _encrypted = cpl->encrypted (); _kdm_valid = true; - /* Check that we can read the first picture frame */ + /* Check that we can read the first picture, sound and subtitle frames of each reel */ try { - if (!cpl->reels().empty ()) { - shared_ptr<dcp::PictureAsset> asset = cpl->reels().front()->main_picture()->asset (); - shared_ptr<dcp::MonoPictureAsset> mono = dynamic_pointer_cast<dcp::MonoPictureAsset> (asset); - shared_ptr<dcp::StereoPictureAsset> stereo = dynamic_pointer_cast<dcp::StereoPictureAsset> (asset); + BOOST_FOREACH (shared_ptr<dcp::Reel> i, cpl->reels()) { + shared_ptr<dcp::PictureAsset> pic = i->main_picture()->asset (); + shared_ptr<dcp::MonoPictureAsset> mono = dynamic_pointer_cast<dcp::MonoPictureAsset> (pic); + shared_ptr<dcp::StereoPictureAsset> stereo = dynamic_pointer_cast<dcp::StereoPictureAsset> (pic); if (mono) { mono->start_read()->get_frame(0)->xyz_image (); @@ -178,6 +181,14 @@ DCPExaminer::DCPExaminer (shared_ptr<const DCPContent> content) stereo->start_read()->get_frame(0)->xyz_image (dcp::EYE_LEFT); } + if (i->main_sound()) { + shared_ptr<dcp::SoundAsset> sound = i->main_sound()->asset (); + i->main_sound()->asset()->start_read()->get_frame(0); + } + + if (i->main_subtitle()) { + i->main_subtitle()->asset()->subtitles (); + } } } catch (dcp::DCPReadError& e) { _kdm_valid = false; diff --git a/src/lib/player.cc b/src/lib/player.cc index c17cdfdc0..69306e381 100644 --- a/src/lib/player.cc +++ b/src/lib/player.cc @@ -169,7 +169,8 @@ Player::playlist_content_changed (weak_ptr<Content> w, int property, bool freque property == ContentProperty::TRIM_END || property == ContentProperty::PATH || property == VideoContentProperty::FRAME_TYPE || - property == DCPContentProperty::CAN_BE_PLAYED || + property == DCPContentProperty::NEEDS_ASSETS || + property == DCPContentProperty::NEEDS_KDM || property == SubtitleContentProperty::COLOUR || property == SubtitleContentProperty::OUTLINE || property == SubtitleContentProperty::SHADOW || diff --git a/src/wx/content_panel.cc b/src/wx/content_panel.cc index 1d9f010bf..5892d9c4c 100644 --- a/src/wx/content_panel.cc +++ b/src/wx/content_panel.cc @@ -468,7 +468,7 @@ ContentPanel::set_selection (weak_ptr<Content> wc) void ContentPanel::film_content_changed (int property) { - if (property == ContentProperty::PATH || property == DCPContentProperty::CAN_BE_PLAYED) { + if (property == ContentProperty::PATH || property == DCPContentProperty::NEEDS_ASSETS || property == DCPContentProperty::NEEDS_KDM) { setup (); } |
