Hack: delay decisions about subtitle position late enough that we can refresh the...
[dcpomatic.git] / src / lib / player_video.h
index 3cd5594097baa42e7a3727ba59c83d6ae0544d18..f62287a64c58c84d54e950a88aa4e73845ebd347 100644 (file)
@@ -26,6 +26,7 @@
 #include "dcpomatic_time.h"
 #include "colour_conversion.h"
 #include "position_image.h"
+#include "player_text.h"
 extern "C" {
 #include <libavutil/pixfmt.h>
 }
@@ -56,14 +57,15 @@ public:
                boost::optional<ColourConversion>,
                VideoRange video_range,
                boost::weak_ptr<Content>,
-               boost::optional<Frame>
+               boost::optional<dcpomatic::DCPTime>,
+               int video_frame_rate
                );
 
        PlayerVideo (boost::shared_ptr<cxml::Node>, boost::shared_ptr<Socket>);
 
        boost::shared_ptr<PlayerVideo> shallow_copy () const;
 
-       void set_text (PositionImage);
+       void set_text (std::list<PlayerText>);
 
        void prepare (boost::function<AVPixelFormat (AVPixelFormat)> pixel_format, bool aligned, bool fast);
        boost::shared_ptr<Image> image (boost::function<AVPixelFormat (AVPixelFormat)> pixel_format, bool aligned, bool fast) const;
@@ -119,13 +121,14 @@ private:
        Part _part;
        boost::optional<ColourConversion> _colour_conversion;
        VideoRange _video_range;
-       boost::optional<PositionImage> _text;
+       std::list<PlayerText> _text;
        /** Content that we came from.  This is so that reset_metadata() can work, and also
         *  for variant:swaroop's non-skippable ads.
         */
        boost::weak_ptr<Content> _content;
-       /** Video frame that we came from.  Again, this is for reset_metadata() */
-       boost::optional<Frame> _video_frame;
+       /** Time that we came from.  Again, this is for reset_metadata() */
+       boost::optional<dcpomatic::DCPTime> _time;
+       int _video_frame_rate;
 
        mutable boost::mutex _mutex;
        mutable boost::shared_ptr<Image> _image;
@@ -137,6 +140,7 @@ private:
        mutable dcp::Size _image_out_size;
        /** _fade that was used to make _image */
        mutable boost::optional<double> _image_fade;
+       mutable bool _image_dirty;
 };
 
 #endif