| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_IPC_VIDEO_FRAME_CAPTURER_H_ | 5 #ifndef REMOTING_HOST_IPC_VIDEO_FRAME_CAPTURER_H_ |
| 6 #define REMOTING_HOST_IPC_VIDEO_FRAME_CAPTURER_H_ | 6 #define REMOTING_HOST_IPC_VIDEO_FRAME_CAPTURER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 public: | 22 public: |
| 23 explicit IpcVideoFrameCapturer( | 23 explicit IpcVideoFrameCapturer( |
| 24 scoped_refptr<DesktopSessionProxy> desktop_session_proxy); | 24 scoped_refptr<DesktopSessionProxy> desktop_session_proxy); |
| 25 ~IpcVideoFrameCapturer() override; | 25 ~IpcVideoFrameCapturer() override; |
| 26 | 26 |
| 27 // webrtc::DesktopCapturer interface. | 27 // webrtc::DesktopCapturer interface. |
| 28 void Start(Callback* callback) override; | 28 void Start(Callback* callback) override; |
| 29 void Capture(const webrtc::DesktopRegion& region) override; | 29 void Capture(const webrtc::DesktopRegion& region) override; |
| 30 | 30 |
| 31 // Called when a video |frame| has been captured. | 31 // Called when a video |frame| has been captured. |
| 32 void OnCaptureCompleted(std::unique_ptr<webrtc::DesktopFrame> frame); | 32 void OnCaptureResult(webrtc::DesktopCapturer::Result result, |
| 33 std::unique_ptr<webrtc::DesktopFrame> frame); |
| 33 | 34 |
| 34 private: | 35 private: |
| 35 // Points to the callback passed to webrtc::DesktopCapturer::Start(). | 36 // Points to the callback passed to webrtc::DesktopCapturer::Start(). |
| 36 webrtc::DesktopCapturer::Callback* callback_; | 37 webrtc::DesktopCapturer::Callback* callback_; |
| 37 | 38 |
| 38 // Wraps the IPC channel to the desktop session agent. | 39 // Wraps the IPC channel to the desktop session agent. |
| 39 scoped_refptr<DesktopSessionProxy> desktop_session_proxy_; | 40 scoped_refptr<DesktopSessionProxy> desktop_session_proxy_; |
| 40 | 41 |
| 41 // Set to true when a frame is being captured. | 42 // Set to true when a frame is being captured. |
| 42 bool capture_pending_; | 43 bool capture_pending_; |
| 43 | 44 |
| 44 // Used to cancel tasks pending on the capturer when it is stopped. | 45 // Used to cancel tasks pending on the capturer when it is stopped. |
| 45 base::WeakPtrFactory<IpcVideoFrameCapturer> weak_factory_; | 46 base::WeakPtrFactory<IpcVideoFrameCapturer> weak_factory_; |
| 46 | 47 |
| 47 DISALLOW_COPY_AND_ASSIGN(IpcVideoFrameCapturer); | 48 DISALLOW_COPY_AND_ASSIGN(IpcVideoFrameCapturer); |
| 48 }; | 49 }; |
| 49 | 50 |
| 50 } // namespace remoting | 51 } // namespace remoting |
| 51 | 52 |
| 52 #endif // REMOTING_HOST_IPC_VIDEO_FRAME_CAPTURER_H_ | 53 #endif // REMOTING_HOST_IPC_VIDEO_FRAME_CAPTURER_H_ |
| OLD | NEW |