zijiehe | b68d655 | 2016-10-28 17:35:11 -0700 | [diff] [blame] | 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/desktop_capturer.h" |
| 12 | |
| 13 | #include "webrtc/modules/desktop_capture/desktop_capture_options.h" |
zijiehe | 54fd579 | 2016-11-02 14:49:35 -0700 | [diff] [blame] | 14 | #include "webrtc/modules/desktop_capture/desktop_capturer_differ_wrapper.h" |
zijiehe | b68d655 | 2016-10-28 17:35:11 -0700 | [diff] [blame] | 15 | |
| 16 | namespace webrtc { |
| 17 | |
| 18 | DesktopCapturer::~DesktopCapturer() = default; |
| 19 | |
| 20 | void DesktopCapturer::SetSharedMemoryFactory( |
| 21 | std::unique_ptr<SharedMemoryFactory> shared_memory_factory) {} |
| 22 | |
| 23 | void DesktopCapturer::SetExcludedWindow(WindowId window) {} |
| 24 | |
| 25 | bool DesktopCapturer::GetSourceList(SourceList* sources) { |
| 26 | return true; |
| 27 | } |
| 28 | |
| 29 | bool DesktopCapturer::SelectSource(SourceId id) { |
| 30 | return false; |
| 31 | } |
| 32 | |
| 33 | bool DesktopCapturer::FocusOnSelectedSource() { |
| 34 | return false; |
| 35 | } |
| 36 | |
Zijie He | 1282711 | 2017-08-29 11:19:13 -0700 | [diff] [blame] | 37 | bool DesktopCapturer::IsOccluded(const DesktopVector& pos) { |
| 38 | return false; |
| 39 | } |
| 40 | |
zijiehe | 54fd579 | 2016-11-02 14:49:35 -0700 | [diff] [blame] | 41 | // static |
| 42 | std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateWindowCapturer( |
| 43 | const DesktopCaptureOptions& options) { |
| 44 | std::unique_ptr<DesktopCapturer> capturer = CreateRawWindowCapturer(options); |
sergeyu | 3eba2d8 | 2017-03-17 15:33:27 -0700 | [diff] [blame] | 45 | if (capturer && options.detect_updated_region()) { |
zijiehe | 54fd579 | 2016-11-02 14:49:35 -0700 | [diff] [blame] | 46 | capturer.reset(new DesktopCapturerDifferWrapper(std::move(capturer))); |
| 47 | } |
| 48 | |
| 49 | return capturer; |
| 50 | } |
| 51 | |
| 52 | // static |
| 53 | std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateScreenCapturer( |
| 54 | const DesktopCaptureOptions& options) { |
| 55 | std::unique_ptr<DesktopCapturer> capturer = CreateRawScreenCapturer(options); |
sergeyu | 3eba2d8 | 2017-03-17 15:33:27 -0700 | [diff] [blame] | 56 | if (capturer && options.detect_updated_region()) { |
zijiehe | 54fd579 | 2016-11-02 14:49:35 -0700 | [diff] [blame] | 57 | capturer.reset(new DesktopCapturerDifferWrapper(std::move(capturer))); |
| 58 | } |
| 59 | |
| 60 | return capturer; |
| 61 | } |
zijiehe | 54fd579 | 2016-11-02 14:49:35 -0700 | [diff] [blame] | 62 | |
zijiehe | b68d655 | 2016-10-28 17:35:11 -0700 | [diff] [blame] | 63 | } // namespace webrtc |