diff options
| author | Carl Hetherington <cth@carlh.net> | 2024-06-06 21:17:56 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2024-06-06 21:17:56 +0200 |
| commit | 3185f6330dc6ccc8ff86a0925602880c67951213 (patch) | |
| tree | ba8ec5ff9b27bf59de0a5f65ea5f4252cb02d936 /src/wx/film_viewer.cc | |
| parent | cfa0a559a8feec79d1e8acd20d4b11ef8cd01513 (diff) | |
Support optimised rendering of YUV420P in OpenGL.
Diffstat (limited to 'src/wx/film_viewer.cc')
| -rw-r--r-- | src/wx/film_viewer.cc | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc index b6f8096e8..ad240b957 100644 --- a/src/wx/film_viewer.cc +++ b/src/wx/film_viewer.cc @@ -174,7 +174,7 @@ FilmViewer::set_film (shared_ptr<Film> film) } try { - _player.emplace(_film, _optimise_for_j2k ? Image::Alignment::COMPACT : Image::Alignment::PADDED); + _player.emplace(_film, _optimisation == Optimisation::NONE ? Image::Alignment::PADDED : Image::Alignment::COMPACT); _player->set_fast (); if (_dcp_decode_reduction) { _player->set_dcp_decode_reduction (_dcp_decode_reduction); @@ -235,9 +235,9 @@ void FilmViewer::create_butler() { #if wxCHECK_VERSION(3, 1, 0) - auto const j2k_gl_optimised = dynamic_pointer_cast<GLVideoView>(_video_view) && _optimise_for_j2k; + auto const opengl = dynamic_pointer_cast<GLVideoView>(_video_view); #else - auto const j2k_gl_optimised = false; + auto const opengl = false; #endif DCPOMATIC_ASSERT(_player); @@ -249,9 +249,9 @@ FilmViewer::create_butler() _audio_channels, boost::bind(&PlayerVideo::force, AV_PIX_FMT_RGB24), VideoRange::FULL, - j2k_gl_optimised ? Image::Alignment::COMPACT : Image::Alignment::PADDED, + (opengl && _optimisation != Optimisation::NONE) ? Image::Alignment::COMPACT : Image::Alignment::PADDED, true, - j2k_gl_optimised, + opengl && _optimisation == Optimisation::JPEG2000, (Config::instance()->sound() && _audio.isStreamOpen()) ? Butler::Audio::ENABLED : Butler::Audio::DISABLED ); @@ -874,10 +874,11 @@ FilmViewer::image_changed (shared_ptr<PlayerVideo> pv) void -FilmViewer::set_optimise_for_j2k (bool o) +FilmViewer::set_optimisation(Optimisation o) { - _optimise_for_j2k = o; - _video_view->set_optimise_for_j2k (o); + _optimisation = o; + _video_view->set_optimisation(o); + destroy_and_maybe_create_butler(); } |
