blob: d4ef9b940a7e49ecd9ea75e0d3e3b4ca5d8a5257 [file] [log] [blame]
sergeyu@chromium.orgb10ccbe2013-05-19 07:02:48 +00001/*
2 * Copyright (c) 2013 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
pbos@webrtc.org12dc1a32013-08-05 16:22:53 +000011#include <assert.h>
sergeyu@chromium.orgb10ccbe2013-05-19 07:02:48 +000012
zijiehe98903d22016-11-10 21:57:10 -080013#include "webrtc/modules/desktop_capture/desktop_capturer.h"
sergeyu@chromium.orgb10ccbe2013-05-19 07:02:48 +000014#include "webrtc/modules/desktop_capture/desktop_frame.h"
Edward Lemurc20978e2017-07-06 19:44:34 +020015#include "webrtc/rtc_base/constructormagic.h"
sergeyu@chromium.orgb10ccbe2013-05-19 07:02:48 +000016
17namespace webrtc {
18
19namespace {
20
zijiehe98903d22016-11-10 21:57:10 -080021class WindowCapturerNull : public DesktopCapturer {
sergeyu@chromium.orgb10ccbe2013-05-19 07:02:48 +000022 public:
sergeyu@chromium.org9f282402013-08-23 18:22:12 +000023 WindowCapturerNull();
sergeyue1831212016-10-26 13:15:42 -070024 ~WindowCapturerNull() override;
sergeyu@chromium.orgb10ccbe2013-05-19 07:02:48 +000025
sergeyu@chromium.orgb10ccbe2013-05-19 07:02:48 +000026 // DesktopCapturer interface.
kjellander@webrtc.org14665ff2015-03-04 12:58:35 +000027 void Start(Callback* callback) override;
zijiehe91902cb2016-10-13 16:47:49 -070028 void CaptureFrame() override;
zijiehefce49052016-11-07 15:25:18 -080029 bool GetSourceList(SourceList* sources) override;
30 bool SelectSource(SourceId id) override;
sergeyu@chromium.orgb10ccbe2013-05-19 07:02:48 +000031
32 private:
sergeyu5d910282016-06-07 16:41:58 -070033 Callback* callback_ = nullptr;
sergeyu@chromium.orgb10ccbe2013-05-19 07:02:48 +000034
henrikg3c089d72015-09-16 05:37:44 -070035 RTC_DISALLOW_COPY_AND_ASSIGN(WindowCapturerNull);
sergeyu@chromium.orgb10ccbe2013-05-19 07:02:48 +000036};
37
sergeyu5d910282016-06-07 16:41:58 -070038WindowCapturerNull::WindowCapturerNull() {}
39WindowCapturerNull::~WindowCapturerNull() {}
sergeyu@chromium.orgb10ccbe2013-05-19 07:02:48 +000040
zijiehefce49052016-11-07 15:25:18 -080041bool WindowCapturerNull::GetSourceList(SourceList* sources) {
sergeyu@chromium.orgb10ccbe2013-05-19 07:02:48 +000042 // Not implemented yet.
43 return false;
44}
45
zijiehefce49052016-11-07 15:25:18 -080046bool WindowCapturerNull::SelectSource(SourceId id) {
jiayl@webrtc.org886c94f2014-03-18 17:10:36 +000047 // Not implemented yet.
48 return false;
49}
50
sergeyu@chromium.org9f282402013-08-23 18:22:12 +000051void WindowCapturerNull::Start(Callback* callback) {
sergeyu@chromium.orgb10ccbe2013-05-19 07:02:48 +000052 assert(!callback_);
53 assert(callback);
54
55 callback_ = callback;
56}
57
zijiehe91902cb2016-10-13 16:47:49 -070058void WindowCapturerNull::CaptureFrame() {
sergeyu@chromium.orgb10ccbe2013-05-19 07:02:48 +000059 // Not implemented yet.
sergeyu5d910282016-06-07 16:41:58 -070060 callback_->OnCaptureResult(Result::ERROR_TEMPORARY, nullptr);
sergeyu@chromium.orgb10ccbe2013-05-19 07:02:48 +000061}
62
63} // namespace
64
65// static
zijiehe54fd5792016-11-02 14:49:35 -070066std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateRawWindowCapturer(
67 const DesktopCaptureOptions& options) {
68 return std::unique_ptr<DesktopCapturer>(new WindowCapturerNull());
69}
70
sergeyu@chromium.orgb10ccbe2013-05-19 07:02:48 +000071} // namespace webrtc