Zijie He | a7567a9 | 2017-09-15 09:12:25 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2017 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 "modules/desktop_capture/desktop_capturer_wrapper.h" |
| 12 | |
| 13 | #include <utility> |
| 14 | |
| 15 | #include "rtc_base/checks.h" |
| 16 | |
| 17 | namespace webrtc { |
| 18 | |
| 19 | DesktopCapturerWrapper::DesktopCapturerWrapper( |
| 20 | std::unique_ptr<DesktopCapturer> base_capturer) |
| 21 | : base_capturer_(std::move(base_capturer)) { |
| 22 | RTC_DCHECK(base_capturer_); |
| 23 | } |
| 24 | |
| 25 | DesktopCapturerWrapper::~DesktopCapturerWrapper() = default; |
| 26 | |
| 27 | void DesktopCapturerWrapper::Start(Callback* callback) { |
| 28 | base_capturer_->Start(callback); |
| 29 | } |
| 30 | |
| 31 | void DesktopCapturerWrapper::SetSharedMemoryFactory( |
| 32 | std::unique_ptr<SharedMemoryFactory> shared_memory_factory) { |
| 33 | base_capturer_->SetSharedMemoryFactory(std::move(shared_memory_factory)); |
| 34 | } |
| 35 | |
| 36 | void DesktopCapturerWrapper::CaptureFrame() { |
| 37 | base_capturer_->CaptureFrame(); |
| 38 | } |
| 39 | |
| 40 | void DesktopCapturerWrapper::SetExcludedWindow(WindowId window) { |
| 41 | base_capturer_->SetExcludedWindow(window); |
| 42 | } |
| 43 | |
| 44 | bool DesktopCapturerWrapper::GetSourceList(SourceList* sources) { |
| 45 | return base_capturer_->GetSourceList(sources); |
| 46 | } |
| 47 | |
| 48 | bool DesktopCapturerWrapper::SelectSource(SourceId id) { |
| 49 | return base_capturer_->SelectSource(id); |
| 50 | } |
| 51 | |
| 52 | bool DesktopCapturerWrapper::FocusOnSelectedSource() { |
| 53 | return base_capturer_->FocusOnSelectedSource(); |
| 54 | } |
| 55 | |
| 56 | bool DesktopCapturerWrapper::IsOccluded(const DesktopVector& pos) { |
| 57 | return base_capturer_->IsOccluded(pos); |
| 58 | } |
| 59 | |
| 60 | } // namespace webrtc |