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

Side by Side Diff: webrtc/modules/desktop_capture/screen_capturer_x11.cc

Issue 2738513005: Fix error handling in X11 screen capturer (Closed)
Patch Set: Created 3 years, 9 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 333
334 for (DesktopRegion::Iterator it(*updated_region); 334 for (DesktopRegion::Iterator it(*updated_region);
335 !it.IsAtEnd(); it.Advance()) { 335 !it.IsAtEnd(); it.Advance()) {
336 if (!x_server_pixel_buffer_.CaptureRect(it.rect(), frame.get())) 336 if (!x_server_pixel_buffer_.CaptureRect(it.rect(), frame.get()))
337 return nullptr; 337 return nullptr;
338 } 338 }
339 } else { 339 } else {
340 // Doing full-screen polling, or this is the first capture after a 340 // Doing full-screen polling, or this is the first capture after a
341 // screen-resolution change. In either case, need a full-screen capture. 341 // screen-resolution change. In either case, need a full-screen capture.
342 DesktopRect screen_rect = DesktopRect::MakeSize(frame->size()); 342 DesktopRect screen_rect = DesktopRect::MakeSize(frame->size());
343 x_server_pixel_buffer_.CaptureRect(screen_rect, frame.get()); 343 if (!x_server_pixel_buffer_.CaptureRect(screen_rect, frame.get()))
344 return nullptr;
344 updated_region->SetRect(screen_rect); 345 updated_region->SetRect(screen_rect);
345 } 346 }
346 347
347 return std::move(frame); 348 return std::move(frame);
348 } 349 }
349 350
350 void ScreenCapturerLinux::ScreenConfigurationChanged() { 351 void ScreenCapturerLinux::ScreenConfigurationChanged() {
351 // Make sure the frame buffers will be reallocated. 352 // Make sure the frame buffers will be reallocated.
352 queue_.Reset(); 353 queue_.Reset();
353 354
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 410
410 std::unique_ptr<ScreenCapturerLinux> capturer(new ScreenCapturerLinux()); 411 std::unique_ptr<ScreenCapturerLinux> capturer(new ScreenCapturerLinux());
411 if (!capturer.get()->Init(options)) { 412 if (!capturer.get()->Init(options)) {
412 return nullptr; 413 return nullptr;
413 } 414 }
414 415
415 return std::move(capturer); 416 return std::move(capturer);
416 } 417 }
417 418
418 } // namespace webrtc 419 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698