OLD | NEW |
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 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 // something we want so instead, just bail out. | 286 // something we want so instead, just bail out. |
287 LOG(LS_INFO) << "No Xcomposite extension detected."; | 287 LOG(LS_INFO) << "No Xcomposite extension detected."; |
288 callback_->OnCaptureResult(Result::ERROR_PERMANENT, nullptr); | 288 callback_->OnCaptureResult(Result::ERROR_PERMANENT, nullptr); |
289 return; | 289 return; |
290 } | 290 } |
291 | 291 |
292 std::unique_ptr<DesktopFrame> frame( | 292 std::unique_ptr<DesktopFrame> frame( |
293 new BasicDesktopFrame(x_server_pixel_buffer_.window_size())); | 293 new BasicDesktopFrame(x_server_pixel_buffer_.window_size())); |
294 | 294 |
295 x_server_pixel_buffer_.Synchronize(); | 295 x_server_pixel_buffer_.Synchronize(); |
296 x_server_pixel_buffer_.CaptureRect(DesktopRect::MakeSize(frame->size()), | 296 if (!x_server_pixel_buffer_.CaptureRect(DesktopRect::MakeSize(frame->size()), |
297 frame.get()); | 297 frame.get())) { |
| 298 callback_->OnCaptureResult(Result::ERROR_TEMPORARY, nullptr); |
| 299 return; |
| 300 } |
298 | 301 |
299 frame->mutable_updated_region()->SetRect( | 302 frame->mutable_updated_region()->SetRect( |
300 DesktopRect::MakeSize(frame->size())); | 303 DesktopRect::MakeSize(frame->size())); |
301 | 304 |
302 callback_->OnCaptureResult(Result::SUCCESS, std::move(frame)); | 305 callback_->OnCaptureResult(Result::SUCCESS, std::move(frame)); |
303 } | 306 } |
304 | 307 |
305 bool WindowCapturerLinux::HandleXEvent(const XEvent& event) { | 308 bool WindowCapturerLinux::HandleXEvent(const XEvent& event) { |
306 if (event.type == ConfigureNotify) { | 309 if (event.type == ConfigureNotify) { |
307 XConfigureEvent xce = event.xconfigure; | 310 XConfigureEvent xce = event.xconfigure; |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 } // namespace | 424 } // namespace |
422 | 425 |
423 // static | 426 // static |
424 WindowCapturer* WindowCapturer::Create(const DesktopCaptureOptions& options) { | 427 WindowCapturer* WindowCapturer::Create(const DesktopCaptureOptions& options) { |
425 if (!options.x_display()) | 428 if (!options.x_display()) |
426 return nullptr; | 429 return nullptr; |
427 return new WindowCapturerLinux(options); | 430 return new WindowCapturerLinux(options); |
428 } | 431 } |
429 | 432 |
430 } // namespace webrtc | 433 } // namespace webrtc |
OLD | NEW |