40 #include "mono_picture_asset.h"
46 #include "compose.hpp"
51 using std::shared_ptr;
52 using std::make_shared;
57 dcp::asset_factory (boost::filesystem::path path,
bool ignore_incorrect_picture_mxf_type,
bool* found_threed_marked_as_twod)
63 ASDCP::EssenceType_t type;
64 if (ASDCP::EssenceType (path.string().c_str(), type) != ASDCP::RESULT_OK) {
65 throw ReadError (
"Could not find essence type");
68 case ASDCP::ESS_UNKNOWN:
69 case ASDCP::ESS_MPEG2_VES:
70 throw ReadError (
"MPEG2 video essences are not supported");
71 case ASDCP::ESS_JPEG_2000:
73 return make_shared<MonoPictureAsset>(path);
75 if (ignore_incorrect_picture_mxf_type && e.
number() == ASDCP::RESULT_SFORMAT) {
77 auto stereo = make_shared<StereoPictureAsset>(path);
78 if (stereo && found_threed_marked_as_twod) {
79 *found_threed_marked_as_twod =
true;
86 case ASDCP::ESS_PCM_24b_48k:
87 case ASDCP::ESS_PCM_24b_96k:
88 return make_shared<SoundAsset>(path);
89 case ASDCP::ESS_JPEG_2000_S:
90 return make_shared<StereoPictureAsset>(path);
91 case ASDCP::ESS_TIMED_TEXT:
92 return make_shared<SMPTESubtitleAsset>(path);
93 case ASDCP::ESS_DCDATA_DOLBY_ATMOS:
94 return make_shared<AtmosAsset>(path);
96 throw ReadError (String::compose(
"Unknown MXF essence type %1 in %2",
static_cast<int>(type), path.string()));
An exception related to an MXF file.
Any error that occurs when reading data from a DCP.
Namespace for everything in libdcp.
std::shared_ptr< Asset > asset_factory(boost::filesystem::path path, bool ignore_incorrect_picture_mxf_type, bool *found_threed_marked_as_twod=nullptr)
SMPTESubtitleAsset class.
StereoPictureAsset class.