summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2012-07-17 16:33:43 +0100
committerCarl Hetherington <cth@carlh.net>2012-07-17 16:33:43 +0100
commit0e7591e3bf95d4abe08d854850b6fc4e411586b0 (patch)
treee65ea79ca879d62051f46fae8686f71620a87d3e /src
parenteaac013b4e68dea48fb2c3070b7c7ca59dfd1b96 (diff)
Various testing tweaks.
Diffstat (limited to 'src')
-rw-r--r--src/asset.cc6
-rw-r--r--src/dcp.cc22
-rw-r--r--src/dcp.h2
-rw-r--r--src/picture_asset.cc6
-rw-r--r--src/sound_asset.cc4
-rw-r--r--src/tags.cc7
-rw-r--r--src/tags.h1
-rw-r--r--src/util.cc4
8 files changed, 26 insertions, 26 deletions
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 << " <Id>urn:uuid:" << _uuid << "</Id>\n"
+ s << " <Asset>\n"
+ << " <Id>urn:uuid:" << _uuid << "</Id>\n"
<< " <AnnotationText>" << filesystem::path(_mxf_path).filename() << "</AnnotationText>\n"
<< " <Hash>" << _digest << "</Hash>\n"
<< " <Size>" << filesystem::file_size(_mxf_path) << "</Size>\n"
- << " <Type>application/mxf</Type>\n";
+ << " <Type>application/mxf</Type>\n"
+ << " </Asset>\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
<< "<CompositionPlaylist xmlns=\"http://www.smpte-ra.org/schemas/429-7/2006/CPL\">\n"
<< " <Id>urn:uuid:" << cpl_uuid << "</Id>\n"
<< " <AnnotationText>" << _name << "</AnnotationText>\n"
- << " <IssueDate>" << _date << "</IssueDate>\n"
- << " <Creator>libdcp " << Tags::instance()->creator << "</Creator>\n"
+ << " <IssueDate>" << Tags::instance()->issue_date << "</IssueDate>\n"
+ << " <Creator>" << Tags::instance()->creator << "</Creator>\n"
<< " <ContentTitleText>" << _name << "</ContentTitleText>\n"
- << " <ContentKind>" << _content_type << "</ContentKind>\n"
+ << " <ContentKind>" << content_type_string (_content_type) << "</ContentKind>\n"
<< " <ContentVersion>\n"
- << " <Id>urn:uri:" << cpl_uuid << "_" << _date << "</Id>\n"
- << " <LabelText>" << cpl_uuid << "_" << _date << "</LabelText>\n"
+ << " <Id>urn:uri:" << cpl_uuid << "_" << Tags::instance()->issue_date << "</Id>\n"
+ << " <LabelText>" << cpl_uuid << "_" << Tags::instance()->issue_date << "</LabelText>\n"
<< " </ContentVersion>\n"
<< " <RatingList/>\n"
<< " <ReelList>\n";
@@ -152,7 +146,7 @@ DCP::write_pkl (string pkl_uuid, string cpl_uuid, string cpl_digest, int cpl_len
<< "<PackingList xmlns=\"http://www.smpte-ra.org/schemas/429-8/2007/PKL\">\n"
<< " <Id>urn:uuid:" << pkl_uuid << "</Id>\n"
<< " <AnnotationText>" << _name << "</AnnotationText>\n"
- << " <IssueDate>" << _date << "</IssueDate>\n"
+ << " <IssueDate>" << Tags::instance()->issue_date << "</IssueDate>\n"
<< " <Issuer>" << Tags::instance()->issuer << "</Issuer>\n"
<< " <Creator>" << Tags::instance()->creator << "</Creator>\n"
<< " <AssetList>\n";
@@ -162,7 +156,7 @@ DCP::write_pkl (string pkl_uuid, string cpl_uuid, string cpl_digest, int cpl_len
}
pkl << " <Asset>\n"
- << " <Id>urn:uuid" << cpl_uuid << "</Id>\n"
+ << " <Id>urn:uuid:" << cpl_uuid << "</Id>\n"
<< " <Hash>" << cpl_digest << "</Hash>\n"
<< " <Size>" << cpl_length << "</Size>\n"
<< " <Type>text/xml</Type>\n"
@@ -201,7 +195,7 @@ DCP::write_assetmap (string cpl_uuid, int cpl_length, string pkl_uuid, int pkl_l
<< " <Id>urn:uuid:" << make_uuid() << "</Id>\n"
<< " <Creator>" << Tags::instance()->creator << "</Creator>\n"
<< " <VolumeCount>1</VolumeCount>\n"
- << " <IssueDate>" << _date << "</IssueDate>\n"
+ << " <IssueDate>" << Tags::instance()->issue_date << "</IssueDate>\n"
<< " <Issuer>" << Tags::instance()->issuer << "</Issuer>\n"
<< " <AssetList>\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<boost::shared_ptr<Asset> > _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 << " <MainPicture>\n"
- << " <Id>" << _uuid << "</Id>\n"
+ << " <Id>urn:uuid:" << _uuid << "</Id>\n"
<< " <AnnotationText>" << filesystem::path(_mxf_path).filename() << "</AnnotationText>\n"
- << " <EditRate>" << _fps << "</EditRate>\n"
+ << " <EditRate>" << _fps << " 1</EditRate>\n"
<< " <IntrinsicDuration>" << _length << "</IntrinsicDuration>\n"
<< " <EntryPoint>0</EntryPoint>\n"
<< " <Duration>" << _length << "</Duration>\n"
- << " <FrameRate>" << _fps << "</FrameRate>\n"
+ << " <FrameRate>" << _fps << " 1</FrameRate>\n"
<< " <ScreenAspectRatio>" << _width << " " << _height << "</ScreenAspectRatio>\n"
<< " </MainPicture>\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 << " <MainSound>\n"
- << " <Id>" << _uuid << "</Id>\n"
+ << " <Id>urn:uuid:" << _uuid << "</Id>\n"
<< " <AnnotationText>" << filesystem::path(_mxf_path).filename() << "</AnnotationText>\n"
- << " <EditRate>" << _fps << "</EditRate>\n"
+ << " <EditRate>" << _fps << " 1</EditRate>\n"
<< " <IntrinsicDuration>" << _length << "</IntrinsicDuration>\n"
<< " <EntryPoint>0</EntryPoint>\n"
<< " <Duration>" << _length << "</Duration>\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 <stdexcept>
#include <sstream>
+#include <iostream>
#include <iomanip>
#include <openssl/sha.h>
#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);
}