From 95230fe5db8aeda47aca18f613bd4309a17ee427 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 9 Feb 2026 23:34:03 +0100 Subject: Copy some more metadata from DCP into the film when requested. --- src/lib/copy_dcp_details_to_film.cc | 4 ++++ src/lib/dcp_content.cc | 37 +++++++++++++++++++++++++++++++++++++ src/lib/dcp_content.h | 21 +++++++++++++++++++++ src/lib/dcp_examiner.cc | 4 ++++ src/lib/dcp_examiner.h | 20 ++++++++++++++++++++ 5 files changed, 86 insertions(+) (limited to 'src') diff --git a/src/lib/copy_dcp_details_to_film.cc b/src/lib/copy_dcp_details_to_film.cc index 67a207de1..cff2ea51c 100644 --- a/src/lib/copy_dcp_details_to_film.cc +++ b/src/lib/copy_dcp_details_to_film.cc @@ -68,6 +68,10 @@ copy_dcp_settings_to_film(shared_ptr dcp, shared_ptr fil film->set_ratings(dcp->ratings()); film->set_content_versions(dcp->content_versions()); + film->set_chain(dcp->chain()); + film->set_distributor(dcp->distributor()); + film->set_facility(dcp->facility()); + film->set_luminance(dcp->luminance()); } diff --git a/src/lib/dcp_content.cc b/src/lib/dcp_content.cc index cf1d208bf..ce4b552f9 100644 --- a/src/lib/dcp_content.cc +++ b/src/lib/dcp_content.cc @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include @@ -172,6 +173,22 @@ DCPContent::DCPContent(cxml::ConstNodePtr node, boost::optionalcontent() == "1"; } catch (MetadataError&) {} } + + if (auto chain = node->optional_string_child("Chain")) { + _chain = *chain; + } + + if (auto distributor = node->optional_string_child("Distributor")) { + _distributor = *distributor; + } + + if (auto facility = node->optional_string_child("Facility")) { + _facility = *facility; + } + + if (auto luminance = node->optional_node_child("Luminance")) { + _luminance = dcp::Luminance(luminance); + } } void @@ -334,6 +351,10 @@ DCPContent::examine(shared_ptr film, shared_ptr job, bool toler _ratings = examiner->ratings(); _content_versions = examiner->content_versions(); _has_non_zero_entry_point = examiner->has_non_zero_entry_point(); + _chain = examiner->chain(); + _distributor = examiner->distributor(); + _facility = examiner->facility(); + _luminance = examiner->luminance(); } if (needed_assets == needs_assets()) { @@ -472,6 +493,22 @@ DCPContent::as_xml(xmlpp::Element* element, bool with_paths, PathBehaviour path_ has->set_attribute("type", text_type_to_string(static_cast(i))); } } + + if (_chain) { + cxml::add_text_child(element, "Chain", *_chain); + } + + if (_distributor) { + cxml::add_text_child(element, "Distributor", *_distributor); + } + + if (_facility) { + cxml::add_text_child(element, "Facility", *_facility); + } + + if (_luminance) { + _luminance->as_xml(element, ""); + } } diff --git a/src/lib/dcp_content.h b/src/lib/dcp_content.h index 80b7f64a8..bac051eea 100644 --- a/src/lib/dcp_content.h +++ b/src/lib/dcp_content.h @@ -223,6 +223,22 @@ public: void check_font_ids(); + boost::optional chain() const { + return _chain; + } + + boost::optional distributor() const { + return _distributor; + } + + boost::optional facility() const { + return _facility; + } + + boost::optional luminance() const { + return _luminance; + } + std::list reels(std::shared_ptr film) const; private: @@ -274,6 +290,11 @@ private: boost::optional _active_audio_channels; boost::optional _audio_language; + + boost::optional _chain; + boost::optional _distributor; + boost::optional _facility; + boost::optional _luminance; }; diff --git a/src/lib/dcp_examiner.cc b/src/lib/dcp_examiner.cc index a5180822a..b749c9686 100644 --- a/src/lib/dcp_examiner.cc +++ b/src/lib/dcp_examiner.cc @@ -122,6 +122,10 @@ DCPExaminer::DCPExaminer(shared_ptr content, bool tolerant) _cpl = selected_cpl->id(); _name = selected_cpl->content_title_text(); _content_kind = selected_cpl->content_kind(); + _chain = selected_cpl->chain(); + _distributor = selected_cpl->distributor(); + _facility = selected_cpl->facility(); + _luminance = selected_cpl->luminance(); LOG_GENERAL("Selected CPL {}", _cpl); diff --git a/src/lib/dcp_examiner.h b/src/lib/dcp_examiner.h index 8dd865762..7e73a8b09 100644 --- a/src/lib/dcp_examiner.h +++ b/src/lib/dcp_examiner.h @@ -200,6 +200,22 @@ public: return _has_non_zero_entry_point; } + boost::optional chain() const { + return _chain; + } + + boost::optional distributor() const { + return _distributor; + } + + boost::optional facility() const { + return _facility; + } + + boost::optional luminance() const { + return _luminance; + } + void add_fonts(std::shared_ptr content); private: @@ -243,6 +259,10 @@ private: dcp::Fraction _atmos_edit_rate; EnumIndexedVector _has_non_zero_entry_point; VideoRange _video_range = VideoRange::FULL; + boost::optional _chain; + boost::optional _distributor; + boost::optional _facility; + boost::optional _luminance; struct Font { -- cgit v1.2.3