Commit cf9081b2 authored by braveyao's avatar braveyao Committed by Commit Bot

desktopCapture: fix regression of handling minimized shared window.

We receive a 1x1 frame when the shared window is minimized and will replace it
with a blackframe to avaoid video freezing at last frame. But due to frame size
rounding added later, the 1x1 frame will be dropped. Let's fix it again by
replacing it with a 2x2 black frame.

Bug: 568835
Change-Id: Ifd9a37b62e4f179318c8b30bee4687494d976ab1
Reviewed-on: https://chromium-review.googlesource.com/596920Reviewed-by: default avatarZijie He <zijiehe@chromium.org>
Commit-Queue: Weiyong Yao <braveyao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#491533}
parent b054ab43
......@@ -267,11 +267,14 @@ void DesktopCaptureDevice::Core::OnCaptureResult(
}
// Align to 2x2 pixel boundaries, as required by OnIncomingCapturedData() so
// it can convert the frame to I420 format.
const webrtc::DesktopSize output_size(
webrtc::DesktopSize output_size(
resolution_chooser_->capture_size().width() & ~1,
resolution_chooser_->capture_size().height() & ~1);
if (output_size.is_empty())
return;
if (output_size.is_empty()) {
// Even RESOLUTION_POLICY_ANY_WITHIN_LIMIT is used, a non-empty size should
// be guaranteed.
output_size.set(2, 2);
}
size_t output_bytes = output_size.width() * output_size.height() *
webrtc::DesktopFrame::kBytesPerPixel;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment