/*
- Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2012-2020 Carl Hetherington <cth@carlh.net>
This file is part of libdcp.
}
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;
}
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);
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
)
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);
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> >
/*
- Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2012-2020 Carl Hetherington <cth@carlh.net>
This file is part of libdcp.
#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>
class Content;
class Reel;
class CPL;
-class XMLMetadata;
class CertificateChain;
class DecryptedKDM;
class Asset;
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")
);
* @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;
chromaticity.h
colour_conversion.h
combine.h
+ compose.hpp
cpl.h
crypto_context.h
dcp.h
xml_meta.issuer = "OpenDCP 0.0.25";
xml_meta.creator = "OpenDCP 0.0.25";
xml_meta.issue_date = "2012-07-17T04:45:18+00:00";
- make_simple("build/test/DCP/dcp_test1")->write_xml (dcp::SMPTE, xml_meta);
+ make_simple("build/test/DCP/dcp_test1")->write_xml (dcp::SMPTE, xml_meta.issuer, xml_meta.creator, xml_meta.issue_date, xml_meta.annotation_text);
/* build/test/DCP/dcp_test1 is checked against test/ref/DCP/dcp_test1 by run/tests */
}
d.add (cpl);
xml_meta.annotation_text = "Created by libdcp";
- d.write_xml (dcp::SMPTE, xml_meta);
+ d.write_xml (dcp::SMPTE, xml_meta.issuer, xml_meta.creator, xml_meta.issue_date, xml_meta.annotation_text);
/* build/test/DCP/dcp_test2 is checked against test/ref/DCP/dcp_test2 by run/tests */
}
d.add (cpl);
xml_meta.annotation_text = "Created by libdcp";
- d.write_xml (dcp::SMPTE, xml_meta);
+ d.write_xml (dcp::SMPTE, xml_meta.issuer, xml_meta.creator, xml_meta.issue_date, xml_meta.annotation_text);
/* build/test/DCP/dcp_test5 is checked against test/ref/DCP/dcp_test5 by run/tests */
}
xml_meta.issuer = "OpenDCP 0.0.25";
xml_meta.creator = "OpenDCP 0.0.25";
xml_meta.issue_date = "2012-07-17T04:45:18+00:00";
- make_simple("build/test/DCP/dcp_test7")->write_xml (dcp::INTEROP, xml_meta);
+ make_simple("build/test/DCP/dcp_test7")->write_xml(dcp::INTEROP, xml_meta.issuer, xml_meta.creator, xml_meta.issue_date, xml_meta.annotation_text);
/* build/test/DCP/dcp_test7 is checked against test/ref/DCP/dcp_test7 by run/tests */
}
d.add (cpl);
xml_metadata.annotation_text = "Created by libdcp";
- d.write_xml (dcp::SMPTE, xml_metadata, signer);
+ d.write_xml (dcp::SMPTE, xml_metadata.issuer, xml_metadata.creator, xml_metadata.issue_date, xml_metadata.annotation_text, signer);
dcp::DecryptedKDM kdm (
cpl,
dcp::DCP dcp ("build/test/write_interop_subtitle_test3");
dcp.add (cpl);
- dcp.write_xml (dcp::INTEROP, xml_meta);
+ dcp.write_xml (dcp::INTEROP, xml_meta.issuer, xml_meta.creator, xml_meta.issue_date, xml_meta.annotation_text);
check_xml (
dcp::file_to_string("test/ref/write_interop_subtitle_test3/subs.xml"),