If a desktop captured window switches on/off it full screen mode, the capture may be unexpectedly terminated. During the transition of full screen mode on/off, the window can be temporarily invisible.
BUG=498484 Review URL: https://codereview.webrtc.org/1426103005 Cr-Commit-Position: refs/heads/master@{#10583}
This commit is contained in:
@ -156,15 +156,16 @@ void WindowCapturerWin::Capture(const DesktopRegion& region) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Stop capturing if the window has been closed or hidden.
|
// Stop capturing if the window has been closed.
|
||||||
if (!IsWindow(window_) || !IsWindowVisible(window_)) {
|
if (!IsWindow(window_)) {
|
||||||
callback_->OnCaptureCompleted(NULL);
|
callback_->OnCaptureCompleted(NULL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return a 1x1 black frame if the window is minimized, to match the behavior
|
// Return a 1x1 black frame if the window is minimized or invisible, to match
|
||||||
// on Mac.
|
// behavior on mace. Window can be temporarily invisible during the
|
||||||
if (IsIconic(window_)) {
|
// transition of full screen mode on/off.
|
||||||
|
if (IsIconic(window_) || !IsWindowVisible(window_)) {
|
||||||
BasicDesktopFrame* frame = new BasicDesktopFrame(DesktopSize(1, 1));
|
BasicDesktopFrame* frame = new BasicDesktopFrame(DesktopSize(1, 1));
|
||||||
memset(frame->data(), 0, frame->stride() * frame->size().height());
|
memset(frame->data(), 0, frame->stride() * frame->size().height());
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user