diff options
| author | Carl Hetherington <cth@carlh.net> | 2018-09-29 00:13:49 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2018-09-29 00:13:49 +0100 |
| commit | 92f024ea58c7279b8096e5e9f60f9cb2613e8a91 (patch) | |
| tree | 02c3b4a91effa6ca53ba511b60d6451c1b1f2009 /src/lib | |
| parent | d6825b500b89430cb018d311c090d794ec18faf3 (diff) | |
swaroop: Disable play/stop/pause and slider during ad content.
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/dcp_content.cc | 9 | ||||
| -rw-r--r-- | src/lib/dcp_content.h | 6 | ||||
| -rw-r--r-- | src/lib/dcp_examiner.cc | 1 | ||||
| -rw-r--r-- | src/lib/dcp_examiner.h | 5 | ||||
| -rw-r--r-- | src/lib/player_video.h | 8 |
5 files changed, 28 insertions, 1 deletions
diff --git a/src/lib/dcp_content.cc b/src/lib/dcp_content.cc index 3498cc961..7301e5373 100644 --- a/src/lib/dcp_content.cc +++ b/src/lib/dcp_content.cc @@ -133,6 +133,11 @@ DCPContent::DCPContent (shared_ptr<const Film> film, cxml::ConstNodePtr node, in } } _three_d = node->optional_bool_child("ThreeD").get_value_or (false); + + optional<string> ck = node->optional_string_child("ContentKind"); + if (ck) { + _content_kind = dcp::content_kind_from_string (*ck); + } _cpl = node->optional_string_child("CPL"); BOOST_FOREACH (cxml::ConstNodePtr i, node->node_children("ReelLength")) { _reel_lengths.push_back (raw_convert<int64_t> (i->content ())); @@ -209,6 +214,7 @@ DCPContent::examine (shared_ptr<Job> job) _kdm_valid = examiner->kdm_valid (); _standard = examiner->standard (); _three_d = examiner->three_d (); + _content_kind = examiner->content_kind (); _cpl = examiner->cpl (); _reel_lengths = examiner->reel_lengths (); } @@ -301,6 +307,9 @@ DCPContent::as_xml (xmlpp::Node* node, bool with_paths) const } } node->add_child("ThreeD")->add_child_text (_three_d ? "1" : "0"); + if (_content_kind) { + node->add_child("ContentKind")->add_child_text(dcp::content_kind_to_string(*_content_kind)); + } if (_cpl) { node->add_child("CPL")->add_child_text (_cpl.get ()); } diff --git a/src/lib/dcp_content.h b/src/lib/dcp_content.h index db617afa2..2a3ef46e8 100644 --- a/src/lib/dcp_content.h +++ b/src/lib/dcp_content.h @@ -138,6 +138,11 @@ public: return _three_d; } + boost::optional<dcp::ContentKind> content_kind () const { + boost::mutex::scoped_lock lm (_mutex); + return _content_kind; + } + bool kdm_timing_window_valid () const; private: @@ -176,6 +181,7 @@ private: bool _reference_text[TEXT_COUNT]; boost::optional<dcp::Standard> _standard; + boost::optional<dcp::ContentKind> _content_kind; bool _three_d; /** ID of the CPL to use; older metadata might not specify this: in that case * just use the only CPL. diff --git a/src/lib/dcp_examiner.cc b/src/lib/dcp_examiner.cc index 1785669dd..dfb47f2eb 100644 --- a/src/lib/dcp_examiner.cc +++ b/src/lib/dcp_examiner.cc @@ -108,6 +108,7 @@ DCPExaminer::DCPExaminer (shared_ptr<const DCPContent> content) _cpl = cpl->id (); _name = cpl->content_title_text (); + _content_kind = cpl->content_kind (); BOOST_FOREACH (shared_ptr<dcp::Reel> i, cpl->reels()) { diff --git a/src/lib/dcp_examiner.h b/src/lib/dcp_examiner.h index 4b93bfa42..f54f02c36 100644 --- a/src/lib/dcp_examiner.h +++ b/src/lib/dcp_examiner.h @@ -99,6 +99,10 @@ public: return _three_d; } + dcp::ContentKind content_kind () const { + return _content_kind; + } + std::string cpl () const { return _cpl; } @@ -125,6 +129,7 @@ private: bool _kdm_valid; boost::optional<dcp::Standard> _standard; bool _three_d; + dcp::ContentKind _content_kind; std::string _cpl; std::list<int64_t> _reel_lengths; }; diff --git a/src/lib/player_video.h b/src/lib/player_video.h index cd904af06..11b2c8833 100644 --- a/src/lib/player_video.h +++ b/src/lib/player_video.h @@ -100,6 +100,10 @@ public: size_t memory_used () const; + boost::weak_ptr<Content> content () const { + return _content; + } + private: boost::shared_ptr<const ImageProxy> _in; Crop _crop; @@ -110,7 +114,9 @@ private: Part _part; boost::optional<ColourConversion> _colour_conversion; boost::optional<PositionImage> _text; - /** Content that we came from. This is so that reset_metadata() can work */ + /** Content that we came from. This is so that reset_metadata() can work, and also + * for variant:swaroop's non-skippable ads. + */ boost::weak_ptr<Content> _content; /** Video frame that we came from. Again, this is for reset_metadata() */ boost::optional<Frame> _video_frame; |
