diff options
| author | Carl Hetherington <cth@carlh.net> | 2020-12-08 23:42:40 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2021-01-17 20:13:22 +0100 |
| commit | 8dd69a2a86b64bbf5ec80a78a6ad74865f752fde (patch) | |
| tree | 3edcb1bbf14b85c61e3124f3c76bfd54f6121d8c | |
| parent | b6cfa3cfa660622997a52f00a9f0376339c0f743 (diff) | |
Bv2.1 6.1: DCPs must be SMPTE.
| -rwxr-xr-x | run/tests | 2 | ||||
| -rw-r--r-- | src/verify.cc | 6 | ||||
| -rw-r--r-- | src/verify.h | 2 | ||||
| -rw-r--r-- | test/combine_test.cc | 8 | ||||
| -rw-r--r-- | test/verify_test.cc | 24 | ||||
| -rw-r--r-- | tools/dcpverify.cc | 11 |
6 files changed, 45 insertions, 8 deletions
@@ -113,7 +113,7 @@ done # Run dcpverify on all the DCPs in private/metadata for d in `find $private/metadata -mindepth 1 -maxdepth 1 -type d | sort -f -d`; do if [ `basename $d` != ".git" ]; then - $dcpverify --ignore-missing-assets -q $d + $dcpverify --ignore-missing-assets --ignore-bv21-smpte -q $d if [ "$?" != "0" ]; then echo "FAIL: dcpverify failed for $d" exit 1 diff --git a/src/verify.cc b/src/verify.cc index e31fa682..f3ecb1f4 100644 --- a/src/verify.cc +++ b/src/verify.cc @@ -591,6 +591,10 @@ dcp::verify ( notes.push_back (VerificationNote(VerificationNote::VERIFY_ERROR, VerificationNote::GENERAL_READ, string(e.what()))); } + if (dcp->standard() != dcp::SMPTE) { + notes.push_back (VerificationNote(VerificationNote::VERIFY_BV21_ERROR, VerificationNote::NOT_SMPTE)); + } + BOOST_FOREACH (shared_ptr<CPL> cpl, dcp->cpls()) { stage ("Checking CPL", cpl->file()); validate_xml (cpl->file().get(), xsd_dtd_directory, notes); @@ -698,6 +702,8 @@ dcp::note_to_string (dcp::VerificationNote note) return String::compose("The instantaneous bit rate of the picture asset %1 is close to the limit of 250Mbit/s in at least one place.", note.file()->filename()); case dcp::VerificationNote::EXTERNAL_ASSET: return String::compose("An asset that this DCP refers to is not included in the DCP. It may be a VF. Missing asset is %1.", note.note().get()); + case dcp::VerificationNote::NOT_SMPTE: + return "This DCP does not use the SMPTE standard, which is required for Bv2.1 compliance."; } return ""; diff --git a/src/verify.h b/src/verify.h index 4b4442e4..0140066e 100644 --- a/src/verify.h +++ b/src/verify.h @@ -90,6 +90,8 @@ public: PICTURE_FRAME_NEARLY_TOO_LARGE, /** An asset that the CPL requires is not in this DCP; the DCP may be a VF */ EXTERNAL_ASSET, + /** DCP is Interop, not SMPTE [Bv2.1_6.1] */ + NOT_SMPTE, }; VerificationNote (Type type, Code code) diff --git a/test/combine_test.cc b/test/combine_test.cc index 6db968f6..c62f0322 100644 --- a/test/combine_test.cc +++ b/test/combine_test.cc @@ -85,6 +85,14 @@ check_no_errors (boost::filesystem::path path) vector<boost::filesystem::path> directories; directories.push_back (path); list<dcp::VerificationNote> notes = dcp::verify (directories, &stage, &progress, xsd_test); + for (list<dcp::VerificationNote>::iterator i = notes.begin(); i != notes.end(); ) { + list<dcp::VerificationNote>::iterator tmp = i; + ++tmp; + if (i->code() == dcp::VerificationNote::NOT_SMPTE) { + notes.erase (i); + } + i = tmp; + } dump_notes (notes); BOOST_CHECK (notes.empty()); } diff --git a/test/verify_test.cc b/test/verify_test.cc index fdf85100..5a05bcd3 100644 --- a/test/verify_test.cc +++ b/test/verify_test.cc @@ -485,7 +485,10 @@ BOOST_AUTO_TEST_CASE (verify_test13) ++st; BOOST_REQUIRE (st == stages.end()); - BOOST_CHECK_EQUAL (notes.size(), 0); + BOOST_REQUIRE_EQUAL (notes.size(), 1U); + list<dcp::VerificationNote>::const_iterator i = notes.begin (); + BOOST_CHECK_EQUAL (i->type(), dcp::VerificationNote::VERIFY_BV21_ERROR); + BOOST_CHECK_EQUAL (i->code(), dcp::VerificationNote::NOT_SMPTE); } /* DCP with a short asset */ @@ -494,8 +497,10 @@ BOOST_AUTO_TEST_CASE (verify_test14) vector<boost::filesystem::path> directories = setup (8, 14); list<dcp::VerificationNote> notes = dcp::verify (directories, &stage, &progress, xsd_test); - BOOST_REQUIRE_EQUAL (notes.size(), 4); + BOOST_REQUIRE_EQUAL (notes.size(), 5); list<dcp::VerificationNote>::const_iterator i = notes.begin (); + BOOST_CHECK_EQUAL (i->code(), dcp::VerificationNote::NOT_SMPTE); + ++i; BOOST_CHECK_EQUAL (i->code(), dcp::VerificationNote::DURATION_TOO_SMALL); ++i; BOOST_CHECK_EQUAL (i->code(), dcp::VerificationNote::INTRINSIC_DURATION_TOO_SMALL); @@ -623,7 +628,9 @@ BOOST_AUTO_TEST_CASE (verify_test18) 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(), 0); + BOOST_REQUIRE_EQUAL (notes.size(), 1U); + list<dcp::VerificationNote>::const_iterator i = notes.begin (); + BOOST_CHECK_EQUAL (i->code(), dcp::VerificationNote::NOT_SMPTE); } @@ -652,9 +659,14 @@ BOOST_AUTO_TEST_CASE (verify_test19) 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(), 2); - BOOST_CHECK_EQUAL (notes.front().code(), dcp::VerificationNote::XML_VALIDATION_ERROR); - BOOST_CHECK_EQUAL (notes.back().code(), dcp::VerificationNote::XML_VALIDATION_ERROR); + BOOST_REQUIRE_EQUAL (notes.size(), 3); + list<dcp::VerificationNote>::const_iterator i = notes.begin (); + BOOST_CHECK_EQUAL (i->code(), dcp::VerificationNote::NOT_SMPTE); + ++i; + BOOST_CHECK_EQUAL (i->code(), dcp::VerificationNote::XML_VALIDATION_ERROR); + ++i; + BOOST_CHECK_EQUAL (i->code(), dcp::VerificationNote::XML_VALIDATION_ERROR); + ++i; } diff --git a/tools/dcpverify.cc b/tools/dcpverify.cc index c26fe7c4..b3c93bdd 100644 --- a/tools/dcpverify.cc +++ b/tools/dcpverify.cc @@ -57,6 +57,7 @@ help (string n) << " -V, --version show libdcp version\n" << " -h, --help show this help\n" << " --ignore-missing-assets don't give errors about missing assets\n" + << " --ignore-bv21-smpte don't give the SMPTE Bv2.1 error about a DCP not being SMPTE\n" << " -q, --quiet don't report progress\n"; } @@ -86,6 +87,7 @@ main (int argc, char* argv[]) dcp::init (); bool ignore_missing_assets = false; + bool ignore_bv21_smpte = false; bool quiet = false; int option_index = 0; @@ -94,11 +96,12 @@ main (int argc, char* argv[]) { "version", no_argument, 0, 'V' }, { "help", no_argument, 0, 'h' }, { "ignore-missing-assets", no_argument, 0, 'A' }, + { "ignore-bv21-smpte", no_argument, 0, 'B' }, { "quiet", no_argument, 0, 'q' }, { 0, 0, 0, 0 } }; - int c = getopt_long (argc, argv, "VhAq", long_options, &option_index); + int c = getopt_long (argc, argv, "VhABq", long_options, &option_index); if (c == -1) { break; @@ -114,6 +117,9 @@ main (int argc, char* argv[]) case 'A': ignore_missing_assets = true; break; + case 'B': + ignore_bv21_smpte = true; + break; case 'q': quiet = true; break; @@ -137,6 +143,9 @@ main (int argc, char* argv[]) bool failed = false; BOOST_FOREACH (dcp::VerificationNote i, notes) { + if (ignore_bv21_smpte && i.code() == dcp::VerificationNote::NOT_SMPTE) { + continue; + } switch (i.type()) { case dcp::VerificationNote::VERIFY_ERROR: cout << "Error: " << note_to_string(i) << "\n"; |
