Merge master.
[dcpomatic.git] / src / lib / dcp_video_frame.h
index 9929b9a8a22ab0b7e0bc796466db5ca02b720b40..40f758c7423ab855e07ac3991984bfa559eeef1d 100644 (file)
@@ -20,6 +20,7 @@
 
 #include <openjpeg.h>
 #include <libdcp/picture_asset.h>
+#include <libdcp/picture_asset_writer.h>
 #include "util.h"
 
 /** @file  src/dcp_video_frame.h
@@ -42,13 +43,13 @@ public:
        /** @param s Size of data, in bytes */
        EncodedData (int s);
 
-       EncodedData (std::string f);
+       EncodedData (boost::filesystem::path);
 
        virtual ~EncodedData ();
 
        void send (boost::shared_ptr<Socket> socket);
-       void write (boost::shared_ptr<const Film>, int) const;
-       void write_info (boost::shared_ptr<const Film>, int, libdcp::FrameInfo) const;
+       void write (boost::shared_ptr<const Film>, int, Eyes) const;
+       void write_info (boost::shared_ptr<const Film>, int, Eyes, libdcp::FrameInfo) const;
 
        /** @return data */
        uint8_t* data () const {
@@ -62,7 +63,7 @@ public:
 
 protected:
        uint8_t* _data; ///< data
-       int _size;      ///< data size in bytes
+       int _size;      ///< data size in bytes
 };
 
 /** @class LocallyEncodedData
@@ -101,25 +102,31 @@ public:
 class DCPVideoFrame : public boost::noncopyable
 {
 public:
-       DCPVideoFrame (boost::shared_ptr<const Image>, int, int, int, boost::shared_ptr<Log>);
-       ~DCPVideoFrame ();
+       DCPVideoFrame (boost::shared_ptr<const Image>, int, Eyes, ColourConversion, int, int, Resolution, boost::shared_ptr<Log>);
+       DCPVideoFrame (boost::shared_ptr<const Image>, boost::shared_ptr<const cxml::Node>, boost::shared_ptr<Log>);
 
        boost::shared_ptr<EncodedData> encode_locally ();
-       boost::shared_ptr<EncodedData> encode_remotely (ServerDescription const *);
+       boost::shared_ptr<EncodedData> encode_remotely (ServerDescription);
 
+       Eyes eyes () const {
+               return _eyes;
+       }
+       
        int frame () const {
                return _frame;
        }
        
 private:
+
+       void add_metadata (xmlpp::Element *) const;
+       
        boost::shared_ptr<const Image> _image;
-       int _frame;                      ///< frame index within the DCP's intrinsic duration
-       int _frames_per_second;          ///< Frames per second that we will use for the DCP
-       int _j2k_bandwidth;              ///< J2K bandwidth to use
+       int _frame;                      ///< frame index within the DCP's intrinsic duration
+       Eyes _eyes;
+       ColourConversion _conversion;
+       int _frames_per_second;          ///< Frames per second that we will use for the DCP
+       int _j2k_bandwidth;              ///< J2K bandwidth to use
+       Resolution _resolution;          ///< Resolution (2K or 4K)
 
        boost::shared_ptr<Log> _log; ///< log
-
-       opj_cparameters_t* _parameters;    ///< libopenjpeg's parameters
-       opj_cinfo_t* _cinfo;               ///< libopenjpeg's opj_cinfo_t
-       opj_cio_t* _cio;                   ///< libopenjpeg's opj_cio_t
 };