Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 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 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 612 RTC_DCHECK(result); | 612 RTC_DCHECK(result); |
| 613 *result->mutable_updated_region() = | 613 *result->mutable_updated_region() = |
| 614 surfaces_.current_frame()->get()->updated_region(); | 614 surfaces_.current_frame()->get()->updated_region(); |
| 615 return result; | 615 return result; |
| 616 } | 616 } |
| 617 | 617 |
| 618 void ScreenCapturerWinDirectx::Capture(const DesktopRegion& region) { | 618 void ScreenCapturerWinDirectx::Capture(const DesktopRegion& region) { |
| 619 RTC_DCHECK(callback_); | 619 RTC_DCHECK(callback_); |
| 620 | 620 |
| 621 if (!g_container->duplication && !DuplicateOutput()) { | 621 if (!g_container->duplication && !DuplicateOutput()) { |
| 622 // Failed to initialize desktop duplication. | 622 // Failed to initialize desktop duplication. This usually happens when |
| 623 callback_->OnCaptureResult(Result::ERROR_PERMANENT, nullptr); | 623 // Windows is switching display mode. Retrying later usually resolve the |
|
Jamie
2016/06/23 17:16:32
s/resolve/resolves/
Hzj_jie
2016/06/23 18:42:07
Done.
| |
| 624 // issue. | |
| 625 callback_->OnCaptureResult(Result::ERROR_TEMPORARY, nullptr); | |
| 624 return; | 626 return; |
| 625 } | 627 } |
| 626 | 628 |
| 627 RTC_DCHECK(g_container->duplication); | 629 RTC_DCHECK(g_container->duplication); |
| 628 int64_t capture_start_time_nanos = rtc::TimeNanos(); | 630 int64_t capture_start_time_nanos = rtc::TimeNanos(); |
| 629 | 631 |
| 630 if (!SetThreadExecutionState(ES_DISPLAY_REQUIRED | ES_SYSTEM_REQUIRED)) { | 632 if (!SetThreadExecutionState(ES_DISPLAY_REQUIRED | ES_SYSTEM_REQUIRED)) { |
| 631 if (!set_thread_execution_state_failed_) { | 633 if (!set_thread_execution_state_failed_) { |
| 632 set_thread_execution_state_failed_ = true; | 634 set_thread_execution_state_failed_ = true; |
| 633 LOG(LS_WARNING) << "Failed to make system & display power assertion: " | 635 LOG(LS_WARNING) << "Failed to make system & display power assertion: " |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 717 } | 719 } |
| 718 | 720 |
| 719 // If there is no shared_memory_factory_, last frame is stored in surfaces_ | 721 // If there is no shared_memory_factory_, last frame is stored in surfaces_ |
| 720 // queue. | 722 // queue. |
| 721 std::unique_ptr<DesktopFrame> frame( | 723 std::unique_ptr<DesktopFrame> frame( |
| 722 new DxgiDesktopFrame(*surfaces_.current_frame())); | 724 new DxgiDesktopFrame(*surfaces_.current_frame())); |
| 723 callback_->OnCaptureResult(Result::SUCCESS, std::move(frame)); | 725 callback_->OnCaptureResult(Result::SUCCESS, std::move(frame)); |
| 724 } | 726 } |
| 725 | 727 |
| 726 } // namespace webrtc | 728 } // namespace webrtc |
| OLD | NEW |