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