Allow nanomsg to be null.
[dcpomatic.git] / src / lib / ffmpeg_image_proxy.h
index 5f9b3b1313935d6fcfbd754f2f4f7a7d80eedb05..4fca899f49626c92223691e010f97df221a2bb37 100644 (file)
 */
 
 #include "image_proxy.h"
-#include <dcp/data.h>
+#include "types.h"
+#include <dcp/array_data.h>
 #include <boost/thread/mutex.hpp>
 #include <boost/filesystem.hpp>
 
 class FFmpegImageProxy : public ImageProxy
 {
 public:
-       explicit FFmpegImageProxy (boost::filesystem::path);
-       explicit FFmpegImageProxy (dcp::Data);
+       explicit FFmpegImageProxy (boost::filesystem::path, VideoRange video_range);
+       explicit FFmpegImageProxy (dcp::ArrayData, VideoRange video_range);
        FFmpegImageProxy (boost::shared_ptr<cxml::Node> xml, boost::shared_ptr<Socket> socket);
 
-       std::pair<boost::shared_ptr<Image>, int> image (
+       Result image (
                boost::optional<dcp::Size> size = boost::optional<dcp::Size> ()
                ) const;
 
        void add_metadata (xmlpp::Node *) const;
-       void send_binary (boost::shared_ptr<Socket>) const;
+       void write_to_socket (boost::shared_ptr<Socket>) const;
        bool same (boost::shared_ptr<const ImageProxy> other) const;
        size_t memory_used () const;
 
@@ -43,7 +44,8 @@ public:
        int64_t avio_seek (int64_t const pos, int whence);
 
 private:
-       dcp::Data _data;
+       dcp::ArrayData _data;
+       VideoRange _video_range;
        mutable int64_t _pos;
        /** Path of a file that this image came from, if applicable; stored so that
            failed-decode errors can give more detail.