X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fvideo_decoder.cc;h=9d165ab02f810b7d7e4730ff1617115f3a57eafb;hb=bdbfd6b08856a445446bfd845f1c43109d184250;hp=31dc3cdc204836e821b385b0280d2c13f2defb31;hpb=9922c1f2eaea674ba2ff6cce5f5853655fd8ad7a;p=dcpomatic.git diff --git a/src/lib/video_decoder.cc b/src/lib/video_decoder.cc index 31dc3cdc2..9d165ab02 100644 --- a/src/lib/video_decoder.cc +++ b/src/lib/video_decoder.cc @@ -49,7 +49,7 @@ VideoDecoder::VideoDecoder (shared_ptr c) } list -VideoDecoder::decoded_video (VideoFrame frame) +VideoDecoder::decoded_video (Frame frame) { list output; @@ -68,7 +68,7 @@ VideoDecoder::decoded_video (VideoFrame frame) * @return Frames; there may be none (if there is no video there), 1 for 2D or 2 for 3D. */ list -VideoDecoder::get_video (VideoFrame frame, bool accurate) +VideoDecoder::get_video (Frame frame, bool accurate) { /* At this stage, if we have get_video()ed before, _decoded_video will contain the last frame that this method returned (and possibly a few more). If the requested frame is not in _decoded_video and it is not the next @@ -96,7 +96,7 @@ VideoDecoder::get_video (VideoFrame frame, bool accurate) break; } - if (pass (PASS_REASON_VIDEO)) { + if (pass ()) { /* The decoder has nothing more for us */ break; } @@ -113,7 +113,7 @@ VideoDecoder::get_video (VideoFrame frame, bool accurate) dec = decoded_video (frame); } else { /* Any frame will do: use the first one that comes out of pass() */ - while (_decoded_video.empty() && !pass (PASS_REASON_VIDEO)) {} + while (_decoded_video.empty() && !pass ()) {} if (!_decoded_video.empty ()) { dec.push_back (_decoded_video.front ()); } @@ -130,7 +130,7 @@ VideoDecoder::get_video (VideoFrame frame, bool accurate) /** Fill _decoded_video from `from' up to, but not including, `to' */ void -VideoDecoder::fill_2d (VideoFrame from, VideoFrame to) +VideoDecoder::fill_2d (Frame from, Frame to) { if (to == 0) { /* Already OK */ @@ -147,24 +147,19 @@ VideoDecoder::fill_2d (VideoFrame from, VideoFrame to) filler_part = _decoded_video.back().part; } - VideoFrame filler_frame = from; - - while (filler_frame < to) { - + for (Frame i = from; i < to; ++i) { #ifdef DCPOMATIC_DEBUG test_gaps++; #endif _decoded_video.push_back ( - ContentVideo (filler_image, EYES_BOTH, filler_part, filler_frame) + ContentVideo (filler_image, EYES_BOTH, filler_part, i) ); - - ++filler_frame; } } /** Fill _decoded_video from `from' up to, but not including, `to' */ void -VideoDecoder::fill_3d (VideoFrame from, VideoFrame to, Eyes eye) +VideoDecoder::fill_3d (Frame from, Frame to, Eyes eye) { if (to == 0 && eye == EYES_LEFT) { /* Already OK */ @@ -192,7 +187,7 @@ VideoDecoder::fill_3d (VideoFrame from, VideoFrame to, Eyes eye) } } - VideoFrame filler_frame = from; + Frame filler_frame = from; Eyes filler_eye = _decoded_video.empty() ? EYES_LEFT : _decoded_video.back().eyes; if (_decoded_video.empty ()) { @@ -232,7 +227,7 @@ VideoDecoder::fill_3d (VideoFrame from, VideoFrame to, Eyes eye) /** Called by subclasses when they have a video frame ready */ void -VideoDecoder::video (shared_ptr image, VideoFrame frame) +VideoDecoder::video (shared_ptr image, Frame frame) { if (_ignore_video) { return; @@ -275,8 +270,8 @@ VideoDecoder::video (shared_ptr image, VideoFrame frame) and the things we are about to push. */ - boost::optional from; - boost::optional to; + boost::optional from; + boost::optional to; if (_decoded_video.empty() && _last_seek_time && _last_seek_accurate) { from = _last_seek_time->frames (_video_content->video_frame_rate ());