35 #include "compose.hpp"
36 #include "mono_mpeg2_picture_frame.h"
39 using std::make_shared;
40 using std::shared_ptr;
45 MonoMPEG2PictureFrame::MonoMPEG2PictureFrame(uint8_t
const* data,
int size)
47 _buffer = make_shared<ASDCP::MPEG2::FrameBuffer>(
size);
59 MonoMPEG2PictureFrame::MonoMPEG2PictureFrame(ASDCP::MPEG2::MXFReader* reader,
int n, shared_ptr<DecryptionContext> context,
bool check_hmac)
62 _buffer = make_shared<ASDCP::MPEG2::FrameBuffer>(4 * Kumu::Megabyte);
64 auto const r = reader->ReadFrame(n, *_buffer, context->context(), check_hmac ? context->hmac() :
nullptr);
66 if (ASDCP_FAILURE(r)) {
67 boost::throw_exception(
ReadError(String::compose(
"could not read video frame %1 (%2)", n,
static_cast<int>(r))));
75 return _buffer->RoData();
82 return _buffer->Data();
89 return _buffer->Size();
uint8_t const * data() const override
int size() const override
Any error that occurs when reading data from a DCP.
Namespace for everything in libdcp.