diff options
| -rw-r--r-- | src/asset.cc | 2 | ||||
| -rw-r--r-- | src/interop_subtitle_asset.cc | 2 | ||||
| -rw-r--r-- | src/pkl.cc | 7 | ||||
| -rw-r--r-- | src/pkl.h | 11 | ||||
| -rw-r--r-- | test/ref/DCP/dcp_test1/ASSETMAP.xml | 2 | ||||
| -rw-r--r-- | test/ref/DCP/dcp_test1/pkl_d199d58b-5ef8-4d49-b270-07e590ccb280.xml | 3 | ||||
| -rw-r--r-- | test/ref/DCP/dcp_test2/ASSETMAP.xml | 2 | ||||
| -rw-r--r-- | test/ref/DCP/dcp_test2/pkl_d199d58b-5ef8-4d49-b270-07e590ccb280.xml | 3 | ||||
| -rw-r--r-- | test/ref/DCP/dcp_test5/ASSETMAP.xml | 2 | ||||
| -rw-r--r-- | test/ref/DCP/dcp_test5/pkl_017b3de4-6dda-408d-b19b-6711354b0bc3.xml | 3 | ||||
| -rw-r--r-- | test/ref/DCP/dcp_test7/ASSETMAP | 2 | ||||
| -rw-r--r-- | test/ref/DCP/dcp_test7/pkl_d199d58b-5ef8-4d49-b270-07e590ccb280.xml | 3 | ||||
| -rw-r--r-- | test/ref/DCP/encryption_test/ASSETMAP.xml | 2 | ||||
| -rw-r--r-- | test/ref/DCP/encryption_test/pkl_93887017-5d6a-4ee5-b5f4-161b06281d0e.xml | 17 | ||||
| -rw-r--r-- | test/ref/write_interop_subtitle_test3/ASSETMAP | 2 | ||||
| -rw-r--r-- | test/ref/write_interop_subtitle_test3/pkl_ac8d301c-e5d9-4343-b6f3-ba2668adbe56.xml | 3 | ||||
| -rw-r--r-- | test/verify_test.cc | 4 |
17 files changed, 49 insertions, 21 deletions
diff --git a/src/asset.cc b/src/asset.cc index 372779b1..c164a26b 100644 --- a/src/asset.cc +++ b/src/asset.cc @@ -98,7 +98,7 @@ Asset::add_to_pkl (shared_ptr<PKL> pkl, path root) const return; } - pkl->add_asset (_id, _id, hash(), file_size(_file.get()), pkl_type(pkl->standard())); + pkl->add_asset(_id, _id, hash(), file_size(_file.get()), pkl_type(pkl->standard()), _file->filename().string()); } diff --git a/src/interop_subtitle_asset.cc b/src/interop_subtitle_asset.cc index ce3a4943..d58e16a3 100644 --- a/src/interop_subtitle_asset.cc +++ b/src/interop_subtitle_asset.cc @@ -290,7 +290,7 @@ InteropSubtitleAsset::add_to_pkl (shared_ptr<PKL> pkl, boost::filesystem::path r auto im = dynamic_pointer_cast<dcp::SubtitleImage> (i); if (im) { auto png_image = im->png_image (); - pkl->add_asset (im->id(), optional<string>(), make_digest(png_image), png_image.size(), "image/png"); + pkl->add_asset(im->id(), optional<string>(), make_digest(png_image), png_image.size(), "image/png", root.filename().string()); } } } @@ -87,9 +87,9 @@ PKL::PKL (boost::filesystem::path file) void -PKL::add_asset (std::string id, boost::optional<std::string> annotation_text, std::string hash, int64_t size, std::string type) +PKL::add_asset(std::string id, boost::optional<std::string> annotation_text, std::string hash, int64_t size, std::string type, std::string original_filename) { - _asset_list.push_back (make_shared<Asset>(id, annotation_text, hash, size, type)); + _asset_list.push_back(make_shared<Asset>(id, annotation_text, hash, size, type, original_filename)); } @@ -122,6 +122,9 @@ PKL::write_xml (boost::filesystem::path file, shared_ptr<const CertificateChain> asset->add_child("Hash")->add_child_text (i->hash()); asset->add_child("Size")->add_child_text (raw_convert<string>(i->size())); asset->add_child("Type")->add_child_text (i->type()); + if (auto filename = i->original_filename()) { + asset->add_child("OriginalFileName")->add_child_text(*filename); + } } indent (pkl, 0); @@ -66,7 +66,7 @@ public: boost::optional<std::string> type (std::string id) const; void clear_assets(); - void add_asset (std::string id, boost::optional<std::string> annotation_text, std::string hash, int64_t size, std::string type); + void add_asset(std::string id, boost::optional<std::string> annotation_text, std::string hash, int64_t size, std::string type, std::string original_filename); void write_xml (boost::filesystem::path file, std::shared_ptr<const CertificateChain> signer) const; /** @return the most recent disk file used to read or write this PKL, if there is one */ @@ -83,14 +83,16 @@ public: , _hash (node->string_child("Hash")) , _size (node->number_child<int64_t>("Size")) , _type (node->string_child("Type")) + , _original_filename(node->optional_string_child("OriginalFileName")) {} - Asset (std::string id, boost::optional<std::string> annotation_text, std::string hash, int64_t size, std::string type) + Asset(std::string id, boost::optional<std::string> annotation_text, std::string hash, int64_t size, std::string type, std::string original_filename) : Object (id) , _annotation_text (annotation_text) , _hash (hash) , _size (size) , _type (type) + , _original_filename(original_filename) {} boost::optional<std::string> annotation_text () const { @@ -109,11 +111,16 @@ public: return _type; } + boost::optional<std::string> original_filename() const { + return _original_filename; + } + private: boost::optional<std::string> _annotation_text; std::string _hash; int64_t _size = 0; std::string _type; + boost::optional<std::string> _original_filename; }; std::vector<std::shared_ptr<Asset>> asset_list () const { diff --git a/test/ref/DCP/dcp_test1/ASSETMAP.xml b/test/ref/DCP/dcp_test1/ASSETMAP.xml index f805bb28..4e0d1e5a 100644 --- a/test/ref/DCP/dcp_test1/ASSETMAP.xml +++ b/test/ref/DCP/dcp_test1/ASSETMAP.xml @@ -15,7 +15,7 @@ <Path>pkl_d199d58b-5ef8-4d49-b270-07e590ccb280.xml</Path> <VolumeIndex>1</VolumeIndex> <Offset>0</Offset> - <Length>1179</Length> + <Length>1373</Length> </Chunk> </ChunkList> </Asset> diff --git a/test/ref/DCP/dcp_test1/pkl_d199d58b-5ef8-4d49-b270-07e590ccb280.xml b/test/ref/DCP/dcp_test1/pkl_d199d58b-5ef8-4d49-b270-07e590ccb280.xml index dd963585..cedbb15b 100644 --- a/test/ref/DCP/dcp_test1/pkl_d199d58b-5ef8-4d49-b270-07e590ccb280.xml +++ b/test/ref/DCP/dcp_test1/pkl_d199d58b-5ef8-4d49-b270-07e590ccb280.xml @@ -12,6 +12,7 @@ <Hash>tfX1mVIKJCVr1m7Y32Nzxf0+Rpw=</Hash> <Size>8559</Size> <Type>text/xml</Type> + <OriginalFileName>cpl_6affb8ee-0020-4dff-a53c-17652f6358ab.xml</OriginalFileName> </Asset> <Asset> <Id>urn:uuid:5407b210-4441-4e97-8b16-8bdc7c12da54</Id> @@ -19,6 +20,7 @@ <Hash>wUmt8G+cFFKMGt0ueS9+F1S4uhc=</Hash> <Size>49240</Size> <Type>application/mxf</Type> + <OriginalFileName>video.mxf</OriginalFileName> </Asset> <Asset> <Id>urn:uuid:97f0f352-5b77-48ee-a558-9df37717f4fa</Id> @@ -26,6 +28,7 @@ <Hash>KcJb7S2K5cNm8RG4kfQD5FTeS0A=</Hash> <Size>881326</Size> <Type>application/mxf</Type> + <OriginalFileName>audio.mxf</OriginalFileName> </Asset> </AssetList> </PackingList> diff --git a/test/ref/DCP/dcp_test2/ASSETMAP.xml b/test/ref/DCP/dcp_test2/ASSETMAP.xml index e0adff1e..68d9a5cb 100644 --- a/test/ref/DCP/dcp_test2/ASSETMAP.xml +++ b/test/ref/DCP/dcp_test2/ASSETMAP.xml @@ -15,7 +15,7 @@ <Path>pkl_d199d58b-5ef8-4d49-b270-07e590ccb280.xml</Path> <VolumeIndex>1</VolumeIndex> <Offset>0</Offset> - <Length>1186</Length> + <Length>1380</Length> </Chunk> </ChunkList> </Asset> diff --git a/test/ref/DCP/dcp_test2/pkl_d199d58b-5ef8-4d49-b270-07e590ccb280.xml b/test/ref/DCP/dcp_test2/pkl_d199d58b-5ef8-4d49-b270-07e590ccb280.xml index d1162163..44da5c43 100644 --- a/test/ref/DCP/dcp_test2/pkl_d199d58b-5ef8-4d49-b270-07e590ccb280.xml +++ b/test/ref/DCP/dcp_test2/pkl_d199d58b-5ef8-4d49-b270-07e590ccb280.xml @@ -12,6 +12,7 @@ <Hash>6F7kAEYbNdv6gz6PG5JcMjGF8kU=</Hash> <Size>1686</Size> <Type>text/xml</Type> + <OriginalFileName>cpl_6affb8ee-0020-4dff-a53c-17652f6358ab.xml</OriginalFileName> </Asset> <Asset> <Id>urn:uuid:5407b210-4441-4e97-8b16-8bdc7c12da54</Id> @@ -19,6 +20,7 @@ <Hash>BUpeFS6X9j+X0z2TZWSsLMT4pE0=</Hash> <Size>63160</Size> <Type>application/mxf</Type> + <OriginalFileName>video.mxf</OriginalFileName> </Asset> <Asset> <Id>urn:uuid:fc843acc-1ad9-4808-b9ed-33f5319e047d</Id> @@ -26,6 +28,7 @@ <Hash>3PtaGoYcvBdq5WYiK0cmeDwm8d0=</Hash> <Size>161326</Size> <Type>application/mxf</Type> + <OriginalFileName>audio.mxf</OriginalFileName> </Asset> </AssetList> </PackingList> diff --git a/test/ref/DCP/dcp_test5/ASSETMAP.xml b/test/ref/DCP/dcp_test5/ASSETMAP.xml index 42b8133b..79a3091c 100644 --- a/test/ref/DCP/dcp_test5/ASSETMAP.xml +++ b/test/ref/DCP/dcp_test5/ASSETMAP.xml @@ -15,7 +15,7 @@ <Path>pkl_017b3de4-6dda-408d-b19b-6711354b0bc3.xml</Path> <VolumeIndex>1</VolumeIndex> <Offset>0</Offset> - <Length>1186</Length> + <Length>1380</Length> </Chunk> </ChunkList> </Asset> diff --git a/test/ref/DCP/dcp_test5/pkl_017b3de4-6dda-408d-b19b-6711354b0bc3.xml b/test/ref/DCP/dcp_test5/pkl_017b3de4-6dda-408d-b19b-6711354b0bc3.xml index 77d67c23..9b388774 100644 --- a/test/ref/DCP/dcp_test5/pkl_017b3de4-6dda-408d-b19b-6711354b0bc3.xml +++ b/test/ref/DCP/dcp_test5/pkl_017b3de4-6dda-408d-b19b-6711354b0bc3.xml @@ -12,6 +12,7 @@ <Hash>kiv8PHo8XZc/lI2xk7qYghrP2SA=</Hash> <Size>2024</Size> <Type>text/xml</Type> + <OriginalFileName>cpl_6affb8ee-0020-4dff-a53c-17652f6358ab.xml</OriginalFileName> </Asset> <Asset> <Id>urn:uuid:5407b210-4441-4e97-8b16-8bdc7c12da54</Id> @@ -19,6 +20,7 @@ <Hash>o3VmpdFsNUgF11oadcaGJ/IfO0M=</Hash> <Size>40144</Size> <Type>application/mxf</Type> + <OriginalFileName>video.mxf</OriginalFileName> </Asset> <Asset> <Id>urn:uuid:97f0f352-5b77-48ee-a558-9df37717f4fa</Id> @@ -26,6 +28,7 @@ <Hash>wLbXcpQtWt2IFMHIcibxwND667I=</Hash> <Size>161326</Size> <Type>application/mxf</Type> + <OriginalFileName>audio.mxf</OriginalFileName> </Asset> </AssetList> </PackingList> diff --git a/test/ref/DCP/dcp_test7/ASSETMAP b/test/ref/DCP/dcp_test7/ASSETMAP index f41b1366..86a6ff6a 100644 --- a/test/ref/DCP/dcp_test7/ASSETMAP +++ b/test/ref/DCP/dcp_test7/ASSETMAP @@ -15,7 +15,7 @@ <Path>pkl_d199d58b-5ef8-4d49-b270-07e590ccb280.xml</Path> <VolumeIndex>1</VolumeIndex> <Offset>0</Offset> - <Length>1253</Length> + <Length>1447</Length> </Chunk> </ChunkList> </Asset> diff --git a/test/ref/DCP/dcp_test7/pkl_d199d58b-5ef8-4d49-b270-07e590ccb280.xml b/test/ref/DCP/dcp_test7/pkl_d199d58b-5ef8-4d49-b270-07e590ccb280.xml index 20bad65e..4180eb8d 100644 --- a/test/ref/DCP/dcp_test7/pkl_d199d58b-5ef8-4d49-b270-07e590ccb280.xml +++ b/test/ref/DCP/dcp_test7/pkl_d199d58b-5ef8-4d49-b270-07e590ccb280.xml @@ -12,6 +12,7 @@ <Hash>Vsre14v3AhK6X2gUzeYF9G8GKo0=</Hash> <Size>1965</Size> <Type>text/xml;asdcpKind=CPL</Type> + <OriginalFileName>cpl_6affb8ee-0020-4dff-a53c-17652f6358ab.xml</OriginalFileName> </Asset> <Asset> <Id>urn:uuid:5407b210-4441-4e97-8b16-8bdc7c12da54</Id> @@ -19,6 +20,7 @@ <Hash>wUmt8G+cFFKMGt0ueS9+F1S4uhc=</Hash> <Size>49240</Size> <Type>application/x-smpte-mxf;asdcpKind=Picture</Type> + <OriginalFileName>video.mxf</OriginalFileName> </Asset> <Asset> <Id>urn:uuid:97f0f352-5b77-48ee-a558-9df37717f4fa</Id> @@ -26,6 +28,7 @@ <Hash>KcJb7S2K5cNm8RG4kfQD5FTeS0A=</Hash> <Size>881326</Size> <Type>application/x-smpte-mxf;asdcpKind=Sound</Type> + <OriginalFileName>audio.mxf</OriginalFileName> </Asset> </AssetList> </PackingList> diff --git a/test/ref/DCP/encryption_test/ASSETMAP.xml b/test/ref/DCP/encryption_test/ASSETMAP.xml index cf6c74f5..902833dc 100644 --- a/test/ref/DCP/encryption_test/ASSETMAP.xml +++ b/test/ref/DCP/encryption_test/ASSETMAP.xml @@ -15,7 +15,7 @@ <Path>pkl_93887017-5d6a-4ee5-b5f4-161b06281d0e.xml</Path> <VolumeIndex>1</VolumeIndex> <Offset>0</Offset> - <Length>8708</Length> + <Length>8902</Length> </Chunk> </ChunkList> </Asset> diff --git a/test/ref/DCP/encryption_test/pkl_93887017-5d6a-4ee5-b5f4-161b06281d0e.xml b/test/ref/DCP/encryption_test/pkl_93887017-5d6a-4ee5-b5f4-161b06281d0e.xml index 57421adc..db5b78f2 100644 --- a/test/ref/DCP/encryption_test/pkl_93887017-5d6a-4ee5-b5f4-161b06281d0e.xml +++ b/test/ref/DCP/encryption_test/pkl_93887017-5d6a-4ee5-b5f4-161b06281d0e.xml @@ -12,6 +12,7 @@ <Hash>ocIgRDFtEn7QPxwcqXYVpSrTPpI=</Hash> <Size>9226</Size> <Type>text/xml</Type> + <OriginalFileName>cpl_6affb8ee-0020-4dff-a53c-17652f6358ab.xml</OriginalFileName> </Asset> <Asset> <Id>urn:uuid:9a7fbb03-4078-4944-90b1-0d8a21c9d793</Id> @@ -19,6 +20,7 @@ <Hash>AVtX8wz76uG2Uw0Qbc9+DKnHUfw=</Hash> <Size>44008</Size> <Type>application/mxf</Type> + <OriginalFileName>video.mxf</OriginalFileName> </Asset> <Asset> <Id>urn:uuid:ce300880-a425-40a6-adac-eb1e3f5643fc</Id> @@ -26,6 +28,7 @@ <Hash>lS+FKcwLD7cRjgZMQ+hvGg/yJIc=</Hash> <Size>165454</Size> <Type>application/mxf</Type> + <OriginalFileName>audio.mxf</OriginalFileName> </Asset> </AssetList> <Signer xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"> @@ -46,15 +49,15 @@ <dsig:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/> </dsig:Transforms> <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/> - <dsig:DigestValue>Gxo6VfxF8Guiq1+IFU2ePslEu00=</dsig:DigestValue> + <dsig:DigestValue>G6rpYhOo/0ZdBo+SI3UzyPQA/F0=</dsig:DigestValue> </dsig:Reference> </dsig:SignedInfo> - <dsig:SignatureValue>bzUioGIym79+2SaZ+V3zHOnZzoYR2L3NcW0yrre+FclIO2BB6XjdPnJJJPEHml9R -ATXtAOUIjYUZT5x+2B64dpclvIdikr4P72J6PQzHB+lvnrptoisOhFMa0Pnk1vCi -0o/WBHUCSDePU8Hl8OGK9GL+n/iXEZKfbpuAIRBIGayD1WE1CmTxGxVx28VTk+2H -klIbYhojVoj0AaaVN9xVvaq126Tmk4y1dILyPlNyYYVxzam7T1hlEHSj3E4i3StZ -r1vsK8I8EMWLrBio3ih44GwkJeM6N7PPI5kDeen7Mk7S4Btq+HtildekSmKRNkOc -odAqTC/SVvYtWvri7PldJQ==</dsig:SignatureValue> + <dsig:SignatureValue>tdapJHKPEmEa552oOg9s3/Q4TcnzIiNfd3U+xiSG5XGl+7K0n6JKbpNVgm4KpE0l +a7bVsu4Yp0ftCrcjxxczZ/puS7nVC/zcfk63miZcJKdXem0xt0AZJHEguwQq74Tc +48Efe1/MtIBCOtQErh2kcDVwXOUo6Nz0yW1g5PRQ5u9KlqQ67RLqDWRdX1OkWIUZ +Z2Iz2nSnTP4GDDHs5pX6xxZKNlgZIa5iYMBp97X1DGlGaQ2o/sbcUysE4g4oO+iU +cfRdkI68vj53hHWApxVGoAPAl4t8B6kMbLQAp1w4R/4ruLR9FKTffqRlUjOXtyiT +pQVNxwCU50/opyfv8v2v6w==</dsig:SignatureValue> <dsig:KeyInfo> <dsig:X509Data> <dsig:X509IssuerSerial> diff --git a/test/ref/write_interop_subtitle_test3/ASSETMAP b/test/ref/write_interop_subtitle_test3/ASSETMAP index 8dfb256d..1fd41e81 100644 --- a/test/ref/write_interop_subtitle_test3/ASSETMAP +++ b/test/ref/write_interop_subtitle_test3/ASSETMAP @@ -15,7 +15,7 @@ <Path>pkl_ac8d301c-e5d9-4343-b6f3-ba2668adbe56.xml</Path> <VolumeIndex>1</VolumeIndex> <Offset>0</Offset> - <Length>1114</Length> + <Length>1326</Length> </Chunk> </ChunkList> </Asset> diff --git a/test/ref/write_interop_subtitle_test3/pkl_ac8d301c-e5d9-4343-b6f3-ba2668adbe56.xml b/test/ref/write_interop_subtitle_test3/pkl_ac8d301c-e5d9-4343-b6f3-ba2668adbe56.xml index 362177c7..ae7644af 100644 --- a/test/ref/write_interop_subtitle_test3/pkl_ac8d301c-e5d9-4343-b6f3-ba2668adbe56.xml +++ b/test/ref/write_interop_subtitle_test3/pkl_ac8d301c-e5d9-4343-b6f3-ba2668adbe56.xml @@ -12,6 +12,7 @@ <Hash>M9U2kzcnfcBAy7MrXZGKjA8hQRU=</Hash> <Size>1061</Size> <Type>text/xml;asdcpKind=CPL</Type> + <OriginalFileName>cpl_5407b210-4441-4e97-8b16-8bdc7c12da54.xml</OriginalFileName> </Asset> <Asset> <Id>urn:uuid:a6c58cff-3e1e-4b38-acec-a42224475ef6</Id> @@ -19,12 +20,14 @@ <Hash>RmflhDu9QYUsNnBftdNlIEGdzG0=</Hash> <Size>438</Size> <Type>text/xml;asdcpKind=Subtitle</Type> + <OriginalFileName>subs.xml</OriginalFileName> </Asset> <Asset> <Id>urn:uuid:dd015243-ab77-435c-a13d-690566885121</Id> <Hash>2vTylSKQ5MCQHbKPT4X+rlwfHk4=</Hash> <Size>44861</Size> <Type>image/png</Type> + <OriginalFileName>write_interop_subtitle_test3</OriginalFileName> </Asset> </AssetList> </PackingList> diff --git a/test/verify_test.cc b/test/verify_test.cc index 1122f73b..d1319810 100644 --- a/test/verify_test.cc +++ b/test/verify_test.cc @@ -458,9 +458,9 @@ BOOST_AUTO_TEST_CASE (verify_mismatched_picture_sound_hashes) { dcp::VerificationNote::Type::ERROR, dcp::VerificationNote::Code::MISMATCHED_CPL_HASHES, dcp_test1_cpl_id, canonical(dir / dcp_test1_cpl) }, { dcp::VerificationNote::Type::ERROR, dcp::VerificationNote::Code::MISMATCHED_PICTURE_HASHES, canonical(dir / "video.mxf") }, { dcp::VerificationNote::Type::ERROR, dcp::VerificationNote::Code::MISMATCHED_SOUND_HASHES, canonical(dir / "audio.mxf") }, - { dcp::VerificationNote::Type::ERROR, dcp::VerificationNote::Code::INVALID_XML, "value 'xKcJb7S2K5cNm8RG4kfQD5FTeS0A=' is invalid Base64-encoded binary", canonical(dir / dcp_test1_pkl), 26 }, + { dcp::VerificationNote::Type::ERROR, dcp::VerificationNote::Code::INVALID_XML, "value 'xKcJb7S2K5cNm8RG4kfQD5FTeS0A=' is invalid Base64-encoded binary", canonical(dir / dcp_test1_pkl), 28 }, { dcp::VerificationNote::Type::ERROR, dcp::VerificationNote::Code::INVALID_XML, "value 'xtfX1mVIKJCVr1m7Y32Nzxf0+Rpw=' is invalid Base64-encoded binary", canonical(dir / dcp_test1_pkl), 12 }, - { dcp::VerificationNote::Type::ERROR, dcp::VerificationNote::Code::INVALID_XML, "value 'xwUmt8G+cFFKMGt0ueS9+F1S4uhc=' is invalid Base64-encoded binary", canonical(dir / dcp_test1_pkl), 19 }, + { dcp::VerificationNote::Type::ERROR, dcp::VerificationNote::Code::INVALID_XML, "value 'xwUmt8G+cFFKMGt0ueS9+F1S4uhc=' is invalid Base64-encoded binary", canonical(dir / dcp_test1_pkl), 20 }, }); } |
