diff options
| author | Carl Hetherington <cth@carlh.net> | 2023-09-24 17:04:34 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2024-01-28 02:01:57 +0100 |
| commit | 3b1ee8690b21ddc5ff53ba3b2ba50270e3c9f9bf (patch) | |
| tree | 81d08a884d840ca3187438f597f71e48c6dc9df8 /src/lib/grok | |
| parent | ef4bc89bf3d0a4915959c2097d70e37e7491ee76 (diff) | |
Cleanup: use dcp::ArrayData instead of home-grown version.
Diffstat (limited to 'src/lib/grok')
| -rw-r--r-- | src/lib/grok/context.h | 24 |
1 files changed, 3 insertions, 21 deletions
diff --git a/src/lib/grok/context.h b/src/lib/grok/context.h index 640ec2196..72e62c4fa 100644 --- a/src/lib/grok/context.h +++ b/src/lib/grok/context.h @@ -27,6 +27,7 @@ #include "../dcpomatic_log.h" #include "../writer.h" #include "messenger.h" +#include <dcp/array_data.h> static std::mutex launchMutex; @@ -98,24 +99,6 @@ public: messenger_(nullptr), launched_(false) { - struct CompressedData : public dcp::Data { - explicit CompressedData(int dataLen) : data_(new uint8_t[dataLen]), dataLen_(dataLen) - {} - ~CompressedData(void){ - 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 ()) { boost::filesystem::path folder(dcpomaticContext_.location_); boost::filesystem::path binaryPath = folder / "grk_compress"; @@ -137,9 +120,8 @@ public: auto processor = [this](FrameProxy srcFrame, uint8_t* compressed, uint32_t compressedFrameLength) { - auto compressedData = std::make_shared<CompressedData>(compressedFrameLength); - memcpy(compressedData->data_,compressed,compressedFrameLength ); - dcpomaticContext_.writer_.write(compressedData, srcFrame.index(), srcFrame.eyes()); + auto compressed_data = std::make_shared<dcp::ArrayData>(compressed, compressedFrameLength); + dcpomaticContext_.writer_.write(compressed_data, srcFrame.index(), srcFrame.eyes()); frame_done (); }; int const minimum_size = 16384; |
