OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 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_WIN_SCREEN_CAPTURER_WIN_DIRECTX_H_ | 11 #ifndef WEBRTC_MODULES_DESKTOP_CAPTURE_WIN_SCREEN_CAPTURER_WIN_DIRECTX_H_ |
12 #define WEBRTC_MODULES_DESKTOP_CAPTURE_WIN_SCREEN_CAPTURER_WIN_DIRECTX_H_ | 12 #define WEBRTC_MODULES_DESKTOP_CAPTURE_WIN_SCREEN_CAPTURER_WIN_DIRECTX_H_ |
13 | 13 |
14 #include <D3DCommon.h> | 14 #include <D3DCommon.h> |
15 | 15 |
16 #include <memory> | 16 #include <memory> |
17 #include <vector> | 17 #include <vector> |
18 | 18 |
19 #include "webrtc/modules/desktop_capture/desktop_capturer.h" | 19 #include "webrtc/modules/desktop_capture/desktop_capturer.h" |
20 #include "webrtc/modules/desktop_capture/desktop_capture_options.h" | 20 #include "webrtc/modules/desktop_capture/desktop_capture_options.h" |
21 #include "webrtc/modules/desktop_capture/desktop_region.h" | 21 #include "webrtc/modules/desktop_capture/desktop_region.h" |
22 #include "webrtc/modules/desktop_capture/resolution_change_detector.h" | |
23 #include "webrtc/modules/desktop_capture/screen_capture_frame_queue.h" | 22 #include "webrtc/modules/desktop_capture/screen_capture_frame_queue.h" |
24 #include "webrtc/modules/desktop_capture/shared_desktop_frame.h" | |
25 #include "webrtc/modules/desktop_capture/win/dxgi_duplicator_controller.h" | 23 #include "webrtc/modules/desktop_capture/win/dxgi_duplicator_controller.h" |
| 24 #include "webrtc/modules/desktop_capture/win/dxgi_frame.h" |
26 | 25 |
27 namespace webrtc { | 26 namespace webrtc { |
28 | 27 |
29 // ScreenCapturerWinDirectx captures 32bit RGBA using DirectX. | 28 // ScreenCapturerWinDirectx captures 32bit RGBA using DirectX. |
30 class ScreenCapturerWinDirectx : public DesktopCapturer { | 29 class ScreenCapturerWinDirectx : public DesktopCapturer { |
31 public: | 30 public: |
32 using D3dInfo = DxgiDuplicatorController::D3dInfo; | 31 using D3dInfo = DxgiDuplicatorController::D3dInfo; |
33 | 32 |
34 // Whether the system supports DirectX based capturing. | 33 // Whether the system supports DirectX based capturing. |
35 static bool IsSupported(); | 34 static bool IsSupported(); |
(...skipping 13 matching lines...) Expand all Loading... |
49 ~ScreenCapturerWinDirectx() override; | 48 ~ScreenCapturerWinDirectx() override; |
50 | 49 |
51 void Start(Callback* callback) override; | 50 void Start(Callback* callback) override; |
52 void SetSharedMemoryFactory( | 51 void SetSharedMemoryFactory( |
53 std::unique_ptr<SharedMemoryFactory> shared_memory_factory) override; | 52 std::unique_ptr<SharedMemoryFactory> shared_memory_factory) override; |
54 void CaptureFrame() override; | 53 void CaptureFrame() override; |
55 bool GetSourceList(SourceList* sources) override; | 54 bool GetSourceList(SourceList* sources) override; |
56 bool SelectSource(SourceId id) override; | 55 bool SelectSource(SourceId id) override; |
57 | 56 |
58 private: | 57 private: |
59 // Returns desktop size of selected screen. | 58 ScreenCaptureFrameQueue<DxgiFrame> frames_; |
60 DesktopSize SelectedDesktopSize() const; | |
61 | |
62 // TODO(zijiehe): Merge |frames_| and |contexts_| into a single object. | |
63 ScreenCaptureFrameQueue<SharedDesktopFrame> frames_; | |
64 ScreenCaptureFrameQueue<DxgiDuplicatorController::Context> contexts_; | |
65 std::unique_ptr<SharedMemoryFactory> shared_memory_factory_; | 59 std::unique_ptr<SharedMemoryFactory> shared_memory_factory_; |
66 Callback* callback_ = nullptr; | 60 Callback* callback_ = nullptr; |
67 SourceId current_screen_id_ = kFullDesktopScreenId; | 61 SourceId current_screen_id_ = kFullDesktopScreenId; |
68 ResolutionChangeDetector resolution_change_detector_; | |
69 | 62 |
70 RTC_DISALLOW_COPY_AND_ASSIGN(ScreenCapturerWinDirectx); | 63 RTC_DISALLOW_COPY_AND_ASSIGN(ScreenCapturerWinDirectx); |
71 }; | 64 }; |
72 | 65 |
73 } // namespace webrtc | 66 } // namespace webrtc |
74 | 67 |
75 #endif // WEBRTC_MODULES_DESKTOP_CAPTURE_WIN_SCREEN_CAPTURER_WIN_DIRECTX_H_ | 68 #endif // WEBRTC_MODULES_DESKTOP_CAPTURE_WIN_SCREEN_CAPTURER_WIN_DIRECTX_H_ |
OLD | NEW |