Support capturing rotated displays on Windows (#1602)

This commit is contained in:
ns6089
2023-09-13 17:34:26 +03:00
committed by GitHub
parent 9dc76e3748
commit e98d7577bb
7 changed files with 222 additions and 54 deletions

View File

@@ -500,6 +500,8 @@ namespace nvenc {
return true;
}
encoder_state.rfi_needs_confirmation = true;
if (last_frame < first_frame) {
BOOST_LOG(error) << "NvEnc: invaid rfi request " << first_frame << "-" << last_frame << ", generating IDR";
return false;
@@ -508,14 +510,13 @@ namespace nvenc {
BOOST_LOG(debug) << "NvEnc: rfi request " << first_frame << "-" << last_frame << " expanding to last encoded frame " << encoder_state.last_encoded_frame_index;
last_frame = encoder_state.last_encoded_frame_index;
encoder_state.last_rfi_range = { first_frame, last_frame };
if (last_frame - first_frame + 1 >= encoder_params.ref_frames_in_dpb) {
BOOST_LOG(debug) << "NvEnc: rfi request too large, generating IDR";
return false;
}
encoder_state.rfi_needs_confirmation = true;
encoder_state.last_rfi_range = { first_frame, last_frame };
for (auto i = first_frame; i <= last_frame; i++) {
if (nvenc_failed(nvenc->nvEncInvalidateRefFrames(encoder, i))) {
BOOST_LOG(error) << "NvEncInvalidateRefFrames " << i << " failed: " << last_error_string;