Remove DwmFlush()

This commit is contained in:
ns6089
2023-05-12 16:46:05 +03:00
committed by Cameron Gutman
parent 9ae40d3d5a
commit 8dc51a21df
6 changed files with 0 additions and 56 deletions

View File

@@ -413,27 +413,6 @@ resolutions
3840x1600,
]
dwmflush
^^^^^^^^
**Description**
Invoke DwmFlush() to sync screen capture to the Windows presentation interval.
.. Caution:: Applies to Windows only. Alleviates visual stuttering during mouse movement.
If enabled, this feature will automatically deactivate if the client framerate exceeds
the host monitor's current refresh rate.
.. Note:: If you disable this option, you may see video stuttering during mouse movement in certain scenarios.
It is recommended to leave enabled when possible.
**Default**
``enabled``
**Example**
.. code-block:: text
dwmflush = enabled
Audio
-----

View File

@@ -438,7 +438,6 @@ namespace config {
{}, // encoder
{}, // adapter_name
{}, // output_name
true // dwmflush
};
audio_t audio {
@@ -1034,7 +1033,6 @@ namespace config {
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);

View File

@@ -64,7 +64,6 @@ namespace config {
std::string encoder;
std::string adapter_name;
std::string output_name;
bool dwmflush;
};
struct audio_t {

View File

@@ -109,7 +109,6 @@ namespace platf::dxgi {
public:
dup_t dup;
bool has_frame {};
bool use_dwmflush {};
std::chrono::steady_clock::time_point last_protected_content_warning_time {};
capture_e

View File

@@ -32,10 +32,6 @@ namespace platf::dxgi {
return capture_status;
}
if (use_dwmflush) {
DwmFlush();
}
auto status = dup->AcquireNextFrame(timeout.count(), &frame_info, res_p);
switch (status) {
@@ -470,21 +466,6 @@ namespace platf::dxgi {
<< "Offset : "sv << offset_x << 'x' << offset_y << std::endl
<< "Virtual Desktop : "sv << env_width << 'x' << env_height;
// Enable DwmFlush() only if the current refresh rate can match the client framerate.
auto refresh_rate = config.framerate;
DWM_TIMING_INFO timing_info;
timing_info.cbSize = sizeof(timing_info);
status = DwmGetCompositionTimingInfo(NULL, &timing_info);
if (FAILED(status)) {
BOOST_LOG(warning) << "Failed to detect active refresh rate.";
}
else {
refresh_rate = std::round((double) timing_info.rateRefresh.uiNumerator / (double) timing_info.rateRefresh.uiDenominator);
}
dup.use_dwmflush = config::video.dwmflush && !(config.framerate > refresh_rate) ? true : false;
// Bump up thread priority
{
const DWORD flags = TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY;

View File

@@ -582,18 +582,6 @@
tools\dxgi-info.exe<br />
</div>
</div>
<!--DwmFlush-->
<div class="mb-3" v-if="platform === 'windows'">
<label for="dwmflush" class="form-label">DwmFlush</label>
<select id="dwmflush" class="form-select" v-model="config.dwmflush">
<option value="disabled">Disabled</option>
<option value="enabled">Enabled</option>
</select>
<div class="form-text">
Improves capture latency/smoothness during mouse movement.<br />
Disable if you encounter any VSync-related issues.
</div>
</div>
<div class="mb-3" v-if="platform === 'linux'">
<label for="output_name" class="form-label">Monitor number</label>
<input