Make player decide whether subtitles should be burnt based on
[dcpomatic.git] / src / lib / dcp_video.cc
index b72353d9ecbc6482c6573f496275e53687d495d4..3879947eb027ba38912f5fa255f27fd0e879a7dc 100644 (file)
@@ -77,14 +77,13 @@ using dcp::Size;
  *  @param l Log to write to.
  */
 DCPVideo::DCPVideo (
-       shared_ptr<const PlayerVideo> frame, int index, int dcp_fps, int bw, Resolution r, bool b, shared_ptr<Log> l
+       shared_ptr<const PlayerVideo> frame, int index, int dcp_fps, int bw, Resolution r, shared_ptr<Log> l
        )
        : _frame (frame)
        , _index (index)
        , _frames_per_second (dcp_fps)
        , _j2k_bandwidth (bw)
        , _resolution (r)
-       , _burn_subtitles (b)
        , _log (l)
 {
 
@@ -98,7 +97,6 @@ DCPVideo::DCPVideo (shared_ptr<const PlayerVideo> frame, shared_ptr<const cxml::
        _frames_per_second = node->number_child<int> ("FramesPerSecond");
        _j2k_bandwidth = node->number_child<int> ("J2KBandwidth");
        _resolution = Resolution (node->optional_number_child<int>("Resolution").get_value_or (RESOLUTION_2K));
-       _burn_subtitles = node->bool_child ("BurnSubtitles");
 }
 
 /** J2K-encode this frame on the local host.
@@ -109,7 +107,7 @@ DCPVideo::encode_locally (dcp::NoteHandler note)
 {
        shared_ptr<dcp::OpenJPEGImage> xyz;
 
-       shared_ptr<Image> image = _frame->image (AV_PIX_FMT_RGB48LE, _burn_subtitles, note);
+       shared_ptr<Image> image = _frame->image (AV_PIX_FMT_RGB48LE, note);
        if (_frame->colour_conversion()) {
                xyz = dcp::rgb_to_xyz (
                        image->data()[0],
@@ -276,7 +274,7 @@ DCPVideo::encode_remotely (ServerDescription serv)
        socket->write ((uint8_t *) xml.c_str(), xml.length() + 1);
 
        /* Send binary data */
-       _frame->send_binary (socket, _burn_subtitles);
+       _frame->send_binary (socket);
 
        /* Read the response (JPEG2000-encoded data); this blocks until the data
           is ready and sent back.
@@ -296,8 +294,7 @@ DCPVideo::add_metadata (xmlpp::Element* el) const
        el->add_child("FramesPerSecond")->add_child_text (raw_convert<string> (_frames_per_second));
        el->add_child("J2KBandwidth")->add_child_text (raw_convert<string> (_j2k_bandwidth));
        el->add_child("Resolution")->add_child_text (raw_convert<string> (int (_resolution)));
-       el->add_child("BurnSubtitles")->add_child_text (_burn_subtitles ? "1" : "0");
-       _frame->add_metadata (el, _burn_subtitles);
+       _frame->add_metadata (el);
 }
 
 Eyes
@@ -314,8 +311,7 @@ DCPVideo::same (shared_ptr<const DCPVideo> other) const
 {
        if (_frames_per_second != other->_frames_per_second ||
            _j2k_bandwidth != other->_j2k_bandwidth ||
-           _resolution != other->_resolution ||
-           _burn_subtitles != other->_burn_subtitles) {
+           _resolution != other->_resolution) {
                return false;
        }