X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fdcp_decoder.cc;h=0411ad94183d8818df84adcc5d23ac5ec1d3b5f8;hb=0a93237cb5e4642d3b698ff9b7d0cfae5401478c;hp=bf016ef877bb11990bccf83a01821459cecb5a71;hpb=5e4f001bf32e3cdf65efa34803d70e6c1c00c66b;p=dcpomatic.git diff --git a/src/lib/dcp_decoder.cc b/src/lib/dcp_decoder.cc index bf016ef87..0411ad941 100644 --- a/src/lib/dcp_decoder.cc +++ b/src/lib/dcp_decoder.cc @@ -17,6 +17,11 @@ */ +#include "dcp_decoder.h" +#include "dcp_content.h" +#include "j2k_image_proxy.h" +#include "image.h" +#include "config.h" #include #include #include @@ -27,22 +32,16 @@ #include #include #include -#include "dcp_decoder.h" -#include "dcp_content.h" -#include "j2k_image_proxy.h" -#include "image.h" -#include "config.h" using std::list; using std::cout; using boost::shared_ptr; using boost::dynamic_pointer_cast; -DCPDecoder::DCPDecoder (shared_ptr c, shared_ptr log) +DCPDecoder::DCPDecoder (shared_ptr c) : VideoDecoder (c) , AudioDecoder (c) , SubtitleDecoder (c) - , _log (log) , _dcp_content (c) { dcp::DCP dcp (c->directory ()); @@ -50,13 +49,13 @@ DCPDecoder::DCPDecoder (shared_ptr c, shared_ptr log) if (c->kdm ()) { dcp.add (dcp::DecryptedKDM (c->kdm().get (), Config::instance()->decryption_private_key ())); } - assert (dcp.cpls().size() == 1); + DCPOMATIC_ASSERT (dcp.cpls().size() == 1); _reels = dcp.cpls().front()->reels (); _reel = _reels.begin (); } bool -DCPDecoder::pass () +DCPDecoder::pass (PassReason) { if (_reel == _reels.end () || !_dcp_content->can_be_played ()) { return true; @@ -71,15 +70,15 @@ DCPDecoder::pass () shared_ptr stereo = dynamic_pointer_cast (mxf); int64_t const entry_point = (*_reel)->main_picture()->entry_point (); if (mono) { - video (shared_ptr (new J2KImageProxy (mono->get_frame (entry_point + frame), mxf->size(), _log)), frame); + video (shared_ptr (new J2KImageProxy (mono->get_frame (entry_point + frame), mxf->size())), frame); } else { video ( - shared_ptr (new J2KImageProxy (stereo->get_frame (entry_point + frame), mxf->size(), dcp::EYE_LEFT, _log)), + shared_ptr (new J2KImageProxy (stereo->get_frame (entry_point + frame), mxf->size(), dcp::EYE_LEFT)), frame ); video ( - shared_ptr (new J2KImageProxy (stereo->get_frame (entry_point + frame), mxf->size(), dcp::EYE_RIGHT, _log)), + shared_ptr (new J2KImageProxy (stereo->get_frame (entry_point + frame), mxf->size(), dcp::EYE_RIGHT)), frame ); } @@ -90,7 +89,7 @@ DCPDecoder::pass () shared_ptr sf = (*_reel)->main_sound()->mxf()->get_frame (entry_point + frame); uint8_t const * from = sf->data (); - int const channels = _dcp_content->audio_channels (); + int const channels = _dcp_content->audio_stream()->channels (); int const frames = sf->size() / (3 * channels); shared_ptr data (new AudioBuffers (channels, frames)); for (int i = 0; i < frames; ++i) { @@ -100,7 +99,7 @@ DCPDecoder::pass () } } - audio (data, _next); + audio (_dcp_content->audio_stream(), data, _next); } /* XXX: subtitle */ @@ -134,7 +133,14 @@ DCPDecoder::seek (ContentTime t, bool accurate) list -DCPDecoder::subtitles_during (ContentTimePeriod, bool starting) const +DCPDecoder::image_subtitles_during (ContentTimePeriod, bool) const +{ + return list (); +} + +list +DCPDecoder::text_subtitles_during (ContentTimePeriod, bool) const { + /* XXX */ return list (); }