| 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 "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "remoting/host/video_frame_capturer.h" | 9 #include "remoting/capturer/video_frame_capturer.h" |
| 10 | 10 |
| 11 namespace IPC { | 11 namespace IPC { |
| 12 class Message; | 12 class Message; |
| 13 } // IPC | 13 } // namespace IPC |
| 14 | 14 |
| 15 namespace remoting { | 15 namespace remoting { |
| 16 | 16 |
| 17 struct MouseCursorShape; |
| 17 class DesktopSessionProxy; | 18 class DesktopSessionProxy; |
| 18 | 19 |
| 19 // Routes VideoFrameCapturer calls though the IPC channel to the desktop session | 20 // Routes VideoFrameCapturer calls though the IPC channel to the desktop session |
| 20 // agent running in the desktop integration process. | 21 // agent running in the desktop integration process. |
| 21 class IpcVideoFrameCapturer : public VideoFrameCapturer { | 22 class IpcVideoFrameCapturer : public VideoFrameCapturer { |
| 22 public: | 23 public: |
| 23 explicit IpcVideoFrameCapturer( | 24 explicit IpcVideoFrameCapturer( |
| 24 scoped_refptr<DesktopSessionProxy> desktop_session_proxy); | 25 scoped_refptr<DesktopSessionProxy> desktop_session_proxy); |
| 25 virtual ~IpcVideoFrameCapturer(); | 26 virtual ~IpcVideoFrameCapturer(); |
| 26 | 27 |
| 27 // VideoFrameCapturer interface. | 28 // VideoFrameCapturer interface. |
| 28 virtual void Start(Delegate* delegate) OVERRIDE; | 29 virtual void Start(Delegate* delegate) OVERRIDE; |
| 29 virtual void Stop() OVERRIDE; | 30 virtual void Stop() OVERRIDE; |
| 30 virtual media::VideoFrame::Format pixel_format() const OVERRIDE; | 31 virtual media::VideoFrame::Format pixel_format() const OVERRIDE; |
| 31 virtual void InvalidateRegion(const SkRegion& invalid_region) OVERRIDE; | 32 virtual void InvalidateRegion(const SkRegion& invalid_region) OVERRIDE; |
| 32 virtual void CaptureFrame() OVERRIDE; | 33 virtual void CaptureFrame() OVERRIDE; |
| 33 virtual const SkISize& size_most_recent() const OVERRIDE; | 34 virtual const SkISize& size_most_recent() const OVERRIDE; |
| 34 | 35 |
| 35 // Called when a video frame has been captured. |capture_data| describes | 36 // Called when a video frame has been captured. |capture_data| describes |
| 36 // a captured frame. | 37 // a captured frame. |
| 37 void OnCaptureCompleted(scoped_refptr<CaptureData> capture_data); | 38 void OnCaptureCompleted(scoped_refptr<CaptureData> capture_data); |
| 38 | 39 |
| 39 // Called when the cursor shape has changed. | 40 // Called when the cursor shape has changed. |
| 40 void OnCursorShapeChanged(scoped_ptr<protocol::CursorShapeInfo> cursor_shape); | 41 void OnCursorShapeChanged(const MouseCursorShape& cursor_shape); |
| 41 | 42 |
| 42 private: | 43 private: |
| 43 // Points to the delegate passed to VideoFrameCapturer::Start(). | 44 // Points to the delegate passed to VideoFrameCapturer::Start(). |
| 44 VideoFrameCapturer::Delegate* delegate_; | 45 VideoFrameCapturer::Delegate* delegate_; |
| 45 | 46 |
| 46 // Wraps the IPC channel to the desktop session agent. | 47 // Wraps the IPC channel to the desktop session agent. |
| 47 scoped_refptr<DesktopSessionProxy> desktop_session_proxy_; | 48 scoped_refptr<DesktopSessionProxy> desktop_session_proxy_; |
| 48 | 49 |
| 49 // Size of the most recent captured frame. | 50 // Size of the most recent captured frame. |
| 50 SkISize size_most_recent_; | 51 SkISize size_most_recent_; |
| 51 | 52 |
| 52 DISALLOW_COPY_AND_ASSIGN(IpcVideoFrameCapturer); | 53 DISALLOW_COPY_AND_ASSIGN(IpcVideoFrameCapturer); |
| 53 }; | 54 }; |
| 54 | 55 |
| 55 } // namespace remoting | 56 } // namespace remoting |
| 56 | 57 |
| 57 #endif // REMOTING_HOST_IPC_VIDEO_FRAME_CAPTURER_H_ | 58 #endif // REMOTING_HOST_IPC_VIDEO_FRAME_CAPTURER_H_ |
| OLD | NEW |