From 23f47c6d5e0ccd9d467f23cb60ec18f41ceff4e0 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 14 Jun 2020 14:25:37 +0200 Subject: Enable gpu hardware decoding --- src/QuickMedia.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/QuickMedia.cpp') diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp index 8299423..f878497 100644 --- a/src/QuickMedia.cpp +++ b/src/QuickMedia.cpp @@ -638,7 +638,7 @@ namespace QuickMedia { std::unique_ptr video_player; std::unique_ptr video_player_ui_window; - auto on_window_create = [this, &video_player_ui_window, &video_player, &seekable](sf::WindowHandle video_player_window) { + auto on_window_create = [this, &video_player_ui_window, &video_player, &seekable](sf::WindowHandle video_player_window) mutable { int screen = DefaultScreen(disp); Window ui_window = XCreateSimpleWindow(disp, video_player_window, 0, 0, 1, 1, 0, 0, BlackPixel(disp, screen)); XMapWindow(disp, ui_window); @@ -649,7 +649,7 @@ namespace QuickMedia { video_player->is_seekable(&seekable); }; - auto load_video_error_check = [this, &video_player, previous_page]() { + auto load_video_error_check = [this, &video_player, previous_page]() mutable { watched_videos.insert(content_url); VideoPlayer::Error err = video_player->load_video(content_url.c_str(), window.getSystemHandle()); if(err != VideoPlayer::Error::OK) { @@ -755,6 +755,13 @@ namespace QuickMedia { if(event.type == sf::Event::Resized) { sf::FloatRect visible_area(0, 0, event.size.width, event.size.height); video_player_ui_window->setView(sf::View(visible_area)); + } else if(event.type == sf::Event::MouseMoved) { + ui_hide_timer.restart(); + if(!ui_visible) { + ui_visible = true; + video_player_ui_window->setVisible(true); + //window.setMouseCursorVisible(true); + } } } } -- cgit v1.2.3