Change MagickImageProxy to FFmpegImageProxy and make it use FFmpeg
[dcpomatic.git] / src / lib / j2k_image_proxy.h
index c20d89340318b2040bf3fc60a6c26b8d95e70845..a67cc24deeffea184215ad221e371b3b2c288c90 100644 (file)
@@ -50,7 +50,7 @@ public:
 
        J2KImageProxy (boost::shared_ptr<cxml::Node> xml, boost::shared_ptr<Socket> socket);
 
-       boost::shared_ptr<Image> image (
+       std::pair<boost::shared_ptr<Image>, int> image (
                boost::optional<dcp::NoteHandler> note = boost::optional<dcp::NoteHandler> (),
                boost::optional<dcp::Size> size = boost::optional<dcp::Size> ()
                ) const;
@@ -59,10 +59,7 @@ public:
        void send_binary (boost::shared_ptr<Socket>) const;
        /** @return true if our image is definitely the same as another, false if it is probably not */
        bool same (boost::shared_ptr<const ImageProxy>) const;
-       void prepare (boost::optional<dcp::Size> = boost::optional<dcp::Size>()) const;
-       AVPixelFormat pixel_format () const {
-               return _pixel_format;
-       }
+       int prepare (boost::optional<dcp::Size> = boost::optional<dcp::Size>()) const;
 
        dcp::Data j2k () const {
                return _data;
@@ -72,6 +69,8 @@ public:
                return _size;
        }
 
+       size_t memory_used () const;
+
 private:
        friend struct client_server_test_j2k;
 
@@ -83,6 +82,7 @@ private:
        boost::optional<dcp::Eye> _eye;
        mutable boost::shared_ptr<dcp::OpenJPEGImage> _decompressed;
        mutable boost::optional<dcp::Size> _target_size;
+       mutable boost::optional<int> _reduce;
        AVPixelFormat _pixel_format;
        mutable boost::mutex _mutex;
        boost::optional<int> _forced_reduction;