Fix window capturing on Windows when the window is minimized.

BUG=crbug/410290
R=sergeyu@chromium.org

Review URL: https://webrtc-codereview.appspot.com/20319004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@7158 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
jiayl@webrtc.org 2014-09-11 19:33:58 +00:00
parent f520ea5eed
commit 89959966a9

View File

@ -173,6 +173,17 @@ void WindowCapturerWin::Capture(const DesktopRegion& region) {
return;
}
// Return a 2x2 black frame if the window is minimized. The size is 2x2 so it
// can be subsampled to I420 downstream.
if (IsIconic(window_)) {
BasicDesktopFrame* frame = new BasicDesktopFrame(DesktopSize(2, 2));
memset(frame->data(), 0, frame->stride() * frame->size().height());
previous_size_ = frame->size();
callback_->OnCaptureCompleted(frame);
return;
}
DesktopRect original_rect;
DesktopRect cropped_rect;
if (!GetCroppedWindowRect(window_, &cropped_rect, &original_rect)) {