summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2021-08-04 00:11:43 +0200
committerCarl Hetherington <cth@carlh.net>2021-08-04 00:11:43 +0200
commitec7ce7b248188c69a99ca6fba4f56ab6d791bf58 (patch)
tree0a52455c89dc61e0d6e856697d4e0fb927dffee2 /src
parentce7477d528912601972af14b921604943e859de5 (diff)
Make adding extension metadata items more generic.
Diffstat (limited to 'src')
-rw-r--r--src/cpl.cc18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/cpl.cc b/src/cpl.cc
index 20d22b65..92fa7044 100644
--- a/src/cpl.cc
+++ b/src/cpl.cc
@@ -423,13 +423,19 @@ CPL::maybe_write_composition_metadata_asset (xmlpp::Element* node) const
meta->add_child("MainSubtitleLanguageList", "meta")->add_child_text(lang);
}
+ auto metadata_list = meta->add_child("ExtensionMetadataList", "meta");
+
+ auto add_extension_metadata = [metadata_list](string scope, string name, string property_name, string property_value) {
+ auto extension = metadata_list->add_child("ExtensionMetadata", "meta");
+ extension->set_attribute("scope", scope);
+ extension->add_child("Name", "meta")->add_child_text(name);
+ auto property = extension->add_child("PropertyList", "meta")->add_child("Property", "meta");
+ property->add_child("Name", "meta")->add_child_text(property_name);
+ property->add_child("Value", "meta")->add_child_text(property_value);
+ };
+
/* SMPTE Bv2.1 8.6.3 */
- auto extension = meta->add_child("ExtensionMetadataList", "meta")->add_child("ExtensionMetadata", "meta");
- extension->set_attribute("scope", "http://isdcf.com/ns/cplmd/app");
- extension->add_child("Name", "meta")->add_child_text("Application");
- auto property = extension->add_child("PropertyList", "meta")->add_child("Property", "meta");
- property->add_child("Name", "meta")->add_child_text("DCP Constraints Profile");
- property->add_child("Value", "meta")->add_child_text("SMPTE-RDD-52:2020-Bv2.1");
+ add_extension_metadata ("http://isdcf.com/ns/cplmd/app", "Application", "DCP Constraints Profile", "SMPTE-RDD-52:2020-Bv2.1");
if (_reels.front()->main_sound()) {
auto asset = _reels.front()->main_sound()->asset();