Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(437)

Side by Side Diff: webrtc/modules/desktop_capture/screen_capturer.cc

Issue 2452263003: Add DesktopCapturer GetSourceList SelectSource FocusOnSelectedSource functions (Closed)
Patch Set: Fix build break on Chromium Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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
OLDNEW
« no previous file with comments | « webrtc/modules/desktop_capture/screen_capturer.h ('k') | webrtc/modules/desktop_capture/window_capturer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698