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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
67 DxgiDuplicatorController::Result result; | 67 DxgiDuplicatorController::Result result; |
68 if (current_screen_id_ == kFullDesktopScreenId) { | 68 if (current_screen_id_ == kFullDesktopScreenId) { |
69 result = controller_->Duplicate(frames_.current_frame()); | 69 result = controller_->Duplicate(frames_.current_frame()); |
70 } else { | 70 } else { |
71 result = controller_->DuplicateMonitor( | 71 result = controller_->DuplicateMonitor( |
72 frames_.current_frame(), current_screen_id_); | 72 frames_.current_frame(), current_screen_id_); |
73 } | 73 } |
74 | 74 |
75 using DuplicateResult = DxgiDuplicatorController::Result; | 75 using DuplicateResult = DxgiDuplicatorController::Result; |
76 switch (result) { | 76 switch (result) { |
77 case DuplicateResult::UNSUPPORTED_SESSION: { | |
78 LOG(LS_ERROR) << "Current binary is running on an unsupported session."; | |
Sergey Ulanov
2017/06/28 01:29:59
nit: Replace "an unsupported session" with "a sess
Hzj_jie
2017/06/28 05:01:58
Done.
| |
79 callback_->OnCaptureResult(Result::ERROR_PERMANENT, nullptr); | |
80 break; | |
81 } | |
77 case DuplicateResult::FRAME_PREPARE_FAILED: { | 82 case DuplicateResult::FRAME_PREPARE_FAILED: { |
78 LOG(LS_ERROR) << "Failed to allocate a new DesktopFrame."; | 83 LOG(LS_ERROR) << "Failed to allocate a new DesktopFrame."; |
79 // This usually means we do not have enough memory or SharedMemoryFactory | 84 // This usually means we do not have enough memory or SharedMemoryFactory |
80 // cannot work correctly. | 85 // cannot work correctly. |
81 callback_->OnCaptureResult(Result::ERROR_PERMANENT, nullptr); | 86 callback_->OnCaptureResult(Result::ERROR_PERMANENT, nullptr); |
82 break; | 87 break; |
83 } | 88 } |
84 case DuplicateResult::INVALID_MONITOR_ID: { | 89 case DuplicateResult::INVALID_MONITOR_ID: { |
85 callback_->OnCaptureResult(Result::ERROR_PERMANENT, nullptr); | 90 callback_->OnCaptureResult(Result::ERROR_PERMANENT, nullptr); |
86 break; | 91 break; |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
123 | 128 |
124 int screen_count = controller_->ScreenCount(); | 129 int screen_count = controller_->ScreenCount(); |
125 if (id >= 0 && id < screen_count) { | 130 if (id >= 0 && id < screen_count) { |
126 current_screen_id_ = id; | 131 current_screen_id_ = id; |
127 return true; | 132 return true; |
128 } | 133 } |
129 return false; | 134 return false; |
130 } | 135 } |
131 | 136 |
132 } // namespace webrtc | 137 } // namespace webrtc |
OLD | NEW |