Bv2.1 6.1: DCPs must be SMPTE.
authorCarl Hetherington <cth@carlh.net>
Tue, 8 Dec 2020 22:42:40 +0000 (23:42 +0100)
committerCarl Hetherington <cth@carlh.net>
Sun, 17 Jan 2021 19:13:22 +0000 (20:13 +0100)
run/tests
src/verify.cc
src/verify.h
test/combine_test.cc
test/verify_test.cc
tools/dcpverify.cc

index 489614f27ab1ea438cbd5a69b562ce70f270ce4d..3e5defa35efbc569b3bb8ae7ed7d1d23a5797fe3 100755 (executable)
--- a/run/tests
+++ b/run/tests
@@ -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
index e31fa682df73eaca67a7acaeedfc31688bce40ce..f3ecb1f4d09a2413050a31516a4ff52a9ba88bd8 100644 (file)
@@ -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 "";
index 4b4442e412f7ad11bbf509b549e205b118e9f5cd..0140066e7edd72a76dfd008a2a6bcda82cc9baa6 100644 (file)
@@ -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)
index 6db968f62cb662b915edf9ce7f6655cd4a62b058..c62f0322b687da4459dc49966c798af7c9c46967 100644 (file)
@@ -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());
 }
index fdf85100017ded152a1ee6b029efa9326dab0e61..5a05bcd36ab35c5947ffd3c5d456bfe5440bda52 100644 (file)
@@ -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;
 }
 
 
index c26fe7c4d0973e1500b9bd58a8dd81425878b720..b3c93bdd297d53eb0144e39b445fe6680259542c 100644 (file)
@@ -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";