/*
- Copyright (C) 2013-2014 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
+ Taken from code Copyright (C) 2010-2011 Terrence Meiczinger
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
*/
-extern "C" {
-#include <libavutil/avutil.h>
-}
-#include <boost/shared_ptr.hpp>
-#include "types.h"
-#include "colour_conversion.h"
-#include "position.h"
-#include "position_image.h"
+#include <dcp/picture_mxf_writer.h>
+#include "util.h"
-class Image;
+/** @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;
/** @class DCPVideo
+ * @brief A single frame of video destined for a DCP.
+ *
+ * Given an Image and some settings, this class knows how to encode
+ * the image to J2K either on the local host or on a remote server.
*
- * A ContentVideo image with:
- * - content parameters (crop, scaling, colour conversion)
- * - merged content (subtitles)
- * and with its time converted from a ContentTime to a DCPTime.
+ * Objects of this class are used for the queue that we keep
+ * of images that require encoding.
*/
-class DCPVideo
+class DCPVideo : public boost::noncopyable
{
public:
- DCPVideo (boost::shared_ptr<const Image>, Eyes eyes, Crop, dcp::Size, dcp::Size, Scaler const *, ColourConversion conversion, DCPTime time);
+ DCPVideo (boost::shared_ptr<const PlayerVideo>, int, int, int, Resolution, bool b, boost::shared_ptr<Log>);
+ DCPVideo (boost::shared_ptr<const PlayerVideo>, cxml::ConstNodePtr, boost::shared_ptr<Log>);
- void set_subtitle (PositionImage);
- boost::shared_ptr<Image> image (AVPixelFormat, bool) const;
+ boost::shared_ptr<EncodedData> encode_locally ();
+ boost::shared_ptr<EncodedData> encode_remotely (ServerDescription);
- Eyes eyes () const {
- return _eyes;
- }
-
- ColourConversion conversion () const {
- return _conversion;
+ int index () const {
+ return _index;
}
+ Eyes eyes () const;
+
private:
- boost::shared_ptr<const Image> _in;
- Eyes _eyes;
- Crop _crop;
- dcp::Size _inter_size;
- dcp::Size _out_size;
- Scaler const * _scaler;
- ColourConversion _conversion;
- DCPTime _time;
- PositionImage _subtitle;
+
+ 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
+ int _j2k_bandwidth; ///< J2K bandwidth to use
+ Resolution _resolution; ///< Resolution (2K or 4K)
+ bool _burn_subtitles; ///< true to burn subtitles into the image
+
+ boost::shared_ptr<Log> _log; ///< log
};