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