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 |
11 #include "webrtc/modules/desktop_capture/win/dxgi_duplicator_controller.h" | 11 #include "webrtc/modules/desktop_capture/win/dxgi_duplicator_controller.h" |
12 | 12 |
13 #include <windows.h> | 13 #include <windows.h> |
14 | 14 |
15 #include <algorithm> | 15 #include <algorithm> |
16 | 16 |
17 #include "webrtc/base/checks.h" | 17 #include "webrtc/base/checks.h" |
18 | 18 |
19 namespace webrtc { | 19 namespace webrtc { |
20 | 20 |
| 21 DxgiDuplicatorController::Context::Context() {} |
| 22 |
21 DxgiDuplicatorController::Context::~Context() { | 23 DxgiDuplicatorController::Context::~Context() { |
22 DxgiDuplicatorController::Instance()->Unregister(this); | 24 DxgiDuplicatorController::Instance()->Unregister(this); |
23 } | 25 } |
24 | 26 |
25 // static | 27 // static |
26 DxgiDuplicatorController* DxgiDuplicatorController::Instance() { | 28 DxgiDuplicatorController* DxgiDuplicatorController::Instance() { |
27 // The static instance won't be deleted to ensure it can be used by other | 29 // The static instance won't be deleted to ensure it can be used by other |
28 // threads even during program exiting. | 30 // threads even during program exiting. |
29 static DxgiDuplicatorController* instance = new DxgiDuplicatorController(); | 31 static DxgiDuplicatorController* instance = new DxgiDuplicatorController(); |
30 return instance; | 32 return instance; |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 Deinitialize(); | 227 Deinitialize(); |
226 return false; | 228 return false; |
227 } | 229 } |
228 } | 230 } |
229 // id >= ScreenCount(). This is a user error, so we do not need to | 231 // id >= ScreenCount(). This is a user error, so we do not need to |
230 // deinitialize. | 232 // deinitialize. |
231 return false; | 233 return false; |
232 } | 234 } |
233 | 235 |
234 } // namespace webrtc | 236 } // namespace webrtc |
OLD | NEW |