diff options
| author | Carl Hetherington <cth@carlh.net> | 2020-11-05 22:12:27 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2020-11-05 22:56:23 +0100 |
| commit | d1addc203597a892c02bd162585c6a55950ffaf5 (patch) | |
| tree | e4f86abdbdc4269ec461f001766018f31e446f4f /src | |
| parent | a6929b79a5f6167600a2d2bfc4e1ef1dc4796665 (diff) | |
Fix video waveform view with GL backend.
Diffstat (limited to 'src')
| -rw-r--r-- | src/wx/film_viewer.cc | 7 | ||||
| -rw-r--r-- | src/wx/film_viewer.h | 3 | ||||
| -rw-r--r-- | src/wx/gl_video_view.cc | 1 | ||||
| -rw-r--r-- | src/wx/simple_video_view.cc | 2 | ||||
| -rw-r--r-- | src/wx/video_waveform_plot.cc | 6 | ||||
| -rw-r--r-- | src/wx/video_waveform_plot.h | 2 |
6 files changed, 14 insertions, 7 deletions
diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc index ff278d8a9..997fe88c8 100644 --- a/src/wx/film_viewer.cc +++ b/src/wx/film_viewer.cc @@ -732,3 +732,10 @@ FilmViewer::content_change (ChangeType type, int property) } } + +void +FilmViewer::image_changed (shared_ptr<PlayerVideo> pv) +{ + emit (boost::bind(boost::ref(ImageChanged), pv)); +} + diff --git a/src/wx/film_viewer.h b/src/wx/film_viewer.h index 11a4731fc..a0edafe95 100644 --- a/src/wx/film_viewer.h +++ b/src/wx/film_viewer.h @@ -140,12 +140,13 @@ public: return _closed_captions_dialog; } void finished (); + void image_changed (boost::shared_ptr<PlayerVideo> video); bool pending_idle_get () const { return _idle_get; } - boost::signals2::signal<void (boost::weak_ptr<PlayerVideo>)> ImageChanged; + boost::signals2::signal<void (boost::shared_ptr<PlayerVideo>)> ImageChanged; boost::signals2::signal<void (dcpomatic::DCPTime)> Started; boost::signals2::signal<void (dcpomatic::DCPTime)> Stopped; /** While playing back we reached the end of the film (emitted from GUI thread) */ diff --git a/src/wx/gl_video_view.cc b/src/wx/gl_video_view.cc index d33882821..38270a7b7 100644 --- a/src/wx/gl_video_view.cc +++ b/src/wx/gl_video_view.cc @@ -327,6 +327,7 @@ GLVideoView::set_image_and_draw () if (pv) { set_image (pv->image(bind(&PlayerVideo::force, _1, AV_PIX_FMT_RGB24), false, true)); draw (pv->inter_position(), pv->inter_size()); + _viewer->image_changed (pv); } } diff --git a/src/wx/simple_video_view.cc b/src/wx/simple_video_view.cc index 97e582ce7..2e79deee8 100644 --- a/src/wx/simple_video_view.cc +++ b/src/wx/simple_video_view.cc @@ -258,7 +258,7 @@ SimpleVideoView::update () ); _state_timer.set ("ImageChanged"); - _viewer->ImageChanged (player_video().first); + _viewer->image_changed (player_video().first); _state_timer.unset (); _inter_position = player_video().first->inter_position (); diff --git a/src/wx/video_waveform_plot.cc b/src/wx/video_waveform_plot.cc index 9674d0af2..866f5f568 100644 --- a/src/wx/video_waveform_plot.cc +++ b/src/wx/video_waveform_plot.cc @@ -192,18 +192,16 @@ note () } void -VideoWaveformPlot::set_image (weak_ptr<PlayerVideo> image) +VideoWaveformPlot::set_image (shared_ptr<PlayerVideo> image) { if (!_enabled) { return; } - shared_ptr<PlayerVideo> pv = image.lock (); - DCPOMATIC_ASSERT (pv); /* 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 (pv->shallow_copy(), boost::bind (¬e)); + _image = DCPVideo::convert_to_xyz (image->shallow_copy(), boost::bind(¬e)); _dirty = true; Refresh (); } diff --git a/src/wx/video_waveform_plot.h b/src/wx/video_waveform_plot.h index 1e38f5890..f107f0399 100644 --- a/src/wx/video_waveform_plot.h +++ b/src/wx/video_waveform_plot.h @@ -55,7 +55,7 @@ private: void paint (); void sized (wxSizeEvent &); void create_waveform (); - void set_image (boost::weak_ptr<PlayerVideo>); + void set_image (boost::shared_ptr<PlayerVideo>); void mouse_moved (wxMouseEvent &); boost::weak_ptr<const Film> _film; |
