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

@@ -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;