summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2020-12-12 20:33:15 +0100
committerCarl Hetherington <cth@carlh.net>2021-01-17 20:13:22 +0100
commitab9d9fe2f33bf5fadb0132120111e0e73c86ca09 (patch)
tree0cf431c3a4ce79d4c2a4ef96ef6fd9de2ae10344
parent621b82e1a5dfeb34602f336d645c670618d6db7e (diff)
Bv2.1 6.2.1: Check that release territory conforms to RFC 5646.
-rw-r--r--BRANCH5
-rw-r--r--src/cpl.h4
-rw-r--r--src/verify.cc4
-rw-r--r--test/verify_test.cc15
4 files changed, 21 insertions, 7 deletions
diff --git a/BRANCH b/BRANCH
index abeaa5e3..9ea3ee09 100644
--- 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
+
diff --git a/src/cpl.h b/src/cpl.h
index 8d7c76e4..6805cc89 100644
--- 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);
diff --git a/src/verify.cc b/src/verify.cc
index 16233021..363264db 100644
--- a/src/verify.cc
+++ b/src/verify.cc
@@ -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());
diff --git a/test/verify_test.cc b/test/verify_test.cc
index 91d4a8e1..438dbbd6 100644
--- a/test/verify_test.cc
+++ b/test/verify_test.cc
@@ -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;
}