40 using std::shared_ptr;
49 : frame_buffer (4 * Kumu::Megabyte)
52 ASDCP::JP2K::CodestreamParser j2k_parser;
53 ASDCP::JP2K::FrameBuffer frame_buffer;
54 ASDCP::WriterInfo writer_info;
55 ASDCP::JP2K::PictureDescriptor picture_descriptor;
62 template <
class P,
class Q>
63 void dcp::start (PictureAssetWriter* writer, shared_ptr<P> state, Q* asset, uint8_t
const * data,
int size)
65 asset->set_file (writer->_file);
67 if (ASDCP_FAILURE (state->j2k_parser.OpenReadFrame(data, size, state->frame_buffer))) {
68 boost::throw_exception (MiscError (
"could not parse J2K frame"));
71 state->j2k_parser.FillPictureDescriptor (state->picture_descriptor);
72 state->picture_descriptor.EditRate = ASDCP::Rational (asset->edit_rate().numerator, asset->edit_rate().denominator);
74 asset->set_size (Size (state->picture_descriptor.StoredWidth, state->picture_descriptor.StoredHeight));
75 asset->set_screen_aspect_ratio (Fraction (state->picture_descriptor.AspectRatio.Numerator, state->picture_descriptor.AspectRatio.Denominator));
77 asset->fill_writer_info (&state->writer_info, asset->id());
79 auto r = state->mxf_writer.OpenWrite (
80 asset->file()->string().c_str(),
82 state->picture_descriptor,
87 if (ASDCP_FAILURE(r)) {
88 boost::throw_exception (MXFFileError(
"could not open MXF file for writing", asset->file()->string(), r));
91 writer->_started =
true;
Namespace for everything in libdcp.