OLD | NEW |
| (Empty) |
1 /* | |
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | |
3 * | |
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 | |
6 * tree. An additional intellectual property rights grant can be found | |
7 * in the file PATENTS. All contributing project authors may | |
8 * be found in the AUTHORS file in the root of the source tree. | |
9 */ | |
10 | |
11 #include "webrtc/modules/desktop_capture/screen_capturer.h" | |
12 | |
13 #include <memory> | |
14 #include <utility> | |
15 | |
16 namespace webrtc { | |
17 | |
18 ScreenCapturer::~ScreenCapturer() = default; | |
19 | |
20 bool ScreenCapturer::GetScreenList(ScreenList* screens) { | |
21 SourceList sources; | |
22 if (!GetSourceList(&sources)) { | |
23 return false; | |
24 } | |
25 | |
26 for (const Source& source : sources) { | |
27 screens->push_back({source.id}); | |
28 } | |
29 return true; | |
30 } | |
31 | |
32 bool ScreenCapturer::SelectScreen(ScreenId id) { | |
33 return SelectSource(id); | |
34 } | |
35 | |
36 bool ScreenCapturer::GetSourceList(SourceList* sources) { | |
37 ScreenList screens; | |
38 if (!GetScreenList(&screens)) { | |
39 return false; | |
40 } | |
41 | |
42 for (const Screen& screen : screens) { | |
43 sources->push_back({screen.id}); | |
44 } | |
45 | |
46 return true; | |
47 } | |
48 | |
49 bool ScreenCapturer::SelectSource(SourceId id) { | |
50 return SelectScreen(id); | |
51 } | |
52 | |
53 } // namespace webrtc | |
OLD | NEW |