summaryrefslogtreecommitdiff
path: root/src/lib/dcp_video.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2022-08-04 23:55:17 +0200
committerCarl Hetherington <cth@carlh.net>2022-08-04 23:55:17 +0200
commit7bd8eecb8ba8535978d58408dc73ce7528034c7e (patch)
treee3019a153415a6becde846fcb6a68f0674341bc1 /src/lib/dcp_video.cc
parentd6aeaf8dd1b3158689da7b75c7417c1838af9c95 (diff)
wip: got stuck... because PlayerVideo is related to the render sizeadjust-sizing
because its subtitles are prepared for the _video_container_size that the Player knows about. I think the only way around this would be to store the subs in PlayerVideo in some independent way and to scale/convert to bitmap later.
Diffstat (limited to 'src/lib/dcp_video.cc')
-rw-r--r--src/lib/dcp_video.cc18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/lib/dcp_video.cc b/src/lib/dcp_video.cc
index 14f23bd37..0e42f0a12 100644
--- a/src/lib/dcp_video.cc
+++ b/src/lib/dcp_video.cc
@@ -80,9 +80,10 @@ using namespace boost::placeholders;
* @param bw J2K bandwidth to use (see Config::j2k_bandwidth ())
*/
DCPVideo::DCPVideo (
- shared_ptr<const PlayerVideo> frame, int index, int dcp_fps, int bw, Resolution r
+ shared_ptr<const PlayerVideo> frame, dcp::Size container, int index, int dcp_fps, int bw, Resolution r
)
: _frame (frame)
+ , _container(container)
, _index (index)
, _frames_per_second (dcp_fps)
, _j2k_bandwidth (bw)
@@ -101,11 +102,18 @@ DCPVideo::DCPVideo (shared_ptr<const PlayerVideo> frame, shared_ptr<const cxml::
}
shared_ptr<dcp::OpenJPEGImage>
-DCPVideo::convert_to_xyz (shared_ptr<const PlayerVideo> frame, dcp::NoteHandler note)
+DCPVideo::convert_to_xyz (shared_ptr<const PlayerVideo> frame, dcp::Size container, dcp::NoteHandler note)
{
shared_ptr<dcp::OpenJPEGImage> xyz;
- auto image = frame->image (bind(&PlayerVideo::keep_xyz_or_rgb, _1), VideoRange::FULL, false);
+ auto image = frame->image(
+ bind(&PlayerVideo::keep_xyz_or_rgb, _1),
+ container,
+ container,
+ VideoRange::FULL,
+ false
+ );
+
if (frame->colour_conversion()) {
xyz = dcp::rgb_to_xyz (
image->data()[0],
@@ -134,7 +142,7 @@ DCPVideo::encode_locally () const
int const minimum_size = 16384;
LOG_DEBUG_ENCODE("Using minimum frame size %1", minimum_size);
- auto xyz = convert_to_xyz (_frame, boost::bind(&Log::dcp_log, dcpomatic_log.get(), _1, _2));
+ auto xyz = convert_to_xyz(_frame, _container, boost::bind(&Log::dcp_log, dcpomatic_log.get(), _1, _2));
int noise_amount = 2;
int pixel_skip = 16;
while (true) {
@@ -159,7 +167,7 @@ DCPVideo::encode_locally () const
* convert_to_xyz() again because compress_j2k() corrupts its xyz parameter.
*/
- xyz = convert_to_xyz (_frame, boost::bind(&Log::dcp_log, dcpomatic_log.get(), _1, _2));
+ xyz = convert_to_xyz(_frame, _container, boost::bind(&Log::dcp_log, dcpomatic_log.get(), _1, _2));
auto size = xyz->size ();
auto pixels = size.width * size.height;
dcpomatic::RNG rng(42);