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

Unified Diff: webrtc/modules/desktop_capture/screen_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
« no previous file with comments | « no previous file | webrtc/modules/desktop_capture/window_capturer_x11.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/desktop_capture/screen_capturer_x11.cc
diff --git a/webrtc/modules/desktop_capture/screen_capturer_x11.cc b/webrtc/modules/desktop_capture/screen_capturer_x11.cc
index ff3ee1197f2c694e91eb522230325e5adcff6825..484d50382d99eee8e90479e1b8b1c2d500c5708c 100644
--- a/webrtc/modules/desktop_capture/screen_capturer_x11.cc
+++ b/webrtc/modules/desktop_capture/screen_capturer_x11.cc
@@ -256,6 +256,11 @@ void ScreenCapturerLinux::CaptureFrame() {
}
std::unique_ptr<DesktopFrame> result = CaptureScreen();
+ if (!result) {
+ callback_->OnCaptureResult(Result::ERROR_TEMPORARY, nullptr);
+ return;
+ }
+
last_invalid_region_ = result->updated_region();
result->set_capture_time_ms((rtc::TimeNanos() - capture_start_time_nanos) /
rtc::kNumNanosecsPerMillisec);
@@ -334,7 +339,8 @@ std::unique_ptr<DesktopFrame> ScreenCapturerLinux::CaptureScreen() {
for (DesktopRegion::Iterator it(*updated_region);
!it.IsAtEnd(); it.Advance()) {
- x_server_pixel_buffer_.CaptureRect(it.rect(), frame.get());
+ if (!x_server_pixel_buffer_.CaptureRect(it.rect(), frame.get()))
+ return nullptr;
}
} else {
// Doing full-screen polling, or this is the first capture after a
« no previous file with comments | « no previous file | webrtc/modules/desktop_capture/window_capturer_x11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698