X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fimage_decoder.cc;h=15187b11b6aa27ef084e24ea759c27163603194f;hb=0877bf6d06de8e6f768534ec40c26bf629618a20;hp=b0841688fb23d11114b5af019636f9ab5c301f16;hpb=de2af791bdfdcd653752cba970e59efc7bf810c7;p=dcpomatic.git diff --git a/src/lib/image_decoder.cc b/src/lib/image_decoder.cc index b0841688f..15187b11b 100644 --- a/src/lib/image_decoder.cc +++ b/src/lib/image_decoder.cc @@ -22,12 +22,12 @@ #include "image_decoder.h" #include "video_decoder.h" #include "image.h" -#include "magick_image_proxy.h" +#include "ffmpeg_image_proxy.h" #include "j2k_image_proxy.h" #include "film.h" #include "exceptions.h" #include "video_content.h" -#include +#include "frame_interval_checker.h" #include #include @@ -36,19 +36,21 @@ using std::cout; using boost::shared_ptr; using dcp::Size; +using namespace dcpomatic; -ImageDecoder::ImageDecoder (shared_ptr c, shared_ptr log) - : _image_content (c) +ImageDecoder::ImageDecoder (shared_ptr film, shared_ptr c) + : Decoder (film) + , _image_content (c) , _frame_video_position (0) { - video.reset (new VideoDecoder (this, c, log)); + video.reset (new VideoDecoder (this, c)); } -void +bool ImageDecoder::pass () { if (_frame_video_position >= _image_content->video->length()) { - return; + return true; } if (!_image_content->still() || !_image) { @@ -68,18 +70,18 @@ ImageDecoder::pass () */ _image.reset (new J2KImageProxy (path, _image_content->video->size(), pf)); } else { - _image.reset (new MagickImageProxy (path)); + _image.reset (new FFmpegImageProxy (path)); } } - video->set_position (ContentTime::from_frames (_frame_video_position, _image_content->active_video_frame_rate ())); - video->emit (_image, _frame_video_position); + video->emit (film(), _image, _frame_video_position); ++_frame_video_position; - return; + return false; } void -ImageDecoder::seek (ContentTime time, bool) +ImageDecoder::seek (ContentTime time, bool accurate) { - _frame_video_position = time.frames_round (_image_content->active_video_frame_rate ()); + Decoder::seek (time, accurate); + _frame_video_position = time.frames_round (_image_content->active_video_frame_rate(film())); }