X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fdcp_video.h;h=05aa0ff7c31b9e56aea469eb20f050adc6e3ded6;hb=53ca2dda0e9138a251adc186a745f7943fc1abc1;hp=7b01966bd25f04e0cee162d843d8da788c5e0ddc;hpb=15f23b356b757a9697bf1a9ec30c243ab8070404;p=dcpomatic.git diff --git a/src/lib/dcp_video.h b/src/lib/dcp_video.h index 7b01966bd..05aa0ff7c 100644 --- a/src/lib/dcp_video.h +++ b/src/lib/dcp_video.h @@ -18,77 +18,18 @@ */ -#include -#include "util.h" +#include "types.h" +#include "server_description.h" +#include +#include /** @file src/dcp_video_frame.h * @brief A single frame of video destined for a DCP. */ -class Film; -class ServerDescription; -class Scaler; -class Image; class Log; -class Subtitle; class PlayerVideo; -/** @class EncodedData - * @brief Container for J2K-encoded data. - */ -class EncodedData : public boost::noncopyable -{ -public: - /** @param s Size of data, in bytes */ - EncodedData (int s); - - EncodedData (boost::filesystem::path); - - virtual ~EncodedData (); - - void send (boost::shared_ptr socket); - void write (boost::shared_ptr, int, Eyes) const; - void write_info (boost::shared_ptr, int, Eyes, dcp::FrameInfo) const; - - /** @return data */ - uint8_t* data () const { - return _data; - } - - /** @return data size, in bytes */ - int size () const { - return _size; - } - -protected: - uint8_t* _data; ///< data - int _size; ///< data size in bytes -}; - -/** @class LocallyEncodedData - * @brief EncodedData that was encoded locally; this class - * just keeps a pointer to the data, but does no memory - * management. - */ -class LocallyEncodedData : public EncodedData -{ -public: - /** @param d Data (which will be copied by this class) - * @param s Size of data, in bytes. - */ - LocallyEncodedData (uint8_t* d, int s); -}; - -/** @class RemotelyEncodedData - * @brief EncodedData that is being read from a remote server; - * this class allocates and manages memory for the data. - */ -class RemotelyEncodedData : public EncodedData -{ -public: - RemotelyEncodedData (int s); -}; - /** @class DCPVideo * @brief A single frame of video destined for a DCP. * @@ -104,19 +45,23 @@ public: DCPVideo (boost::shared_ptr, int, int, int, Resolution, boost::shared_ptr); DCPVideo (boost::shared_ptr, cxml::ConstNodePtr, boost::shared_ptr); - boost::shared_ptr encode_locally (); - boost::shared_ptr encode_remotely (ServerDescription); + dcp::Data encode_locally (dcp::NoteHandler note); + dcp::Data encode_remotely (ServerDescription, int timeout = 30); int index () const { return _index; } Eyes eyes () const; - + + bool same (boost::shared_ptr other) const; + + static boost::shared_ptr convert_to_xyz (boost::shared_ptr frame, dcp::NoteHandler note); + private: void add_metadata (xmlpp::Element *) const; - + boost::shared_ptr _frame; int _index; ///< frame index within the DCP's intrinsic duration int _frames_per_second; ///< Frames per second that we will use for the DCP