42 #include "compose.hpp"
52 using std::shared_ptr;
53 using std::make_shared;
58 dcp::asset_factory (boost::filesystem::path path,
bool ignore_incorrect_picture_mxf_type,
bool* found_threed_marked_as_twod)
64 ASDCP::EssenceType_t type;
65 Kumu::FileReaderFactory factory;
66 auto const result = ASDCP::EssenceType(dcp::filesystem::fix_long_path(path).
string().c_str(), type, factory);
67 if (!ASDCP_SUCCESS(result)) {
68 throw ReadError(String::compose(
"Could not find essence type (%1)", result.Message()), path.string());
71 case ASDCP::ESS_UNKNOWN:
73 case ASDCP::ESS_MPEG2_VES:
74 return make_shared<MonoMPEG2PictureAsset>(path);
75 case ASDCP::ESS_JPEG_2000:
77 return make_shared<MonoJ2KPictureAsset>(path);
79 if (ignore_incorrect_picture_mxf_type && e.
number() == ASDCP::RESULT_SFORMAT) {
81 auto stereo = make_shared<StereoJ2KPictureAsset>(path);
82 if (stereo && found_threed_marked_as_twod) {
83 *found_threed_marked_as_twod =
true;
90 case ASDCP::ESS_PCM_24b_48k:
91 case ASDCP::ESS_PCM_24b_96k:
92 return make_shared<SoundAsset>(path);
93 case ASDCP::ESS_JPEG_2000_S:
94 return make_shared<StereoJ2KPictureAsset>(path);
95 case ASDCP::ESS_TIMED_TEXT:
96 return make_shared<SMPTETextAsset>(path);
97 case ASDCP::ESS_DCDATA_DOLBY_ATMOS:
98 return make_shared<AtmosAsset>(path);
100 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.
MonoJ2KPictureAsset class.
MonoMPEG2PictureAsset class.
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)
StereoJ2KPictureAsset class.