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:
parent
f520ea5eed
commit
89959966a9
@ -173,6 +173,17 @@ void WindowCapturerWin::Capture(const DesktopRegion& region) {
|
|||||||
return;
|
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 original_rect;
|
||||||
DesktopRect cropped_rect;
|
DesktopRect cropped_rect;
|
||||||
if (!GetCroppedWindowRect(window_, &cropped_rect, &original_rect)) {
|
if (!GetCroppedWindowRect(window_, &cropped_rect, &original_rect)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user