From 89ee4cc6019036fa4fc0a6e07e052ffdc3b136ac Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Thu, 25 Jun 2015 11:58:12 +0100 Subject: [PATCH] Make player decide whether subtitles should be burnt based on content settings rather than using the film's settings. Remove film property of burn-subtitles. --- src/lib/dcp_video.cc | 14 +++---- src/lib/dcp_video.h | 3 +- src/lib/encoder.cc | 1 - src/lib/film.cc | 20 +-------- src/lib/film.h | 8 ---- src/lib/player.cc | 76 ++++++++++++++++++++--------------- src/lib/player.h | 12 +++--- src/lib/player_video.cc | 12 +++--- src/lib/player_video.h | 6 +-- src/lib/transcoder.cc | 27 ++++++++++--- src/tools/server_test.cc | 4 +- src/wx/dcp_panel.cc | 20 --------- src/wx/dcp_panel.h | 2 - src/wx/film_viewer.cc | 6 +-- test/burnt_subtitle_test.cc | 2 +- test/client_server_test.cc | 2 - test/data | 2 +- test/dcp_subtitle_test.cc | 2 +- test/srt_subtitle_test.cc | 4 +- test/time_calculation_test.cc | 1 + test/xml_subtitle_test.cc | 2 +- 21 files changed, 101 insertions(+), 125 deletions(-) diff --git a/src/lib/dcp_video.cc b/src/lib/dcp_video.cc index b72353d9e..3879947eb 100644 --- a/src/lib/dcp_video.cc +++ b/src/lib/dcp_video.cc @@ -77,14 +77,13 @@ using dcp::Size; * @param l Log to write to. */ DCPVideo::DCPVideo ( - shared_ptr frame, int index, int dcp_fps, int bw, Resolution r, bool b, shared_ptr l + shared_ptr frame, int index, int dcp_fps, int bw, Resolution r, shared_ptr 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 frame, shared_ptrnumber_child ("FramesPerSecond"); _j2k_bandwidth = node->number_child ("J2KBandwidth"); _resolution = Resolution (node->optional_number_child("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 xyz; - shared_ptr image = _frame->image (AV_PIX_FMT_RGB48LE, _burn_subtitles, note); + shared_ptr 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 (_frames_per_second)); el->add_child("J2KBandwidth")->add_child_text (raw_convert (_j2k_bandwidth)); el->add_child("Resolution")->add_child_text (raw_convert (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 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; } diff --git a/src/lib/dcp_video.h b/src/lib/dcp_video.h index 97be07798..8fd668b00 100644 --- a/src/lib/dcp_video.h +++ b/src/lib/dcp_video.h @@ -46,7 +46,7 @@ class Data; class DCPVideo : public boost::noncopyable { public: - DCPVideo (boost::shared_ptr, int, int, int, Resolution, bool b, boost::shared_ptr); + DCPVideo (boost::shared_ptr, int, int, int, Resolution, boost::shared_ptr); DCPVideo (boost::shared_ptr, cxml::ConstNodePtr, boost::shared_ptr); 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 }; diff --git a/src/lib/encoder.cc b/src/lib/encoder.cc index 93e15031d..c3ad08441 100644 --- a/src/lib/encoder.cc +++ b/src/lib/encoder.cc @@ -236,7 +236,6 @@ Encoder::enqueue (shared_ptr pv) _film->video_frame_rate(), _film->j2k_bandwidth(), _film->resolution(), - _film->burn_subtitles(), _film->log() ) )); diff --git a/src/lib/film.cc b/src/lib/film.cc index 75dfa45eb..2ef59fe21 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -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 c, cl) { shared_ptr sc = dynamic_pointer_cast (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) { diff --git a/src/lib/film.h b/src/lib/film.h index 5e4c01c86..6c7333ec1 100644 --- a/src/lib/film.h +++ b/src/lib/film.h @@ -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; diff --git a/src/lib/player.cc b/src/lib/player.cc index be1268f48..361f41c92 100644 --- a/src/lib/player.cc +++ b/src/lib/player.cc @@ -72,7 +72,7 @@ Player::Player (shared_ptr 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 sub_images; + + /* Image subtitles */ + list 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 s = render_subtitles (ps.text, _video_container_size); + copy (s.begin (), s.end (), back_inserter (sub_images)); + } + + optional subtitles; + if (!sub_images.empty ()) { + subtitles = merge (sub_images); + } + + /* Find video */ + list > ov = overlaps ( 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 = ov.back (); shared_ptr decoder = dynamic_pointer_cast (piece->decoder); DCPOMATIC_ASSERT (decoder); - shared_ptr content = dynamic_pointer_cast (piece->content); - DCPOMATIC_ASSERT (content); + shared_ptr video_content = dynamic_pointer_cast (piece->content); + DCPOMATIC_ASSERT (video_content); list 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::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 sub_images; - - /* Image subtitles */ - list 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 s = render_subtitles (ps.text, _video_container_size); - copy (s.begin (), s.end (), back_inserter (sub_images)); - } - - if (!sub_images.empty ()) { - for (list >::const_iterator i = pvf.begin(); i != pvf.end(); ++i) { - (*i)->set_subtitle (merge (sub_images)); + if (subtitles) { + BOOST_FOREACH (shared_ptr 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 > subs = overlaps (time, time + length); @@ -550,7 +561,7 @@ Player::get_subtitles (DCPTime time, DCPTime length, bool starting) for (list >::const_iterator j = subs.begin(); j != subs.end(); ++j) { shared_ptr subtitle_content = dynamic_pointer_cast ((*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; } diff --git a/src/lib/player.h b/src/lib/player.h index f22faa7ac..6edfa49b7 100644 --- a/src/lib/player.h +++ b/src/lib/player.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2013-2014 Carl Hetherington + Copyright (C) 2013-2015 Carl Hetherington 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 > get_video (DCPTime time, bool accurate); boost::shared_ptr 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 > 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 _audio_processor; diff --git a/src/lib/player_video.cc b/src/lib/player_video.cc index 7b6ea574e..765896a0e 100644 --- a/src/lib/player_video.cc +++ b/src/lib/player_video.cc @@ -89,7 +89,7 @@ PlayerVideo::set_subtitle (PositionImage image) } shared_ptr -PlayerVideo::image (AVPixelFormat pixel_format, bool burn_subtitle, dcp::NoteHandler note) const +PlayerVideo::image (AVPixelFormat pixel_format, dcp::NoteHandler note) const { shared_ptr im = _in->image (optional (note)); @@ -118,7 +118,7 @@ PlayerVideo::image (AVPixelFormat pixel_format, bool burn_subtitle, dcp::NoteHan shared_ptr 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 (_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 (_subtitle->image->size().width)); node->add_child ("SubtitleHeight")->add_child_text (raw_convert (_subtitle->image->size().height)); node->add_child ("SubtitleX")->add_child_text (raw_convert (_subtitle->position.x)); @@ -156,10 +156,10 @@ PlayerVideo::add_metadata (xmlpp::Node* node, bool send_subtitles) const } void -PlayerVideo::send_binary (shared_ptr socket, bool send_subtitles) const +PlayerVideo::send_binary (shared_ptr socket) const { _in->send_binary (socket); - if (send_subtitles && _subtitle) { + if (_subtitle) { _subtitle->image->write_to_socket (socket); } } diff --git a/src/lib/player_video.h b/src/lib/player_video.h index 50c27bebe..0dcc2eeec 100644 --- a/src/lib/player_video.h +++ b/src/lib/player_video.h @@ -54,10 +54,10 @@ public: void set_subtitle (PositionImage); - boost::shared_ptr image (AVPixelFormat pix_fmt, bool burn_subtitle, dcp::NoteHandler note) const; + boost::shared_ptr 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, bool send_subtitles) const; + void add_metadata (xmlpp::Node* node) const; + void send_binary (boost::shared_ptr socket) const; bool has_j2k () const; Data j2k () const; diff --git a/src/lib/transcoder.cc b/src/lib/transcoder.cc index 3ecc3a064..fd216c101 100644 --- a/src/lib/transcoder.cc +++ b/src/lib/transcoder.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2012-2014 Carl Hetherington + Copyright (C) 2012-2015 Carl Hetherington 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 -#include #include "transcoder.h" #include "encoder.h" #include "film.h" @@ -34,6 +32,10 @@ #include "player.h" #include "job.h" #include "writer.h" +#include "subtitle_content.h" +#include +#include +#include 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 c, _film->content ()) { + shared_ptr sc = dynamic_pointer_cast (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)); } } diff --git a/src/tools/server_test.cc b/src/tools/server_test.cc index 02f4e6673..b7e48a333 100644 --- a/src/tools/server_test.cc +++ b/src/tools/server_test.cc @@ -49,8 +49,8 @@ static int frame_count = 0; void process_video (shared_ptr pvf) { - shared_ptr local (new DCPVideo (pvf, frame_count, film->video_frame_rate(), 250000000, RESOLUTION_2K, true, log_)); - shared_ptr remote (new DCPVideo (pvf, frame_count, film->video_frame_rate(), 250000000, RESOLUTION_2K, true, log_)); + shared_ptr local (new DCPVideo (pvf, frame_count, film->video_frame_rate(), 250000000, RESOLUTION_2K, log_)); + shared_ptr remote (new DCPVideo (pvf, frame_count, film->video_frame_rate(), 250000000, RESOLUTION_2K, log_)); cout << "Frame " << frame_count << ": "; cout.flush (); diff --git a/src/wx/dcp_panel.cc b/src/wx/dcp_panel.cc index 0f5ec5afc..b38476dd7 100644 --- a/src/wx/dcp_panel.cc +++ b/src/wx/dcp_panel.cc @@ -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_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)); diff --git a/src/wx/dcp_panel.h b/src/wx/dcp_panel.h index 055de67a6..a81af4f45 100644 --- a/src/wx/dcp_panel.h +++ b/src/wx/dcp_panel.h @@ -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; diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc index 4e155e05d..7a306de62 100644 --- a/src/wx/film_viewer.cc +++ b/src/wx/film_viewer.cc @@ -145,10 +145,10 @@ FilmViewer::set_film (shared_ptr 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()) { diff --git a/test/burnt_subtitle_test.cc b/test/burnt_subtitle_test.cc index 9bb772f4a..f861370b4 100644 --- a/test/burnt_subtitle_test.cc +++ b/test/burnt_subtitle_test.cc @@ -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 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 (); diff --git a/test/client_server_test.cc b/test/client_server_test.cc index e97abcec5..99cc845bc 100644 --- a/test/client_server_test.cc +++ b/test/client_server_test.cc @@ -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 ) ); diff --git a/test/data b/test/data index f3a8fc2ba..c710f266d 160000 --- a/test/data +++ b/test/data @@ -1 +1 @@ -Subproject commit f3a8fc2ba88126db06aa3c9dd5eb5110fb2de67c +Subproject commit c710f266d188cd7b933506b2973c97b967f33329 diff --git a/test/dcp_subtitle_test.cc b/test/dcp_subtitle_test.cc index 314b214f2..e8a5a4c04 100644 --- a/test/dcp_subtitle_test.cc +++ b/test/dcp_subtitle_test.cc @@ -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 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 (); diff --git a/test/srt_subtitle_test.cc b/test/srt_subtitle_test.cc index 64249a118..161d23d77 100644 --- a/test/srt_subtitle_test.cc +++ b/test/srt_subtitle_test.cc @@ -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 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 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"); diff --git a/test/time_calculation_test.cc b/test/time_calculation_test.cc index f4f21486c..296ffbdf8 100644 --- a/test/time_calculation_test.cc +++ b/test/time_calculation_test.cc @@ -32,6 +32,7 @@ BOOST_AUTO_TEST_CASE (ffmpeg_time_calculation_test) string const xml = "" "FFmpeg" + "0" "/home/c.hetherington/DCP/clapperboard.mp4" "2760e03c7251480f7f02c01a907792673784335" "0" diff --git a/test/xml_subtitle_test.cc b/test/xml_subtitle_test.cc index 8f44fa722..536cb7d46 100644 --- a/test/xml_subtitle_test.cc +++ b/test/xml_subtitle_test.cc @@ -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 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 (); -- 2.30.2