Bv2.1 6.2.1: Check that release territory conforms to RFC 5646.
authorCarl Hetherington <cth@carlh.net>
Sat, 12 Dec 2020 19:33:15 +0000 (20:33 +0100)
committerCarl Hetherington <cth@carlh.net>
Sun, 17 Jan 2021 19:13:22 +0000 (20:13 +0100)
BRANCH
src/cpl.h
src/verify.cc
test/verify_test.cc

diff --git a/BRANCH b/BRANCH
index abeaa5e3c2718d015280789279c977274b3cb1f0..9ea3ee097f6d8e496412d6c585b8ed5b5a3cad53 100644 (file)
--- a/BRANCH
+++ b/BRANCH
@@ -13,6 +13,9 @@ Mark things with [Bv2.1_paragraph]
     - sound MXF Language [/]
     - ccap reel <Language> [/]
     - MainSubtitleLanguageList [/]
-    - RFC5646SpokenLanguage
+    - RFC5646SpokenLanguage [*] awkward; held in MXFs and duplicated in CPL metadata
     - CPL metadata ReleaseTerritory
 
+7 [/]
+7.1 picture essence encoding; frame size, rate and 2D/3D will be one of the four allowed combinations
+
index 8d7c76e4d1278cd9f7400355f862b5d20f76ace8..6805cc8949ba3479feede6232d7873b75e03619e 100644 (file)
--- a/src/cpl.h
+++ b/src/cpl.h
@@ -54,7 +54,7 @@
 #include <vector>
 
 
-struct verify_invalid_sound_reel_and_additional_language;
+struct verify_various_invalid_languages;
 
 
 namespace dcp {
@@ -283,7 +283,7 @@ protected:
        std::string pkl_type (Standard standard) const;
 
 private:
-       friend struct ::verify_invalid_sound_reel_and_additional_language;
+       friend struct ::verify_various_invalid_languages;
 
        void maybe_write_composition_metadata_asset (xmlpp::Element* node) const;
        void read_composition_metadata_asset (cxml::ConstNodePtr node);
index 16233021b8d27153bc5ea22399b4a709b706d800..363264db8c79b91c91a4716b363967ec2fc073fb 100644 (file)
@@ -647,6 +647,10 @@ dcp::verify (
                                verify_language_tag (i, notes);
                        }
 
+                       if (cpl->release_territory()) {
+                               verify_language_tag (cpl->release_territory().get(), notes);
+                       }
+
                        /* Check that the CPL's hash corresponds to the PKL */
                        BOOST_FOREACH (shared_ptr<PKL> i, dcp->pkls()) {
                                optional<string> h = i->hash(cpl->id());
index 91d4a8e1f26d278f8e5375fc0c953cb8a799ca5f..438dbbd6c813533e095ad0aab0e8e0712b4cd6f3 100644 (file)
@@ -951,10 +951,12 @@ BOOST_AUTO_TEST_CASE (verify_invalid_closed_caption_languages)
 }
 
 
-/* SMPTE DCP with invalid <Language> in the MainSound reel and in the CPL additional subtitles languages */
-BOOST_AUTO_TEST_CASE (verify_invalid_sound_reel_and_additional_language)
+/* SMPTE DCP with invalid <Language> in the MainSound reel, the CPL additional subtitles languages and
+ * the release territory.
+ */
+BOOST_AUTO_TEST_CASE (verify_various_invalid_languages)
 {
-       boost::filesystem::path const dir("build/test/verify_invalid_sound_reel_and_additional_language");
+       boost::filesystem::path const dir("build/test/verify_various_invalid_languages");
        prepare_directory (dir);
 
        shared_ptr<dcp::MonoPictureAsset> picture = simple_picture (dir, "foo");
@@ -972,6 +974,7 @@ BOOST_AUTO_TEST_CASE (verify_invalid_sound_reel_and_additional_language)
        cpl->set_main_sound_sample_rate (48000);
        cpl->set_main_picture_stored_area (dcp::Size(1998, 1080));
        cpl->set_main_picture_active_area (dcp::Size(1440, 1080));
+       cpl->_release_territory = "fred-jim";
        shared_ptr<dcp::DCP> dcp(new dcp::DCP(dir));
        dcp->add (cpl);
        dcp->write_xml (dcp::SMPTE);
@@ -979,7 +982,7 @@ BOOST_AUTO_TEST_CASE (verify_invalid_sound_reel_and_additional_language)
        vector<boost::filesystem::path> dirs;
        dirs.push_back (dir);
        list<dcp::VerificationNote> notes = dcp::verify (dirs, &stage, &progress, xsd_test);
-       BOOST_REQUIRE_EQUAL (notes.size(), 3U);
+       BOOST_REQUIRE_EQUAL (notes.size(), 4U);
        list<dcp::VerificationNote>::const_iterator i = notes.begin ();
        BOOST_CHECK_EQUAL (i->code(), dcp::VerificationNote::BAD_LANGUAGE);
        BOOST_REQUIRE (i->note());
@@ -991,6 +994,10 @@ BOOST_AUTO_TEST_CASE (verify_invalid_sound_reel_and_additional_language)
        ++i;
        BOOST_CHECK_EQUAL (i->code(), dcp::VerificationNote::BAD_LANGUAGE);
        BOOST_REQUIRE (i->note());
+       BOOST_CHECK_EQUAL (*i->note(), "fred-jim");
+       ++i;
+       BOOST_CHECK_EQUAL (i->code(), dcp::VerificationNote::BAD_LANGUAGE);
+       BOOST_REQUIRE (i->note());
        BOOST_CHECK_EQUAL (*i->note(), "frobozz");
        ++i;
 }