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.
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)
} 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;
}
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);
}
*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") {
stage ("Checking DCP", dcp->directory());
bool carry_on = true;
try {
- dcp->read (¬es);
+ dcp->read (¬es, true);
} catch (MissingAssetmapError& e) {
notes.push_back ({VerificationNote::Type::ERROR, VerificationNote::Code::FAILED_READ, string(e.what())});
carry_on = false;
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:
* 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].
{ dcp::VerificationNote::Type::BV21_ERROR, dcp::VerificationNote::Code::MISSING_CPL_METADATA, cpl->id(), cpl->file().get() }
});
}
+
+
+/** Check a DCP with a 3D asset marked as 2D */
+BOOST_AUTO_TEST_CASE (verify_threed_marked_as_twod)
+{
+ check_verify_result (
+ { private_test / "data" / "xm" },
+ {
+ {
+ dcp::VerificationNote::Type::WARNING,
+ dcp::VerificationNote::Code::THREED_ASSET_MARKED_AS_TWOD, boost::filesystem::canonical(find_file(private_test / "data" / "xm", "j2c"))
+ },
+ {
+ dcp::VerificationNote::Type::BV21_ERROR,
+ dcp::VerificationNote::Code::INVALID_STANDARD
+ },
+ });
+
+}
+