diff options
| author | Carl Hetherington <cth@carlh.net> | 2025-07-22 00:18:32 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2025-08-12 17:16:07 +0200 |
| commit | 9b73c143ce568bd8694e3a50f2fefc1ee3a03515 (patch) | |
| tree | b6774c68129ccc687c34a8271fa5e1361b93d3d0 /src/lib/player_video.cc | |
| parent | 0114987c5d6040d8fe07a719d7f97b0a5e200458 (diff) | |
Replace AVPixelFormat parameter to PlayerVideo::image with a functor.
This was removed in df9b4676aba8b941f124b174393988cad21677e1 and
surrounding commits, but it turns out we need it after all.
Diffstat (limited to 'src/lib/player_video.cc')
| -rw-r--r-- | src/lib/player_video.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/player_video.cc b/src/lib/player_video.cc index b304d60df..63811fb69 100644 --- a/src/lib/player_video.cc +++ b/src/lib/player_video.cc @@ -116,7 +116,7 @@ PlayerVideo::set_text(PositionImage image) shared_ptr<Image> -PlayerVideo::image(AVPixelFormat pixel_format, VideoRange video_range, bool fast) const +PlayerVideo::image(function<AVPixelFormat (AVPixelFormat)> pixel_format, VideoRange video_range, bool fast) const { /* XXX: this assumes that image() and prepare() are only ever called with the same parameters (except crop, inter size, out size, fade) */ @@ -136,11 +136,11 @@ PlayerVideo::raw_image() const /** Create an image for this frame. A lock must be held on _mutex. - * @param pixel_format Output image pixel format. + * @param pixel_format Functor returning output image pixel format for a given input pixel format. * @param fast true to be fast at the expense of quality. */ void -PlayerVideo::make_image(AVPixelFormat pixel_format, VideoRange video_range, bool fast) const +PlayerVideo::make_image(function<AVPixelFormat (AVPixelFormat)> pixel_format, VideoRange video_range, bool fast) const { _image_crop = _crop; _image_inter_size = _inter_size; @@ -183,7 +183,7 @@ PlayerVideo::make_image(AVPixelFormat pixel_format, VideoRange video_range, bool } _image = prox.image->crop_scale_window( - total_crop, _inter_size, _out_size, yuv_to_rgb, _video_range, pixel_format, video_range, Image::Alignment::COMPACT, fast + total_crop, _inter_size, _out_size, yuv_to_rgb, _video_range, pixel_format(prox.image->pixel_format()), video_range, Image::Alignment::COMPACT, fast ); if (_text) { @@ -301,7 +301,7 @@ PlayerVideo::prepare(AVPixelFormat pixel_format, VideoRange video_range, Image:: _in->prepare(alignment, _inter_size); boost::mutex::scoped_lock lm(_mutex); if (!_image && !proxy_only) { - make_image(pixel_format, video_range, fast); + make_image(force(pixel_format), video_range, fast); } } |
