From d402875fa50164c6533ef0f7b2098f73eb94b8a8 Mon Sep 17 00:00:00 2001 From: "sergeyu@chromium.org" Date: Fri, 15 Aug 2014 23:13:23 +0000 Subject: [PATCH] Set updated_rect for frames generated by WindowCapturer implementationsw Previous updated_rect wasn't set for frames generated by WindowCapturer implementation. That makes them unustable with chromoting host that uses update_rect. With that change the frames will always contain updated_rect that coveras the whole frame. Change by Ronak Vora R=wez@chromium.org Review URL: https://webrtc-codereview.appspot.com/22079004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@6912 4adac7df-926f-26a2-2b94-8c16560cd09d --- webrtc/modules/desktop_capture/window_capturer_mac.mm | 3 +++ webrtc/modules/desktop_capture/window_capturer_win.cc | 3 +++ webrtc/modules/desktop_capture/window_capturer_x11.cc | 3 +++ 3 files changed, 9 insertions(+) diff --git a/webrtc/modules/desktop_capture/window_capturer_mac.mm b/webrtc/modules/desktop_capture/window_capturer_mac.mm index f60be5d69..e69fc11d6 100644 --- a/webrtc/modules/desktop_capture/window_capturer_mac.mm +++ b/webrtc/modules/desktop_capture/window_capturer_mac.mm @@ -224,6 +224,9 @@ void WindowCapturerMac::Capture(const DesktopRegion& region) { CFRelease(cf_data); CFRelease(window_image); + frame->mutable_updated_region()->SetRect( + DesktopRect::MakeSize(frame->size())); + callback_->OnCaptureCompleted(frame); if (full_screen_chrome_window_detector_) diff --git a/webrtc/modules/desktop_capture/window_capturer_win.cc b/webrtc/modules/desktop_capture/window_capturer_win.cc index a00218562..9f19faf27 100644 --- a/webrtc/modules/desktop_capture/window_capturer_win.cc +++ b/webrtc/modules/desktop_capture/window_capturer_win.cc @@ -251,6 +251,9 @@ void WindowCapturerWin::Capture(const DesktopRegion& region) { previous_size_ = frame->size(); + frame->mutable_updated_region()->SetRect( + DesktopRect::MakeSize(frame->size())); + if (!result) { LOG(LS_ERROR) << "Both PrintWindow() and BitBlt() failed."; frame.reset(); diff --git a/webrtc/modules/desktop_capture/window_capturer_x11.cc b/webrtc/modules/desktop_capture/window_capturer_x11.cc index b641c9321..4945423c6 100755 --- a/webrtc/modules/desktop_capture/window_capturer_x11.cc +++ b/webrtc/modules/desktop_capture/window_capturer_x11.cc @@ -302,6 +302,9 @@ void WindowCapturerLinux::Capture(const DesktopRegion& region) { x_server_pixel_buffer_.CaptureRect(DesktopRect::MakeSize(frame->size()), frame); + frame->mutable_updated_region()->SetRect( + DesktopRect::MakeSize(frame->size())); + callback_->OnCaptureCompleted(frame); }