ScreenCapturerWinDirectx may flicker on certain hardware

Once the first capture attempt failed, we should keep the
context->updated_region unchanged for next attempt. This change can (partially?)
fix issue 704205.

BUG=704205

Review-Url: https://codereview.webrtc.org/2780093002
Cr-Commit-Position: refs/heads/master@{#17456}
This commit is contained in:
zijiehe 2017-03-29 14:37:53 -07:00 committed by Commit bot
parent 687392ffba
commit cf757cf3fd

View File

@ -219,6 +219,10 @@ bool DxgiOutputDuplicator::Duplicate(Context* context,
target->CopyPixelsFrom(*last_frame_, it.rect().top_left(), it.rect());
}
target->mutable_updated_region()->AddRegion(updated_region);
} else {
// If we were at the very first frame, and capturing failed, the
// context->updated_region should be kept unchanged for next attempt.
context->updated_region.Swap(&updated_region);
}
// If AcquireNextFrame() failed with timeout error, we do not need to release
// the frame.