Store mtime in Content.
[dcpomatic.git] / src / lib / player_video.cc
index a50b196a200152caf782a108c45eb1fdaddc5fbc..02c85be12ea34c0cecc6526e0c8e4766de4d68ca 100644 (file)
@@ -92,14 +92,14 @@ PlayerVideo::PlayerVideo (shared_ptr<cxml::Node> node, shared_ptr<Socket> socket
 
                image->read_from_socket (socket);
 
-               _subtitle = PositionImage (image, Position<int> (node->number_child<int> ("SubtitleX"), node->number_child<int> ("SubtitleY")));
+               _text = PositionImage (image, Position<int> (node->number_child<int> ("SubtitleX"), node->number_child<int> ("SubtitleY")));
        }
 }
 
 void
-PlayerVideo::set_subtitle (PositionImage image)
+PlayerVideo::set_text (PositionImage image)
 {
-       _subtitle = image;
+       _text = image;
 }
 
 /** Create an image for this frame.
@@ -153,8 +153,8 @@ PlayerVideo::image (dcp::NoteHandler note, function<AVPixelFormat (AVPixelFormat
                total_crop, _inter_size, _out_size, yuv_to_rgb, pixel_format (_in->pixel_format()), aligned, fast
                );
 
-       if (_subtitle) {
-               out->alpha_blend (Image::ensure_aligned (_subtitle->image), _subtitle->position);
+       if (_text) {
+               out->alpha_blend (Image::ensure_aligned (_text->image), _text->position);
        }
 
        if (_fade) {
@@ -181,11 +181,11 @@ PlayerVideo::add_metadata (xmlpp::Node* node) const
        if (_colour_conversion) {
                _colour_conversion.get().as_xml (node);
        }
-       if (_subtitle) {
-               node->add_child ("SubtitleWidth")->add_child_text (raw_convert<string> (_subtitle->image->size().width));
-               node->add_child ("SubtitleHeight")->add_child_text (raw_convert<string> (_subtitle->image->size().height));
-               node->add_child ("SubtitleX")->add_child_text (raw_convert<string> (_subtitle->position.x));
-               node->add_child ("SubtitleY")->add_child_text (raw_convert<string> (_subtitle->position.y));
+       if (_text) {
+               node->add_child ("SubtitleWidth")->add_child_text (raw_convert<string> (_text->image->size().width));
+               node->add_child ("SubtitleHeight")->add_child_text (raw_convert<string> (_text->image->size().height));
+               node->add_child ("SubtitleX")->add_child_text (raw_convert<string> (_text->position.x));
+               node->add_child ("SubtitleY")->add_child_text (raw_convert<string> (_text->position.y));
        }
 }
 
@@ -193,8 +193,8 @@ void
 PlayerVideo::send_binary (shared_ptr<Socket> socket) const
 {
        _in->send_binary (socket);
-       if (_subtitle) {
-               _subtitle->image->write_to_socket (socket);
+       if (_text) {
+               _text->image->write_to_socket (socket);
        }
 }
 
@@ -208,7 +208,7 @@ PlayerVideo::has_j2k () const
                return false;
        }
 
-       return _crop == Crop () && _out_size == j2k->size() && !_subtitle && !_fade && !_colour_conversion;
+       return _crop == Crop () && _out_size == j2k->size() && !_text && !_fade && !_colour_conversion;
 }
 
 Data
@@ -239,13 +239,13 @@ PlayerVideo::same (shared_ptr<const PlayerVideo> other) const
                return false;
        }
 
-       if ((!_subtitle && other->_subtitle) || (_subtitle && !other->_subtitle)) {
-               /* One has a subtitle and the other doesn't */
+       if ((!_text && other->_text) || (_text && !other->_text)) {
+               /* One has a text and the other doesn't */
                return false;
        }
 
-       if (_subtitle && other->_subtitle && !_subtitle->same (other->_subtitle.get ())) {
-               /* They both have subtitles but they are different */
+       if (_text && other->_text && !_text->same (other->_text.get ())) {
+               /* They both have texts but they are different */
                return false;
        }
 
@@ -278,7 +278,7 @@ PlayerVideo::memory_used () const
        return _in->memory_used();
 }
 
-/** @return Shallow copy of this; _in and _subtitle are shared between the original and the copy */
+/** @return Shallow copy of this; _in and _text are shared between the original and the copy */
 shared_ptr<PlayerVideo>
 PlayerVideo::shallow_copy () const
 {