mirror of
https://github.com/kunkundi/crossdesk.git
synced 2025-10-26 12:15:34 +08:00
[feat] limit screen capturing to 30 fps
This commit is contained in:
@@ -303,7 +303,7 @@ int Render::ScreenCapturerInit() {
|
|||||||
std::chrono::steady_clock::now().time_since_epoch())
|
std::chrono::steady_clock::now().time_since_epoch())
|
||||||
.count();
|
.count();
|
||||||
auto duration = now_time - last_frame_time_;
|
auto duration = now_time - last_frame_time_;
|
||||||
if (duration >= 0) {
|
if (duration >= 33) {
|
||||||
XVideoFrame frame;
|
XVideoFrame frame;
|
||||||
frame.data = (const char*)data;
|
frame.data = (const char*)data;
|
||||||
frame.size = size;
|
frame.size = size;
|
||||||
@@ -569,9 +569,8 @@ int Render::CreateMainWindow() {
|
|||||||
|
|
||||||
ImGui::SetCurrentContext(main_ctx_);
|
ImGui::SetCurrentContext(main_ctx_);
|
||||||
|
|
||||||
SDL_WindowFlags window_flags =
|
SDL_WindowFlags window_flags = (SDL_WindowFlags)(
|
||||||
(SDL_WindowFlags)(SDL_WINDOW_ALLOW_HIGHDPI | SDL_WINDOW_BORDERLESS |
|
SDL_WINDOW_ALLOW_HIGHDPI | SDL_WINDOW_BORDERLESS | SDL_WINDOW_HIDDEN);
|
||||||
SDL_WINDOW_HIDDEN);
|
|
||||||
main_window_ =
|
main_window_ =
|
||||||
SDL_CreateWindow("Remote Desk", SDL_WINDOWPOS_UNDEFINED,
|
SDL_CreateWindow("Remote Desk", SDL_WINDOWPOS_UNDEFINED,
|
||||||
SDL_WINDOWPOS_UNDEFINED, (int)main_window_width_default_,
|
SDL_WINDOWPOS_UNDEFINED, (int)main_window_width_default_,
|
||||||
|
|||||||
2
thirdparty/projectx
vendored
2
thirdparty/projectx
vendored
Submodule thirdparty/projectx updated: 9ee3bec9df...c936af0320
Reference in New Issue
Block a user