35 #include "filesystem.h"
38 #include "mono_mpeg2_picture_asset_writer.h"
39 #include <asdcp/AS_DCP.h>
42 using std::shared_ptr;
46 MonoMPEG2PictureAsset::MonoMPEG2PictureAsset(boost::filesystem::path file)
49 Kumu::FileReaderFactory factory;
50 ASDCP::MPEG2::MXFReader reader(factory);
51 auto const result = reader.OpenRead(dcp::filesystem::fix_long_path(file).
string().c_str());
52 if (ASDCP_FAILURE(result)) {
53 boost::throw_exception(
MXFFileError(
"could not open MXF file for reading", file.string(), result));
56 ASDCP::MPEG2::VideoDescriptor desc;
57 if (ASDCP_FAILURE(reader.FillVideoDescriptor(desc))) {
58 boost::throw_exception(
ReadError(
"could not read video MXF information"));
61 read_video_descriptor(desc);
63 ASDCP::WriterInfo info;
64 if (ASDCP_FAILURE(reader.FillWriterInfo(info))) {
65 boost::throw_exception(
ReadError(
"could not read video MXF information"));
68 _id = read_writer_info(info);
72 shared_ptr<MonoMPEG2PictureAssetReader>
73 MonoMPEG2PictureAsset::start_read ()
const
81 shared_ptr<MPEG2PictureAssetWriter>
82 MonoMPEG2PictureAsset::start_write(boost::filesystem::path file, Behaviour behaviour)
boost::optional< boost::filesystem::path > file() const
An exception related to an MXF file.
boost::optional< Key > key() const
Any error that occurs when reading data from a DCP.
MonoMPEG2PictureAsset class.
MonoJ2KPictureAssetReader typedef.
Namespace for everything in libdcp.