Make player decide whether subtitles should be burnt based on
authorCarl Hetherington <cth@carlh.net>
Thu, 25 Jun 2015 10:58:12 +0000 (11:58 +0100)
committerCarl Hetherington <cth@carlh.net>
Thu, 25 Jun 2015 12:36:17 +0000 (13:36 +0100)
content settings rather than using the film's settings.  Remove
film property of burn-subtitles.

21 files changed:
src/lib/dcp_video.cc
src/lib/dcp_video.h
src/lib/encoder.cc
src/lib/film.cc
src/lib/film.h
src/lib/player.cc
src/lib/player.h
src/lib/player_video.cc
src/lib/player_video.h
src/lib/transcoder.cc
src/tools/server_test.cc
src/wx/dcp_panel.cc
src/wx/dcp_panel.h
src/wx/film_viewer.cc
test/burnt_subtitle_test.cc
test/client_server_test.cc
test/data
test/dcp_subtitle_test.cc
test/srt_subtitle_test.cc
test/time_calculation_test.cc
test/xml_subtitle_test.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;
        }
 
index 97be0779802b8cc7653feed28b24f68fcb2957bb..8fd668b00dc7402a016a171b5967b54dcded8fa8 100644 (file)
@@ -46,7 +46,7 @@ class Data;
 class DCPVideo : public boost::noncopyable
 {
 public:
-       DCPVideo (boost::shared_ptr<const PlayerVideo>, int, int, int, Resolution, bool b, boost::shared_ptr<Log>);
+       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>);
 
        Data encode_locally (dcp::NoteHandler note);
@@ -69,7 +69,6 @@ private:
        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
 };
index 93e15031db14f2b754a824fccf2d65ad4c743285..c3ad084419a071958be2873ac0a8c1c6a373d1d2 100644 (file)
@@ -236,7 +236,6 @@ Encoder::enqueue (shared_ptr<PlayerVideo> pv)
                                                  _film->video_frame_rate(),
                                                  _film->j2k_bandwidth(),
                                                  _film->resolution(),
-                                                 _film->burn_subtitles(),
                                                  _film->log()
                                                  )
                                          ));
index 75dfa45eba397e3cddc0c07e712cfdb6f43a41b7..2ef59fe216e04aa89fb378f7d849948a8375174b 100644 (file)
@@ -128,7 +128,6 @@ Film::Film (boost::filesystem::path dir, bool log)
        , _three_d (false)
        , _sequence_video (true)
        , _interop (false)
-       , _burn_subtitles (false)
        , _audio_processor (0)
        , _state_version (current_state_version)
        , _dirty (false)
@@ -199,10 +198,6 @@ Film::video_identifier () const
                s << "_S";
        }
 
-       if (_burn_subtitles) {
-               s << "_B";
-       }
-
        if (_three_d) {
                s << "_3D";
        }
@@ -285,13 +280,13 @@ Film::make_dcp ()
        ContentList cl = content ();
        BOOST_FOREACH (shared_ptr<Content> c, cl) {
                shared_ptr<SubtitleContent> sc = dynamic_pointer_cast<SubtitleContent> (c);
-               if (sc && sc->has_image_subtitles() && sc->use_subtitles() && !burn_subtitles()) {
+               if (sc && sc->has_image_subtitles() && sc->use_subtitles() && !sc->burn_subtitles ()) {
                        must_burn = true;
                }
        }
 
        if (must_burn) {
-               throw EncodeError (_("this project has content with image-based subtitles, which this version of DCP-o-matic cannot include as separate DCP subtitles.  To use subtitles with this project you must burn them into the image (tick the box on the DCP Video tab)."));
+               throw EncodeError (_("this project has content with image-based subtitles, which this version of DCP-o-matic cannot include as separate DCP subtitles.  To use these subtitles you must burn them into the image (tick the box in the Subtitles tab)."));
        }
 
        set_isdcf_date_today ();
@@ -359,7 +354,6 @@ Film::metadata () const
        root->add_child("ThreeD")->add_child_text (_three_d ? "1" : "0");
        root->add_child("SequenceVideo")->add_child_text (_sequence_video ? "1" : "0");
        root->add_child("Interop")->add_child_text (_interop ? "1" : "0");
-       root->add_child("BurnSubtitles")->add_child_text (_burn_subtitles ? "1" : "0");
        root->add_child("Signed")->add_child_text (_signed ? "1" : "0");
        root->add_child("Encrypted")->add_child_text (_encrypted ? "1" : "0");
        root->add_child("Key")->add_child_text (_key.hex ());
@@ -441,9 +435,6 @@ Film::read_metadata ()
        _sequence_video = f.bool_child ("SequenceVideo");
        _three_d = f.bool_child ("ThreeD");
        _interop = f.bool_child ("Interop");
-       if (_state_version >= 32) {
-               _burn_subtitles = f.bool_child ("BurnSubtitles");
-       }
        _key = dcp::Key (f.string_child ("Key"));
 
        if (f.optional_string_child ("AudioProcessor")) {
@@ -818,13 +809,6 @@ Film::set_interop (bool i)
        signal_changed (INTEROP);
 }
 
-void
-Film::set_burn_subtitles (bool b)
-{
-       _burn_subtitles = b;
-       signal_changed (BURN_SUBTITLES);
-}
-
 void
 Film::set_audio_processor (AudioProcessor const * processor)
 {
index 5e4c01c868cb46341f073f823182e3b77e436bba..6c7333ec1507042d3c0b4abb1815f98ab8a5c394 100644 (file)
@@ -164,8 +164,6 @@ public:
                THREE_D,
                SEQUENCE_VIDEO,
                INTEROP,
-               /** The setting of _burn_subtitles has changed */
-               BURN_SUBTITLES,
                AUDIO_PROCESSOR,
        };
 
@@ -238,10 +236,6 @@ public:
                return _interop;
        }
 
-       bool burn_subtitles () const {
-               return _burn_subtitles;
-       }
-
        AudioProcessor const * audio_processor () const {
                return _audio_processor;
        }
@@ -273,7 +267,6 @@ public:
        void set_isdcf_date_today ();
        void set_sequence_video (bool);
        void set_interop (bool);
-       void set_burn_subtitles (bool);
        void set_audio_processor (AudioProcessor const * processor);
 
        /** Emitted when some property has of the Film has changed */
@@ -334,7 +327,6 @@ private:
        bool _three_d;
        bool _sequence_video;
        bool _interop;
-       bool _burn_subtitles;
        AudioProcessor const * _audio_processor;
 
        int _state_version;
index be1268f48a02fcdafb4985431cfdb1e5e2fff50d..361f41c92cf07263a083bdd872136cfb68e4ce3c 100644 (file)
@@ -72,7 +72,7 @@ Player::Player (shared_ptr<const Film> film)
        : _film (film)
        , _have_valid_pieces (false)
        , _ignore_video (false)
-       , _burn_subtitles (film->burn_subtitles ())
+       , _always_burn_subtitles (false)
 {
        _film_content_changed_connection = _film->ContentChanged.connect (bind (&Player::content_changed, this, _1, _2, _3));
        _film_changed_connection = _film->Changed.connect (bind (&Player::film_changed, this, _1));
@@ -322,6 +322,29 @@ Player::get_video (DCPTime time, bool accurate)
                setup_pieces ();
        }
 
+       /* Find subtitles for possible burn-in */
+
+       PlayerSubtitles ps = get_subtitles (time, DCPTime::from_frames (1, _film->video_frame_rate ()), false, true);
+
+       list<PositionImage> sub_images;
+
+       /* Image subtitles */
+       list<PositionImage> c = transform_image_subtitles (ps.image);
+       copy (c.begin(), c.end(), back_inserter (sub_images));
+
+       /* Text subtitles (rendered to an image) */
+       if (!ps.text.empty ()) {
+               list<PositionImage> s = render_subtitles (ps.text, _video_container_size);
+               copy (s.begin (), s.end (), back_inserter (sub_images));
+       }
+
+       optional<PositionImage> subtitles;
+       if (!sub_images.empty ()) {
+               subtitles = merge (sub_images);
+       }
+
+       /* Find video */
+
        list<shared_ptr<Piece> > ov = overlaps<VideoContent> (
                time,
                time + DCPTime::from_frames (1, _film->video_frame_rate ()) - DCPTime::delta()
@@ -338,8 +361,8 @@ Player::get_video (DCPTime time, bool accurate)
                shared_ptr<Piece> piece = ov.back ();
                shared_ptr<VideoDecoder> decoder = dynamic_pointer_cast<VideoDecoder> (piece->decoder);
                DCPOMATIC_ASSERT (decoder);
-               shared_ptr<VideoContent> content = dynamic_pointer_cast<VideoContent> (piece->content);
-               DCPOMATIC_ASSERT (content);
+               shared_ptr<VideoContent> video_content = dynamic_pointer_cast<VideoContent> (piece->content);
+               DCPOMATIC_ASSERT (video_content);
 
                list<ContentVideo> content_video = decoder->get_video (dcp_to_content_video (piece, time), accurate);
                if (content_video.empty ()) {
@@ -347,7 +370,7 @@ Player::get_video (DCPTime time, bool accurate)
                        return pvf;
                }
 
-               dcp::Size image_size = content->scale().size (content, _video_container_size, _film->frame_size ());
+               dcp::Size image_size = video_content->scale().size (video_content, _video_container_size, _film->frame_size ());
 
                for (list<ContentVideo>::const_iterator i = content_video.begin(); i != content_video.end(); ++i) {
                        pvf.push_back (
@@ -355,38 +378,22 @@ Player::get_video (DCPTime time, bool accurate)
                                        new PlayerVideo (
                                                i->image,
                                                content_video_to_dcp (piece, i->frame),
-                                               content->crop (),
-                                               content->fade (i->frame),
+                                               video_content->crop (),
+                                               video_content->fade (i->frame),
                                                image_size,
                                                _video_container_size,
                                                i->eyes,
                                                i->part,
-                                               content->colour_conversion ()
+                                               video_content->colour_conversion ()
                                                )
                                        )
                                );
                }
        }
 
-       /* Add subtitles (for possible burn-in) to whatever PlayerVideos we got */
-
-       PlayerSubtitles ps = get_subtitles (time, DCPTime::from_frames (1, _film->video_frame_rate ()), false);
-
-       list<PositionImage> sub_images;
-
-       /* Image subtitles */
-       list<PositionImage> c = transform_image_subtitles (ps.image);
-       copy (c.begin(), c.end(), back_inserter (sub_images));
-
-       /* Text subtitles (rendered to an image) */
-       if (_burn_subtitles && !ps.text.empty ()) {
-               list<PositionImage> s = render_subtitles (ps.text, _video_container_size);
-               copy (s.begin (), s.end (), back_inserter (sub_images));
-       }
-
-       if (!sub_images.empty ()) {
-               for (list<shared_ptr<PlayerVideo> >::const_iterator i = pvf.begin(); i != pvf.end(); ++i) {
-                       (*i)->set_subtitle (merge (sub_images));
+       if (subtitles) {
+               BOOST_FOREACH (shared_ptr<PlayerVideo> p, pvf) {
+                       p->set_subtitle (subtitles.get ());
                }
        }
 
@@ -541,8 +548,12 @@ Player::statistics () const
        return _statistics;
 }
 
+/** @param burnt true to return only subtitles to be burnt, false to return only
+ *  subtitles that should not be burnt.  This parameter will be ignored if
+ *  _always_burn_subtitles is true; in this case, all subtitles will be returned.
+ */
 PlayerSubtitles
-Player::get_subtitles (DCPTime time, DCPTime length, bool starting)
+Player::get_subtitles (DCPTime time, DCPTime length, bool starting, bool burnt)
 {
        list<shared_ptr<Piece> > subs = overlaps<SubtitleContent> (time, time + length);
 
@@ -550,7 +561,7 @@ Player::get_subtitles (DCPTime time, DCPTime length, bool starting)
 
        for (list<shared_ptr<Piece> >::const_iterator j = subs.begin(); j != subs.end(); ++j) {
                shared_ptr<SubtitleContent> subtitle_content = dynamic_pointer_cast<SubtitleContent> ((*j)->content);
-               if (!subtitle_content->use_subtitles ()) {
+               if (!subtitle_content->use_subtitles () || (!_always_burn_subtitles && (burnt != subtitle_content->burn_subtitles ()))) {
                        continue;
                }
 
@@ -626,11 +637,12 @@ Player::set_ignore_video ()
        _ignore_video = true;
 }
 
-/** Set whether or not this player should burn text subtitles into the image.
- *  @param burn true to burn subtitles, false to not.
+/** Set whether or not this player should always burn text subtitles into the image,
+ *  regardless of the content settings.
+ *  @param burn true to always burn subtitles, false to obey content settings.
  */
 void
-Player::set_burn_subtitles (bool burn)
+Player::set_always_burn_subtitles (bool burn)
 {
-       _burn_subtitles = burn;
+       _always_burn_subtitles = burn;
 }
index f22faa7ac28bf9d3f84fb829d61be72ee3dbb41d..6edfa49b7d20ada1a4acb15d1c1171ea39a3560b 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2013-2014 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2013-2015 Carl Hetherington <cth@carlh.net>
 
     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
@@ -87,13 +87,13 @@ public:
 
        std::list<boost::shared_ptr<PlayerVideo> > get_video (DCPTime time, bool accurate);
        boost::shared_ptr<AudioBuffers> get_audio (DCPTime time, DCPTime length, bool accurate);
-       PlayerSubtitles get_subtitles (DCPTime time, DCPTime length, bool starting);
+       PlayerSubtitles get_subtitles (DCPTime time, DCPTime length, bool starting, bool burnt);
        std::list<boost::shared_ptr<Font> > get_subtitle_fonts ();
 
        void set_video_container_size (dcp::Size);
        void set_ignore_video ();
        void set_enable_subtitles (bool enable);
-       void set_burn_subtitles (bool burn);
+       void set_always_burn_subtitles (bool burn);
 
        PlayerStatistics const & statistics () const;
 
@@ -157,8 +157,10 @@ private:
 
        /** true if the player should ignore all video; i.e. never produce any */
        bool _ignore_video;
-       /** true if the player should burn subtitles into the video */
-       bool _burn_subtitles;
+       /** true if the player should always burn subtitles into the video regardless
+           of content settings
+       */
+       bool _always_burn_subtitles;
 
        boost::shared_ptr<AudioProcessor> _audio_processor;
 
index 7b6ea574eb2c7eae2291f4247ada73e44d7c7dfa..765896a0eb532d9c314143b6ce6929408bf82b85 100644 (file)
@@ -89,7 +89,7 @@ PlayerVideo::set_subtitle (PositionImage image)
 }
 
 shared_ptr<Image>
-PlayerVideo::image (AVPixelFormat pixel_format, bool burn_subtitle, dcp::NoteHandler note) const
+PlayerVideo::image (AVPixelFormat pixel_format, dcp::NoteHandler note) const
 {
        shared_ptr<Image> im = _in->image (optional<dcp::NoteHandler> (note));
 
@@ -118,7 +118,7 @@ PlayerVideo::image (AVPixelFormat pixel_format, bool burn_subtitle, dcp::NoteHan
 
        shared_ptr<Image> out = im->crop_scale_window (total_crop, _inter_size, _out_size, yuv_to_rgb, pixel_format, true);
 
-       if (burn_subtitle && _subtitle) {
+       if (_subtitle) {
                out->alpha_blend (_subtitle->image, _subtitle->position);
        }
 
@@ -130,7 +130,7 @@ PlayerVideo::image (AVPixelFormat pixel_format, bool burn_subtitle, dcp::NoteHan
 }
 
 void
-PlayerVideo::add_metadata (xmlpp::Node* node, bool send_subtitles) const
+PlayerVideo::add_metadata (xmlpp::Node* node) const
 {
        node->add_child("Time")->add_child_text (raw_convert<string> (_time.get ()));
        _crop.as_xml (node);
@@ -147,7 +147,7 @@ PlayerVideo::add_metadata (xmlpp::Node* node, bool send_subtitles) const
        if (_colour_conversion) {
                _colour_conversion.get().as_xml (node);
        }
-       if (send_subtitles && _subtitle) {
+       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));
@@ -156,10 +156,10 @@ PlayerVideo::add_metadata (xmlpp::Node* node, bool send_subtitles) const
 }
 
 void
-PlayerVideo::send_binary (shared_ptr<Socket> socket, bool send_subtitles) const
+PlayerVideo::send_binary (shared_ptr<Socket> socket) const
 {
        _in->send_binary (socket);
-       if (send_subtitles && _subtitle) {
+       if (_subtitle) {
                _subtitle->image->write_to_socket (socket);
        }
 }
index 50c27bebeda4ac7c427b296a605a4aa20b347a6e..0dcc2eeec422295e1bd5e2c8ac108a90ea99c68e 100644 (file)
@@ -54,10 +54,10 @@ public:
 
        void set_subtitle (PositionImage);
 
-       boost::shared_ptr<Image> image (AVPixelFormat pix_fmt, bool burn_subtitle, dcp::NoteHandler note) const;
+       boost::shared_ptr<Image> image (AVPixelFormat pix_fmt, dcp::NoteHandler note) const;
 
-       void add_metadata (xmlpp::Node* node, bool send_subtitles) const;
-       void send_binary (boost::shared_ptr<Socket> socket, bool send_subtitles) const;
+       void add_metadata (xmlpp::Node* node) const;
+       void send_binary (boost::shared_ptr<Socket> socket) const;
 
        bool has_j2k () const;
        Data j2k () const;
index 3ecc3a064bb2b476ab41016e6c4d7083e1cfd72d..fd216c10112954d00c047945e35e7d1deaebe042 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
 
     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
@@ -24,8 +24,6 @@
  *  as a parameter to the constructor.
  */
 
-#include <iostream>
-#include <boost/signals2.hpp>
 #include "transcoder.h"
 #include "encoder.h"
 #include "film.h"
 #include "player.h"
 #include "job.h"
 #include "writer.h"
+#include "subtitle_content.h"
+#include <boost/signals2.hpp>
+#include <boost/foreach.hpp>
+#include <iostream>
 
 using std::string;
 using std::cout;
@@ -64,7 +66,20 @@ Transcoder::go ()
        DCPTime const frame = DCPTime::from_frames (1, _film->video_frame_rate ());
        DCPTime const length = _film->length ();
 
-       if (!_film->burn_subtitles ()) {
+       int burnt_subtitles = 0;
+       int non_burnt_subtitles = 0;
+       BOOST_FOREACH (shared_ptr<const Content> c, _film->content ()) {
+               shared_ptr<const SubtitleContent> sc = dynamic_pointer_cast<const SubtitleContent> (c);
+               if (sc && sc->use_subtitles()) {
+                       if (sc->burn_subtitles()) {
+                               ++burnt_subtitles;
+                       } else {
+                               ++non_burnt_subtitles;
+                       }
+               }
+       }
+
+       if (non_burnt_subtitles) {
                _writer->write (_player->get_subtitle_fonts ());
        }
 
@@ -74,8 +89,8 @@ Transcoder::go ()
                        _encoder->enqueue (*i);
                }
                _writer->write (_player->get_audio (t, frame, true));
-               if (!_film->burn_subtitles ()) {
-                       _writer->write (_player->get_subtitles (t, frame, true));
+               if (non_burnt_subtitles) {
+                       _writer->write (_player->get_subtitles (t, frame, true, false));
                }
        }
 
index 02f4e667398fb16376ee17411bbc5b5b79a8f02b..b7e48a3331c96bff2c0df518c4179dfb4481ff5d 100644 (file)
@@ -49,8 +49,8 @@ static int frame_count = 0;
 void
 process_video (shared_ptr<PlayerVideo> pvf)
 {
-       shared_ptr<DCPVideo> local  (new DCPVideo (pvf, frame_count, film->video_frame_rate(), 250000000, RESOLUTION_2K, true, log_));
-       shared_ptr<DCPVideo> remote (new DCPVideo (pvf, frame_count, film->video_frame_rate(), 250000000, RESOLUTION_2K, true, log_));
+       shared_ptr<DCPVideo> local  (new DCPVideo (pvf, frame_count, film->video_frame_rate(), 250000000, RESOLUTION_2K, log_));
+       shared_ptr<DCPVideo> remote (new DCPVideo (pvf, frame_count, film->video_frame_rate(), 250000000, RESOLUTION_2K, log_));
 
        cout << "Frame " << frame_count << ": ";
        cout.flush ();
index 0f5ec5afc7d3bfcd178a7a3ab8adbd8b467b0e7d..b38476dd7a0a8a4d44cb92045903f9a249cc2e91 100644 (file)
@@ -196,16 +196,6 @@ DCPPanel::signed_toggled ()
        _film->set_signed (_signed->GetValue ());
 }
 
-void
-DCPPanel::burn_subtitles_toggled ()
-{
-       if (!_film) {
-               return;
-       }
-
-       _film->set_burn_subtitles (_burn_subtitles->GetValue ());
-}
-
 void
 DCPPanel::encrypted_toggled ()
 {
@@ -289,9 +279,6 @@ DCPPanel::film_changed (int p)
                checked_set (_dcp_content_type, DCPContentType::as_index (_film->dcp_content_type ()));
                setup_dcp_name ();
                break;
-       case Film::BURN_SUBTITLES:
-               checked_set (_burn_subtitles, _film->burn_subtitles ());
-               break;
        case Film::SIGNED:
                checked_set (_signed, _film->is_signed ());
                break;
@@ -455,7 +442,6 @@ DCPPanel::set_film (shared_ptr<Film> film)
        film_changed (Film::CONTAINER);
        film_changed (Film::RESOLUTION);
        film_changed (Film::SIGNED);
-       film_changed (Film::BURN_SUBTITLES);
        film_changed (Film::ENCRYPTED);
        film_changed (Film::KEY);
        film_changed (Film::J2K_BANDWIDTH);
@@ -481,7 +467,6 @@ DCPPanel::set_general_sensitivity (bool s)
        if (_film && _film->encrypted ()) {
                si = false;
        }
-       _burn_subtitles->Enable (s);
        _signed->Enable (si);
 
        _encrypted->Enable (s);
@@ -605,10 +590,6 @@ DCPPanel::make_video_panel ()
                ++r;
        }
 
-       _burn_subtitles = new wxCheckBox (panel, wxID_ANY, _("Burn subtitles into image"));
-       grid->Add (_burn_subtitles, wxGBPosition (r, 0), wxGBSpan (1, 2));
-       ++r;
-
        _three_d = new wxCheckBox (panel, wxID_ANY, _("3D"));
        grid->Add (_three_d, wxGBPosition (r, 0), wxGBSpan (1, 2));
        ++r;
@@ -632,7 +613,6 @@ DCPPanel::make_video_panel ()
        _frame_rate_choice->Bind(wxEVT_COMMAND_CHOICE_SELECTED,       boost::bind (&DCPPanel::frame_rate_choice_changed, this));
        _frame_rate_spin->Bind  (wxEVT_COMMAND_SPINCTRL_UPDATED,      boost::bind (&DCPPanel::frame_rate_spin_changed, this));
        _best_frame_rate->Bind  (wxEVT_COMMAND_BUTTON_CLICKED,        boost::bind (&DCPPanel::best_frame_rate_clicked, this));
-       _burn_subtitles->Bind   (wxEVT_COMMAND_CHECKBOX_CLICKED,      boost::bind (&DCPPanel::burn_subtitles_toggled, this));
        _j2k_bandwidth->Bind    (wxEVT_COMMAND_SPINCTRL_UPDATED,      boost::bind (&DCPPanel::j2k_bandwidth_changed, this));
        /* Also listen to wxEVT_COMMAND_TEXT_UPDATED so that typing numbers directly in is always noticed */
        _j2k_bandwidth->Bind    (wxEVT_COMMAND_TEXT_UPDATED,          boost::bind (&DCPPanel::j2k_bandwidth_changed, this));
index 055de67a61156f5310a41ec758a823693b6bfa66..a81af4f454d77fa366540d5eaebbfae5d084d90e 100644 (file)
@@ -67,7 +67,6 @@ private:
        void three_d_changed ();
        void standard_changed ();
        void signed_toggled ();
-       void burn_subtitles_toggled ();
        void encrypted_toggled ();
        void edit_key_clicked ();
        void audio_processor_changed ();
@@ -110,7 +109,6 @@ private:
        wxChoice* _resolution;
        wxChoice* _standard;
        wxCheckBox* _signed;
-       wxCheckBox* _burn_subtitles;
        wxCheckBox* _encrypted;
        wxStaticText* _key;
        wxButton* _edit_key;
index 4e155e05d9e11d221c1f53cba945fdc79e2a880a..7a306de62dc88598aa1165a88070620149314bb9 100644 (file)
@@ -145,10 +145,10 @@ FilmViewer::set_film (shared_ptr<Film> film)
                return;
        }
 
-       /* Always burn in subtitles, even if we are set not to, otherwise we won't see them
+       /* Always burn in subtitles, even if content is set not to, otherwise we won't see them
           in the preview.
        */
-       _player->set_burn_subtitles (true);
+       _player->set_always_burn_subtitles (true);
 
        _film_connection = _film->Changed.connect (boost::bind (&FilmViewer::film_changed, this, _1));
 
@@ -183,7 +183,7 @@ FilmViewer::get (DCPTime p, bool accurate)
 
        if (!pvf.empty ()) {
                try {
-                       _frame = pvf.front()->image (PIX_FMT_RGB24, true, boost::bind (&Log::dcp_log, _film->log().get(), _1, _2));
+                       _frame = pvf.front()->image (PIX_FMT_RGB24, boost::bind (&Log::dcp_log, _film->log().get(), _1, _2));
 
                        dcp::YUVToRGB yuv_to_rgb = dcp::YUV_TO_RGB_REC601;
                        if (pvf.front()->colour_conversion()) {
index 9bb772f4a263eb02e7087dae5a6e85286c5ce04f..f861370b459ab5f25ae788c37f04e1ec4560cab9 100644 (file)
@@ -39,9 +39,9 @@ BOOST_AUTO_TEST_CASE (burnt_subtitle_test_subrip)
        film->set_container (Ratio::from_id ("185"));
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR"));
        film->set_name ("frobozz");
-       film->set_burn_subtitles (true);
        shared_ptr<SubRipContent> content (new SubRipContent (film, "test/data/subrip2.srt"));
        content->set_use_subtitles (true);
+       content->set_burn_subtitles (true);
        film->examine_and_add_content (content, true);
        wait_for_jobs ();
        film->make_dcp ();
index e97abcec5b34c3003d6ee57fe84d8e85c08c3c58..99cc845bcd1eb5f9ba5c2a60bb68c0e8d0284071 100644 (file)
@@ -103,7 +103,6 @@ BOOST_AUTO_TEST_CASE (client_server_test_rgb)
                        24,
                        200000000,
                        RESOLUTION_2K,
-                       true,
                        log
                        )
                );
@@ -185,7 +184,6 @@ BOOST_AUTO_TEST_CASE (client_server_test_yuv)
                        24,
                        200000000,
                        RESOLUTION_2K,
-                       true,
                        log
                        )
                );
index f3a8fc2ba88126db06aa3c9dd5eb5110fb2de67c..c710f266d188cd7b933506b2973c97b967f33329 160000 (submodule)
--- a/test/data
+++ b/test/data
@@ -1 +1 @@
-Subproject commit f3a8fc2ba88126db06aa3c9dd5eb5110fb2de67c
+Subproject commit c710f266d188cd7b933506b2973c97b967f33329
index 314b214f2acf5ccc4f576c32c4d0c6661f30d8e4..e8a5a4c04cb25d0ae08b4c590fcee48e74faa48c 100644 (file)
@@ -38,7 +38,6 @@ BOOST_AUTO_TEST_CASE (dcp_subtitle_test)
        film->set_container (Ratio::from_id ("185"));
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR"));
        film->set_name ("frobozz");
-       film->set_burn_subtitles (false);
        shared_ptr<DCPSubtitleContent> content (new DCPSubtitleContent (film, "test/data/dcp_sub.xml"));
        film->examine_and_add_content (content);
        wait_for_jobs ();
@@ -46,6 +45,7 @@ BOOST_AUTO_TEST_CASE (dcp_subtitle_test)
        BOOST_CHECK_EQUAL (content->full_length(), DCPTime::from_seconds (2));
 
        content->set_use_subtitles (true);
+       content->set_burn_subtitles (false);
        film->make_dcp ();
        wait_for_jobs ();
 
index 64249a118ce322134fedc39b4a38a7510a2bbe93..161d23d7769af904f7d3444ffe147121707b633f 100644 (file)
@@ -37,12 +37,12 @@ BOOST_AUTO_TEST_CASE (srt_subtitle_test)
        film->set_container (Ratio::from_id ("185"));
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR"));
        film->set_name ("frobozz");
-       film->set_burn_subtitles (false);
        shared_ptr<SubRipContent> content (new SubRipContent (film, "test/data/subrip2.srt"));
        film->examine_and_add_content (content);
        wait_for_jobs ();
 
        content->set_use_subtitles (true);
+       content->set_burn_subtitles (false);
        film->make_dcp ();
        wait_for_jobs ();
 
@@ -57,12 +57,12 @@ BOOST_AUTO_TEST_CASE (srt_subtitle_test2)
        film->set_container (Ratio::from_id ("185"));
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR"));
        film->set_name ("frobozz");
-       film->set_burn_subtitles (false);
        shared_ptr<SubRipContent> content (new SubRipContent (film, "test/data/subrip2.srt"));
        film->examine_and_add_content (content);
        wait_for_jobs ();
 
        content->set_use_subtitles (true);
+       content->set_burn_subtitles (false);
        /* Use test/data/subrip2.srt as if it were a font file  */
        content->fonts().front()->set_file ("test/data/subrip2.srt");
 
index f4f21486cd0c43b9b2b8b333e1559dec0d3f2adf..296ffbdf8e6ad07be38019fa0aad1812d37d33a5 100644 (file)
@@ -32,6 +32,7 @@ BOOST_AUTO_TEST_CASE (ffmpeg_time_calculation_test)
 
        string const xml = "<Content>"
                "<Type>FFmpeg</Type>"
+               "<BurnSubtitles>0</BurnSubtitles>"
                "<Path>/home/c.hetherington/DCP/clapperboard.mp4</Path>"
                "<Digest>2760e03c7251480f7f02c01a907792673784335</Digest>"
                "<Position>0</Position>"
index 8f44fa7229bdb4b060086e820704994ac038fdee..536cb7d466f560650ebfd487deddaa29c822953f 100644 (file)
@@ -38,9 +38,9 @@ BOOST_AUTO_TEST_CASE (xml_subtitle_test)
        film->set_container (Ratio::from_id ("185"));
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR"));
        film->set_name ("frobozz");
-       film->set_burn_subtitles (false);
        shared_ptr<SubRipContent> content (new SubRipContent (film, "test/data/subrip2.srt"));
        content->set_use_subtitles (true);
+       content->set_burn_subtitles (false);
        film->examine_and_add_content (content);
        wait_for_jobs ();
        film->make_dcp ();