Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(977)

Unified Diff: webrtc/modules/desktop_capture/window_capturer_x11.cc

Issue 2446733003: Update XServerPixelBuffer to handle errors returned from XGetImage(). (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/desktop_capture/window_capturer_x11.cc
diff --git a/webrtc/modules/desktop_capture/window_capturer_x11.cc b/webrtc/modules/desktop_capture/window_capturer_x11.cc
index e4a0917b9063dfd89a87eb906660d7d83040e409..bae185236d5cb589ab24c7930f9aa24018699840 100644
--- a/webrtc/modules/desktop_capture/window_capturer_x11.cc
+++ b/webrtc/modules/desktop_capture/window_capturer_x11.cc
@@ -293,8 +293,11 @@ void WindowCapturerLinux::CaptureFrame() {
new BasicDesktopFrame(x_server_pixel_buffer_.window_size()));
x_server_pixel_buffer_.Synchronize();
- x_server_pixel_buffer_.CaptureRect(DesktopRect::MakeSize(frame->size()),
- frame.get());
+ if (!x_server_pixel_buffer_.CaptureRect(DesktopRect::MakeSize(frame->size()),
+ frame.get())) {
+ callback_->OnCaptureResult(Result::ERROR_TEMPORARY, nullptr);
+ return;
+ }
frame->mutable_updated_region()->SetRect(
DesktopRect::MakeSize(frame->size()));
« no previous file with comments | « webrtc/modules/desktop_capture/screen_capturer_x11.cc ('k') | webrtc/modules/desktop_capture/x11/x_server_pixel_buffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698