platform/windows: add optional DwmFlush() call to improve Windows capture

Invoke DwmFlush() before acquiring the next frame to alleviate visual stutter
during mouse movement at the cost of constraining the capture rate to the host's
monitor refresh.

Disabled by default; enable via "dwmflush" boolean configuration parameter.
This commit is contained in:
Conn O'Griofa
2022-05-18 18:20:33 +01:00
parent d051b58190
commit 211b25848f
7 changed files with 45 additions and 5 deletions

View File

@@ -226,9 +226,10 @@ video_t video {
1,
-1 }, // vt
{}, // encoder
{}, // adapter_name
{}, // output_name
{}, // encoder
{}, // adapter_name
{}, // output_name
false // dwmflush
};
audio_t audio {};
@@ -735,6 +736,7 @@ void apply_config(std::unordered_map<std::string, std::string> &&vars) {
string_f(vars, "encoder", video.encoder);
string_f(vars, "adapter_name", video.adapter_name);
string_f(vars, "output_name", video.output_name);
bool_f(vars, "dwmflush", video.dwmflush);
path_f(vars, "pkey", nvhttp.pkey);
path_f(vars, "cert", nvhttp.cert);