OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef REMOTING_HOST_DESKTOP_CAPTURER_PROXY_H_ | 5 #ifndef REMOTING_HOST_DESKTOP_CAPTURER_PROXY_H_ |
6 #define REMOTING_HOST_DESKTOP_CAPTURER_PROXY_H_ | 6 #define REMOTING_HOST_DESKTOP_CAPTURER_PROXY_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 // the capturer thread and then returning results to the caller's thread. | 31 // the capturer thread and then returning results to the caller's thread. |
32 class DesktopCapturerProxy : public webrtc::DesktopCapturer { | 32 class DesktopCapturerProxy : public webrtc::DesktopCapturer { |
33 public: | 33 public: |
34 DesktopCapturerProxy( | 34 DesktopCapturerProxy( |
35 scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner, | 35 scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner, |
36 const webrtc::DesktopCaptureOptions& options); | 36 const webrtc::DesktopCaptureOptions& options); |
37 ~DesktopCapturerProxy() override; | 37 ~DesktopCapturerProxy() override; |
38 | 38 |
39 // webrtc::DesktopCapturer interface. | 39 // webrtc::DesktopCapturer interface. |
40 void Start(Callback* callback) override; | 40 void Start(Callback* callback) override; |
41 void SetSharedMemoryFactory(rtc::scoped_ptr<webrtc::SharedMemoryFactory> | 41 void SetSharedMemoryFactory(std::unique_ptr<webrtc::SharedMemoryFactory> |
42 shared_memory_factory) override; | 42 shared_memory_factory) override; |
43 void Capture(const webrtc::DesktopRegion& rect) override; | 43 void Capture(const webrtc::DesktopRegion& rect) override; |
44 | 44 |
45 private: | 45 private: |
46 class Core; | 46 class Core; |
47 | 47 |
48 void OnFrameCaptured(std::unique_ptr<webrtc::DesktopFrame> frame); | 48 void OnFrameCaptured(std::unique_ptr<webrtc::DesktopFrame> frame); |
49 | 49 |
50 base::ThreadChecker thread_checker_; | 50 base::ThreadChecker thread_checker_; |
51 | 51 |
52 std::unique_ptr<Core> core_; | 52 std::unique_ptr<Core> core_; |
53 scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner_; | 53 scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner_; |
54 webrtc::DesktopCapturer::Callback* callback_; | 54 webrtc::DesktopCapturer::Callback* callback_; |
55 | 55 |
56 base::WeakPtrFactory<DesktopCapturerProxy> weak_factory_; | 56 base::WeakPtrFactory<DesktopCapturerProxy> weak_factory_; |
57 | 57 |
58 DISALLOW_COPY_AND_ASSIGN(DesktopCapturerProxy); | 58 DISALLOW_COPY_AND_ASSIGN(DesktopCapturerProxy); |
59 }; | 59 }; |
60 | 60 |
61 } // namespace remoting | 61 } // namespace remoting |
62 | 62 |
63 #endif // REMOTING_HOST_DESKTOP_CAPTURER_PROXY_H_ | 63 #endif // REMOTING_HOST_DESKTOP_CAPTURER_PROXY_H_ |
OLD | NEW |