X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fdcp_decoder.cc;h=4076936ddca2460898d06f4aae30046fbc3ef9ba;hb=8fedaaa75c4586a4cc7ffb393bd71d1fdb091dc8;hp=17710a3bd093a0127af3aec339d33cff6de0ffa6;hpb=ddcd4f3ba0af3e9d49dbb68127317cd0d871a248;p=dcpomatic.git diff --git a/src/lib/dcp_decoder.cc b/src/lib/dcp_decoder.cc index 17710a3bd..4076936dd 100644 --- a/src/lib/dcp_decoder.cc +++ b/src/lib/dcp_decoder.cc @@ -49,7 +49,6 @@ #include #include #include -#include #include #include "i18n.h" @@ -59,8 +58,8 @@ using std::cout; using std::map; using std::string; using std::vector; -using boost::shared_ptr; -using boost::dynamic_pointer_cast; +using std::shared_ptr; +using std::dynamic_pointer_cast; using boost::optional; using namespace dcpomatic; @@ -76,7 +75,7 @@ DCPDecoder::DCPDecoder (shared_ptr film, shared_ptraudio) { audio.reset (new AudioDecoder (this, c->audio, fast)); } - BOOST_FOREACH (shared_ptr i, c->text) { + for (auto i: c->text) { /* XXX: this time here should be the time of the first subtitle, not 0 */ text.push_back (shared_ptr (new TextDecoder (this, i, ContentTime()))); } @@ -106,7 +105,7 @@ DCPDecoder::DCPDecoder (shared_ptr film, shared_ptr cpl; - BOOST_FOREACH (shared_ptr i, cpl_list) { + for (auto i: cpl_list) { if (_dcp_content->cpl() && i->id() == _dcp_content->cpl().get()) { cpl = i; } @@ -179,7 +178,7 @@ DCPDecoder::pass () new J2KImageProxy ( _stereo_reader->get_frame (entry_point + frame), picture_asset->size(), - dcp::EYE_LEFT, + dcp::Eye::LEFT, AV_PIX_FMT_XYZ12LE, _forced_reduction ) @@ -193,7 +192,7 @@ DCPDecoder::pass () new J2KImageProxy ( _stereo_reader->get_frame (entry_point + frame), picture_asset->size(), - dcp::EYE_RIGHT, + dcp::Eye::RIGHT, AV_PIX_FMT_XYZ12LE, _forced_reduction ) @@ -255,7 +254,7 @@ DCPDecoder::pass_texts (ContentTime next, dcp::Size size) pass_texts ( next, (*_reel)->main_subtitle()->asset(), - _dcp_content->reference_text(TEXT_OPEN_SUBTITLE), + _dcp_content->reference_text(TextType::OPEN_SUBTITLE), (*_reel)->main_subtitle()->entry_point().get_value_or(0), *decoder, size @@ -263,9 +262,9 @@ DCPDecoder::pass_texts (ContentTime next, dcp::Size size) ++decoder; } - BOOST_FOREACH (shared_ptr i, (*_reel)->closed_captions()) { + for (auto i: (*_reel)->closed_captions()) { pass_texts ( - next, i->asset(), _dcp_content->reference_text(TEXT_CLOSED_CAPTION), i->entry_point().get_value_or(0), *decoder, size + next, i->asset(), _dcp_content->reference_text(TextType::CLOSED_CAPTION), i->entry_point().get_value_or(0), *decoder, size ); ++decoder; } @@ -281,7 +280,7 @@ DCPDecoder::pass_texts ( int64_t const frame = next.frames_round (vfr); if (_decode_referenced || !reference) { - list > subs = asset->subtitles_during ( + auto subs = asset->subtitles_during ( dcp::Time (entry_point + frame, vfr, vfr), dcp::Time (entry_point + frame + 1, vfr, vfr), true @@ -289,11 +288,11 @@ DCPDecoder::pass_texts ( list strings; - BOOST_FOREACH (shared_ptr i, subs) { - shared_ptr is = dynamic_pointer_cast (i); + for (auto i: subs) { + auto is = dynamic_pointer_cast(i); if (is) { if (!strings.empty() && (strings.back().in() != is->in() || strings.back().out() != is->out())) { - dcp::SubtitleString b = strings.back(); + auto b = strings.back(); decoder->emit_plain ( ContentTimePeriod ( ContentTime::from_frames(_offset - entry_point, vfr) + ContentTime::from_seconds(b.in().as_seconds()), @@ -311,7 +310,7 @@ DCPDecoder::pass_texts ( this would need to be done both here and in DCPSubtitleDecoder. */ - shared_ptr ii = dynamic_pointer_cast (i); + auto ii = dynamic_pointer_cast(i); if (ii) { emit_subtitle_image ( ContentTimePeriod ( @@ -326,7 +325,7 @@ DCPDecoder::pass_texts ( } if (!strings.empty()) { - dcp::SubtitleString b = strings.back(); + auto b = strings.back(); decoder->emit_plain ( ContentTimePeriod ( ContentTime::from_frames(_offset - entry_point, vfr) + ContentTime::from_seconds(b.in().as_seconds()), @@ -471,7 +470,7 @@ string DCPDecoder::calculate_lazy_digest (shared_ptr c) const { Digester d; - BOOST_FOREACH (boost::filesystem::path i, c->paths()) { + for (auto i: c->paths()) { d.add (i.string()); } if (_dcp_content->kdm()) { @@ -495,7 +494,7 @@ vector DCPDecoder::fonts () const { vector data; - BOOST_FOREACH (shared_ptr i, _reels) { + for (auto i: _reels) { if (i->main_subtitle() && i->main_subtitle()->asset()) { map fm = i->main_subtitle()->asset()->font_data(); for (map::const_iterator j = fm.begin(); j != fm.end(); ++j) {