Pass around JPEG2000 data as a shared_ptr and hence avoid a copy
[dcpomatic.git] / src / lib / reel_writer.h
index 17bfc7ba2c191482e674bb0645b470bf965e6e3e..09c29adae05a1e7efacdf22448ed81ac0e6ce31e 100644 (file)
@@ -66,7 +66,7 @@ public:
                boost::optional<std::string> content_summary
                );
 
-       void write (boost::optional<dcp::Data> encoded, Frame frame, Eyes eyes);
+       void write (boost::shared_ptr<const dcp::Data> encoded, Frame frame, Eyes eyes);
        void fake_write (int size);
        void repeat_write (Frame frame, Eyes eyes);
        void write (boost::shared_ptr<const AudioBuffers> audio);
@@ -104,7 +104,7 @@ private:
        /** the first picture frame index that does not already exist in our MXF */
        int _first_nonexistant_frame;
        /** the data of the last written frame, if there is one */
-       boost::optional<dcp::Data> _last_written[EYES_COUNT];
+       boost::shared_ptr<const dcp::Data> _last_written[EYES_COUNT];
        /** index of this reel within the DCP (starting from 0) */
        int _reel_index;
        /** number of reels in the DCP */