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. --- run-tests.sh | 2 +- 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 +- .../02020202-0202-0202-0202-020202020202_cpl.xml | 39 --- .../04040404-0404-0404-0404-040404040404_pkl.xml | 30 -- .../8e293965-f8ad-48c6-971d-261b01f65cdb_pkl.xml | 30 ++ test/ref/DCP/ASSETMAP.xml | 16 +- test/ref/DCP/audio.mxf | Bin 305326 -> 305326 bytes .../df0e4141-13c3-4a7a-bef8-b5a04fcbc4bb_cpl.xml | 39 +++ test/ref/DCP/video.dump | 302 --------------------- test/ref/DCP/video.mxf | Bin 26080 -> 26080 bytes test/ref/make.py | 75 +++++ test/ref/make.sh | 10 - test/tests.cc | 2 +- 20 files changed, 180 insertions(+), 417 deletions(-) delete mode 100644 test/ref/DCP/02020202-0202-0202-0202-020202020202_cpl.xml delete mode 100644 test/ref/DCP/04040404-0404-0404-0404-040404040404_pkl.xml create mode 100644 test/ref/DCP/8e293965-f8ad-48c6-971d-261b01f65cdb_pkl.xml create mode 100644 test/ref/DCP/df0e4141-13c3-4a7a-bef8-b5a04fcbc4bb_cpl.xml delete mode 100644 test/ref/DCP/video.dump create mode 100755 test/ref/make.py delete mode 100644 test/ref/make.sh diff --git a/run-tests.sh b/run-tests.sh index a44ccea0..a837a287 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -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 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); } 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 index cc5e933e..00000000 --- a/test/ref/DCP/02020202-0202-0202-0202-020202020202_cpl.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - urn:uuid:488d58ab-474e-4b01-a2cb-a6ce1e5e70b3 - A Test DCP - 2012-07-16T06:28:27+00:00 - OpenDCP 0.0.25 - A Test DCP - feature - - urn:uri:488d58ab-474e-4b01-a2cb-a6ce1e5e70b3_2012-07-16T06:28:27+00:00 - 488d58ab-474e-4b01-a2cb-a6ce1e5e70b3_2012-07-16T06:28:27+00:00 - - - - - urn:uuid:b4f8f14e-63d9-4d34-9b8d-11d158d77115 - - - urn:uuid:0a2335fe-09a3-4a19-b5ea-2e0308e727b3 - video.mxf - 24 1 - 24 - 0 - 24 - 24 1 - 32 32 - - - urn:uuid:ac884d5a-1d72-425b-a45b-d0c0bce4f6f4 - audio.mxf - 24 1 - 24 - 0 - 24 - - - - - 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 index 76f1292a..00000000 --- a/test/ref/DCP/04040404-0404-0404-0404-040404040404_pkl.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - urn:uuid:caaf9bfe-2a00-4b95-b6d3-d6c0b181e17b - A Test DCP - 2012-07-16T06:28:27+00:00 - OpenDCP 0.0.25 - OpenDCP 0.0.25 - - - urn:uuid:0a2335fe-09a3-4a19-b5ea-2e0308e727b3 - video.mxf - ETDlJzvJT98gAc2Y84/4AoXQuhs= - 26080 - application/mxf - - - urn:uuid:ac884d5a-1d72-425b-a45b-d0c0bce4f6f4 - audio.mxf - duYsdzeBVwuv5EfxvLmshyBQdo0= - 305326 - application/mxf - - - urn:uuid:488d58ab-474e-4b01-a2cb-a6ce1e5e70b3 - RanewioDBtecLpvB7W2v/g9/vos= - 1526 - text/xml - - - 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 index 00000000..e8342cc7 --- /dev/null +++ b/test/ref/DCP/8e293965-f8ad-48c6-971d-261b01f65cdb_pkl.xml @@ -0,0 +1,30 @@ + + + urn:uuid:8e293965-f8ad-48c6-971d-261b01f65cdb + A Test DCP + 2012-07-17T04:32:07+00:00 + OpenDCP 0.0.25 + OpenDCP 0.0.25 + + + urn:uuid:81fb54df-e1bf-4647-8788-ea7ba154375b + video.mxf + 4jimd5RaYhFS0ENh6tUTnjMqN/M= + 26080 + application/mxf + + + urn:uuid:c38bdd62-ce03-4988-8603-195f134207c7 + audio.mxf + 6YhrUkOvm46kYdhrgDuKNvfa9uA= + 305326 + application/mxf + + + urn:uuid:df0e4141-13c3-4a7a-bef8-b5a04fcbc4bb + DR62woRxafHQcqScRIHQd6hChFU= + 1526 + text/xml + + + diff --git a/test/ref/DCP/ASSETMAP.xml b/test/ref/DCP/ASSETMAP.xml index dff86855..cf845772 100644 --- a/test/ref/DCP/ASSETMAP.xml +++ b/test/ref/DCP/ASSETMAP.xml @@ -1,17 +1,17 @@ - urn:uuid:7193f3d3-4083-4e4d-9a35-b108dad4e305 + urn:uuid:18be072e-5a0f-44e1-b2eb-c8a52ae12789 OpenDCP 0.0.25 1 - 2012-07-16T06:28:27+00:00 + 2012-07-17T04:32:07+00:00 OpenDCP 0.0.25 - urn:uuid:caaf9bfe-2a00-4b95-b6d3-d6c0b181e17b + urn:uuid:8e293965-f8ad-48c6-971d-261b01f65cdb true - caaf9bfe-2a00-4b95-b6d3-d6c0b181e17b_pkl.xml + 8e293965-f8ad-48c6-971d-261b01f65cdb_pkl.xml 1 0 1049 @@ -19,10 +19,10 @@ - urn:uuid:488d58ab-474e-4b01-a2cb-a6ce1e5e70b3 + urn:uuid:df0e4141-13c3-4a7a-bef8-b5a04fcbc4bb - 488d58ab-474e-4b01-a2cb-a6ce1e5e70b3_cpl.xml + df0e4141-13c3-4a7a-bef8-b5a04fcbc4bb_cpl.xml 1 0 1526 @@ -30,7 +30,7 @@ - urn:uuid:0a2335fe-09a3-4a19-b5ea-2e0308e727b3 + urn:uuid:81fb54df-e1bf-4647-8788-ea7ba154375b video.mxf @@ -41,7 +41,7 @@ - urn:uuid:ac884d5a-1d72-425b-a45b-d0c0bce4f6f4 + urn:uuid:c38bdd62-ce03-4988-8603-195f134207c7 audio.mxf diff --git a/test/ref/DCP/audio.mxf b/test/ref/DCP/audio.mxf index 06e9438d..a945da6d 100644 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 index 00000000..27fdc5b5 --- /dev/null +++ b/test/ref/DCP/df0e4141-13c3-4a7a-bef8-b5a04fcbc4bb_cpl.xml @@ -0,0 +1,39 @@ + + + urn:uuid:df0e4141-13c3-4a7a-bef8-b5a04fcbc4bb + A Test DCP + 2012-07-17T04:32:07+00:00 + OpenDCP 0.0.25 + A Test DCP + feature + + urn:uri:df0e4141-13c3-4a7a-bef8-b5a04fcbc4bb_2012-07-17T04:32:07+00:00 + df0e4141-13c3-4a7a-bef8-b5a04fcbc4bb_2012-07-17T04:32:07+00:00 + + + + + urn:uuid:e4456baa-d4d6-42f6-bfc6-1cf748582227 + + + urn:uuid:81fb54df-e1bf-4647-8788-ea7ba154375b + video.mxf + 24 1 + 24 + 0 + 24 + 24 1 + 32 32 + + + urn:uuid:c38bdd62-ce03-4988-8603-195f134207c7 + audio.mxf + 24 1 + 24 + 0 + 24 + + + + + diff --git a/test/ref/DCP/video.dump b/test/ref/DCP/video.dump deleted file mode 100644 index c01dfd73..00000000 --- a/test/ref/DCP/video.dump +++ /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 diff --git a/test/ref/DCP/video.mxf b/test/ref/DCP/video.mxf index 9b11f99e..d71cf1e3 100644 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 index 00000000..013a7c24 --- /dev/null +++ b/test/ref/make.py @@ -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 index 1d04e244..00000000 --- a/test/ref/make.sh +++ /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 diff --git a/test/tests.cc b/test/tests.cc index ec7cc688..11f8a7ee 100644 --- a/test/tests.cc +++ b/test/tests.cc @@ -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); -- cgit v1.2.3