From 0e7591e3bf95d4abe08d854850b6fc4e411586b0 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 17 Jul 2012 16:33:43 +0100 Subject: Various testing tweaks. --- src/asset.cc | 6 ++++-- src/dcp.cc | 22 ++++++++-------------- src/dcp.h | 2 -- src/picture_asset.cc | 6 +++--- src/sound_asset.cc | 4 ++-- src/tags.cc | 7 ++++++- src/tags.h | 1 + src/util.cc | 4 ++-- 8 files changed, 26 insertions(+), 26 deletions(-) (limited to 'src') diff --git a/src/asset.cc b/src/asset.cc index d4214d5f..6b4c3fe4 100644 --- a/src/asset.cc +++ b/src/asset.cc @@ -46,11 +46,13 @@ Asset::Asset (string p, int fps, int len) void Asset::write_to_pkl (ostream& s) const { - s << " urn:uuid:" << _uuid << "\n" + s << " \n" + << " urn:uuid:" << _uuid << "\n" << " " << filesystem::path(_mxf_path).filename() << "\n" << " " << _digest << "\n" << " " << filesystem::file_size(_mxf_path) << "\n" - << " application/mxf\n"; + << " application/mxf\n" + << " \n"; } void diff --git a/src/dcp.cc b/src/dcp.cc index 0ba4ed72..758e357b 100644 --- a/src/dcp.cc +++ b/src/dcp.cc @@ -43,12 +43,6 @@ DCP::DCP (string d, string n, ContentType c, int fps, int length) , _fps (fps) , _length (length) { - char buffer[64]; - time_t now; - time (&now); - struct tm* tm = localtime (&now); - strftime (buffer, 64, "%Y-%m-%dT%I:%M:%S+00:00", tm); - _date = string (buffer); } void @@ -105,13 +99,13 @@ DCP::write_cpl (string cpl_uuid) const << "\n" << " urn:uuid:" << cpl_uuid << "\n" << " " << _name << "\n" - << " " << _date << "\n" - << " libdcp " << Tags::instance()->creator << "\n" + << " " << Tags::instance()->issue_date << "\n" + << " " << Tags::instance()->creator << "\n" << " " << _name << "\n" - << " " << _content_type << "\n" + << " " << content_type_string (_content_type) << "\n" << " \n" - << " urn:uri:" << cpl_uuid << "_" << _date << "\n" - << " " << cpl_uuid << "_" << _date << "\n" + << " urn:uri:" << cpl_uuid << "_" << Tags::instance()->issue_date << "\n" + << " " << cpl_uuid << "_" << Tags::instance()->issue_date << "\n" << " \n" << " \n" << " \n"; @@ -152,7 +146,7 @@ DCP::write_pkl (string pkl_uuid, string cpl_uuid, string cpl_digest, int cpl_len << "\n" << " urn:uuid:" << pkl_uuid << "\n" << " " << _name << "\n" - << " " << _date << "\n" + << " " << Tags::instance()->issue_date << "\n" << " " << Tags::instance()->issuer << "\n" << " " << Tags::instance()->creator << "\n" << " \n"; @@ -162,7 +156,7 @@ DCP::write_pkl (string pkl_uuid, string cpl_uuid, string cpl_digest, int cpl_len } pkl << " \n" - << " urn:uuid" << cpl_uuid << "\n" + << " urn:uuid:" << cpl_uuid << "\n" << " " << cpl_digest << "\n" << " " << cpl_length << "\n" << " text/xml\n" @@ -201,7 +195,7 @@ DCP::write_assetmap (string cpl_uuid, int cpl_length, string pkl_uuid, int pkl_l << " urn:uuid:" << make_uuid() << "\n" << " " << Tags::instance()->creator << "\n" << " 1\n" - << " " << _date << "\n" + << " " << Tags::instance()->issue_date << "\n" << " " << Tags::instance()->issuer << "\n" << " \n"; diff --git a/src/dcp.h b/src/dcp.h index 27be9ec6..2c320451 100644 --- a/src/dcp.h +++ b/src/dcp.h @@ -65,8 +65,6 @@ private: int _fps; int _length; std::list > _assets; - - std::string _date; }; } diff --git a/src/picture_asset.cc b/src/picture_asset.cc index 848a2c27..bdf8ce41 100644 --- a/src/picture_asset.cc +++ b/src/picture_asset.cc @@ -80,13 +80,13 @@ void PictureAsset::write_to_cpl (ostream& s) const { s << " \n" - << " " << _uuid << "\n" + << " urn:uuid:" << _uuid << "\n" << " " << filesystem::path(_mxf_path).filename() << "\n" - << " " << _fps << "\n" + << " " << _fps << " 1\n" << " " << _length << "\n" << " 0\n" << " " << _length << "\n" - << " " << _fps << "\n" + << " " << _fps << " 1\n" << " " << _width << " " << _height << "\n" << " \n"; } diff --git a/src/sound_asset.cc b/src/sound_asset.cc index 873b4755..0b22b4f5 100644 --- a/src/sound_asset.cc +++ b/src/sound_asset.cc @@ -120,9 +120,9 @@ void SoundAsset::write_to_cpl (ostream& s) const { s << " \n" - << " " << _uuid << "\n" + << " urn:uuid:" << _uuid << "\n" << " " << filesystem::path(_mxf_path).filename() << "\n" - << " " << _fps << "\n" + << " " << _fps << " 1\n" << " " << _length << "\n" << " 0\n" << " " << _length << "\n" diff --git a/src/tags.cc b/src/tags.cc index 40aeeea3..584d3623 100644 --- a/src/tags.cc +++ b/src/tags.cc @@ -31,7 +31,12 @@ Tags::Tags () , issuer ("libdcp" LIBDCP_VERSION) , creator ("libdcp" LIBDCP_VERSION) { - + char buffer[64]; + time_t now; + time (&now); + struct tm* tm = localtime (&now); + strftime (buffer, 64, "%Y-%m-%dT%I:%M:%S+00:00", tm); + issue_date = string (buffer); } Tags * diff --git a/src/tags.h b/src/tags.h index 036bd4e6..511558f0 100644 --- a/src/tags.h +++ b/src/tags.h @@ -32,6 +32,7 @@ public: std::string product_version; std::string issuer; std::string creator; + std::string issue_date; private: Tags (); diff --git a/src/util.cc b/src/util.cc index e805f3eb..c9f50289 100644 --- a/src/util.cc +++ b/src/util.cc @@ -19,6 +19,7 @@ #include #include +#include #include #include #include "KM_util.h" @@ -75,6 +76,5 @@ libdcp::make_digest (string filename) stringstream s; char digest[64]; - s << setfill('0') << setw(36) << Kumu::base64encode (byte_buffer, 20, digest, 64); - return s.str (); + return Kumu::base64encode (byte_buffer, 20, digest, 64); } -- cgit v1.2.3