diff options
author | dec05eba <dec05eba@protonmail.com> | 2020-06-14 14:25:37 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-06-14 14:25:37 +0200 |
commit | 23f47c6d5e0ccd9d467f23cb60ec18f41ceff4e0 (patch) | |
tree | 6656447840e8e7120b4583a406cff37a2db2a9ff /src | |
parent | 93b89cf4fce6b48ba8e26e9e907cbbb9e9632cf1 (diff) |
Enable gpu hardware decoding
Diffstat (limited to 'src')
-rw-r--r-- | src/QuickMedia.cpp | 11 | ||||
-rw-r--r-- | src/VideoPlayer.cpp | 4 |
2 files changed, 12 insertions, 3 deletions
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<VideoPlayer> video_player; std::unique_ptr<sf::RenderWindow> 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); + } } } } diff --git a/src/VideoPlayer.cpp b/src/VideoPlayer.cpp index 9845442..8bb6825 100644 --- a/src/VideoPlayer.cpp +++ b/src/VideoPlayer.cpp @@ -13,7 +13,7 @@ #include <signal.h> const int RETRY_TIME_MS = 500; -const int MAX_RETRIES_CONNECT = 10; +const int MAX_RETRIES_CONNECT = 20; const int READ_TIMEOUT_MS = 200; namespace QuickMedia { @@ -80,6 +80,8 @@ namespace QuickMedia { "--no-input-terminal", "--no-osc", "--profile=gpu-hq", + "--vo=gpu", + "--hwdec=auto", "--no-resume-playback", /*"--vo=gpu", "--hwdec=auto",*/ wid_arg.c_str(), "--", path, nullptr }); |