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

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

Issue 2468753002: Add CreateWindowCapturer() and CreateScreenCapturer() in DesktopCapturer (Closed)
Patch Set: Build break without X11 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
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/desktop_capturer.h" 11 #include "webrtc/modules/desktop_capture/desktop_capturer.h"
12 12
13 #include "webrtc/modules/desktop_capture/desktop_capture_options.h" 13 #include "webrtc/modules/desktop_capture/desktop_capture_options.h"
14 #include "webrtc/modules/desktop_capture/screen_capturer_differ_wrapper.h" 14 #include "webrtc/modules/desktop_capture/desktop_capturer_differ_wrapper.h"
15 15
16 namespace webrtc { 16 namespace webrtc {
17 17
18 DesktopCapturer::~DesktopCapturer() = default; 18 DesktopCapturer::~DesktopCapturer() = default;
19 19
20 void DesktopCapturer::SetSharedMemoryFactory( 20 void DesktopCapturer::SetSharedMemoryFactory(
21 std::unique_ptr<SharedMemoryFactory> shared_memory_factory) {} 21 std::unique_ptr<SharedMemoryFactory> shared_memory_factory) {}
22 22
23 void DesktopCapturer::SetExcludedWindow(WindowId window) {} 23 void DesktopCapturer::SetExcludedWindow(WindowId window) {}
24 24
25 bool DesktopCapturer::GetSourceList(SourceList* sources) { 25 bool DesktopCapturer::GetSourceList(SourceList* sources) {
26 return true; 26 return true;
27 } 27 }
28 28
29 bool DesktopCapturer::SelectSource(SourceId id) { 29 bool DesktopCapturer::SelectSource(SourceId id) {
30 return false; 30 return false;
31 } 31 }
32 32
33 bool DesktopCapturer::FocusOnSelectedSource() { 33 bool DesktopCapturer::FocusOnSelectedSource() {
34 return false; 34 return false;
35 } 35 }
36 36
37 // Some platforms, such as ChromeOS, have their DesktopCapturer implementations
38 // in Chromium. So even we do not have CreateRawWindowCapturer() or
39 // CreateRawScreenCapturer() implemented in WebRTC, we still need to build other
40 // DesktopCapturer components when RTC_DESKTOP_CAPTURE_SUPPORTED is not defined.
41 #if defined(RTC_DESKTOP_CAPTURE_SUPPORTED)
42 // static
43 std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateWindowCapturer(
44 const DesktopCaptureOptions& options) {
45 std::unique_ptr<DesktopCapturer> capturer = CreateRawWindowCapturer(options);
46 if (options.detect_updated_region()) {
47 capturer.reset(new DesktopCapturerDifferWrapper(std::move(capturer)));
48 }
49
50 return capturer;
51 }
52
53 // static
54 std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateScreenCapturer(
55 const DesktopCaptureOptions& options) {
56 std::unique_ptr<DesktopCapturer> capturer = CreateRawScreenCapturer(options);
57 if (options.detect_updated_region()) {
58 capturer.reset(new DesktopCapturerDifferWrapper(std::move(capturer)));
59 }
60
61 return capturer;
62 }
63 #endif // defined(RTC_DESKTOP_CAPTURE_SUPPORTED)
64
37 } // namespace webrtc 65 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/desktop_capture/desktop_capturer.h ('k') | webrtc/modules/desktop_capture/desktop_capturer_differ_wrapper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698