From 91b608773a4b0f0b6fc91bdac5b43fba5a41af58 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Tue, 6 Aug 2019 14:15:35 +0200 Subject: Change video from deprecated opengl_cl to render_gl --- include/VideoPlayer.hpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'include/VideoPlayer.hpp') diff --git a/include/VideoPlayer.hpp b/include/VideoPlayer.hpp index c52c1e5..6bd8f4f 100644 --- a/include/VideoPlayer.hpp +++ b/include/VideoPlayer.hpp @@ -12,7 +12,7 @@ #include class mpv_handle; -class mpv_opengl_cb_context; +class mpv_render_context; namespace QuickMedia { class VideoInitializationException : public std::runtime_error { @@ -35,12 +35,15 @@ namespace QuickMedia { // @path can also be an url if youtube-dl is installed void load_file(const std::string &path); - // This counter is incremented when mpv wants to redraw content - std::atomic_int redrawCounter; + // This is updated when mpv wants to render + std::atomic_bool redraw; + std::atomic_bool event_update; PlaybackEndedCallback onPlaybackEndedCallback; + private: + void handle_events(); private: mpv_handle *mpv; - mpv_opengl_cb_context *mpvGl; + mpv_render_context *mpvGl; std::unique_ptr context; sf::Sprite sprite; sf::Texture texture; -- cgit v1.2.3