X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fplayer_video.cc;h=0a6ce0d993cf08ac4f304288db60d42389feb418;hb=6cac49dc50dae6b173135df101d532f20031ca70;hp=f91b990c8b1d32c8df8ac723ddc820dac71da0c2;hpb=8fedaaa75c4586a4cc7ffb393bd71d1fdb091dc8;p=dcpomatic.git diff --git a/src/lib/player_video.cc b/src/lib/player_video.cc index f91b990c8..0a6ce0d99 100644 --- a/src/lib/player_video.cc +++ b/src/lib/player_video.cc @@ -36,12 +36,11 @@ extern "C" { using std::cout; using std::dynamic_pointer_cast; using std::make_shared; -using std::pair; using std::shared_ptr; using std::string; using std::weak_ptr; using boost::optional; -using boost::function; +using std::function; using dcp::Data; using dcp::raw_convert; @@ -122,6 +121,14 @@ PlayerVideo::image (function pixel_format, VideoR return _image; } + +shared_ptr +PlayerVideo::raw_image () const +{ + return _in->image(_inter_size).image; +} + + /** Create an image for this frame. A lock must be held on _mutex. * @param pixel_format Function which is called to decide what pixel format the output image should be; * it is passed the pixel format of the input image from the ImageProxy, and should return the desired @@ -231,7 +238,7 @@ PlayerVideo::has_j2k () const return false; } - return _crop == Crop() && _out_size == j2k->size() && !_text && !_fade && !_colour_conversion; + return _crop == Crop() && _out_size == j2k->size() && _inter_size == j2k->size() && !_text && !_fade && !_colour_conversion; } shared_ptr @@ -291,11 +298,11 @@ PlayerVideo::keep_xyz_or_rgb (AVPixelFormat p) } void -PlayerVideo::prepare (function pixel_format, VideoRange video_range, bool aligned, bool fast) +PlayerVideo::prepare (function pixel_format, VideoRange video_range, bool aligned, bool fast, bool proxy_only) { _in->prepare (_inter_size); boost::mutex::scoped_lock lm (_mutex); - if (!_image) { + if (!_image && !proxy_only) { make_image (pixel_format, video_range, aligned, fast); } }