summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2021-04-22 21:56:38 +0200
committerCarl Hetherington <cth@carlh.net>2021-04-22 21:56:38 +0200
commit5e1ce36be463bfc48663d4697860340649060d01 (patch)
treeb05b203e023a3ec1932f2a73ff4ea9d5dcfd7ffd /src
parentba27603d5b53231607bc8fe41b201d8811b22b4f (diff)
Don't give an error on verifying Interop DCPs with possibly-incorrectly
marked 3D assets. This also adds a warning into the verification output. I don't know if this is actually a standard violation but they have been seen in the wild made by "reputable" DCP creation software. DoM bug #1976.
Diffstat (limited to 'src')
-rw-r--r--src/asset_factory.cc8
-rw-r--r--src/asset_factory.h8
-rw-r--r--src/dcp.cc6
-rw-r--r--src/verify.cc4
-rw-r--r--src/verify.h4
5 files changed, 25 insertions, 5 deletions
diff --git a/src/asset_factory.cc b/src/asset_factory.cc
index e02281d2..bab65678 100644
--- a/src/asset_factory.cc
+++ b/src/asset_factory.cc
@@ -54,7 +54,7 @@ using namespace dcp;
shared_ptr<Asset>
-dcp::asset_factory (boost::filesystem::path path, bool ignore_incorrect_picture_mxf_type)
+dcp::asset_factory (boost::filesystem::path path, bool ignore_incorrect_picture_mxf_type, bool* found_threed_marked_as_twod)
{
/* XXX: asdcplib does not appear to support discovery of read MXFs standard
(Interop / SMPTE)
@@ -74,7 +74,11 @@ dcp::asset_factory (boost::filesystem::path path, bool ignore_incorrect_picture_
} catch (dcp::MXFFileError& e) {
if (ignore_incorrect_picture_mxf_type && e.number() == ASDCP::RESULT_SFORMAT) {
/* Tried to load it as mono but the error says it's stereo; try that instead */
- return make_shared<StereoPictureAsset>(path);
+ auto stereo = make_shared<StereoPictureAsset>(path);
+ if (stereo && found_threed_marked_as_twod) {
+ *found_threed_marked_as_twod = true;
+ }
+ return stereo;
} else {
throw;
}
diff --git a/src/asset_factory.h b/src/asset_factory.h
index 2dd04559..0e60de03 100644
--- a/src/asset_factory.h
+++ b/src/asset_factory.h
@@ -47,7 +47,13 @@ namespace dcp {
class Asset;
-std::shared_ptr<Asset> asset_factory (boost::filesystem::path path, bool ignore_incorrect_picture_mxf_type);
+/** Create an Asset from a file.
+ * @param ignore_incorrect_picture_mxf_type true to ignore cases where a stereo picture asset is marked
+ * as 2D; if this is false an exception will be thrown in that case.
+ * @param ignored_incorrect_picture_mxf_type if this is non-null it will be set to true if a 3D asset was
+ * marked as 2D, otherwise it will be left alone.
+ */
+std::shared_ptr<Asset> asset_factory (boost::filesystem::path path, bool ignore_incorrect_picture_mxf_type, bool* found_threed_marked_as_twod = nullptr);
}
diff --git a/src/dcp.cc b/src/dcp.cc
index cea79ba4..3316b60e 100644
--- a/src/dcp.cc
+++ b/src/dcp.cc
@@ -261,7 +261,11 @@ DCP::read (vector<dcp::VerificationNote>* notes, bool ignore_incorrect_picture_m
*pkl_type == remove_parameters(SMPTESubtitleAsset::static_pkl_type(*_standard))
) {
- other_assets.push_back (asset_factory(path, ignore_incorrect_picture_mxf_type));
+ bool found_threed_marked_as_twod = false;
+ other_assets.push_back (asset_factory(path, ignore_incorrect_picture_mxf_type, &found_threed_marked_as_twod));
+ if (found_threed_marked_as_twod && notes) {
+ notes->push_back ({VerificationNote::Type::WARNING, VerificationNote::Code::THREED_ASSET_MARKED_AS_TWOD, path});
+ }
} else if (*pkl_type == remove_parameters(FontAsset::static_pkl_type(*_standard))) {
other_assets.push_back (make_shared<FontAsset>(i.first, path));
} else if (*pkl_type == "image/png") {
diff --git a/src/verify.cc b/src/verify.cc
index c9d9b24d..7948767a 100644
--- a/src/verify.cc
+++ b/src/verify.cc
@@ -1131,7 +1131,7 @@ dcp::verify (
stage ("Checking DCP", dcp->directory());
bool carry_on = true;
try {
- dcp->read (&notes);
+ dcp->read (&notes, true);
} catch (MissingAssetmapError& e) {
notes.push_back ({VerificationNote::Type::ERROR, VerificationNote::Code::FAILED_READ, string(e.what())});
carry_on = false;
@@ -1472,6 +1472,8 @@ dcp::note_to_string (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 VerificationNote::Code::EXTERNAL_ASSET:
return String::compose("The asset %1 that this DCP refers to is not included in the DCP. It may be a VF.", note.note().get());
+ case VerificationNote::Code::THREED_ASSET_MARKED_AS_TWOD:
+ return String::compose("The asset %1 is 3D but its MXF is marked as 2D.", note.file()->filename());
case VerificationNote::Code::INVALID_STANDARD:
return "This DCP does not use the SMPTE standard.";
case VerificationNote::Code::INVALID_LANGUAGE:
diff --git a/src/verify.h b/src/verify.h
index 169845b7..08be77c6 100644
--- a/src/verify.h
+++ b/src/verify.h
@@ -153,6 +153,10 @@ public:
* note contains the asset ID
*/
EXTERNAL_ASSET,
+ /** A stereoscopic asset has an MXF which is marked as being monoscopic
+ * file contains the asset filename
+ */
+ THREED_ASSET_MARKED_AS_TWOD,
/** DCP is Interop, not SMPTE [Bv2.1_6.1] */
INVALID_STANDARD,
/** A language or territory does not conform to RFC 5646 [Bv2.1_6.2.1].