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 | |
| parent | e617a3f8073fbf8d1d9ef01b57e866dd41978b87 (diff) | |
| parent | 340ae40c51ee175063578ce80131a92d911d9838 (diff) | |
Merge.
Diffstat (limited to 'src')
| -rw-r--r-- | src/reel.cc | 20 | ||||
| -rw-r--r-- | src/reel.h | 2 | ||||
| -rw-r--r-- | src/util.cc | 4 | ||||
| -rw-r--r-- | src/verify.cc | 25 | ||||
| -rw-r--r-- | src/verify.h | 6 |
5 files changed, 52 insertions, 5 deletions
diff --git a/src/reel.cc b/src/reel.cc index 14c0b1e2..3bf249c9 100644 --- a/src/reel.cc +++ b/src/reel.cc @@ -282,6 +282,26 @@ Reel::add (shared_ptr<ReelAsset> asset) } } +list<shared_ptr<ReelAsset> > +Reel::assets () const +{ + list<shared_ptr<ReelAsset> > a; + if (_main_picture) { + a.push_back (_main_picture); + } + if (_main_sound) { + a.push_back (_main_sound); + } + if (_main_subtitle) { + a.push_back (_main_subtitle); + } + std::copy (_closed_captions.begin(), _closed_captions.end(), back_inserter(a)); + if (_atmos) { + a.push_back (_atmos); + } + return a; +} + void Reel::resolve_refs (list<shared_ptr<Asset> > assets) { @@ -111,6 +111,8 @@ public: void add (boost::shared_ptr<ReelAsset> asset); + std::list<boost::shared_ptr<ReelAsset> > assets () const; + void write_to_cpl (xmlpp::Element* node, Standard standard) const; bool encrypted () const; diff --git a/src/util.cc b/src/util.cc index 9374b6e7..f755c21e 100644 --- a/src/util.cc +++ b/src/util.cc @@ -175,8 +175,8 @@ dcp::init () } #ifdef XMLSEC_CRYPTO_DYNAMIC_LOADING - if (xmlSecCryptoDLLoadLibrary(BAD_CAST XMLSEC_CRYPTO) < 0) { - throw MiscError ("unable to load default xmlsec-crypto library"); + if (xmlSecCryptoDLLoadLibrary(BAD_CAST "openssl") < 0) { + throw MiscError ("unable to load openssl xmlsec-crypto library"); } #endif 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 ""; diff --git a/src/verify.h b/src/verify.h index 89069bdd..38c9ee75 100644 --- a/src/verify.h +++ b/src/verify.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2018 Carl Hetherington <cth@carlh.net> + Copyright (C) 2018-2020 Carl Hetherington <cth@carlh.net> This file is part of libdcp. @@ -79,6 +79,10 @@ public: XML_VALIDATION_ERROR, /** No ASSETMAP{.xml} was found */ MISSING_ASSETMAP + /** An asset's IntrinsicDuration is less than 1 second */ + INTRINSIC_DURATION_TOO_SMALL, + /** An asset's Duration is less than 1 second */ + DURATION_TOO_SMALL }; VerificationNote (Type type, Code code) |
