OLD | NEW |
---|---|
(Empty) | |
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 #ifndef WEBRTC_MODULES_DESKTOP_CAPTURE_WIN_DXGI_FRAME_H_ | |
12 #define WEBRTC_MODULES_DESKTOP_CAPTURE_WIN_DXGI_FRAME_H_ | |
13 | |
14 #include <memory> | |
15 | |
16 #include "webrtc/modules/desktop_capture/desktop_capturer.h" | |
17 #include "webrtc/modules/desktop_capture/desktop_capture_types.h" | |
18 #include "webrtc/modules/desktop_capture/desktop_geometry.h" | |
19 #include "webrtc/modules/desktop_capture/resolution_change_detector.h" | |
20 #include "webrtc/modules/desktop_capture/shared_desktop_frame.h" | |
21 #include "webrtc/modules/desktop_capture/shared_memory.h" | |
22 #include "webrtc/modules/desktop_capture/win/dxgi_duplicator_controller.h" | |
23 | |
24 namespace webrtc { | |
25 | |
26 // A pair of a SharedDesktopFrame and a DxgiDuplicatorController::Context for | |
27 // the client of DxgiDuplicatorController. | |
28 class DxgiFrame final { | |
29 public: | |
30 // DxgiFrame does not take ownership of |factory|, consumers should ensure it | |
31 // outlives this instance. | |
32 explicit DxgiFrame(SharedMemoryFactory* factory); | |
33 ~DxgiFrame(); | |
34 | |
35 // Should not be called if Prepare() is not executed or returns false. | |
36 SharedDesktopFrame* frame() const; | |
37 | |
38 private: | |
39 // Allows DxgiDuplicatorController to access Prepare() and context() function. | |
40 friend DxgiDuplicatorController::Result | |
41 DxgiDuplicatorController::DoDuplicate(DxgiFrame*, int); | |
42 | |
43 // Prepares current instance with desktop size and source id. | |
44 bool Prepare(DesktopSize size, DesktopCapturer::SourceId source_id); | |
45 | |
46 // Should not be called if Prepare() is not executed or returns false. | |
47 DxgiDuplicatorController::Context* context(); | |
Sergey Ulanov
2017/04/18 18:10:16
Do we need this as private? This class is not used
Hzj_jie
2017/04/18 22:17:53
This class is used in ScreenCapturerWinDirectx or
| |
48 | |
49 SharedMemoryFactory* const factory_; | |
50 ResolutionChangeDetector resolution_change_detector_; | |
51 DesktopCapturer::SourceId source_id_ = kFullDesktopScreenId; | |
52 std::unique_ptr<SharedDesktopFrame> frame_; | |
53 DxgiDuplicatorController::Context context_; | |
54 }; | |
55 | |
56 } // namespace webrtc | |
57 | |
58 #endif // WEBRTC_MODULES_DESKTOP_CAPTURE_WIN_DXGI_FRAME_H_ | |
OLD | NEW |