summaryrefslogtreecommitdiff
path: root/src/dcp.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2018-11-14 01:23:25 +0000
committerCarl Hetherington <cth@carlh.net>2018-11-14 01:23:25 +0000
commit201b6fdf572c04424d870ac4d07d1d1a8725b24c (patch)
treeb185bb50976b4de805f8480f37449bf507956b42 /src/dcp.cc
parent27e1378bede33c51835fd6307239692909d834d8 (diff)
Simpole DCP recovery utility (dcprecover) added.
Diffstat (limited to 'src/dcp.cc')
-rw-r--r--src/dcp.cc42
1 files changed, 2 insertions, 40 deletions
diff --git a/src/dcp.cc b/src/dcp.cc
index 08febadc..8bf2f02f 100644
--- a/src/dcp.cc
+++ b/src/dcp.cc
@@ -57,6 +57,7 @@
#include "reel_asset.h"
#include "font_asset.h"
#include "pkl.h"
+#include "asset_factory.h"
#include <asdcp/AS_DCP.h>
#include <xmlsec/xmldsig.h>
#include <xmlsec/app.h>
@@ -228,46 +229,7 @@ DCP::read (bool keep_going, ReadErrors* errors, bool ignore_incorrect_picture_mx
*pkl_type == SMPTESubtitleAsset::static_pkl_type(*_standard)
) {
- /* XXX: asdcplib does not appear to support discovery of read MXFs standard
- (Interop / SMPTE)
- */
-
- ASDCP::EssenceType_t type;
- if (ASDCP::EssenceType (path.string().c_str(), type) != ASDCP::RESULT_OK) {
- throw DCPReadError ("Could not find essence type");
- }
- switch (type) {
- case ASDCP::ESS_UNKNOWN:
- case ASDCP::ESS_MPEG2_VES:
- throw DCPReadError ("MPEG2 video essences are not supported");
- case ASDCP::ESS_JPEG_2000:
- try {
- other_assets.push_back (shared_ptr<MonoPictureAsset> (new MonoPictureAsset (path)));
- } 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 */
- other_assets.push_back (shared_ptr<StereoPictureAsset> (new StereoPictureAsset (path)));
- } else {
- throw;
- }
- }
- break;
- case ASDCP::ESS_PCM_24b_48k:
- case ASDCP::ESS_PCM_24b_96k:
- other_assets.push_back (shared_ptr<SoundAsset> (new SoundAsset (path)));
- break;
- case ASDCP::ESS_JPEG_2000_S:
- other_assets.push_back (shared_ptr<StereoPictureAsset> (new StereoPictureAsset (path)));
- break;
- case ASDCP::ESS_TIMED_TEXT:
- other_assets.push_back (shared_ptr<SMPTESubtitleAsset> (new SMPTESubtitleAsset (path)));
- break;
- case ASDCP::ESS_DCDATA_DOLBY_ATMOS:
- other_assets.push_back (shared_ptr<AtmosAsset> (new AtmosAsset (path)));
- break;
- default:
- throw DCPReadError (String::compose ("Unknown MXF essence type %1 in %2", int(type), path.string()));
- }
+ other_assets.push_back (asset_factory(path, ignore_incorrect_picture_mxf_type));
} else if (*pkl_type == FontAsset::static_pkl_type(*_standard)) {
other_assets.push_back (shared_ptr<FontAsset> (new FontAsset (i->first, path)));
} else if (*pkl_type == "image/png") {