X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Fgl_video_view.cc;h=969264c2710d5656a22303c07c5b38f69660b23b;hb=dd9be86db6cde0afa5da0d1d1ac43b42e05dca26;hp=a82d5a27688e156f0c5eab8f8b7aa82fdc6de02d;hpb=2e6f03cbb2c5664bd338ad28bfd6c54732e64b47;p=dcpomatic.git diff --git a/src/wx/gl_video_view.cc b/src/wx/gl_video_view.cc index a82d5a276..969264c27 100644 --- a/src/wx/gl_video_view.cc +++ b/src/wx/gl_video_view.cc @@ -27,7 +27,7 @@ #include "lib/cross.h" #include "lib/player_video.h" #include "lib/butler.h" -#include +#include #include #ifdef DCPOMATIC_OSX @@ -49,8 +49,11 @@ #endif using std::cout; -using boost::shared_ptr; +using std::shared_ptr; using boost::optional; +#if BOOST_VERSION >= 106100 +using namespace boost::placeholders; +#endif static void @@ -109,16 +112,17 @@ GLVideoView::check_for_butler_errors () void GLVideoView::update () { - if (!_thread.joinable()) { - _thread = boost::thread (boost::bind(&GLVideoView::thread, this)); - } - { boost::mutex::scoped_lock lm (_canvas_mutex); if (!_canvas->IsShownOnScreen()) { return; } } + + if (!_thread.joinable()) { + _thread = boost::thread (boost::bind(&GLVideoView::thread, this)); + } + request_one_shot (); } @@ -321,8 +325,9 @@ GLVideoView::set_image_and_draw () { shared_ptr pv = player_video().first; if (pv) { - set_image (pv->image(bind(&PlayerVideo::force, _1, AV_PIX_FMT_RGB24), false, true)); + set_image (pv->image(bind(&PlayerVideo::force, _1, AV_PIX_FMT_RGB24), VIDEO_RANGE_FULL, false, true)); draw (pv->inter_position(), pv->inter_size()); + _viewer->image_changed (pv); } } @@ -400,14 +405,16 @@ catch (boost::thread_interrupted& e) store_current (); } -bool + +VideoView::NextFrameResult GLVideoView::display_next_frame (bool non_blocking) { - bool const r = get_next_frame (non_blocking); + NextFrameResult const r = get_next_frame (non_blocking); request_one_shot (); return r; } + void GLVideoView::request_one_shot () {