X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Fgl_video_view.h;h=36edd6b8b979111285a7df2dcc4421efbd37c0f1;hb=5ccfb74647db6917c054d6d67f91ed5a74e397ba;hp=42a3f89ba8236ae6b88407c876fd9b53a094d310;hpb=ec1df37a1940063dc0dbc45ad2dab638bdc92c0d;p=dcpomatic.git diff --git a/src/wx/gl_video_view.h b/src/wx/gl_video_view.h index 42a3f89ba..36edd6b8b 100644 --- a/src/wx/gl_video_view.h +++ b/src/wx/gl_video_view.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2019 Carl Hetherington + Copyright (C) 2020 Carl Hetherington This file is part of DCP-o-matic. @@ -19,13 +19,20 @@ */ #include "video_view.h" -#include +#include "lib/signaller.h" +#include "lib/position.h" +#include "lib/warnings.h" +DCPOMATIC_DISABLE_WARNINGS #include +#include +DCPOMATIC_ENABLE_WARNINGS #include -#include - +#include +#include +#include #undef None #undef Success +#undef Status class GLVideoView : public VideoView { @@ -33,18 +40,45 @@ public: GLVideoView (FilmViewer* viewer, wxWindow* parent); ~GLVideoView (); - void set_image (boost::shared_ptr image); wxWindow* get () const { return _canvas; } void update (); + void start (); + void stop (); + + NextFrameResult display_next_frame (bool); + + bool vsync_enabled () const { + return _vsync_enabled; + } private: - void paint (); - void draw (); + void set_image (std::shared_ptr image); + void set_image_and_draw (); + void draw (Position inter_position, dcp::Size inter_size); + void thread (); + void thread_playing (); + void request_one_shot (); + void check_for_butler_errors (); + void ensure_context (); + void size_changed (wxSizeEvent const &); wxGLCanvas* _canvas; - wxGLContext* _context; - GLuint _id; - boost::optional _size; + wxGLContext* _context; + + boost::atomic _canvas_size; + + GLuint _id; + boost::optional _size; + bool _have_storage; + bool _vsync_enabled; + boost::thread _thread; + + boost::mutex _playing_mutex; + boost::condition _thread_work_condition; + boost::atomic _playing; + boost::atomic _one_shot; + + std::shared_ptr _timer; };