Patch from Aaron.
[dcpomatic.git] / src / lib / dcp_video.h
index 5d8b9b720a3aef0da98223f287e3668755d8f8b9..c09442d1645c50662bddd6d11ea77247110643c7 100644 (file)
     along with DCP-o-matic.  If not, see <http://www.gnu.org/licenses/>.
 
 */
+#ifndef DCPOMATIC_DCP_VIDEO_H
+#define DCPOMATIC_DCP_VIDEO_H
+
 
-#include "types.h"
 #include "encode_server_description.h"
+#include "resolution.h"
 #include <libcxml/cxml.h>
 #include <dcp/array_data.h>
+#include <dcp/openjpeg_image.h>
+
 
 /** @file  src/dcp_video_frame.h
  *  @brief A single frame of video destined for a DCP.
  */
 
+
 class Log;
 class PlayerVideo;
 
+
 /** @class DCPVideo
  *  @brief A single frame of video destined for a DCP.
  *
@@ -39,14 +46,18 @@ class PlayerVideo;
  *  Objects of this class are used for the queue that we keep
  *  of images that require encoding.
  */
-class DCPVideo : public boost::noncopyable
+class DCPVideo
 {
 public:
-       DCPVideo (std::shared_ptr<const PlayerVideo>, int, int, int, Resolution);
+       DCPVideo (void) : DCPVideo(nullptr,0,0,0,Resolution::TWO_K){}
+       DCPVideo (std::shared_ptr<const PlayerVideo>, int index, int dcp_fps, int bandwidth, Resolution r);
        DCPVideo (std::shared_ptr<const PlayerVideo>, cxml::ConstNodePtr);
 
-       dcp::ArrayData encode_locally ();
-       dcp::ArrayData encode_remotely (EncodeServerDescription, int timeout = 30);
+       DCPVideo (DCPVideo const&) = default;
+       DCPVideo& operator= (DCPVideo const&) = default;
+
+       dcp::ArrayData encode_locally () const;
+       dcp::ArrayData encode_remotely (EncodeServerDescription, int timeout = 30) const;
 
        int index () const {
                return _index;
@@ -58,6 +69,8 @@ public:
 
        static std::shared_ptr<dcp::OpenJPEGImage> convert_to_xyz (std::shared_ptr<const PlayerVideo> frame, dcp::NoteHandler note);
 
+       void convert_to_xyz (uint16_t *dst);
+       dcp::Size get_size(void);
 private:
 
        void add_metadata (xmlpp::Element *) const;
@@ -68,3 +81,5 @@ private:
        int _j2k_bandwidth;              ///< J2K bandwidth to use
        Resolution _resolution;          ///< Resolution (2K or 4K)
 };
+
+#endif