Various testing tweaks.
authorCarl Hetherington <cth@carlh.net>
Tue, 17 Jul 2012 15:33:43 +0000 (16:33 +0100)
committerCarl Hetherington <cth@carlh.net>
Tue, 17 Jul 2012 15:33:43 +0000 (16:33 +0100)
20 files changed:
run-tests.sh
src/asset.cc
src/dcp.cc
src/dcp.h
src/picture_asset.cc
src/sound_asset.cc
src/tags.cc
src/tags.h
src/util.cc
test/ref/DCP/02020202-0202-0202-0202-020202020202_cpl.xml [deleted file]
test/ref/DCP/04040404-0404-0404-0404-040404040404_pkl.xml [deleted file]
test/ref/DCP/8e293965-f8ad-48c6-971d-261b01f65cdb_pkl.xml [new file with mode: 0644]
test/ref/DCP/ASSETMAP.xml
test/ref/DCP/audio.mxf
test/ref/DCP/df0e4141-13c3-4a7a-bef8-b5a04fcbc4bb_cpl.xml [new file with mode: 0644]
test/ref/DCP/video.dump [deleted file]
test/ref/DCP/video.mxf
test/ref/make.py [new file with mode: 0755]
test/ref/make.sh [deleted file]
test/tests.cc

index a44ccea09ea9dbc1b321719c3e02ba4f45986aa5..a837a287e7cc4903f53bf3b844c24cf4eea382bd 100755 (executable)
@@ -2,5 +2,5 @@
 
 LD_LIBRARY_PATH=build/src:build/asdcplib/src
 build/test/tests
-#diff -ur build/test/foo test/ref/DCP
+diff -ur build/test/foo test/ref/DCP
  
\ No newline at end of file
index d4214d5fca4729c624c9f52262dbebfa3a06a608..6b4c3fe4c655ce140a043ec12b41d2500a1ac304 100644 (file)
@@ -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
index 0ba4ed72aed824ab5c9ea283477b14a2c7db27dd..758e357bc1805cb9df4727e2149ea6fe9376fa67 100644 (file)
@@ -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";
 
index 27be9ec63bd76c9c45d2b0892321c0b23cfaf720..2c320451a9b21353c59db1637e186d76ce1b32e5 100644 (file)
--- 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;
 };
 
 }
index 848a2c270c0ed149643e1e30a4119710d2f40073..bdf8ce419e23f8fcb8d8df0f153a2797ed3c2e0a 100644 (file)
@@ -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";
 }
index 873b475549ae7fa544c11e7565542ab405136d54..0b22b4f5cb03c025df804743a8ef34c3e3d5e281 100644 (file)
@@ -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"
index 40aeeea362ba29881eb6a67cde283b82017699b6..584d36237bfd6f65f280a28dff6cab08ad84cae8 100644 (file)
@@ -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 *
index 036bd4e6306c707ffc536e2260324c17ca71fc18..511558f0d22c7197ac8364e0fdae63d432e5e71a 100644 (file)
@@ -32,6 +32,7 @@ public:
        std::string product_version;
        std::string issuer;
        std::string creator;
+       std::string issue_date;
 
 private:
        Tags ();
index e805f3eb876010c61e6c4b57678b2c87f714f7a6..c9f50289626899fadc0e40446f7abc79557d057d 100644 (file)
@@ -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);
 }
diff --git a/test/ref/DCP/02020202-0202-0202-0202-020202020202_cpl.xml b/test/ref/DCP/02020202-0202-0202-0202-020202020202_cpl.xml
deleted file mode 100644 (file)
index cc5e933..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<CompositionPlaylist xmlns="http://www.smpte-ra.org/schemas/429-7/2006/CPL">
-  <Id>urn:uuid:488d58ab-474e-4b01-a2cb-a6ce1e5e70b3</Id>
-  <AnnotationText>A Test DCP</AnnotationText>
-  <IssueDate>2012-07-16T06:28:27+00:00</IssueDate>
-  <Creator>OpenDCP 0.0.25</Creator>
-  <ContentTitleText>A Test DCP</ContentTitleText>
-  <ContentKind>feature</ContentKind>
-  <ContentVersion>
-    <Id>urn:uri:488d58ab-474e-4b01-a2cb-a6ce1e5e70b3_2012-07-16T06:28:27+00:00</Id>
-    <LabelText>488d58ab-474e-4b01-a2cb-a6ce1e5e70b3_2012-07-16T06:28:27+00:00</LabelText>
-  </ContentVersion>
-  <RatingList/>
-  <ReelList>
-    <Reel>
-      <Id>urn:uuid:b4f8f14e-63d9-4d34-9b8d-11d158d77115</Id>
-      <AssetList>
-        <MainPicture>
-          <Id>urn:uuid:0a2335fe-09a3-4a19-b5ea-2e0308e727b3</Id>
-          <AnnotationText>video.mxf</AnnotationText>
-          <EditRate>24 1</EditRate>
-          <IntrinsicDuration>24</IntrinsicDuration>
-          <EntryPoint>0</EntryPoint>
-          <Duration>24</Duration>
-          <FrameRate>24 1</FrameRate>
-          <ScreenAspectRatio>32 32</ScreenAspectRatio>
-        </MainPicture>
-        <MainSound>
-          <Id>urn:uuid:ac884d5a-1d72-425b-a45b-d0c0bce4f6f4</Id>
-          <AnnotationText>audio.mxf</AnnotationText>
-          <EditRate>24 1</EditRate>
-          <IntrinsicDuration>24</IntrinsicDuration>
-          <EntryPoint>0</EntryPoint>
-          <Duration>24</Duration>
-        </MainSound>
-      </AssetList>
-    </Reel>
-  </ReelList>
-</CompositionPlaylist>
diff --git a/test/ref/DCP/04040404-0404-0404-0404-040404040404_pkl.xml b/test/ref/DCP/04040404-0404-0404-0404-040404040404_pkl.xml
deleted file mode 100644 (file)
index 76f1292..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<PackingList xmlns="http://www.smpte-ra.org/schemas/429-8/2007/PKL">
-  <Id>urn:uuid:caaf9bfe-2a00-4b95-b6d3-d6c0b181e17b</Id>
-  <AnnotationText>A Test DCP</AnnotationText>
-  <IssueDate>2012-07-16T06:28:27+00:00</IssueDate>
-  <Issuer>OpenDCP 0.0.25</Issuer>
-  <Creator>OpenDCP 0.0.25</Creator>
-  <AssetList>
-    <Asset>
-      <Id>urn:uuid:0a2335fe-09a3-4a19-b5ea-2e0308e727b3</Id>
-      <AnnotationText>video.mxf</AnnotationText>
-      <Hash>ETDlJzvJT98gAc2Y84/4AoXQuhs=</Hash>
-      <Size>26080</Size>
-      <Type>application/mxf</Type>
-    </Asset>
-    <Asset>
-      <Id>urn:uuid:ac884d5a-1d72-425b-a45b-d0c0bce4f6f4</Id>
-      <AnnotationText>audio.mxf</AnnotationText>
-      <Hash>duYsdzeBVwuv5EfxvLmshyBQdo0=</Hash>
-      <Size>305326</Size>
-      <Type>application/mxf</Type>
-    </Asset>
-    <Asset>
-      <Id>urn:uuid:488d58ab-474e-4b01-a2cb-a6ce1e5e70b3</Id>
-      <Hash>RanewioDBtecLpvB7W2v/g9/vos=</Hash>
-      <Size>1526</Size>
-      <Type>text/xml</Type>
-    </Asset>
-  </AssetList>
-</PackingList>
diff --git a/test/ref/DCP/8e293965-f8ad-48c6-971d-261b01f65cdb_pkl.xml b/test/ref/DCP/8e293965-f8ad-48c6-971d-261b01f65cdb_pkl.xml
new file mode 100644 (file)
index 0000000..e8342cc
--- /dev/null
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<PackingList xmlns="http://www.smpte-ra.org/schemas/429-8/2007/PKL">
+  <Id>urn:uuid:8e293965-f8ad-48c6-971d-261b01f65cdb</Id>
+  <AnnotationText>A Test DCP</AnnotationText>
+  <IssueDate>2012-07-17T04:32:07+00:00</IssueDate>
+  <Issuer>OpenDCP 0.0.25</Issuer>
+  <Creator>OpenDCP 0.0.25</Creator>
+  <AssetList>
+    <Asset>
+      <Id>urn:uuid:81fb54df-e1bf-4647-8788-ea7ba154375b</Id>
+      <AnnotationText>video.mxf</AnnotationText>
+      <Hash>4jimd5RaYhFS0ENh6tUTnjMqN/M=</Hash>
+      <Size>26080</Size>
+      <Type>application/mxf</Type>
+    </Asset>
+    <Asset>
+      <Id>urn:uuid:c38bdd62-ce03-4988-8603-195f134207c7</Id>
+      <AnnotationText>audio.mxf</AnnotationText>
+      <Hash>6YhrUkOvm46kYdhrgDuKNvfa9uA=</Hash>
+      <Size>305326</Size>
+      <Type>application/mxf</Type>
+    </Asset>
+    <Asset>
+      <Id>urn:uuid:df0e4141-13c3-4a7a-bef8-b5a04fcbc4bb</Id>
+      <Hash>DR62woRxafHQcqScRIHQd6hChFU=</Hash>
+      <Size>1526</Size>
+      <Type>text/xml</Type>
+    </Asset>
+  </AssetList>
+</PackingList>
index dff8685553a152a36bb34b49fdc7f6faa5a2dca1..cf84577283eae80158d7f79d361301fcb0f2b1d4 100644 (file)
@@ -1,17 +1,17 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <AssetMap xmlns="http://www.smpte-ra.org/schemas/429-9/2007/AM">
-  <Id>urn:uuid:7193f3d3-4083-4e4d-9a35-b108dad4e305</Id>
+  <Id>urn:uuid:18be072e-5a0f-44e1-b2eb-c8a52ae12789</Id>
   <Creator>OpenDCP 0.0.25</Creator>
   <VolumeCount>1</VolumeCount>
-  <IssueDate>2012-07-16T06:28:27+00:00</IssueDate>
+  <IssueDate>2012-07-17T04:32:07+00:00</IssueDate>
   <Issuer>OpenDCP 0.0.25</Issuer>
   <AssetList>
     <Asset>
-      <Id>urn:uuid:caaf9bfe-2a00-4b95-b6d3-d6c0b181e17b</Id>
+      <Id>urn:uuid:8e293965-f8ad-48c6-971d-261b01f65cdb</Id>
       <PackingList>true</PackingList>
       <ChunkList>
         <Chunk>
-          <Path>caaf9bfe-2a00-4b95-b6d3-d6c0b181e17b_pkl.xml</Path>
+          <Path>8e293965-f8ad-48c6-971d-261b01f65cdb_pkl.xml</Path>
           <VolumeIndex>1</VolumeIndex>
           <Offset>0</Offset>
           <Length>1049</Length>
       </ChunkList>
     </Asset>
     <Asset>
-      <Id>urn:uuid:488d58ab-474e-4b01-a2cb-a6ce1e5e70b3</Id>
+      <Id>urn:uuid:df0e4141-13c3-4a7a-bef8-b5a04fcbc4bb</Id>
       <ChunkList>
         <Chunk>
-          <Path>488d58ab-474e-4b01-a2cb-a6ce1e5e70b3_cpl.xml</Path>
+          <Path>df0e4141-13c3-4a7a-bef8-b5a04fcbc4bb_cpl.xml</Path>
           <VolumeIndex>1</VolumeIndex>
           <Offset>0</Offset>
           <Length>1526</Length>
@@ -30,7 +30,7 @@
       </ChunkList>
     </Asset>
     <Asset>
-      <Id>urn:uuid:0a2335fe-09a3-4a19-b5ea-2e0308e727b3</Id>
+      <Id>urn:uuid:81fb54df-e1bf-4647-8788-ea7ba154375b</Id>
       <ChunkList>
         <Chunk>
           <Path>video.mxf</Path>
@@ -41,7 +41,7 @@
       </ChunkList>
     </Asset>
     <Asset>
-      <Id>urn:uuid:ac884d5a-1d72-425b-a45b-d0c0bce4f6f4</Id>
+      <Id>urn:uuid:c38bdd62-ce03-4988-8603-195f134207c7</Id>
       <ChunkList>
         <Chunk>
           <Path>audio.mxf</Path>
index 06e9438d2d95a0f1a1ea8c3398ac0e819553b713..a945da6df35b1f8d12bb262c269d180a2ba6a8d1 100644 (file)
Binary files a/test/ref/DCP/audio.mxf and b/test/ref/DCP/audio.mxf differ
diff --git a/test/ref/DCP/df0e4141-13c3-4a7a-bef8-b5a04fcbc4bb_cpl.xml b/test/ref/DCP/df0e4141-13c3-4a7a-bef8-b5a04fcbc4bb_cpl.xml
new file mode 100644 (file)
index 0000000..27fdc5b
--- /dev/null
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<CompositionPlaylist xmlns="http://www.smpte-ra.org/schemas/429-7/2006/CPL">
+  <Id>urn:uuid:df0e4141-13c3-4a7a-bef8-b5a04fcbc4bb</Id>
+  <AnnotationText>A Test DCP</AnnotationText>
+  <IssueDate>2012-07-17T04:32:07+00:00</IssueDate>
+  <Creator>OpenDCP 0.0.25</Creator>
+  <ContentTitleText>A Test DCP</ContentTitleText>
+  <ContentKind>feature</ContentKind>
+  <ContentVersion>
+    <Id>urn:uri:df0e4141-13c3-4a7a-bef8-b5a04fcbc4bb_2012-07-17T04:32:07+00:00</Id>
+    <LabelText>df0e4141-13c3-4a7a-bef8-b5a04fcbc4bb_2012-07-17T04:32:07+00:00</LabelText>
+  </ContentVersion>
+  <RatingList/>
+  <ReelList>
+    <Reel>
+      <Id>urn:uuid:e4456baa-d4d6-42f6-bfc6-1cf748582227</Id>
+      <AssetList>
+        <MainPicture>
+          <Id>urn:uuid:81fb54df-e1bf-4647-8788-ea7ba154375b</Id>
+          <AnnotationText>video.mxf</AnnotationText>
+          <EditRate>24 1</EditRate>
+          <IntrinsicDuration>24</IntrinsicDuration>
+          <EntryPoint>0</EntryPoint>
+          <Duration>24</Duration>
+          <FrameRate>24 1</FrameRate>
+          <ScreenAspectRatio>32 32</ScreenAspectRatio>
+        </MainPicture>
+        <MainSound>
+          <Id>urn:uuid:c38bdd62-ce03-4988-8603-195f134207c7</Id>
+          <AnnotationText>audio.mxf</AnnotationText>
+          <EditRate>24 1</EditRate>
+          <IntrinsicDuration>24</IntrinsicDuration>
+          <EntryPoint>0</EntryPoint>
+          <Duration>24</Duration>
+        </MainSound>
+      </AssetList>
+    </Reel>
+  </ReelList>
+</CompositionPlaylist>
diff --git a/test/ref/DCP/video.dump b/test/ref/DCP/video.dump
deleted file mode 100644 (file)
index c01dfd7..0000000
+++ /dev/null
@@ -1,302 +0,0 @@
-Dump an MXF file using MXFLib
-- using dictionary "dict.xml"
-
-Partition at 0x00000000 is for BodySID 0x0000
-ClosedCompleteHeader
-  MajorVersion = 1
-  MinorVersion = 2
-  KAGSize = 1
-  ThisPartition = 0
-  PreviousPartition = 0
-  FooterPartition = 25476
-  HeaderByteCount = 16244
-  IndexByteCount = 0
-  IndexSID = 0
-  BodyOffset = 0
-  BodySID = 0
-  OperationalPattern = MXF Specialized OP Atom
-  EssenceContainers
-    EssenceContainer = MXF-GC Generic Essence Multiple Mappings
-    EssenceContainer = MXF-GC JPEG-2000 Picture Mappings
-
-Header Metadata:
-  Preface
-    InstanceUID = {772726eb-422b-478c-869c-679e550ee103}
-    LastModifiedDate = 2012-07-16 17:28:27.000
-    Version = 258
-    ObjectModelVersion = 0
-    PrimaryPackage -> Weak Reference to SourcePackage
-    Identifications
-      Identification = {7079b446-6e8c-4bfb-91d6-8e2053a0b4c2}
-      Identification -> Strong Reference to Identification
-        Identification
-          InstanceUID = {7079b446-6e8c-4bfb-91d6-8e2053a0b4c2}
-          ThisGenerationUID = {4f2bd67b-f257-4ed9-ac9d-6956bbe61c36}
-          CompanyName = OpenDCP
-          ProductName = OpenDCP
-          ProductVersion = Major="0", Minor="0", Patch="0", Build="0", Release="VersionUnknown"
-          VersionString = 0.0.25
-          ProductUID = {43059a1d-0432-4101-b83f-736815acf31d}
-          ModificationDate = 2012-07-16 17:28:27.000
-          ToolkitVersion = Major="1", Minor="8", Patch="44", Build="27240", Release="VersionReleased"
-          Platform = unix
-    ContentStorage = {f11189d2-31a5-4c7b-8608-59ff5d340245}
-    ContentStorage -> Strong Reference to ContentStorage
-      ContentStorage
-        InstanceUID = {f11189d2-31a5-4c7b-8608-59ff5d340245}
-        Packages
-          Package = {80a78644-dda6-43d7-a55b-77c4fec29654}
-          Package -> Strong Reference to MaterialPackage
-            MaterialPackage
-              InstanceUID = {80a78644-dda6-43d7-a55b-77c4fec29654}
-              PackageUID = [060a2b34.0101.0105.01010f20],13,00,00,00,{2542c57c-5a87-4834-918b-9f09153e10ca}
-              Name = AS-DCP Material Package
-              PackageCreationDate = 2012-07-16 17:28:27.000
-              PackageModifiedDate = 2012-07-16 17:28:27.000
-              Tracks
-                Tracks_Item = {79f6d86f-3f08-40b3-943b-e7e3b1819209}
-                Tracks_Item -> Strong Reference to Track
-                  Track
-                    InstanceUID = {79f6d86f-3f08-40b3-943b-e7e3b1819209}
-                    TrackID = 1
-                    TrackNumber = 0
-                    TrackName = Timecode Track
-                    Sequence = {6964beaf-d7fc-4f74-8d58-6a095850df00}
-                    Sequence -> Strong Reference to Sequence
-                      Sequence
-                        InstanceUID = {6964beaf-d7fc-4f74-8d58-6a095850df00}
-                        DataDefinition = SMPTE 12M Timecode Track
-                        Duration = 24
-                        StructuralComponents
-                          StructuralComponent = {9c28304b-6293-4651-8e20-ba11db057222}
-                          StructuralComponent -> Strong Reference to TimecodeComponent
-                            TimecodeComponent
-                              InstanceUID = {9c28304b-6293-4651-8e20-ba11db057222}
-                              DataDefinition = SMPTE 12M Timecode Track
-                              Duration = 24
-                              RoundedTimecodeBase = 24
-                              StartTimecode = 0
-                              DropFrame = 0
-                    EditRate = 24/1
-                    Origin = 0
-                Tracks_Item = {4cc1735a-c2e5-40c5-a3d8-4699d9d8f28a}
-                Tracks_Item -> Strong Reference to Track
-                  Track
-                    InstanceUID = {4cc1735a-c2e5-40c5-a3d8-4699d9d8f28a}
-                    TrackID = 2
-                    TrackNumber = 0
-                    TrackName = Picture Track
-                    Sequence = {85182d60-83d9-490d-9a6e-9939ea88593b}
-                    Sequence -> Strong Reference to Sequence
-                      Sequence
-                        InstanceUID = {85182d60-83d9-490d-9a6e-9939ea88593b}
-                        DataDefinition = Picture Essence Track
-                        Duration = 24
-                        StructuralComponents
-                          StructuralComponent = {8d1a4bab-3854-4110-a6c6-a8658947859e}
-                          StructuralComponent -> Strong Reference to SourceClip
-                            SourceClip
-                              InstanceUID = {8d1a4bab-3854-4110-a6c6-a8658947859e}
-                              DataDefinition = Picture Essence Track
-                              Duration = 24
-                              StartPosition = 0
-                              SourcePackageID = [060a2b34.0101.0105.01010f20],13,00,00,00,{0a2335fe-09a3-4a19-b5ea-2e0308e727b3}
-                              SourceTrackID = 2
-                    EditRate = 24/1
-                    Origin = 0
-          Package = {24569e0a-10e9-42b5-bbb6-c81b76ec6c7e}
-          Package -> Strong Reference to SourcePackage
-            SourcePackage
-              InstanceUID = {24569e0a-10e9-42b5-bbb6-c81b76ec6c7e}
-              PackageUID = [060a2b34.0101.0105.01010f20],13,00,00,00,{0a2335fe-09a3-4a19-b5ea-2e0308e727b3}
-              Name = File Package: SMPTE 429-4 frame wrapping of JPEG 2000 codestreams
-              PackageCreationDate = 2012-07-16 17:28:27.000
-              PackageModifiedDate = 2012-07-16 17:28:27.000
-              Tracks
-                Tracks_Item = {072c2857-9116-4802-98bb-1c585580baae}
-                Tracks_Item -> Strong Reference to Track
-                  Track
-                    InstanceUID = {072c2857-9116-4802-98bb-1c585580baae}
-                    TrackID = 1
-                    TrackNumber = 0
-                    TrackName = Timecode Track
-                    Sequence = {82f075be-eb53-47c2-b6d6-5aa053756248}
-                    Sequence -> Strong Reference to Sequence
-                      Sequence
-                        InstanceUID = {82f075be-eb53-47c2-b6d6-5aa053756248}
-                        DataDefinition = SMPTE 12M Timecode Track
-                        Duration = 24
-                        StructuralComponents
-                          StructuralComponent = {29dc1968-3487-4ef2-a156-949afe99fdab}
-                          StructuralComponent -> Strong Reference to TimecodeComponent
-                            TimecodeComponent
-                              InstanceUID = {29dc1968-3487-4ef2-a156-949afe99fdab}
-                              DataDefinition = SMPTE 12M Timecode Track
-                              Duration = 24
-                              RoundedTimecodeBase = 24
-                              StartTimecode = 86400
-                              DropFrame = 0
-                    EditRate = 24/1
-                    Origin = 0
-                Tracks_Item = {f2f685f0-25f5-4d65-9592-7f511c730706}
-                Tracks_Item -> Strong Reference to Track
-                  Track
-                    InstanceUID = {f2f685f0-25f5-4d65-9592-7f511c730706}
-                    TrackID = 2
-                    TrackNumber = 352389121
-                    TrackName = Picture Track
-                    Sequence = {90bbbbca-9042-4244-9db2-939c83cd1a84}
-                    Sequence -> Strong Reference to Sequence
-                      Sequence
-                        InstanceUID = {90bbbbca-9042-4244-9db2-939c83cd1a84}
-                        DataDefinition = Picture Essence Track
-                        Duration = 24
-                        StructuralComponents
-                          StructuralComponent = {f1f17679-2c07-458c-af0d-cfdadde6a705}
-                          StructuralComponent -> Strong Reference to SourceClip
-                            SourceClip
-                              InstanceUID = {f1f17679-2c07-458c-af0d-cfdadde6a705}
-                              DataDefinition = Picture Essence Track
-                              Duration = 24
-                              StartPosition = 0
-                              SourcePackageID = [00000000.0000.0000.00000000],00,00,00,00,[00000000.0000.0000.00000000.00000000]
-                              SourceTrackID = 0
-                    EditRate = 24/1
-                    Origin = 0
-              Descriptor = {d33fd7d1-a6ce-4f9f-ade5-db60bf89e34b}
-              Descriptor -> Strong Reference to RGBAEssenceDescriptor
-                RGBAEssenceDescriptor
-                  InstanceUID = {d33fd7d1-a6ce-4f9f-ade5-db60bf89e34b}
-                  SubDescriptors
-                    SubDescriptor = {d4700ab9-4c69-44d1-a849-8920b60b017e}
-                    SubDescriptor -> Strong Reference to JPEG2000PictureSubDescriptor
-                      JPEG2000PictureSubDescriptor
-                        InstanceUID = {d4700ab9-4c69-44d1-a849-8920b60b017e}
-                        Rsiz = 3
-                        Xsiz = 32
-                        Ysiz = 32
-                        XOsiz = 0
-                        YOsiz = 0
-                        XTsiz = 32
-                        YTsiz = 32
-                        XTOsiz = 0
-                        YTOsiz = 0
-                        Csiz = 3
-                        PictureComponentSizing
-                          PictureComponentSize = Ssiz="7", XRsiz="1", YRsiz="1"
-                          PictureComponentSize = Ssiz="7", XRsiz="1", YRsiz="1"
-                          PictureComponentSize = Ssiz="7", XRsiz="1", YRsiz="1"
-                        CodingStyleDefault = Scod="1", SGcod="ProgressionOrder="4", NumberOfLayers="1", MultipleComponentTransformation="1"", SPcod="DecompositionLevels="5", CodeblockWidth="3", CodeblockHeight="3", CodeblockStyle="0", Transformation="0"", PrecinctSize="119, 136, 136, 136, 136, 136"
-                        QuantizationDefault = Sqcd="66", SPqcd="119, 32, 118, 240, 118, 240, 118, 192, 111, 0, 111, 0, 110, 224, 103, 80, 103, 80, 103, 104, 80, 5, 80, 5, 80, 71, 87, 211, 87, 211, 87, 98"
-                  LinkedTrackID = 2
-                  SampleRate = 24/1
-                  ContainerDuration = 24
-                  EssenceContainer = MXF-GC JPEG-2000 Picture Mappings
-                  FrameLayout = 0
-                  StoredWidth = 32
-                  StoredHeight = 32
-                  AspectRatio = 32/32
-                  PictureEssenceCoding = [060e2b34.0401.0109.04010202.03010103]
-                  ComponentMaxRef = 4095
-                  ComponentMinRef = 0
-        EssenceContainerData
-          EssenceContainer = {7d384edf-2ff0-4b50-ab06-9165947b289b}
-          EssenceContainer -> Strong Reference to EssenceContainerData
-            EssenceContainerData
-              InstanceUID = {7d384edf-2ff0-4b50-ab06-9165947b289b}
-              LinkedPackageUID = [060a2b34.0101.0105.01010f20],13,00,00,00,{0a2335fe-09a3-4a19-b5ea-2e0308e727b3}
-              IndexSID = 129
-              BodySID = 1
-    OperationalPattern = MXF Specialized OP Atom
-    EssenceContainers
-      EssenceContainer = MXF-GC Generic Essence Multiple Mappings
-      EssenceContainer = MXF-GC JPEG-2000 Picture Mappings
-    DMSchemes
-
-No index table in this partition
-
-Partition at 0x00004000 is for BodySID 0x0001
-
-Partition at 0x00006384 is for BodySID 0x0000
-CompleteFooter
-  MajorVersion = 1
-  MinorVersion = 2
-  KAGSize = 1
-  ThisPartition = 25476
-  PreviousPartition = 16384
-  FooterPartition = 25476
-  HeaderByteCount = 0
-  IndexByteCount = 404
-  IndexSID = 129
-  BodyOffset = 0
-  BodySID = 0
-  OperationalPattern = MXF Specialized OP Atom
-  EssenceContainers
-    EssenceContainer = MXF-GC Generic Essence Multiple Mappings
-    EssenceContainer = MXF-GC JPEG-2000 Picture Mappings
-No header metadata in this partition
-
-Index Table Segment (first edit unit = 0, duration = 24) :
-  Indexing BodySID 0x0001 from IndexSID 0x0081
-
- Bytestream Order:
-  EditUnit   0 for stream 0 is at 0x00000000, Flags=00  *Exact*
-  EditUnit   1 for stream 0 is at 0x00000175, Flags=00  *Exact*
-  EditUnit   2 for stream 0 is at 0x000002ea, Flags=00  *Exact*
-  EditUnit   3 for stream 0 is at 0x0000045f, Flags=00  *Exact*
-  EditUnit   4 for stream 0 is at 0x000005d4, Flags=00  *Exact*
-  EditUnit   5 for stream 0 is at 0x00000749, Flags=00  *Exact*
-  EditUnit   6 for stream 0 is at 0x000008be, Flags=00  *Exact*
-  EditUnit   7 for stream 0 is at 0x00000a33, Flags=00  *Exact*
-  EditUnit   8 for stream 0 is at 0x00000ba8, Flags=00  *Exact*
-  EditUnit   9 for stream 0 is at 0x00000d1d, Flags=00  *Exact*
-  EditUnit  10 for stream 0 is at 0x00000e92, Flags=00  *Exact*
-  EditUnit  11 for stream 0 is at 0x00001007, Flags=00  *Exact*
-  EditUnit  12 for stream 0 is at 0x0000117c, Flags=00  *Exact*
-  EditUnit  13 for stream 0 is at 0x000012f1, Flags=00  *Exact*
-  EditUnit  14 for stream 0 is at 0x00001466, Flags=00  *Exact*
-  EditUnit  15 for stream 0 is at 0x000015db, Flags=00  *Exact*
-  EditUnit  16 for stream 0 is at 0x00001750, Flags=00  *Exact*
-  EditUnit  17 for stream 0 is at 0x000018c5, Flags=00  *Exact*
-  EditUnit  18 for stream 0 is at 0x00001a3a, Flags=00  *Exact*
-  EditUnit  19 for stream 0 is at 0x00001baf, Flags=00  *Exact*
-  EditUnit  20 for stream 0 is at 0x00001d24, Flags=00  *Exact*
-  EditUnit  21 for stream 0 is at 0x00001e99, Flags=00  *Exact*
-  EditUnit  22 for stream 0 is at 0x0000200e, Flags=00  *Exact*
-  EditUnit  23 for stream 0 is at 0x00002183, Flags=00  *Exact*
-
- Presentation Order:
-  EditUnit   0 for stream 0 is at 0x00000000, Flags=00  *Exact*
-  EditUnit   1 for stream 0 is at 0x00000175, Flags=00  *Exact*
-  EditUnit   2 for stream 0 is at 0x000002ea, Flags=00  *Exact*
-  EditUnit   3 for stream 0 is at 0x0000045f, Flags=00  *Exact*
-  EditUnit   4 for stream 0 is at 0x000005d4, Flags=00  *Exact*
-  EditUnit   5 for stream 0 is at 0x00000749, Flags=00  *Exact*
-  EditUnit   6 for stream 0 is at 0x000008be, Flags=00  *Exact*
-  EditUnit   7 for stream 0 is at 0x00000a33, Flags=00  *Exact*
-  EditUnit   8 for stream 0 is at 0x00000ba8, Flags=00  *Exact*
-  EditUnit   9 for stream 0 is at 0x00000d1d, Flags=00  *Exact*
-  EditUnit  10 for stream 0 is at 0x00000e92, Flags=00  *Exact*
-  EditUnit  11 for stream 0 is at 0x00001007, Flags=00  *Exact*
-  EditUnit  12 for stream 0 is at 0x0000117c, Flags=00  *Exact*
-  EditUnit  13 for stream 0 is at 0x000012f1, Flags=00  *Exact*
-  EditUnit  14 for stream 0 is at 0x00001466, Flags=00  *Exact*
-  EditUnit  15 for stream 0 is at 0x000015db, Flags=00  *Exact*
-  EditUnit  16 for stream 0 is at 0x00001750, Flags=00  *Exact*
-  EditUnit  17 for stream 0 is at 0x000018c5, Flags=00  *Exact*
-  EditUnit  18 for stream 0 is at 0x00001a3a, Flags=00  *Exact*
-  EditUnit  19 for stream 0 is at 0x00001baf, Flags=00  *Exact*
-  EditUnit  20 for stream 0 is at 0x00001d24, Flags=00  *Exact*
-  EditUnit  21 for stream 0 is at 0x00001e99, Flags=00  *Exact*
-  EditUnit  22 for stream 0 is at 0x0000200e, Flags=00  *Exact*
-  EditUnit  23 for stream 0 is at 0x00002183, Flags=00  *Exact*
-
-Read RIP
-  BodySID 0x0000 is at 0x00000000 and is not loaded
-  BodySID 0x0001 is at 0x00004000 and is not loaded
-  BodySID 0x0000 is at 0x00006384 and is not loaded
-
-Scanned RIP
-  BodySID 0x0000 is at 0x00000000 type ClosedCompleteHeader
-  BodySID 0x0001 is at 0x00004000 type ClosedCompleteBodyPartition
-  BodySID 0x0000 is at 0x00006384 type CompleteFooter
index 9b11f99eb93d5d7124d8d0f275b99e8358de9c96..d71cf1e3f634d8fddf9578b786bbe5fea77a3de0 100644 (file)
Binary files a/test/ref/DCP/video.mxf and b/test/ref/DCP/video.mxf differ
diff --git a/test/ref/make.py b/test/ref/make.py
new file mode 100755 (executable)
index 0000000..013a7c2
--- /dev/null
@@ -0,0 +1,75 @@
+#!/usr/bin/python
+
+import os
+import sys
+import fileinput
+from lxml import etree
+
+def replace(l, a, b):
+    return l.replace(a, b)
+
+assetmap_namespace = 'http://www.smpte-ra.org/schemas/429-9/2007/AM'
+cpl_namespace = 'http://www.smpte-ra.org/schemas/429-7/2006/CPL'
+
+wanted_cpl_id = 'df0e4141-13c3-4a7a-bef8-b5a04fcbc4bb'
+wanted_pkl_id = '8e293965-f8ad-48c6-971d-261b01f65cdb'
+wanted_assetmap_id = '18be072e-5a0f-44e1-b2eb-c8a52ae12789'
+wanted_video_mxf_id = '81fb54df-e1bf-4647-8788-ea7ba154375b'
+wanted_audio_mxf_id = 'c38bdd62-ce03-4988-8603-195f134207c7'
+
+os.system('rm -rf DCP')
+os.mkdir('DCP')
+os.system('opendcp_mxf -i j2c -o DCP/video.mxf -r 24')
+os.system('opendcp_mxf -i wav -o DCP/audio.mxf -r 24')
+os.system('opendcp_xml --reel DCP/video.mxf DCP/audio.mxf -k feature -t "A Test DCP" -a "A Test DCP"')
+os.system('mv *.xml DCP')
+
+cpl_id = None
+pkl_id = None
+assetmap_id = None
+
+for r, d, f in os.walk('DCP'):
+    for n in f:
+        if n.endswith('cpl.xml'):
+            cpl_id = n[0:-8]
+        elif n.endswith('pkl.xml'):
+            pkl_id = n[0:-8]
+
+os.rename('DCP/%s_cpl.xml' % cpl_id, 'DCP/%s_cpl.xml' % wanted_cpl_id)
+os.rename('DCP/%s_pkl.xml' % pkl_id, 'DCP/%s_pkl.xml' % wanted_pkl_id)
+
+xml = etree.parse('DCP/ASSETMAP.xml')
+assetmap_id = xml.getroot().find('{%s}Id' % assetmap_namespace).text
+assetmap_id = assetmap_id.replace('urn:uuid:', '')
+
+def cpl_name(s):
+    return '{%s}%s' % (cpl_namespace, s)
+
+xml = etree.parse('DCP/%s_cpl.xml' % wanted_cpl_id)
+
+video_mxf_id = xml.getroot().find(cpl_name('ReelList')).    \
+                             find(cpl_name('Reel')).        \
+                             find(cpl_name('AssetList')).   \
+                             find(cpl_name('MainPicture')). \
+                             find(cpl_name('Id')).text
+video_mxf_id = video_mxf_id.replace('urn:uuid:', '')
+
+audio_mxf_id = xml.getroot().find(cpl_name('ReelList')).    \
+                             find(cpl_name('Reel')).        \
+                             find(cpl_name('AssetList')).   \
+                             find(cpl_name('MainSound')). \
+                             find(cpl_name('Id')).text
+audio_mxf_id = audio_mxf_id.replace('urn:uuid:', '')
+
+for r, d, f in os.walk('DCP'):
+    for n in f:
+        if n.endswith('.xml'):
+            for line in fileinput.input(os.path.join(r, n), inplace = 1):
+                line = replace(line, cpl_id, wanted_cpl_id)
+                line = replace(line, pkl_id, wanted_pkl_id)
+                line = replace(line, assetmap_id, wanted_assetmap_id)
+                line = replace(line, video_mxf_id, wanted_video_mxf_id)
+                line = replace(line, audio_mxf_id, wanted_audio_mxf_id)
+                print line,
+                
+
diff --git a/test/ref/make.sh b/test/ref/make.sh
deleted file mode 100644 (file)
index 1d04e24..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/sh
-
-rm -rf DCP
-mkdir DCP
-opendcp_mxf -i j2c -o DCP/video.mxf -r 24
-opendcp_mxf -i wav -o DCP/audio.mxf -r 24
-opendcp_xml --reel DCP/video.mxf DCP/audio.mxf -k feature -t "A Test DCP" -a "A Test DCP"
-mv *.xml DCP
-mv DCP/*_pkl.xml DCP/04040404-0404-0404-0404-040404040404_pkl.xml
-mv DCP/*_cpl.xml DCP/02020202-0202-0202-0202-020202020202_cpl.xml
index ec7cc6883adebf84e418c1a0181213d0f2e74814..11f8a7eeea0ce0ef1b8154f54cffed8d61f3a208 100644 (file)
@@ -40,7 +40,7 @@ BOOST_AUTO_TEST_CASE (dcp_test)
        t->company_name = "OpenDCP";
        t->product_name = "OpenDCP";
        t->product_version = "0.0.25";
-       
+       t->issue_date = "2012-07-17T04:32:07+00:00";
        filesystem::remove_all ("build/test/foo");
        filesystem::create_directories ("build/test/foo");
        libdcp::DCP d ("build/test/foo", "A Test DCP", libdcp::DCP::FEATURE, 24, 24);