diff options
Diffstat (limited to 'src/asset_factory.cc')
| -rw-r--r-- | src/asset_factory.cc | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/src/asset_factory.cc b/src/asset_factory.cc index be4f6b49..652e1e31 100644 --- a/src/asset_factory.cc +++ b/src/asset_factory.cc @@ -40,11 +40,12 @@ #include "asset_factory.h" #include "atmos_asset.h" #include "compose.hpp" -#include "mono_picture_asset.h" -#include "smpte_subtitle_asset.h" +#include "mono_j2k_picture_asset.h" +#include "mono_mpeg2_picture_asset.h" +#include "smpte_text_asset.h" #include "sound_asset.h" -#include "stereo_picture_asset.h" -#include "stereo_picture_asset.h" +#include "stereo_j2k_picture_asset.h" +#include "stereo_j2k_picture_asset.h" #include <memory> @@ -61,21 +62,23 @@ dcp::asset_factory (boost::filesystem::path path, bool ignore_incorrect_picture_ */ ASDCP::EssenceType_t type; - auto const result = ASDCP::EssenceType(dcp::filesystem::fix_long_path(path).string().c_str(), type); + Kumu::FileReaderFactory factory; + auto const result = ASDCP::EssenceType(dcp::filesystem::fix_long_path(path).string().c_str(), type, factory); if (!ASDCP_SUCCESS(result)) { throw ReadError(String::compose("Could not find essence type (%1)", result.Message()), path.string()); } switch (type) { case ASDCP::ESS_UNKNOWN: + throw ReadError("Unknown asset type"); case ASDCP::ESS_MPEG2_VES: - throw ReadError ("MPEG2 video essences are not supported"); + return make_shared<MonoMPEG2PictureAsset>(path); case ASDCP::ESS_JPEG_2000: try { - return make_shared<MonoPictureAsset>(path); + return make_shared<MonoJ2KPictureAsset>(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 */ - auto stereo = make_shared<StereoPictureAsset>(path); + auto stereo = make_shared<StereoJ2KPictureAsset>(path); if (stereo && found_threed_marked_as_twod) { *found_threed_marked_as_twod = true; } @@ -88,9 +91,9 @@ dcp::asset_factory (boost::filesystem::path path, bool ignore_incorrect_picture_ case ASDCP::ESS_PCM_24b_96k: return make_shared<SoundAsset>(path); case ASDCP::ESS_JPEG_2000_S: - return make_shared<StereoPictureAsset>(path); + return make_shared<StereoJ2KPictureAsset>(path); case ASDCP::ESS_TIMED_TEXT: - return make_shared<SMPTESubtitleAsset>(path); + return make_shared<SMPTETextAsset>(path); case ASDCP::ESS_DCDATA_DOLBY_ATMOS: return make_shared<AtmosAsset>(path); default: |
