#include "grok_context.h"
+#include <dcp/array_data.h>
using namespace grk_plugin;
, _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);
auto compressedFrameLength = msg.next_uint();
auto processor =
[this](FrameProxy srcFrame, uint8_t* compressed, uint32_t compressedFrameLength) {
- auto compressedData = std::make_shared<CompressedData>(compressedFrameLength);
- memcpy(compressedData->data_, compressed, compressedFrameLength);
- _dcpomatic_context.writer.write(compressedData, srcFrame.index(), srcFrame.eyes());
+ auto compressed_data = std::make_shared<dcp::ArrayData>(compressedFrameLength);
+ memcpy(compressed_data->data(), compressed, compressedFrameLength);
+ _dcpomatic_context.writer.write(compressed_data, srcFrame.index(), srcFrame.eyes());
frame_done();
};
int const minimum_size = 16384;