aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2019-08-06 14:15:35 +0200
committerdec05eba <dec05eba@protonmail.com>2019-08-06 14:15:38 +0200
commit91b608773a4b0f0b6fc91bdac5b43fba5a41af58 (patch)
tree6c054b96deb1ac79ac6cd9adf1283efc729fcb9b /include
parentd399e7ec86a91dd14a7c0deedaaec70ae46cef1d (diff)
Change video from deprecated opengl_cl to render_gl
Diffstat (limited to 'include')
-rw-r--r--include/VideoPlayer.hpp11
1 files changed, 7 insertions, 4 deletions
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 <functional>
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<sf::Context> context;
sf::Sprite sprite;
sf::Texture texture;