diff options
| author | Carl Hetherington <cth@carlh.net> | 2020-03-09 21:07:30 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2020-03-09 21:07:30 +0100 |
| commit | 5f8a8d0b4e6a476f6b4d8da655fdff51bdcab8fd (patch) | |
| tree | 54482bede6b194d4897968a06dd0e59ac004d6b9 /src/verify.cc | |
| parent | e617a3f8073fbf8d1d9ef01b57e866dd41978b87 (diff) | |
| parent | 340ae40c51ee175063578ce80131a92d911d9838 (diff) | |
Merge.
Diffstat (limited to 'src/verify.cc')
| -rw-r--r-- | src/verify.cc | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/src/verify.cc b/src/verify.cc index c91257be..66cd25e4 100644 --- a/src/verify.cc +++ b/src/verify.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2018-2019 Carl Hetherington <cth@carlh.net> + Copyright (C) 2018-2020 Carl Hetherington <cth@carlh.net> This file is part of libdcp. @@ -196,6 +196,10 @@ public: add("http://www.w3.org/2001/XMLSchema.dtd", "XMLSchema.dtd"); add("http://www.w3.org/2001/03/xml.xsd", "xml.xsd"); add("http://www.w3.org/TR/2002/REC-xmldsig-core-20020212/xmldsig-core-schema.xsd", "xmldsig-core-schema.xsd"); + add("http://www.digicine.com/schemas/437-Y/2007/Main-Stereo-Picture-CPL.xsd", "Main-Stereo-Picture-CPL.xsd"); + add("http://www.digicine.com/PROTO-ASDCP-CPL-20040511.xsd", "PROTO-ASDCP-CPL-20040511.xsd"); + add("http://www.digicine.com/PROTO-ASDCP-PKL-20040311.xsd", "PROTO-ASDCP-PKL-20040311.xsd"); + add("http://www.digicine.com/PROTO-ASDCP-AM-20040311.xsd", "PROTO-ASDCP-AM-20040311.xsd"); } InputSource* resolveEntity(XMLCh const *, XMLCh const * system_id) @@ -245,7 +249,10 @@ validate_xml (boost::filesystem::path xml_file, boost::filesystem::path xsd_dtd_ schema["http://www.smpte-ra.org/schemas/429-7/2006/CPL"] = "SMPTE-429-7-2006-CPL.xsd"; schema["http://www.smpte-ra.org/schemas/429-8/2006/PKL"] = "SMPTE-429-8-2006-PKL.xsd"; schema["http://www.smpte-ra.org/schemas/429-9/2007/AM"] = "SMPTE-429-9-2007-AM.xsd"; - schema["http://www.w3.org/2001/03/xml.xsd"] = "xml.xsd"; + schema["http://www.digicine.com/schemas/437-Y/2007/Main-Stereo-Picture-CPL.xsd"] = "Main-Stereo-Picture-CPL.xsd"; + schema["http://www.digicine.com/PROTO-ASDCP-CPL-20040511#"] = "PROTO-ASDCP-CPL-20040511.xsd"; + schema["http://www.digicine.com/PROTO-ASDCP-PKL-20040311#"] = "PROTO-ASDCP-PKL-20040311.xsd"; + schema["http://www.digicine.com/PROTO-ASDCP-AM-20040311#"] = "PROTO-ASDCP-AM-20040311.xsd"; string locations; for (map<string, string>::const_iterator i = schema.begin(); i != schema.end(); ++i) { @@ -364,6 +371,16 @@ dcp::verify ( BOOST_FOREACH (shared_ptr<Reel> reel, cpl->reels()) { stage ("Checking reel", optional<boost::filesystem::path>()); + + BOOST_FOREACH (shared_ptr<ReelAsset> i, reel->assets()) { + if (i->duration() && (i->duration().get() * i->edit_rate().denominator / i->edit_rate().numerator) < 1) { + notes.push_back (VerificationNote(VerificationNote::VERIFY_ERROR, VerificationNote::DURATION_TOO_SMALL, i->id())); + } + if ((i->intrinsic_duration() * i->edit_rate().denominator / i->edit_rate().numerator) < 1) { + notes.push_back (VerificationNote(VerificationNote::VERIFY_ERROR, VerificationNote::INTRINSIC_DURATION_TOO_SMALL, i->id())); + } + } + if (reel->main_picture()) { /* Check reel stuff */ Fraction const frame_rate = reel->main_picture()->frame_rate(); @@ -470,6 +487,10 @@ dcp::note_to_string (dcp::VerificationNote note) return String::compose("An XML file is badly formed: %1 (%2:%3)", note.note().get(), note.file()->filename(), note.line().get()); case dcp::VerificationNote::MISSING_ASSETMAP: return "No ASSETMAP or ASSETMAP.xml was found"; + case dcp::VerificationNote::INTRINSIC_DURATION_TOO_SMALL: + return String::compose("The intrinsic duration of an asset is less than 1 second long: %1", note.note().get()); + case dcp::VerificationNote::DURATION_TOO_SMALL: + return String::compose("The duration of an asset is less than 1 second long: %1", note.note().get()); } return ""; |
