| 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 | 15 |
| 16 #include <memory> | 16 #include "webrtc/base/scoped_ptr.h" |
| 17 | |
| 18 #include "webrtc/modules/desktop_capture/desktop_capture_types.h" | 17 #include "webrtc/modules/desktop_capture/desktop_capture_types.h" |
| 19 #include "webrtc/modules/desktop_capture/shared_memory.h" | 18 #include "webrtc/modules/desktop_capture/shared_memory.h" |
| 20 | 19 |
| 21 namespace webrtc { | 20 namespace webrtc { |
| 22 | 21 |
| 23 class DesktopFrame; | 22 class DesktopFrame; |
| 24 class DesktopRegion; | 23 class DesktopRegion; |
| 25 | 24 |
| 26 // Abstract interface for screen and window capturers. | 25 // Abstract interface for screen and window capturers. |
| 27 class DesktopCapturer { | 26 class DesktopCapturer { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 42 | 41 |
| 43 // Called at the beginning of a capturing session. |callback| must remain | 42 // Called at the beginning of a capturing session. |callback| must remain |
| 44 // valid until capturer is destroyed. | 43 // valid until capturer is destroyed. |
| 45 virtual void Start(Callback* callback) = 0; | 44 virtual void Start(Callback* callback) = 0; |
| 46 | 45 |
| 47 // Sets SharedMemoryFactory that will be used to create buffers for the | 46 // Sets SharedMemoryFactory that will be used to create buffers for the |
| 48 // captured frames. The factory can be invoked on a thread other than the one | 47 // captured frames. The factory can be invoked on a thread other than the one |
| 49 // where Capture() is called. It will be destroyed on the same thread. Shared | 48 // where Capture() is called. It will be destroyed on the same thread. Shared |
| 50 // memory is currently supported only by some DesktopCapturer implementations. | 49 // memory is currently supported only by some DesktopCapturer implementations. |
| 51 virtual void SetSharedMemoryFactory( | 50 virtual void SetSharedMemoryFactory( |
| 52 std::unique_ptr<SharedMemoryFactory> shared_memory_factory) {} | 51 rtc::scoped_ptr<SharedMemoryFactory> shared_memory_factory) {} |
| 53 | 52 |
| 54 // Captures next frame. |region| specifies region of the capture target that | 53 // Captures next frame. |region| specifies region of the capture target that |
| 55 // should be fresh in the resulting frame. The frame may also include fresh | 54 // should be fresh in the resulting frame. The frame may also include fresh |
| 56 // data for areas outside |region|. In that case capturer will include these | 55 // data for areas outside |region|. In that case capturer will include these |
| 57 // areas in updated_region() of the frame. |region| is specified relative to | 56 // areas in updated_region() of the frame. |region| is specified relative to |
| 58 // the top left corner of the capture target. Pending capture operations are | 57 // the top left corner of the capture target. Pending capture operations are |
| 59 // canceled when DesktopCapturer is deleted. | 58 // canceled when DesktopCapturer is deleted. |
| 60 virtual void Capture(const DesktopRegion& region) = 0; | 59 virtual void Capture(const DesktopRegion& region) = 0; |
| 61 | 60 |
| 62 // Sets the window to be excluded from the captured image in the future | 61 // Sets the window to be excluded from the captured image in the future |
| 63 // Capture calls. Used to exclude the screenshare notification window for | 62 // Capture calls. Used to exclude the screenshare notification window for |
| 64 // screen capturing. | 63 // screen capturing. |
| 65 virtual void SetExcludedWindow(WindowId window) {} | 64 virtual void SetExcludedWindow(WindowId window) {} |
| 66 }; | 65 }; |
| 67 | 66 |
| 68 } // namespace webrtc | 67 } // namespace webrtc |
| 69 | 68 |
| 70 #endif // WEBRTC_MODULES_DESKTOP_CAPTURE_DESKTOP_CAPTURER_H_ | 69 #endif // WEBRTC_MODULES_DESKTOP_CAPTURE_DESKTOP_CAPTURER_H_ |
| 71 | 70 |
| OLD | NEW |