From c1efe2f4acbb8410afb3d290b2001cbb31c3da40 Mon Sep 17 00:00:00 2001 From: dijunkun Date: Tue, 3 Sep 2024 17:00:57 +0800 Subject: [PATCH] [feat] do not capture cursor --- src/screen_capturer/linux/screen_capturer_x11.cpp | 2 ++ src/screen_capturer/macosx/screen_capturer_avf.cpp | 2 +- src/screen_capturer/windows/wgc_session_impl.cpp | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/screen_capturer/linux/screen_capturer_x11.cpp b/src/screen_capturer/linux/screen_capturer_x11.cpp index d3a298e..b95d721 100644 --- a/src/screen_capturer/linux/screen_capturer_x11.cpp +++ b/src/screen_capturer/linux/screen_capturer_x11.cpp @@ -32,6 +32,8 @@ int ScreenCapturerX11::Init(const RECORD_DESKTOP_RECT &rect, const int fps, // grabbing frame rate av_dict_set(&options_, "framerate", "30", 0); + // show remote cursor + av_dict_set(&options_, "capture_cursor", "0", 0); // Make the grabbed area follow the mouse // av_dict_set(&options_, "follow_mouse", "centered", 0); // Video frame size. The default is to capture the full screen diff --git a/src/screen_capturer/macosx/screen_capturer_avf.cpp b/src/screen_capturer/macosx/screen_capturer_avf.cpp index df53bca..c783cbe 100644 --- a/src/screen_capturer/macosx/screen_capturer_avf.cpp +++ b/src/screen_capturer/macosx/screen_capturer_avf.cpp @@ -32,7 +32,7 @@ int ScreenCapturerAvf::Init(const RECORD_DESKTOP_RECT &rect, const int fps, av_dict_set(&options_, "framerate", "60", 0); av_dict_set(&options_, "pixel_format", "nv12", 0); // show remote cursor - av_dict_set(&options_, "capture_cursor", "1", 0); + av_dict_set(&options_, "capture_cursor", "0", 0); // Make the grabbed area follow the mouse // av_dict_set(&options_, "follow_mouse", "centered", 0); // Video frame size. The default is to capture the full screen diff --git a/src/screen_capturer/windows/wgc_session_impl.cpp b/src/screen_capturer/windows/wgc_session_impl.cpp index 260de7f..616d8f8 100644 --- a/src/screen_capturer/windows/wgc_session_impl.cpp +++ b/src/screen_capturer/windows/wgc_session_impl.cpp @@ -89,6 +89,8 @@ int WgcSessionImpl::Start() { capture_session_.StartCapture(); + capture_session_.IsCursorCaptureEnabled(false); + error = 0; } catch (winrt::hresult_error) { std::cout << "AE_WGC_CREATE_CAPTURER_FAILED" << std::endl;