From 8004d25ca3cb9820ba247ff141669c2933ea417e Mon Sep 17 00:00:00 2001 From: dijunkun Date: Sat, 7 Jun 2025 02:46:51 +0800 Subject: [PATCH] [feat] limit screen capturing to 30 fps --- src/single_window/render.cpp | 7 +++---- thirdparty/projectx | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/single_window/render.cpp b/src/single_window/render.cpp index 7e85d84..272dc70 100644 --- a/src/single_window/render.cpp +++ b/src/single_window/render.cpp @@ -303,7 +303,7 @@ int Render::ScreenCapturerInit() { std::chrono::steady_clock::now().time_since_epoch()) .count(); auto duration = now_time - last_frame_time_; - if (duration >= 0) { + if (duration >= 33) { XVideoFrame frame; frame.data = (const char*)data; frame.size = size; @@ -569,9 +569,8 @@ int Render::CreateMainWindow() { ImGui::SetCurrentContext(main_ctx_); - SDL_WindowFlags window_flags = - (SDL_WindowFlags)(SDL_WINDOW_ALLOW_HIGHDPI | SDL_WINDOW_BORDERLESS | - SDL_WINDOW_HIDDEN); + SDL_WindowFlags window_flags = (SDL_WindowFlags)( + SDL_WINDOW_ALLOW_HIGHDPI | SDL_WINDOW_BORDERLESS | SDL_WINDOW_HIDDEN); main_window_ = SDL_CreateWindow("Remote Desk", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, (int)main_window_width_default_, diff --git a/thirdparty/projectx b/thirdparty/projectx index 9ee3bec..c936af0 160000 --- a/thirdparty/projectx +++ b/thirdparty/projectx @@ -1 +1 @@ -Subproject commit 9ee3bec9df9858012f3dfd8004b29ccec83ab656 +Subproject commit c936af03206305da141cd1b1019709415c04e38b