OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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/window_capturer.h" | 11 #include "webrtc/modules/desktop_capture/window_capturer.h" |
12 | 12 |
13 #include <assert.h> | 13 #include <assert.h> |
14 | 14 |
15 #include "webrtc/base/constructormagic.h" | 15 #include "webrtc/base/constructormagic.h" |
16 #include "webrtc/modules/desktop_capture/desktop_frame.h" | 16 #include "webrtc/modules/desktop_capture/desktop_frame.h" |
17 | 17 |
18 namespace webrtc { | 18 namespace webrtc { |
19 | 19 |
20 namespace { | 20 namespace { |
21 | 21 |
22 class WindowCapturerNull : public WindowCapturer { | 22 class WindowCapturerNull : public WindowCapturer { |
23 public: | 23 public: |
24 WindowCapturerNull(); | 24 WindowCapturerNull(); |
25 ~WindowCapturerNull() override; | 25 ~WindowCapturerNull() override; |
26 | 26 |
27 // WindowCapturer interface. | |
28 bool GetWindowList(WindowList* windows) override; | |
29 bool SelectWindow(WindowId id) override; | |
30 bool BringSelectedWindowToFront() override; | |
31 | |
32 // DesktopCapturer interface. | 27 // DesktopCapturer interface. |
33 void Start(Callback* callback) override; | 28 void Start(Callback* callback) override; |
34 void CaptureFrame() override; | 29 void CaptureFrame() override; |
| 30 bool GetSourceList(SourceList* sources) override; |
| 31 bool SelectSource(SourceId id) override; |
35 | 32 |
36 private: | 33 private: |
37 Callback* callback_ = nullptr; | 34 Callback* callback_ = nullptr; |
38 | 35 |
39 RTC_DISALLOW_COPY_AND_ASSIGN(WindowCapturerNull); | 36 RTC_DISALLOW_COPY_AND_ASSIGN(WindowCapturerNull); |
40 }; | 37 }; |
41 | 38 |
42 WindowCapturerNull::WindowCapturerNull() {} | 39 WindowCapturerNull::WindowCapturerNull() {} |
43 WindowCapturerNull::~WindowCapturerNull() {} | 40 WindowCapturerNull::~WindowCapturerNull() {} |
44 | 41 |
45 bool WindowCapturerNull::GetWindowList(WindowList* windows) { | 42 bool WindowCapturerNull::GetSourceList(SourceList* sources) { |
46 // Not implemented yet. | 43 // Not implemented yet. |
47 return false; | 44 return false; |
48 } | 45 } |
49 | 46 |
50 bool WindowCapturerNull::SelectWindow(WindowId id) { | 47 bool WindowCapturerNull::SelectSource(SourceId id) { |
51 // Not implemented yet. | 48 // Not implemented yet. |
52 return false; | 49 return false; |
53 } | 50 } |
54 | |
55 bool WindowCapturerNull::BringSelectedWindowToFront() { | |
56 // Not implemented yet. | |
57 return false; | |
58 } | |
59 | 51 |
60 void WindowCapturerNull::Start(Callback* callback) { | 52 void WindowCapturerNull::Start(Callback* callback) { |
61 assert(!callback_); | 53 assert(!callback_); |
62 assert(callback); | 54 assert(callback); |
63 | 55 |
64 callback_ = callback; | 56 callback_ = callback; |
65 } | 57 } |
66 | 58 |
67 void WindowCapturerNull::CaptureFrame() { | 59 void WindowCapturerNull::CaptureFrame() { |
68 // Not implemented yet. | 60 // Not implemented yet. |
69 callback_->OnCaptureResult(Result::ERROR_TEMPORARY, nullptr); | 61 callback_->OnCaptureResult(Result::ERROR_TEMPORARY, nullptr); |
70 } | 62 } |
71 | 63 |
72 } // namespace | 64 } // namespace |
73 | 65 |
74 // static | 66 // static |
75 WindowCapturer* WindowCapturer::Create(const DesktopCaptureOptions& options) { | 67 WindowCapturer* WindowCapturer::Create(const DesktopCaptureOptions& options) { |
76 return new WindowCapturerNull(); | 68 return new WindowCapturerNull(); |
77 } | 69 } |
78 | 70 |
79 // static | 71 // static |
80 std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateRawWindowCapturer( | 72 std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateRawWindowCapturer( |
81 const DesktopCaptureOptions& options) { | 73 const DesktopCaptureOptions& options) { |
82 return std::unique_ptr<DesktopCapturer>(new WindowCapturerNull()); | 74 return std::unique_ptr<DesktopCapturer>(new WindowCapturerNull()); |
83 } | 75 } |
84 | 76 |
85 } // namespace webrtc | 77 } // namespace webrtc |
OLD | NEW |