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 |
(...skipping 29 matching lines...) Expand all Loading... |
40 | 40 |
41 MAX_VALUE = ERROR_PERMANENT | 41 MAX_VALUE = ERROR_PERMANENT |
42 }; | 42 }; |
43 | 43 |
44 // Interface that must be implemented by the DesktopCapturer consumers. | 44 // Interface that must be implemented by the DesktopCapturer consumers. |
45 class Callback { | 45 class Callback { |
46 public: | 46 public: |
47 // Called after a frame has been captured. |frame| is not nullptr if and | 47 // Called after a frame has been captured. |frame| is not nullptr if and |
48 // only if |result| is SUCCESS. | 48 // only if |result| is SUCCESS. |
49 virtual void OnCaptureResult(Result result, | 49 virtual void OnCaptureResult(Result result, |
50 std::unique_ptr<DesktopFrame> frame) { | 50 std::unique_ptr<DesktopFrame> frame) = 0; |
51 OnCaptureCompleted(frame.release()); | |
52 } | |
53 | |
54 // Deprecated version of the method above that uses raw pointer instead of | |
55 // std::unique_ptr<>. | |
56 // TODO(sergeyu): Remove this method and make OnCaptureResult() pure | |
57 // virtual. crbug.com/webrtc/5950 | |
58 virtual void OnCaptureCompleted(DesktopFrame* frame) { delete frame; }; | |
59 | 51 |
60 protected: | 52 protected: |
61 virtual ~Callback() {} | 53 virtual ~Callback() {} |
62 }; | 54 }; |
63 | 55 |
64 virtual ~DesktopCapturer() {} | 56 virtual ~DesktopCapturer() {} |
65 | 57 |
66 // Called at the beginning of a capturing session. |callback| must remain | 58 // Called at the beginning of a capturing session. |callback| must remain |
67 // valid until capturer is destroyed. | 59 // valid until capturer is destroyed. |
68 virtual void Start(Callback* callback) = 0; | 60 virtual void Start(Callback* callback) = 0; |
(...skipping 16 matching lines...) Expand all Loading... |
85 // Sets the window to be excluded from the captured image in the future | 77 // Sets the window to be excluded from the captured image in the future |
86 // Capture calls. Used to exclude the screenshare notification window for | 78 // Capture calls. Used to exclude the screenshare notification window for |
87 // screen capturing. | 79 // screen capturing. |
88 virtual void SetExcludedWindow(WindowId window) {} | 80 virtual void SetExcludedWindow(WindowId window) {} |
89 }; | 81 }; |
90 | 82 |
91 } // namespace webrtc | 83 } // namespace webrtc |
92 | 84 |
93 #endif // WEBRTC_MODULES_DESKTOP_CAPTURE_DESKTOP_CAPTURER_H_ | 85 #endif // WEBRTC_MODULES_DESKTOP_CAPTURE_DESKTOP_CAPTURER_H_ |
94 | 86 |
OLD | NEW |