diff options
| author | Carl Hetherington <cth@carlh.net> | 2026-02-09 23:34:03 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2026-02-09 23:34:03 +0100 |
| commit | 95230fe5db8aeda47aca18f613bd4309a17ee427 (patch) | |
| tree | 355691323d33ee77884b009046277a4d8740e19c /src | |
| parent | 8fddf6164257d8776315d8d8b4568a23ed94babb (diff) | |
Copy some more metadata from DCP into the film when requested.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/copy_dcp_details_to_film.cc | 4 | ||||
| -rw-r--r-- | src/lib/dcp_content.cc | 37 | ||||
| -rw-r--r-- | src/lib/dcp_content.h | 21 | ||||
| -rw-r--r-- | src/lib/dcp_examiner.cc | 4 | ||||
| -rw-r--r-- | src/lib/dcp_examiner.h | 20 |
5 files changed, 86 insertions, 0 deletions
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<const DCPContent> dcp, shared_ptr<Film> 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 <dcp/reel_text_asset.h> #include <dcp/reel.h> #include <dcp/scope_guard.h> +#include <dcp/types.h> #include <libxml++/libxml++.h> #include <fmt/format.h> #include <iterator> @@ -172,6 +173,22 @@ DCPContent::DCPContent(cxml::ConstNodePtr node, boost::optional<boost::filesyste _has_non_zero_entry_point[type] = non_zero->content() == "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<const Film> film, shared_ptr<Job> 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<TextType>(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<std::string> chain() const { + return _chain; + } + + boost::optional<std::string> distributor() const { + return _distributor; + } + + boost::optional<std::string> facility() const { + return _facility; + } + + boost::optional<dcp::Luminance> luminance() const { + return _luminance; + } + std::list<dcpomatic::DCPTimePeriod> reels(std::shared_ptr<const Film> film) const; private: @@ -274,6 +290,11 @@ private: boost::optional<int> _active_audio_channels; boost::optional<dcp::LanguageTag> _audio_language; + + boost::optional<std::string> _chain; + boost::optional<std::string> _distributor; + boost::optional<std::string> _facility; + boost::optional<dcp::Luminance> _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<const DCPContent> 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<std::string> chain() const { + return _chain; + } + + boost::optional<std::string> distributor() const { + return _distributor; + } + + boost::optional<std::string> facility() const { + return _facility; + } + + boost::optional<dcp::Luminance> luminance() const { + return _luminance; + } + void add_fonts(std::shared_ptr<TextContent> content); private: @@ -243,6 +259,10 @@ private: dcp::Fraction _atmos_edit_rate; EnumIndexedVector<bool, TextType> _has_non_zero_entry_point; VideoRange _video_range = VideoRange::FULL; + boost::optional<std::string> _chain; + boost::optional<std::string> _distributor; + boost::optional<std::string> _facility; + boost::optional<dcp::Luminance> _luminance; struct Font { |
