*/
-#include <dcp/picture_mxf_writer.h>
-#include "util.h"
+#include "types.h"
+#include "data.h"
+#include "server_description.h"
+#include <libcxml/cxml.h>
/** @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> socket);
- void write (boost::shared_ptr<const Film>, int, Eyes) const;
- void write_info (boost::shared_ptr<const Film>, 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.
*
DCPVideo (boost::shared_ptr<const PlayerVideo>, int, int, int, Resolution, boost::shared_ptr<Log>);
DCPVideo (boost::shared_ptr<const PlayerVideo>, cxml::ConstNodePtr, boost::shared_ptr<Log>);
- boost::shared_ptr<EncodedData> encode_locally ();
- boost::shared_ptr<EncodedData> encode_remotely (ServerDescription);
+ Data encode_locally (dcp::NoteHandler note);
+ Data encode_remotely (ServerDescription);
int index () const {
return _index;
}
Eyes eyes () const;
-
+
+ bool same (boost::shared_ptr<const DCPVideo> other) const;
+
+ static boost::shared_ptr<dcp::OpenJPEGImage> convert_to_xyz (boost::shared_ptr<const PlayerVideo> frame, dcp::NoteHandler note);
+
private:
void add_metadata (xmlpp::Element *) const;
-
+
boost::shared_ptr<const PlayerVideo> _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