| 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 a session not supported " |
| 79 "by DirectX screen capturer."; |
| 80 callback_->OnCaptureResult(Result::ERROR_PERMANENT, nullptr); |
| 81 break; |
| 82 } |
| 77 case DuplicateResult::FRAME_PREPARE_FAILED: { | 83 case DuplicateResult::FRAME_PREPARE_FAILED: { |
| 78 LOG(LS_ERROR) << "Failed to allocate a new DesktopFrame."; | 84 LOG(LS_ERROR) << "Failed to allocate a new DesktopFrame."; |
| 79 // This usually means we do not have enough memory or SharedMemoryFactory | 85 // This usually means we do not have enough memory or SharedMemoryFactory |
| 80 // cannot work correctly. | 86 // cannot work correctly. |
| 81 callback_->OnCaptureResult(Result::ERROR_PERMANENT, nullptr); | 87 callback_->OnCaptureResult(Result::ERROR_PERMANENT, nullptr); |
| 82 break; | 88 break; |
| 83 } | 89 } |
| 84 case DuplicateResult::INVALID_MONITOR_ID: { | 90 case DuplicateResult::INVALID_MONITOR_ID: { |
| 85 callback_->OnCaptureResult(Result::ERROR_PERMANENT, nullptr); | 91 callback_->OnCaptureResult(Result::ERROR_PERMANENT, nullptr); |
| 86 break; | 92 break; |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 | 129 |
| 124 int screen_count = controller_->ScreenCount(); | 130 int screen_count = controller_->ScreenCount(); |
| 125 if (id >= 0 && id < screen_count) { | 131 if (id >= 0 && id < screen_count) { |
| 126 current_screen_id_ = id; | 132 current_screen_id_ = id; |
| 127 return true; | 133 return true; |
| 128 } | 134 } |
| 129 return false; | 135 return false; |
| 130 } | 136 } |
| 131 | 137 |
| 132 } // namespace webrtc | 138 } // namespace webrtc |
| OLD | NEW |