OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef REMOTING_HOST_DESKTOP_CAPTURER_PROXY_H_ |
| 6 #define REMOTING_HOST_DESKTOP_CAPTURER_PROXY_H_ |
| 7 |
| 8 #include "base/callback.h" |
| 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/memory/weak_ptr.h" |
| 11 #include "base/threading/thread_checker.h" |
| 12 #include "third_party/webrtc/modules/desktop_capture/desktop_capturer.h" |
| 13 |
| 14 namespace base { |
| 15 class SingleThreadTaskRunner; |
| 16 } // namespace base |
| 17 |
| 18 namespace remoting { |
| 19 |
| 20 namespace protocol { |
| 21 class CursorShapeInfo; |
| 22 } // namespace protocol |
| 23 |
| 24 // DesktopCapturerProxy is responsible for calling webrtc::DesktopCapturer on |
| 25 // the capturer thread and then returning results to the caller's thread. |
| 26 class DesktopCapturerProxy : public webrtc::DesktopCapturer { |
| 27 public: |
| 28 DesktopCapturerProxy( |
| 29 scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner, |
| 30 scoped_ptr<webrtc::DesktopCapturer> capturer); |
| 31 ~DesktopCapturerProxy() override; |
| 32 |
| 33 // webrtc::DesktopCapturer interface. |
| 34 void Start(Callback* callback) override; |
| 35 void Capture(const webrtc::DesktopRegion& rect) override; |
| 36 |
| 37 private: |
| 38 class Core; |
| 39 |
| 40 void OnFrameCaptured(scoped_ptr<webrtc::DesktopFrame> frame); |
| 41 |
| 42 base::ThreadChecker thread_checker_; |
| 43 |
| 44 scoped_ptr<Core> core_; |
| 45 scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner_; |
| 46 webrtc::DesktopCapturer::Callback* callback_; |
| 47 |
| 48 base::WeakPtrFactory<DesktopCapturerProxy> weak_factory_; |
| 49 |
| 50 DISALLOW_COPY_AND_ASSIGN(DesktopCapturerProxy); |
| 51 }; |
| 52 |
| 53 } // namespace remoting |
| 54 |
| 55 #endif // REMOTING_HOST_DESKTOP_CAPTURER_PROXY_H_ |
OLD | NEW |