summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2022-12-28 01:25:57 +0100
committerCarl Hetherington <cth@carlh.net>2024-04-14 22:48:35 +0200
commitd1dd43787960cd7974e24be5f8d73fe83a0e6c9a (patch)
tree3fae75b0aeb25ee7c6d49fe0befd793065f90cc6
parentd5aa7509cd1b50be5b6a929e00a2572b30585629 (diff)
Make verified DCPs available on the return from dcp::verify().
-rw-r--r--src/verify.cc4
-rw-r--r--src/verify.h12
-rw-r--r--test/combine_test.cc4
-rw-r--r--test/verify_test.cc10
-rw-r--r--tools/dcpverify.cc2
5 files changed, 21 insertions, 11 deletions
diff --git a/src/verify.cc b/src/verify.cc
index ba0007db..0003e0a6 100644
--- a/src/verify.cc
+++ b/src/verify.cc
@@ -1810,7 +1810,7 @@ verify_assetmap(Context& context, shared_ptr<const DCP> dcp)
}
-vector<VerificationNote>
+dcp::VerifyResult
dcp::verify (
vector<boost::filesystem::path> directories,
vector<dcp::DecryptedKDM> kdms,
@@ -1891,7 +1891,7 @@ dcp::verify (
}
}
- return notes;
+ return { notes, dcps };
}
diff --git a/src/verify.h b/src/verify.h
index 2adb47d2..77c5392b 100644
--- a/src/verify.h
+++ b/src/verify.h
@@ -58,6 +58,9 @@
namespace dcp {
+class DCP;
+
+
class VerificationNote
{
public:
@@ -659,7 +662,14 @@ struct VerificationOptions
};
-std::vector<VerificationNote> verify (
+struct VerifyResult
+{
+ std::vector<VerificationNote> notes;
+ std::vector<std::shared_ptr<dcp::DCP>> dcps;
+};
+
+
+VerifyResult verify(
std::vector<boost::filesystem::path> directories,
std::vector<dcp::DecryptedKDM> kdms,
boost::function<void (std::string, boost::optional<boost::filesystem::path>)> stage,
diff --git a/test/combine_test.cc b/test/combine_test.cc
index 12cbb6e2..eb43d8a3 100644
--- a/test/combine_test.cc
+++ b/test/combine_test.cc
@@ -87,7 +87,7 @@ check_no_errors (boost::filesystem::path path)
{
vector<boost::filesystem::path> directories;
directories.push_back (path);
- auto notes = dcp::verify(directories, {}, &stage, &progress, {}, xsd_test);
+ auto notes = dcp::verify(directories, {}, &stage, &progress, {}, xsd_test).notes;
vector<dcp::VerificationNote> filtered_notes;
std::copy_if (notes.begin(), notes.end(), std::back_inserter(filtered_notes), [](dcp::VerificationNote const& i) {
return i.code() != dcp::VerificationNote::Code::INVALID_STANDARD && i.code() != dcp::VerificationNote::Code::INVALID_SUBTITLE_DURATION;
@@ -475,7 +475,7 @@ BOOST_AUTO_TEST_CASE(combine_multi_reel_subtitles)
check_combined({in}, out);
- auto notes = dcp::verify({out}, {}, &stage, &progress, {}, xsd_test);
+ auto notes = dcp::verify({out}, {}, &stage, &progress, {}, xsd_test).notes;
vector<dcp::VerificationNote> filtered_notes;
std::copy_if(notes.begin(), notes.end(), std::back_inserter(filtered_notes), [](dcp::VerificationNote const& i) {
return i.code() != dcp::VerificationNote::Code::INVALID_STANDARD && i.code() != dcp::VerificationNote::Code::MISMATCHED_PKL_ANNOTATION_TEXT_WITH_CPL;
diff --git a/test/verify_test.cc b/test/verify_test.cc
index 3c2a3780..161201b9 100644
--- a/test/verify_test.cc
+++ b/test/verify_test.cc
@@ -199,7 +199,7 @@ static
void
check_verify_result(vector<path> dir, vector<dcp::DecryptedKDM> kdm, vector<dcp::VerificationNote> test_notes)
{
- auto notes = dcp::verify({dir}, kdm, &stage, &progress, {}, xsd_test);
+ auto notes = dcp::verify({dir}, kdm, &stage, &progress, {}, xsd_test).notes;
std::sort (notes.begin(), notes.end());
std::sort (test_notes.begin(), test_notes.end());
@@ -253,7 +253,7 @@ check_verify_result_after_replace (string suffix, boost::function<path (string)>
e.replace (from, to);
}
- auto notes = dcp::verify({dir}, {}, &stage, &progress, {}, xsd_test);
+ auto notes = dcp::verify({dir}, {}, &stage, &progress, {}, xsd_test).notes;
BOOST_REQUIRE_EQUAL (notes.size(), codes.size());
auto i = notes.begin();
@@ -301,7 +301,7 @@ BOOST_AUTO_TEST_CASE (verify_no_error)
{
stages.clear ();
auto dir = setup (1, "no_error");
- auto notes = dcp::verify({dir}, {}, &stage, &progress, {}, xsd_test);
+ auto notes = dcp::verify({dir}, {}, &stage, &progress, {}, xsd_test).notes;
path const cpl_file = dir / dcp_test1_cpl();
path const pkl_file = dir / dcp_test1_pkl();
@@ -565,7 +565,7 @@ BOOST_AUTO_TEST_CASE (verify_invalid_standard)
{
stages.clear ();
auto dir = setup (3, "verify_invalid_standard");
- auto notes = dcp::verify({dir}, {}, &stage, &progress, {}, xsd_test);
+ auto notes = dcp::verify({dir}, {}, &stage, &progress, {}, xsd_test).notes;
path const cpl_file = dir / "cpl_cbfd2bc0-21cf-4a8f-95d8-9cddcbe51296.xml";
path const pkl_file = dir / "pkl_d87a950c-bd6f-41f6-90cc-56ccd673e131.xml";
@@ -1419,7 +1419,7 @@ check_picture_size (int width, int height, int frame_rate, bool three_d)
d->set_annotation_text("A Test DCP");
d->write_xml();
- return dcp::verify({dcp_path}, {}, &stage, &progress, {}, xsd_test);
+ return dcp::verify({dcp_path}, {}, &stage, &progress, {}, xsd_test).notes;
}
diff --git a/tools/dcpverify.cc b/tools/dcpverify.cc
index ebc02874..1f747097 100644
--- a/tools/dcpverify.cc
+++ b/tools/dcpverify.cc
@@ -173,7 +173,7 @@ main (int argc, char* argv[])
vector<boost::filesystem::path> directories;
directories.push_back (argv[optind]);
- auto notes = dcp::verify(directories, {}, stage, progress, verification_options);
+ auto notes = dcp::verify(directories, {}, stage, progress, verification_options).notes;
dcp::filter_notes (notes, ignore_missing_assets);
if (!quiet) {