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 #ifndef WEBRTC_MODULES_DESKTOP_CAPTURE_DESKTOP_CAPTURER_H_ | 11 #ifndef WEBRTC_MODULES_DESKTOP_CAPTURE_DESKTOP_CAPTURER_H_ |
12 #define WEBRTC_MODULES_DESKTOP_CAPTURE_DESKTOP_CAPTURER_H_ | 12 #define WEBRTC_MODULES_DESKTOP_CAPTURE_DESKTOP_CAPTURER_H_ |
13 | 13 |
14 #include <stddef.h> | 14 #include <stddef.h> |
15 #include <stdint.h> | 15 #include <stdint.h> |
16 | 16 |
17 #include <memory> | 17 #include <memory> |
18 #include <string> | 18 #include <string> |
| 19 #include <type_traits> |
19 #include <vector> | 20 #include <vector> |
20 | 21 |
21 #include "webrtc/modules/desktop_capture/desktop_frame.h" | 22 #include "webrtc/modules/desktop_capture/desktop_frame.h" |
22 #include "webrtc/modules/desktop_capture/desktop_capture_types.h" | 23 #include "webrtc/modules/desktop_capture/desktop_capture_types.h" |
23 #include "webrtc/modules/desktop_capture/shared_memory.h" | 24 #include "webrtc/modules/desktop_capture/shared_memory.h" |
24 | 25 |
25 namespace webrtc { | 26 namespace webrtc { |
26 | 27 |
27 class DesktopCaptureOptions; | 28 class DesktopCaptureOptions; |
28 class DesktopFrame; | 29 class DesktopFrame; |
(...skipping 23 matching lines...) Expand all Loading... |
52 // only if |result| is SUCCESS. | 53 // only if |result| is SUCCESS. |
53 virtual void OnCaptureResult(Result result, | 54 virtual void OnCaptureResult(Result result, |
54 std::unique_ptr<DesktopFrame> frame) = 0; | 55 std::unique_ptr<DesktopFrame> frame) = 0; |
55 | 56 |
56 protected: | 57 protected: |
57 virtual ~Callback() {} | 58 virtual ~Callback() {} |
58 }; | 59 }; |
59 | 60 |
60 typedef intptr_t SourceId; | 61 typedef intptr_t SourceId; |
61 | 62 |
| 63 static_assert(std::is_same<SourceId, ScreenId>::value, |
| 64 "SourceId should be a same type as ScreenId."); |
| 65 |
62 struct Source { | 66 struct Source { |
63 // The unique id to represent a Source of current DesktopCapturer. | 67 // The unique id to represent a Source of current DesktopCapturer. |
64 SourceId id; | 68 SourceId id; |
65 | 69 |
66 // Title of the window or screen in UTF-8 encoding, maybe empty. This field | 70 // Title of the window or screen in UTF-8 encoding, maybe empty. This field |
67 // should not be used to identify a source. | 71 // should not be used to identify a source. |
68 std::string title; | 72 std::string title; |
69 }; | 73 }; |
70 | 74 |
71 typedef std::vector<Source> SourceList; | 75 typedef std::vector<Source> SourceList; |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 // Creates a platform specific DesktopCapturer instance which targets to | 135 // Creates a platform specific DesktopCapturer instance which targets to |
132 // capture screens. | 136 // capture screens. |
133 static std::unique_ptr<DesktopCapturer> CreateRawScreenCapturer( | 137 static std::unique_ptr<DesktopCapturer> CreateRawScreenCapturer( |
134 const DesktopCaptureOptions& options); | 138 const DesktopCaptureOptions& options); |
135 }; | 139 }; |
136 | 140 |
137 } // namespace webrtc | 141 } // namespace webrtc |
138 | 142 |
139 #endif // WEBRTC_MODULES_DESKTOP_CAPTURE_DESKTOP_CAPTURER_H_ | 143 #endif // WEBRTC_MODULES_DESKTOP_CAPTURE_DESKTOP_CAPTURER_H_ |
140 | 144 |
OLD | NEW |