diff options
| author | Carl Hetherington <cth@carlh.net> | 2020-08-19 17:04:28 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2020-09-20 19:29:21 +0200 |
| commit | 3f806092b5d0f60fe4c7e40399cf1f7ec0e535ec (patch) | |
| tree | c8a052cbaf8b4f8bc4ffb05753d05f4d6887315f /src | |
| parent | f9078ac398e0765e39f503cdc5bed406d45e0c36 (diff) | |
Remove XMLMetadata from DCP::write_xml and DCP::write_assetmap.
Diffstat (limited to 'src')
| -rw-r--r-- | src/dcp.cc | 30 | ||||
| -rw-r--r-- | src/dcp.h | 15 | ||||
| -rw-r--r-- | src/wscript | 1 |
3 files changed, 30 insertions, 16 deletions
@@ -1,5 +1,5 @@ /* - Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net> + Copyright (C) 2012-2020 Carl Hetherington <cth@carlh.net> This file is part of libdcp. @@ -378,7 +378,10 @@ DCP::write_volindex (Standard standard) const } void -DCP::write_assetmap (Standard standard, string pkl_uuid, boost::filesystem::path pkl_path, XMLMetadata metadata) const +DCP::write_assetmap ( + Standard standard, string pkl_uuid, boost::filesystem::path pkl_path, + string issuer, string creator, string issue_date, string annotation_text + ) const { boost::filesystem::path p = _directory; @@ -408,20 +411,20 @@ DCP::write_assetmap (Standard standard, string pkl_uuid, boost::filesystem::path } root->add_child("Id")->add_child_text ("urn:uuid:" + make_uuid()); - root->add_child("AnnotationText")->add_child_text (metadata.annotation_text); + root->add_child("AnnotationText")->add_child_text (annotation_text); switch (standard) { case INTEROP: root->add_child("VolumeCount")->add_child_text ("1"); - root->add_child("IssueDate")->add_child_text (metadata.issue_date); - root->add_child("Issuer")->add_child_text (metadata.issuer); - root->add_child("Creator")->add_child_text (metadata.creator); + root->add_child("IssueDate")->add_child_text (issue_date); + root->add_child("Issuer")->add_child_text (issuer); + root->add_child("Creator")->add_child_text (creator); break; case SMPTE: - root->add_child("Creator")->add_child_text (metadata.creator); + root->add_child("Creator")->add_child_text (creator); root->add_child("VolumeCount")->add_child_text ("1"); - root->add_child("IssueDate")->add_child_text (metadata.issue_date); - root->add_child("Issuer")->add_child_text (metadata.issuer); + root->add_child("IssueDate")->add_child_text (issue_date); + root->add_child("Issuer")->add_child_text (issuer); break; default: DCP_ASSERT (false); @@ -455,7 +458,10 @@ DCP::write_assetmap (Standard standard, string pkl_uuid, boost::filesystem::path void DCP::write_xml ( Standard standard, - XMLMetadata metadata, + string issuer, + string creator, + string issue_date, + string annotation_text, shared_ptr<const CertificateChain> signer, NameFormat name_format ) @@ -469,7 +475,7 @@ DCP::write_xml ( shared_ptr<PKL> pkl; if (_pkls.empty()) { - pkl.reset (new PKL (standard, metadata.annotation_text, metadata.issue_date, metadata.issuer, metadata.creator)); + pkl.reset (new PKL(standard, annotation_text, issue_date, issuer, creator)); _pkls.push_back (pkl); BOOST_FOREACH (shared_ptr<Asset> i, assets ()) { i->add_to_pkl (pkl, _directory); @@ -484,7 +490,7 @@ DCP::write_xml ( pkl->write (pkl_path, signer); write_volindex (standard); - write_assetmap (standard, pkl->id(), pkl_path, metadata); + write_assetmap (standard, pkl->id(), pkl_path, issuer, creator, issue_date, annotation_text); } list<shared_ptr<CPL> > @@ -1,5 +1,5 @@ /* - Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net> + Copyright (C) 2012-2020 Carl Hetherington <cth@carlh.net> This file is part of libdcp. @@ -38,12 +38,14 @@ #ifndef LIBDCP_DCP_H #define LIBDCP_DCP_H +#include "compose.hpp" #include "types.h" #include "util.h" #include "certificate.h" #include "metadata.h" #include "name_format.h" #include "verify.h" +#include "version.h" #include <boost/shared_ptr.hpp> #include <boost/signals2.hpp> #include <string> @@ -62,7 +64,6 @@ class PKL; class Content; class Reel; class CPL; -class XMLMetadata; class CertificateChain; class DecryptedKDM; class Asset; @@ -111,7 +112,10 @@ public: void write_xml ( Standard standard, - XMLMetadata metadata = XMLMetadata (), + std::string issuer = String::compose("libdcp %1", dcp::version), + std::string creator = String::compose("libdcp %1", dcp::version), + std::string issue_date = LocalTime().as_string(), + std::string annotation_text = String::compose("Created by libdcp %1", dcp::version), boost::shared_ptr<const CertificateChain> signer = boost::shared_ptr<const CertificateChain> (), NameFormat name_format = NameFormat("%t") ); @@ -148,7 +152,10 @@ private: * @param pkl_uuid UUID of our PKL. * @param pkl_path Pathname of our PKL file. */ - void write_assetmap (Standard standard, std::string pkl_uuid, boost::filesystem::path pkl_path, XMLMetadata metadata) const; + void write_assetmap ( + Standard standard, std::string pkl_uuid, boost::filesystem::path pkl_path, + std::string issuer, std::string creator, std::string issue_date, std::string annotation_text + ) const; /** The directory that we are writing to */ boost::filesystem::path _directory; diff --git a/src/wscript b/src/wscript index fd215d76..46b5a5ea 100644 --- a/src/wscript +++ b/src/wscript @@ -124,6 +124,7 @@ def build(bld): chromaticity.h colour_conversion.h combine.h + compose.hpp cpl.h crypto_context.h dcp.h |
