From 2ea3a0d0e4066a166c0700bd1d53daa7f1c50dff Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 1 Nov 2020 23:51:19 +0100 Subject: Pass around JPEG2000 data as a shared_ptr and hence avoid a copy of 4MB of data for every JPEG2000 frame we decode. --- src/lib/j2k_image_proxy.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/lib/j2k_image_proxy.h') diff --git a/src/lib/j2k_image_proxy.h b/src/lib/j2k_image_proxy.h index 71bcffb2c..3eccc213d 100644 --- a/src/lib/j2k_image_proxy.h +++ b/src/lib/j2k_image_proxy.h @@ -19,8 +19,8 @@ */ #include "image_proxy.h" +#include #include -#include #include namespace dcp { @@ -60,7 +60,7 @@ public: bool same (boost::shared_ptr) const; int prepare (boost::optional = boost::optional()) const; - dcp::Data j2k () const { + boost::shared_ptr j2k () const { return _data; } @@ -74,9 +74,9 @@ private: friend struct client_server_test_j2k; /* For tests */ - J2KImageProxy (dcp::Data data, dcp::Size size, AVPixelFormat pixel_format); + J2KImageProxy (dcp::ArrayData data, dcp::Size size, AVPixelFormat pixel_format); - dcp::Data _data; + boost::shared_ptr _data; dcp::Size _size; boost::optional _eye; mutable boost::shared_ptr _image; -- cgit v1.2.3