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/lib/dcp_content.cc | |
| parent | 8fddf6164257d8776315d8d8b4568a23ed94babb (diff) | |
Copy some more metadata from DCP into the film when requested.
Diffstat (limited to 'src/lib/dcp_content.cc')
| -rw-r--r-- | src/lib/dcp_content.cc | 37 |
1 files changed, 37 insertions, 0 deletions
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, ""); + } } |
