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/dcp_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/dcp_video.cc')
| -rw-r--r-- | src/lib/dcp_video.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/lib/dcp_video.cc b/src/lib/dcp_video.cc index f07801c03..823325c3e 100644 --- a/src/lib/dcp_video.cc +++ b/src/lib/dcp_video.cc @@ -41,6 +41,7 @@ #include "log.h" #include "player_video.h" #include "rng.h" +#include "util.h" #include <libcxml/cxml.h> #include <dcp/openjpeg_image.h> #include <dcp/rgb_xyz.h> @@ -101,7 +102,7 @@ DCPVideo::convert_to_xyz(shared_ptr<const PlayerVideo> frame) shared_ptr<dcp::OpenJPEGImage> xyz; if (frame->colour_conversion()) { - auto image = frame->image(AV_PIX_FMT_RGB48LE, VideoRange::FULL, false); + auto image = frame->image(force(AV_PIX_FMT_RGB48LE), VideoRange::FULL, false); xyz = dcp::rgb_to_xyz( image->data()[0], image->size(), @@ -109,7 +110,7 @@ DCPVideo::convert_to_xyz(shared_ptr<const PlayerVideo> frame) frame->colour_conversion().get() ); } else { - auto image = frame->image(AV_PIX_FMT_XYZ12LE, VideoRange::FULL, false); + auto image = frame->image(force(AV_PIX_FMT_RGB48LE), VideoRange::FULL, false); xyz = make_shared<dcp::OpenJPEGImage>(image->data()[0], image->size(), image->stride()[0]); } @@ -119,7 +120,7 @@ DCPVideo::convert_to_xyz(shared_ptr<const PlayerVideo> frame) dcp::Size DCPVideo::get_size() const { - auto image = _frame->image(AV_PIX_FMT_RGB48LE, VideoRange::FULL, false); + auto image = _frame->image(force(AV_PIX_FMT_RGB48LE), VideoRange::FULL, false); return image->size(); } @@ -129,7 +130,7 @@ DCPVideo::convert_to_xyz(uint16_t* dst) const { DCPOMATIC_ASSERT(_frame->colour_conversion()); - auto image = _frame->image(AV_PIX_FMT_RGB48LE, VideoRange::FULL, false); + auto image = _frame->image(force(AV_PIX_FMT_RGB48LE), VideoRange::FULL, false); dcp::rgb_to_xyz( image->data()[0], dst, |
