From 7bd8eecb8ba8535978d58408dc73ce7528034c7e Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Thu, 4 Aug 2022 23:55:17 +0200 Subject: wip: got stuck... because PlayerVideo is related to the render size 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. --- src/wx/simple_video_view.cc | 6 +++++- src/wx/video_waveform_plot.cc | 7 ++++++- 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'src/wx') diff --git a/src/wx/simple_video_view.cc b/src/wx/simple_video_view.cc index 00d81ab47..87d7ddadd 100644 --- a/src/wx/simple_video_view.cc +++ b/src/wx/simple_video_view.cc @@ -241,7 +241,11 @@ SimpleVideoView::update () _state_timer.set ("get image"); - _image = player_video().first->image(boost::bind(&PlayerVideo::force, AV_PIX_FMT_RGB24), VideoRange::FULL, true); + _image = player_video().first->image( + boost::bind(&PlayerVideo::force, AV_PIX_FMT_RGB24), + VideoRange::FULL, + true + ); _state_timer.set ("ImageChanged"); _viewer->image_changed (player_video().first); diff --git a/src/wx/video_waveform_plot.cc b/src/wx/video_waveform_plot.cc index 8e3284682..6ec173469 100644 --- a/src/wx/video_waveform_plot.cc +++ b/src/wx/video_waveform_plot.cc @@ -195,10 +195,15 @@ VideoWaveformPlot::set_image (shared_ptr image) return; } + auto film = _film.lock (); + if (!film) { + return; + } + /* We must copy the PlayerVideo here as we will call ::image() on it, potentially with a different pixel_format than was used when ::prepare() was called. */ - _image = DCPVideo::convert_to_xyz (image->shallow_copy(), [](dcp::NoteType, string) {}); + _image = DCPVideo::convert_to_xyz(image->shallow_copy(), film->frame_size(), [](dcp::NoteType, string) {}); _dirty = true; Refresh (); } -- cgit v1.2.3