diff options
| author | Carl Hetherington <cth@carlh.net> | 2022-01-17 18:45:19 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2022-01-17 20:16:52 +0100 |
| commit | 0a5615c17edf6d9c51d9269c824d6caf71f710e5 (patch) | |
| tree | 469e07adb1e3a4971b5a622f97bff59b0ed5554d | |
| parent | 59e22e6d9ff4fc180f79df64da2a27f44a982b51 (diff) | |
Use optional for ReelAsset _annotation_text.v1.8.6
Not only is this tag optional in Interop and SMPTE, but it would
appear that if it is present but empty a DCP will not play back
on Sony SRX320 / LMT3000 systems (DoM bug #2124).
Here we use optional<>, as seems to make sense, and also refuse
to write empty tags (instead omitting the tag entirely).
23 files changed, 67 insertions, 68 deletions
diff --git a/src/reel_asset.cc b/src/reel_asset.cc index d233ee64..f9742628 100644 --- a/src/reel_asset.cc +++ b/src/reel_asset.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2014-2021 Carl Hetherington <cth@carlh.net> + Copyright (C) 2014-2022 Carl Hetherington <cth@carlh.net> This file is part of libdcp. @@ -72,7 +72,7 @@ ReelAsset::ReelAsset (shared_ptr<const cxml::Node> node) : Object (remove_urn_uuid (node->string_child ("Id"))) , _intrinsic_duration (node->number_child<int64_t> ("IntrinsicDuration")) , _duration (node->optional_number_child<int64_t>("Duration")) - , _annotation_text (node->optional_string_child ("AnnotationText").get_value_or ("")) + , _annotation_text (node->optional_string_child("AnnotationText")) , _edit_rate (Fraction (node->string_child ("EditRate"))) , _entry_point (node->optional_number_child<int64_t>("EntryPoint")) { @@ -93,7 +93,10 @@ ReelAsset::write_to_cpl (xmlpp::Node* node, Standard standard) const a->set_namespace_declaration (ns.first, ns.second); } a->add_child("Id")->add_child_text ("urn:uuid:" + _id); - a->add_child("AnnotationText")->add_child_text (_annotation_text); + /* Empty <AnnotationText> tags cause refusal to play on some Sony SRX320 / LMT3000 systems (DoM bug #2124) */ + if (_annotation_text && !_annotation_text->empty()) { + a->add_child("AnnotationText")->add_child_text(*_annotation_text); + } a->add_child("EditRate")->add_child_text (_edit_rate.as_string()); a->add_child("IntrinsicDuration")->add_child_text (raw_convert<string> (_intrinsic_duration)); if (_entry_point) { @@ -124,7 +127,7 @@ bool ReelAsset::asset_equals (shared_ptr<const ReelAsset> other, EqualityOptions opt, NoteHandler note) const { if (_annotation_text != other->_annotation_text) { - string const s = "Reel: annotation texts differ (" + _annotation_text + " vs " + other->_annotation_text + ")\n"; + string const s = "Reel: annotation texts differ (" + _annotation_text.get_value_or("") + " vs " + other->_annotation_text.get_value_or("") + ")\n"; if (!opt.reel_annotation_texts_can_differ) { note (NoteType::ERROR, s); return false; diff --git a/src/reel_asset.h b/src/reel_asset.h index ab06434e..200c49ff 100644 --- a/src/reel_asset.h +++ b/src/reel_asset.h @@ -120,7 +120,7 @@ public: /** @return <Duration>, or <IntrinsicDuration> - <EntryPoint> if <Duration> is not present */ int64_t actual_duration () const; - std::string annotation_text () const { + boost::optional<std::string> annotation_text () const { return _annotation_text; } @@ -128,6 +128,10 @@ public: _annotation_text = at; } + void unset_annotation_text () { + _annotation_text = boost::none; + } + bool asset_equals (std::shared_ptr<const ReelAsset>, EqualityOptions, NoteHandler) const; protected: @@ -147,7 +151,7 @@ protected: boost::optional<int64_t> _duration; ///< The <Duration> from the reel's entry for this asset, if present private: - std::string _annotation_text; ///< The <AnnotationText> from the reel's entry for this asset + boost::optional<std::string> _annotation_text; ///< The <AnnotationText> from the reel's entry for this asset Fraction _edit_rate; ///< The <EditRate> from the reel's entry for this asset boost::optional<int64_t> _entry_point; ///< The <EntryPoint> from the reel's entry for this asset }; diff --git a/test/reel_asset_test.cc b/test/reel_asset_test.cc index 94f9c265..9dd2f8c3 100644 --- a/test/reel_asset_test.cc +++ b/test/reel_asset_test.cc @@ -67,7 +67,7 @@ BOOST_AUTO_TEST_CASE (reel_picture_asset_test) dcp::ReelMonoPictureAsset pa (doc); BOOST_CHECK_EQUAL (pa.id(), "06ac1ca7-9c46-4107-8864-a6448e24b04b"); - BOOST_CHECK_EQUAL (pa.annotation_text(), "Hello world!"); + BOOST_CHECK_EQUAL (pa.annotation_text().get_value_or(""), "Hello world!"); BOOST_CHECK_EQUAL (pa.edit_rate(), dcp::Fraction(24, 1)); BOOST_CHECK_EQUAL (pa.intrinsic_duration(), 187048); BOOST_CHECK_EQUAL (pa.entry_point().get(), 42L); @@ -99,7 +99,7 @@ BOOST_AUTO_TEST_CASE (reel_smpte_subtitle_asset_test) dcp::ReelSMPTESubtitleAsset ps (doc); BOOST_CHECK_EQUAL (ps.id(), "8bca1489-aab1-9259-a4fd-8150abc1de12"); - BOOST_CHECK_EQUAL (ps.annotation_text(), "Goodbye world!"); + BOOST_CHECK_EQUAL (ps.annotation_text().get_value_or(""), "Goodbye world!"); BOOST_CHECK_EQUAL (ps.edit_rate(), dcp::Fraction(25, 1)); BOOST_CHECK_EQUAL (ps.intrinsic_duration(), 1870); BOOST_CHECK_EQUAL (ps.entry_point().get(), 0L); diff --git a/test/ref/DCP/dcp_test1/ASSETMAP.xml b/test/ref/DCP/dcp_test1/ASSETMAP.xml index 10083feb..ee780c7c 100644 --- a/test/ref/DCP/dcp_test1/ASSETMAP.xml +++ b/test/ref/DCP/dcp_test1/ASSETMAP.xml @@ -26,7 +26,7 @@ <Path>cpl_81fb54df-e1bf-4647-8788-ea7ba154375b.xml</Path> <VolumeIndex>1</VolumeIndex> <Offset>0</Offset> - <Length>8762</Length> + <Length>8630</Length> </Chunk> </ChunkList> </Asset> diff --git a/test/ref/DCP/dcp_test1/cpl_81fb54df-e1bf-4647-8788-ea7ba154375b.xml b/test/ref/DCP/dcp_test1/cpl_81fb54df-e1bf-4647-8788-ea7ba154375b.xml index ae0f23be..01eea88d 100644 --- a/test/ref/DCP/dcp_test1/cpl_81fb54df-e1bf-4647-8788-ea7ba154375b.xml +++ b/test/ref/DCP/dcp_test1/cpl_81fb54df-e1bf-4647-8788-ea7ba154375b.xml @@ -18,7 +18,6 @@ <AssetList> <MainMarkers> <Id>urn:uuid:93182bd2-b1e8-41a3-b5c8-6e6564273bff</Id> - <AnnotationText></AnnotationText> <EditRate>24 1</EditRate> <IntrinsicDuration>24</IntrinsicDuration> <EntryPoint>0</EntryPoint> @@ -36,7 +35,6 @@ </MainMarkers> <MainPicture> <Id>urn:uuid:46c3eb45-15e5-47d6-8684-d8641e4dc516</Id> - <AnnotationText></AnnotationText> <EditRate>24 1</EditRate> <IntrinsicDuration>24</IntrinsicDuration> <EntryPoint>0</EntryPoint> @@ -47,7 +45,6 @@ </MainPicture> <MainSound> <Id>urn:uuid:8b92bcee-62fc-4a33-a51a-816e9611ce85</Id> - <AnnotationText></AnnotationText> <EditRate>24 1</EditRate> <IntrinsicDuration>24</IntrinsicDuration> <EntryPoint>0</EntryPoint> diff --git a/test/ref/DCP/dcp_test1/pkl_6af1e0c1-c441-47f8-a502-3efd46b1fa4f.xml b/test/ref/DCP/dcp_test1/pkl_6af1e0c1-c441-47f8-a502-3efd46b1fa4f.xml index 3f285d23..cf753574 100644 --- a/test/ref/DCP/dcp_test1/pkl_6af1e0c1-c441-47f8-a502-3efd46b1fa4f.xml +++ b/test/ref/DCP/dcp_test1/pkl_6af1e0c1-c441-47f8-a502-3efd46b1fa4f.xml @@ -9,8 +9,8 @@ <Asset> <Id>urn:uuid:81fb54df-e1bf-4647-8788-ea7ba154375b</Id> <AnnotationText>81fb54df-e1bf-4647-8788-ea7ba154375b</AnnotationText> - <Hash>c1DRq6GaSzV2brF0YnSNed46nqk=</Hash> - <Size>8762</Size> + <Hash>6pkiSEIBuZW7KEY73GrNNw8UjDE=</Hash> + <Size>8630</Size> <Type>text/xml</Type> </Asset> <Asset> diff --git a/test/ref/DCP/dcp_test2/ASSETMAP.xml b/test/ref/DCP/dcp_test2/ASSETMAP.xml index 61cf5d21..23390415 100644 --- a/test/ref/DCP/dcp_test2/ASSETMAP.xml +++ b/test/ref/DCP/dcp_test2/ASSETMAP.xml @@ -26,7 +26,7 @@ <Path>cpl_81fb54df-e1bf-4647-8788-ea7ba154375b.xml</Path> <VolumeIndex>1</VolumeIndex> <Offset>0</Offset> - <Length>1774</Length> + <Length>1686</Length> </Chunk> </ChunkList> </Asset> diff --git a/test/ref/DCP/dcp_test2/cpl_81fb54df-e1bf-4647-8788-ea7ba154375b.xml b/test/ref/DCP/dcp_test2/cpl_81fb54df-e1bf-4647-8788-ea7ba154375b.xml index 6e5fab73..3910dcd3 100644 --- a/test/ref/DCP/dcp_test2/cpl_81fb54df-e1bf-4647-8788-ea7ba154375b.xml +++ b/test/ref/DCP/dcp_test2/cpl_81fb54df-e1bf-4647-8788-ea7ba154375b.xml @@ -18,7 +18,6 @@ <AssetList> <MainSound> <Id>urn:uuid:77e1fb48-ce0c-4d29-bf88-8c3bfec8013a</Id> - <AnnotationText></AnnotationText> <EditRate>24 1</EditRate> <IntrinsicDuration>24</IntrinsicDuration> <EntryPoint>0</EntryPoint> @@ -27,7 +26,6 @@ </MainSound> <msp-cpl:MainStereoscopicPicture xmlns:msp-cpl="http://www.smpte-ra.org/schemas/429-10/2008/Main-Stereo-Picture-CPL"> <Id>urn:uuid:46c3eb45-15e5-47d6-8684-d8641e4dc516</Id> - <AnnotationText></AnnotationText> <EditRate>24 1</EditRate> <IntrinsicDuration>24</IntrinsicDuration> <EntryPoint>0</EntryPoint> diff --git a/test/ref/DCP/dcp_test2/pkl_6af1e0c1-c441-47f8-a502-3efd46b1fa4f.xml b/test/ref/DCP/dcp_test2/pkl_6af1e0c1-c441-47f8-a502-3efd46b1fa4f.xml index a37a062a..abfd5100 100644 --- a/test/ref/DCP/dcp_test2/pkl_6af1e0c1-c441-47f8-a502-3efd46b1fa4f.xml +++ b/test/ref/DCP/dcp_test2/pkl_6af1e0c1-c441-47f8-a502-3efd46b1fa4f.xml @@ -9,8 +9,8 @@ <Asset> <Id>urn:uuid:81fb54df-e1bf-4647-8788-ea7ba154375b</Id> <AnnotationText>81fb54df-e1bf-4647-8788-ea7ba154375b</AnnotationText> - <Hash>Q9GRM2MtKZAg5FEIEkRsL28rNeQ=</Hash> - <Size>1774</Size> + <Hash>9JCFUMDcUujOZxSqSig3u/5wIuI=</Hash> + <Size>1686</Size> <Type>text/xml</Type> </Asset> <Asset> diff --git a/test/ref/DCP/dcp_test5/ASSETMAP.xml b/test/ref/DCP/dcp_test5/ASSETMAP.xml index 3f5d9076..fb9f897a 100644 --- a/test/ref/DCP/dcp_test5/ASSETMAP.xml +++ b/test/ref/DCP/dcp_test5/ASSETMAP.xml @@ -26,7 +26,7 @@ <Path>cpl_81fb54df-e1bf-4647-8788-ea7ba154375b.xml</Path> <VolumeIndex>1</VolumeIndex> <Offset>0</Offset> - <Length>2156</Length> + <Length>2024</Length> </Chunk> </ChunkList> </Asset> diff --git a/test/ref/DCP/dcp_test5/cpl_81fb54df-e1bf-4647-8788-ea7ba154375b.xml b/test/ref/DCP/dcp_test5/cpl_81fb54df-e1bf-4647-8788-ea7ba154375b.xml index a7a1441e..69558723 100644 --- a/test/ref/DCP/dcp_test5/cpl_81fb54df-e1bf-4647-8788-ea7ba154375b.xml +++ b/test/ref/DCP/dcp_test5/cpl_81fb54df-e1bf-4647-8788-ea7ba154375b.xml @@ -18,7 +18,6 @@ <AssetList> <MainPicture> <Id>urn:uuid:46c3eb45-15e5-47d6-8684-d8641e4dc516</Id> - <AnnotationText></AnnotationText> <EditRate>24 1</EditRate> <IntrinsicDuration>24</IntrinsicDuration> <EntryPoint>0</EntryPoint> @@ -29,7 +28,6 @@ </MainPicture> <MainSound> <Id>urn:uuid:8b92bcee-62fc-4a33-a51a-816e9611ce85</Id> - <AnnotationText></AnnotationText> <EditRate>24 1</EditRate> <IntrinsicDuration>24</IntrinsicDuration> <EntryPoint>0</EntryPoint> @@ -38,7 +36,6 @@ </MainSound> <axd:AuxData xmlns:axd="http://www.dolby.com/schemas/2012/AD"> <Id>urn:uuid:b68febcc-5ddf-489a-84a7-924f29fa2afd</Id> - <AnnotationText></AnnotationText> <EditRate>24 1</EditRate> <IntrinsicDuration>1489</IntrinsicDuration> <EntryPoint>0</EntryPoint> diff --git a/test/ref/DCP/dcp_test5/pkl_5d51e8a1-b2a5-4da6-9b66-4615c3609440.xml b/test/ref/DCP/dcp_test5/pkl_5d51e8a1-b2a5-4da6-9b66-4615c3609440.xml index 6f7974a4..0ae84d3d 100644 --- a/test/ref/DCP/dcp_test5/pkl_5d51e8a1-b2a5-4da6-9b66-4615c3609440.xml +++ b/test/ref/DCP/dcp_test5/pkl_5d51e8a1-b2a5-4da6-9b66-4615c3609440.xml @@ -9,8 +9,8 @@ <Asset> <Id>urn:uuid:81fb54df-e1bf-4647-8788-ea7ba154375b</Id> <AnnotationText>81fb54df-e1bf-4647-8788-ea7ba154375b</AnnotationText> - <Hash>kvvGY8+ZNsyJyWk6i5Ha1dRpFQU=</Hash> - <Size>2156</Size> + <Hash>+a4c/A2gZJW4rVH5BZ7jbb6qXkc=</Hash> + <Size>2024</Size> <Type>text/xml</Type> </Asset> <Asset> diff --git a/test/ref/DCP/dcp_test7/ASSETMAP b/test/ref/DCP/dcp_test7/ASSETMAP index f82ce56f..71873d99 100644 --- a/test/ref/DCP/dcp_test7/ASSETMAP +++ b/test/ref/DCP/dcp_test7/ASSETMAP @@ -26,7 +26,7 @@ <Path>cpl_81fb54df-e1bf-4647-8788-ea7ba154375b.xml</Path> <VolumeIndex>1</VolumeIndex> <Offset>0</Offset> - <Length>2168</Length> + <Length>2036</Length> </Chunk> </ChunkList> </Asset> diff --git a/test/ref/DCP/dcp_test7/cpl_81fb54df-e1bf-4647-8788-ea7ba154375b.xml b/test/ref/DCP/dcp_test7/cpl_81fb54df-e1bf-4647-8788-ea7ba154375b.xml index d3589fc5..89f6851d 100644 --- a/test/ref/DCP/dcp_test7/cpl_81fb54df-e1bf-4647-8788-ea7ba154375b.xml +++ b/test/ref/DCP/dcp_test7/cpl_81fb54df-e1bf-4647-8788-ea7ba154375b.xml @@ -18,7 +18,6 @@ <AssetList> <MainMarkers> <Id>urn:uuid:93182bd2-b1e8-41a3-b5c8-6e6564273bff</Id> - <AnnotationText></AnnotationText> <EditRate>24 1</EditRate> <IntrinsicDuration>24</IntrinsicDuration> <EntryPoint>0</EntryPoint> @@ -36,7 +35,6 @@ </MainMarkers> <MainPicture> <Id>urn:uuid:46c3eb45-15e5-47d6-8684-d8641e4dc516</Id> - <AnnotationText></AnnotationText> <EditRate>24 1</EditRate> <IntrinsicDuration>24</IntrinsicDuration> <EntryPoint>0</EntryPoint> @@ -47,7 +45,6 @@ </MainPicture> <MainSound> <Id>urn:uuid:8b92bcee-62fc-4a33-a51a-816e9611ce85</Id> - <AnnotationText></AnnotationText> <EditRate>24 1</EditRate> <IntrinsicDuration>24</IntrinsicDuration> <EntryPoint>0</EntryPoint> diff --git a/test/ref/DCP/dcp_test7/pkl_6af1e0c1-c441-47f8-a502-3efd46b1fa4f.xml b/test/ref/DCP/dcp_test7/pkl_6af1e0c1-c441-47f8-a502-3efd46b1fa4f.xml index a2c83a0e..6d529422 100644 --- a/test/ref/DCP/dcp_test7/pkl_6af1e0c1-c441-47f8-a502-3efd46b1fa4f.xml +++ b/test/ref/DCP/dcp_test7/pkl_6af1e0c1-c441-47f8-a502-3efd46b1fa4f.xml @@ -9,8 +9,8 @@ <Asset> <Id>urn:uuid:81fb54df-e1bf-4647-8788-ea7ba154375b</Id> <AnnotationText>81fb54df-e1bf-4647-8788-ea7ba154375b</AnnotationText> - <Hash>LE8AZqXvZYb8W6QjVZiN7zB8Tro=</Hash> - <Size>2168</Size> + <Hash>qD31AlG29UXWwTGYch5P+zuD3xc=</Hash> + <Size>2036</Size> <Type>text/xml;asdcpKind=CPL</Type> </Asset> <Asset> diff --git a/test/ref/DCP/encryption_test/ASSETMAP.xml b/test/ref/DCP/encryption_test/ASSETMAP.xml index 3c1ca16c..71fa54ac 100644 --- a/test/ref/DCP/encryption_test/ASSETMAP.xml +++ b/test/ref/DCP/encryption_test/ASSETMAP.xml @@ -26,7 +26,7 @@ <Path>cpl_81fb54df-e1bf-4647-8788-ea7ba154375b.xml</Path> <VolumeIndex>1</VolumeIndex> <Offset>0</Offset> - <Length>9314</Length> + <Length>9226</Length> </Chunk> </ChunkList> </Asset> diff --git a/test/ref/DCP/encryption_test/cpl_81fb54df-e1bf-4647-8788-ea7ba154375b.xml b/test/ref/DCP/encryption_test/cpl_81fb54df-e1bf-4647-8788-ea7ba154375b.xml index 598444b4..2866df6d 100644 --- a/test/ref/DCP/encryption_test/cpl_81fb54df-e1bf-4647-8788-ea7ba154375b.xml +++ b/test/ref/DCP/encryption_test/cpl_81fb54df-e1bf-4647-8788-ea7ba154375b.xml @@ -18,7 +18,6 @@ <AssetList> <MainPicture> <Id>urn:uuid:e98d059d-645f-4343-a30f-edc61d58b8e0</Id> - <AnnotationText></AnnotationText> <EditRate>24 1</EditRate> <IntrinsicDuration>24</IntrinsicDuration> <EntryPoint>0</EntryPoint> @@ -30,7 +29,6 @@ </MainPicture> <MainSound> <Id>urn:uuid:11471a77-7cd8-4de6-8c11-beaa198c015f</Id> - <AnnotationText></AnnotationText> <EditRate>24 1</EditRate> <IntrinsicDuration>24</IntrinsicDuration> <EntryPoint>0</EntryPoint> @@ -59,15 +57,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>G/4l/FrHjANRjHMvx1wwtojaqXY=</dsig:DigestValue> + <dsig:DigestValue>4/8QgoO0blTh31eQ8ubu1zkECYc=</dsig:DigestValue> </dsig:Reference> </dsig:SignedInfo> - <dsig:SignatureValue>tLWdo5wkG1aseboTfSONMMYLEnd89Wqcjw0Gwhw71wX/lEKEGYiCluUchInurc6J -+Lq7rgNz+SPg7XIgh1N58EHqEarwH6oFTf2ZFMtoEzmX1nXcjKR7MRYomMtCBb/V -g+LOpPuOY+36bQ/8XBYiH8t1w6ayNSLI0LGTuAfJDz+/L6wAGRSLosQgVThjz3bE -nnl9V96ufU3vMPcrq2YpT99Rb61gX3ItBKW60FiTX+NB5vBwQ1lq4vJ6qno4aviE -HEebN6byReZtqm+X6/olVvVHJBAyOG1ZKOb9Oj6I2Iw4hx0OYB70Tg7Qkx+f8zsl -HHXyc9gA+KzKStrrm390oA==</dsig:SignatureValue> + <dsig:SignatureValue>jHGd0G9X7iT26LNertFIPsKGIVUxUNEZWSDmjzYH4QwP2SAYOMh/tGXAaUQyy2vA ++qCj+OQavpBS8q1HMekyUrShRo18XY6mpS3lSADdZBY7TLExCdkLtSq7yoPVfzx+ ++iRypVIKBl6xbv9wf/ssCzpxXMbsuaL5BGbOdRlgH7FFdQN5GKbAWVYoCmPHcl+q +S2BLqXN1S9LjB4zQ606bVq2C4S7mUYqAFZ0a9w/MK1RU5kFRJfq7W2ZktvhIWrFI +K6iF4XGhwoCURfPKP9piAwrpR+5sI7LuknMLa/JHPYzkBCH63oZoNW8vHyzCBNpR +ADgG10jZGAXp+GY0BL8v2w==</dsig:SignatureValue> <dsig:KeyInfo> <dsig:X509Data> <dsig:X509IssuerSerial> diff --git a/test/ref/DCP/encryption_test/pkl_8ee8f7da-8da2-4adb-ae0e-31e8f4b91900.xml b/test/ref/DCP/encryption_test/pkl_8ee8f7da-8da2-4adb-ae0e-31e8f4b91900.xml index ecacaac5..b97d6eaf 100644 --- a/test/ref/DCP/encryption_test/pkl_8ee8f7da-8da2-4adb-ae0e-31e8f4b91900.xml +++ b/test/ref/DCP/encryption_test/pkl_8ee8f7da-8da2-4adb-ae0e-31e8f4b91900.xml @@ -9,8 +9,8 @@ <Asset> <Id>urn:uuid:81fb54df-e1bf-4647-8788-ea7ba154375b</Id> <AnnotationText>81fb54df-e1bf-4647-8788-ea7ba154375b</AnnotationText> - <Hash>iBE1dh+gKFCi7R93mx2AoJ1eaek=</Hash> - <Size>9314</Size> + <Hash>zk4L2kXj9llDdjmxCW2d2X06VQM=</Hash> + <Size>9226</Size> <Type>text/xml</Type> </Asset> <Asset> @@ -46,15 +46,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>iFEJZ3tiVaiuJMzVY/ju8qx+KV0=</dsig:DigestValue> + <dsig:DigestValue>xzO3cFwUX87TL4rL9jq6CLqDN6I=</dsig:DigestValue> </dsig:Reference> </dsig:SignedInfo> - <dsig:SignatureValue>GKFnAkzVuhXi391uAz5kRTmKaJKMKd3iAe1XtYsUoRfhVxtQCv/hha/W8xpVsP2J -g/duTyASL/T4vdaQsrR8K3JUwP/r/gWlN3UfcFIORHkKeJ9OOBSIdauthODZpAJw -V+ZfgTu5S8aTh4XqkWWeVDQSsBWJhgHWFM4vrPrsWxae4l3SGj2DpcXUPhLOe55+ -Xh/sVJVH8CpEcNGKNDZnaJShUI6Ige45ElUePZNsYRNLBDWDcYw+nR0DAUovEuCh -CFqB2H9FKwufxAIWqbEYSca4liHlgFYL7TuHgaDbzdjTlQ8oL3kCPGbtVX5oWiEu -ZksAYCwT9sDxSxeThmFZOQ==</dsig:SignatureValue> + <dsig:SignatureValue>VIZyD5JmV2gnPyzMEMwDaIg+NBOZzpSvBoRtPbWrYUyjxVzQfPvFzAAE+4hz8Wc7 +TIpiTZ3sYXKRQAEmA4Iu5AOJ2uijv8tnioo2FyV6JT9aGr5cNi7eeGFmN7ILU4zc +rgp99iWgTRms8T8C7zy/NtE8P2q8K4sxQvxnYmK/0kHkQPQnWpZafAd6G/fpoV0h +5W8UQTtn72OEPhm21uxp4crWRk9YlF2ayGYDBGm8YFP01w663e0r61xq6ROW2O4i +jR2dQWPM1nzrafHSJKg2TL4S/GtTsDNNuIJihzGpmEjULX2FIt83f6dogyr7K624 +XcjpahE+WHn7WR3VVZsMkw==</dsig:SignatureValue> <dsig:KeyInfo> <dsig:X509Data> <dsig:X509IssuerSerial> diff --git a/test/ref/cpl_metadata_test1.xml b/test/ref/cpl_metadata_test1.xml index 58649e8d..1140c07d 100644 --- a/test/ref/cpl_metadata_test1.xml +++ b/test/ref/cpl_metadata_test1.xml @@ -18,7 +18,6 @@ <AssetList> <MainPicture> <Id>urn:uuid:e98d059d-645f-4343-a30f-edc61d58b8e0</Id> - <AnnotationText></AnnotationText> <EditRate>24 1</EditRate> <IntrinsicDuration>24</IntrinsicDuration> <EntryPoint>0</EntryPoint> diff --git a/test/ref/cpl_metadata_test2.xml b/test/ref/cpl_metadata_test2.xml index 01dd52d8..d04d25af 100644 --- a/test/ref/cpl_metadata_test2.xml +++ b/test/ref/cpl_metadata_test2.xml @@ -18,7 +18,6 @@ <AssetList> <MainPicture> <Id>urn:uuid:e98d059d-645f-4343-a30f-edc61d58b8e0</Id> - <AnnotationText></AnnotationText> <EditRate>24 1</EditRate> <IntrinsicDuration>24</IntrinsicDuration> <EntryPoint>0</EntryPoint> diff --git a/test/ref/write_interop_subtitle_test3/ASSETMAP b/test/ref/write_interop_subtitle_test3/ASSETMAP index 228a7e1c..7c901513 100644 --- a/test/ref/write_interop_subtitle_test3/ASSETMAP +++ b/test/ref/write_interop_subtitle_test3/ASSETMAP @@ -26,7 +26,7 @@ <Path>cpl_46c3eb45-15e5-47d6-8684-d8641e4dc516.xml</Path> <VolumeIndex>1</VolumeIndex> <Offset>0</Offset> - <Length>1105</Length> + <Length>1061</Length> </Chunk> </ChunkList> </Asset> diff --git a/test/ref/write_interop_subtitle_test3/pkl_e94b8a0d-27f7-408a-af16-78d3df419a91.xml b/test/ref/write_interop_subtitle_test3/pkl_e94b8a0d-27f7-408a-af16-78d3df419a91.xml index 664ad626..2da8e910 100644 --- a/test/ref/write_interop_subtitle_test3/pkl_e94b8a0d-27f7-408a-af16-78d3df419a91.xml +++ b/test/ref/write_interop_subtitle_test3/pkl_e94b8a0d-27f7-408a-af16-78d3df419a91.xml @@ -9,8 +9,8 @@ <Asset> <Id>urn:uuid:46c3eb45-15e5-47d6-8684-d8641e4dc516</Id> <AnnotationText>46c3eb45-15e5-47d6-8684-d8641e4dc516</AnnotationText> - <Hash>YkdOdaGok/Vrkq62zAkfCw1l/Y4=</Hash> - <Size>1105</Size> + <Hash>614bJ4VLsNZ6mLbdXbZXjGuoSsY=</Hash> + <Size>1061</Size> <Type>text/xml;asdcpKind=CPL</Type> </Asset> <Asset> diff --git a/test/verify_test.cc b/test/verify_test.cc index dab85a23..b2e98981 100644 --- a/test/verify_test.cc +++ b/test/verify_test.cc @@ -115,6 +115,9 @@ prepare_directory (path path) } +/** Copy dcp_test{reference_number} to build/test/verify_test{verify_test_suffix} + * to make a new sacrifical test DCP. + */ static path setup (int reference_number, string verify_test_suffix) { @@ -255,6 +258,10 @@ check_verify_result (vector<path> dir, vector<dcp::VerificationNote> test_notes) } +/* Copy dcp_test1 to build/test/verify_test{suffix} then edit a file found by the functor 'file', + * replacing from with to. Verify the resulting DCP and check that the results match the given + * list of codes. + */ static void check_verify_result_after_replace (string suffix, boost::function<path (string)> file, string from, string to, vector<dcp::VerificationNote::Code> codes) @@ -379,9 +386,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 'x6pkiSEIBuZW7KEY73GrNNw8UjDE=' is invalid Base64-encoded binary", canonical(dir / dcp_test1_pkl), 12 }, { dcp::VerificationNote::Type::ERROR, dcp::VerificationNote::Code::INVALID_XML, "value 'xLq7ot/GobgrqUYdlbR8FCD5APqs=' is invalid Base64-encoded binary", canonical(dir / dcp_test1_pkl), 26 }, { dcp::VerificationNote::Type::ERROR, dcp::VerificationNote::Code::INVALID_XML, "value 'xgVKhC9IkWyzQbgzpFcJ1bpqbtwk=' is invalid Base64-encoded binary", canonical(dir / dcp_test1_pkl), 19 }, - { dcp::VerificationNote::Type::ERROR, dcp::VerificationNote::Code::INVALID_XML, "value 'xc1DRq6GaSzV2brF0YnSNed46nqk=' is invalid Base64-encoded binary", canonical(dir / dcp_test1_pkl), 12 } }); } @@ -510,7 +517,7 @@ BOOST_AUTO_TEST_CASE (verify_invalid_xml_pkl_id) BOOST_AUTO_TEST_CASE (verify_invalid_xml_asset_map_id) { check_verify_result_after_replace ( - "invalix_xml_asset_map_id", &asset_map, + "invalid_xml_asset_map_id", &asset_map, "<Id>urn:uuid:" + dcp_test1_asset_map_id.substr(0, 3), "<Id>urn:uuid:x" + dcp_test1_asset_map_id.substr(1, 2), { dcp::VerificationNote::Code::INVALID_XML } @@ -936,8 +943,8 @@ BOOST_AUTO_TEST_CASE (verify_invalid_cpl_metadata_bad_tag) check_verify_result ( { dir }, { - { dcp::VerificationNote::Type::ERROR, dcp::VerificationNote::Code::INVALID_XML, string("no declaration found for element 'meta:MainSoundXConfiguration'"), canonical(cpl->file().get()), 54 }, - { dcp::VerificationNote::Type::ERROR, dcp::VerificationNote::Code::INVALID_XML, string("no declaration found for element 'meta:MainSoundXSampleRate'"), canonical(cpl->file().get()), 55 }, + { dcp::VerificationNote::Type::ERROR, dcp::VerificationNote::Code::INVALID_XML, string("no declaration found for element 'meta:MainSoundXConfiguration'"), canonical(cpl->file().get()), 52 }, + { dcp::VerificationNote::Type::ERROR, dcp::VerificationNote::Code::INVALID_XML, string("no declaration found for element 'meta:MainSoundXSampleRate'"), canonical(cpl->file().get()), 53 }, { dcp::VerificationNote::Type::ERROR, dcp::VerificationNote::Code::INVALID_XML, @@ -948,7 +955,7 @@ BOOST_AUTO_TEST_CASE (verify_invalid_cpl_metadata_bad_tag) "MainSoundSampleRate,MainPictureStoredArea,MainPictureActiveArea,MainSubtitleLanguageList?," "ExtensionMetadataList?,)'"), canonical(cpl->file().get()), - 75 + 73 }, { dcp::VerificationNote::Type::ERROR, dcp::VerificationNote::Code::MISMATCHED_CPL_HASHES, cpl->id(), canonical(cpl->file().get()) }, }); @@ -2727,8 +2734,8 @@ BOOST_AUTO_TEST_CASE (verify_invalid_xml_cpl_extension_metadata3) check_verify_result ( {dir}, { - { dcp::VerificationNote::Type::ERROR, dcp::VerificationNote::Code::INVALID_XML, string("no declaration found for element 'meta:NameX'"), cpl->file().get(), 75 }, - { dcp::VerificationNote::Type::ERROR, dcp::VerificationNote::Code::INVALID_XML, string("element 'meta:NameX' is not allowed for content model '(Name,PropertyList?,)'"), cpl->file().get(), 82 }, + { dcp::VerificationNote::Type::ERROR, dcp::VerificationNote::Code::INVALID_XML, string("no declaration found for element 'meta:NameX'"), cpl->file().get(), 72 }, + { dcp::VerificationNote::Type::ERROR, dcp::VerificationNote::Code::INVALID_XML, string("element 'meta:NameX' is not allowed for content model '(Name,PropertyList?,)'"), cpl->file().get(), 79 }, { dcp::VerificationNote::Type::ERROR, dcp::VerificationNote::Code::MISMATCHED_CPL_HASHES, cpl->id(), cpl->file().get() }, }); } @@ -2810,8 +2817,8 @@ BOOST_AUTO_TEST_CASE (verify_invalid_xml_cpl_extension_metadata6) check_verify_result ( {dir}, { - { dcp::VerificationNote::Type::ERROR, dcp::VerificationNote::Code::INVALID_XML, string("no declaration found for element 'meta:ValueX'"), cpl->file().get(), 79 }, - { dcp::VerificationNote::Type::ERROR, dcp::VerificationNote::Code::INVALID_XML, string("element 'meta:ValueX' is not allowed for content model '(Name,Value)'"), cpl->file().get(), 80 }, + { dcp::VerificationNote::Type::ERROR, dcp::VerificationNote::Code::INVALID_XML, string("no declaration found for element 'meta:ValueX'"), cpl->file().get(), 76 }, + { dcp::VerificationNote::Type::ERROR, dcp::VerificationNote::Code::INVALID_XML, string("element 'meta:ValueX' is not allowed for content model '(Name,Value)'"), cpl->file().get(), 77 }, { dcp::VerificationNote::Type::ERROR, dcp::VerificationNote::Code::MISMATCHED_CPL_HASHES, cpl->id(), cpl->file().get() }, }); } @@ -2866,8 +2873,8 @@ BOOST_AUTO_TEST_CASE (verify_invalid_xml_cpl_extension_metadata8) check_verify_result ( {dir}, { - { dcp::VerificationNote::Type::ERROR, dcp::VerificationNote::Code::INVALID_XML, string("no declaration found for element 'meta:PropertyX'"), cpl->file().get(), 77 }, - { dcp::VerificationNote::Type::ERROR, dcp::VerificationNote::Code::INVALID_XML, string("element 'meta:PropertyX' is not allowed for content model '(Property+)'"), cpl->file().get(), 81 }, + { dcp::VerificationNote::Type::ERROR, dcp::VerificationNote::Code::INVALID_XML, string("no declaration found for element 'meta:PropertyX'"), cpl->file().get(), 74 }, + { dcp::VerificationNote::Type::ERROR, dcp::VerificationNote::Code::INVALID_XML, string("element 'meta:PropertyX' is not allowed for content model '(Property+)'"), cpl->file().get(), 78 }, { dcp::VerificationNote::Type::ERROR, dcp::VerificationNote::Code::MISMATCHED_CPL_HASHES, cpl->id(), cpl->file().get() }, }); } @@ -2895,8 +2902,8 @@ BOOST_AUTO_TEST_CASE (verify_invalid_xml_cpl_extension_metadata9) check_verify_result ( {dir}, { - { dcp::VerificationNote::Type::ERROR, dcp::VerificationNote::Code::INVALID_XML, string("no declaration found for element 'meta:PropertyListX'"), cpl->file().get(), 76 }, - { dcp::VerificationNote::Type::ERROR, dcp::VerificationNote::Code::INVALID_XML, string("element 'meta:PropertyListX' is not allowed for content model '(Name,PropertyList?,)'"), cpl->file().get(), 82 }, + { dcp::VerificationNote::Type::ERROR, dcp::VerificationNote::Code::INVALID_XML, string("no declaration found for element 'meta:PropertyListX'"), cpl->file().get(), 73 }, + { dcp::VerificationNote::Type::ERROR, dcp::VerificationNote::Code::INVALID_XML, string("element 'meta:PropertyListX' is not allowed for content model '(Name,PropertyList?,)'"), cpl->file().get(), 79 }, { dcp::VerificationNote::Type::ERROR, dcp::VerificationNote::Code::MISMATCHED_CPL_HASHES, cpl->id(), cpl->file().get() }, }); } |
