X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fgrok_context.cc;fp=src%2Flib%2Fgrok_context.cc;h=31363f01204d4874d9c079e223ddf40eec4839f9;hb=c55d070636a56b2feb4cf1cc5e5f438ad6dfccef;hp=14df64c15555ac3ecc5d159e8d8edba563727fa1;hpb=f4370a5cb2d085a9a2f6396b9b6eec2cb9bdedbb;p=dcpomatic.git diff --git a/src/lib/grok_context.cc b/src/lib/grok_context.cc index 14df64c15..31363f012 100644 --- a/src/lib/grok_context.cc +++ b/src/lib/grok_context.cc @@ -20,6 +20,7 @@ #include "grok_context.h" +#include using namespace grk_plugin; @@ -114,38 +115,6 @@ GrokContext::GrokContext(const DcpomaticContext& dcpomaticContext) , _messenger(nullptr) , _launched(false) { - struct CompressedData : public dcp::Data - { - explicit CompressedData(int dataLen) - : data_(new uint8_t[dataLen]) - , dataLen_(dataLen) - { - } - - ~CompressedData() - { - delete[] data_; - } - - uint8_t const* data() const override - { - return data_; - } - - uint8_t* data() override - { - return data_; - } - - int size() const override - { - return dataLen_; - } - - uint8_t* data_; - int dataLen_; - }; - if (Config::instance()->enable_gpu()) { DCPOMATIC_ASSERT(_dcpomatic_context.location); boost::filesystem::path folder(*_dcpomatic_context.location); @@ -165,9 +134,9 @@ GrokContext::GrokContext(const DcpomaticContext& dcpomaticContext) auto compressedFrameLength = msg.next_uint(); auto processor = [this](FrameProxy srcFrame, uint8_t* compressed, uint32_t compressedFrameLength) { - auto compressedData = std::make_shared(compressedFrameLength); - memcpy(compressedData->data_, compressed, compressedFrameLength); - _dcpomatic_context.writer.write(compressedData, srcFrame.index(), srcFrame.eyes()); + auto compressed_data = std::make_shared(compressedFrameLength); + memcpy(compressed_data->data(), compressed, compressedFrameLength); + _dcpomatic_context.writer.write(compressed_data, srcFrame.index(), srcFrame.eyes()); frame_done(); }; int const minimum_size = 16384;