From c1229ba3e750fa0c877ef8444da82e8ea4a9638f Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 9 Oct 2022 14:13:39 +0200 Subject: Make CPL metadata writing optional. --- src/cpl.cc | 4 ++-- src/cpl.h | 3 ++- src/dcp.cc | 4 ++-- src/dcp.h | 3 ++- 4 files changed, 8 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/cpl.cc b/src/cpl.cc index ee1817fc..5404acd9 100644 --- a/src/cpl.cc +++ b/src/cpl.cc @@ -181,7 +181,7 @@ CPL::set (std::vector> reels) void -CPL::write_xml (boost::filesystem::path file, shared_ptr signer) const +CPL::write_xml(boost::filesystem::path file, shared_ptr signer, bool write_cpl_metadata) const { xmlpp::Document doc; xmlpp::Element* root; @@ -225,7 +225,7 @@ CPL::write_xml (boost::filesystem::path file, shared_ptr bool first = true; for (auto i: _reels) { auto asset_list = i->write_to_cpl (reel_list, _standard); - if (first && _standard == Standard::SMPTE) { + if (first && _standard == Standard::SMPTE && write_cpl_metadata) { maybe_write_composition_metadata_asset (asset_list); first = false; } diff --git a/src/cpl.h b/src/cpl.h index c1489a2c..aaa82740 100644 --- a/src/cpl.h +++ b/src/cpl.h @@ -126,7 +126,8 @@ public: */ void write_xml ( boost::filesystem::path file, - std::shared_ptr + std::shared_ptr, + bool write_cpl_metadata = true ) const; void resolve_refs (std::vector>); diff --git a/src/dcp.cc b/src/dcp.cc index df5c89b4..d507e951 100644 --- a/src/dcp.cc +++ b/src/dcp.cc @@ -400,7 +400,7 @@ DCP::write_volindex (Standard standard) const void -DCP::write_xml (shared_ptr signer, NameFormat name_format) +DCP::write_xml(shared_ptr signer, NameFormat name_format, bool write_cpl_metadata) { if (_cpls.empty()) { throw MiscError ("Cannot write DCP with no CPLs."); @@ -419,7 +419,7 @@ DCP::write_xml (shared_ptr signer, NameFormat name_forma for (auto i: cpls()) { NameFormat::Map values; values['t'] = "cpl"; - i->write_xml (_directory / (name_format.get(values, "_" + i->id() + ".xml")), signer); + i->write_xml(_directory / (name_format.get(values, "_" + i->id() + ".xml")), signer, write_cpl_metadata); } if (_pkls.empty()) { diff --git a/src/dcp.h b/src/dcp.h index 35e2edf8..6a8eef15 100644 --- a/src/dcp.h +++ b/src/dcp.h @@ -157,7 +157,8 @@ public: */ void write_xml ( std::shared_ptr signer = std::shared_ptr(), - NameFormat name_format = NameFormat("%t") + NameFormat name_format = NameFormat("%t"), + bool write_cpl_metadata = true ); void resolve_refs (std::vector> assets); -- cgit v1.2.3