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 #include "remoting/host/ipc_video_frame_capturer.h" | 5 #include "remoting/host/ipc_video_frame_capturer.h" |
6 | 6 |
7 #include "media/video/capture/screen/mouse_cursor_shape.h" | 7 #include "media/video/capture/screen/mouse_cursor_shape.h" |
8 #include "media/video/capture/screen/screen_capture_data.h" | 8 #include "media/video/capture/screen/screen_capture_data.h" |
9 #include "remoting/host/desktop_session_proxy.h" | 9 #include "remoting/host/desktop_session_proxy.h" |
10 | 10 |
11 namespace remoting { | 11 namespace remoting { |
12 | 12 |
13 IpcVideoFrameCapturer::IpcVideoFrameCapturer( | 13 IpcVideoFrameCapturer::IpcVideoFrameCapturer( |
14 scoped_refptr<DesktopSessionProxy> desktop_session_proxy) | 14 scoped_refptr<DesktopSessionProxy> desktop_session_proxy) |
15 : delegate_(NULL), | 15 : delegate_(NULL), |
16 desktop_session_proxy_(desktop_session_proxy), | 16 desktop_session_proxy_(desktop_session_proxy), |
17 weak_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { | 17 weak_factory_(this) { |
18 } | 18 } |
19 | 19 |
20 IpcVideoFrameCapturer::~IpcVideoFrameCapturer() { | 20 IpcVideoFrameCapturer::~IpcVideoFrameCapturer() { |
21 } | 21 } |
22 | 22 |
23 void IpcVideoFrameCapturer::Start(Delegate* delegate) { | 23 void IpcVideoFrameCapturer::Start(Delegate* delegate) { |
24 delegate_ = delegate; | 24 delegate_ = delegate; |
25 desktop_session_proxy_->SetVideoCapturer(weak_factory_.GetWeakPtr()); | 25 desktop_session_proxy_->SetVideoCapturer(weak_factory_.GetWeakPtr()); |
26 } | 26 } |
27 | 27 |
28 void IpcVideoFrameCapturer::CaptureFrame() { | 28 void IpcVideoFrameCapturer::CaptureFrame() { |
29 desktop_session_proxy_->CaptureFrame(); | 29 desktop_session_proxy_->CaptureFrame(); |
30 } | 30 } |
31 | 31 |
32 void IpcVideoFrameCapturer::OnCaptureCompleted( | 32 void IpcVideoFrameCapturer::OnCaptureCompleted( |
33 scoped_refptr<media::ScreenCaptureData> capture_data) { | 33 scoped_refptr<media::ScreenCaptureData> capture_data) { |
34 if (delegate_) | 34 if (delegate_) |
35 delegate_->OnCaptureCompleted(capture_data); | 35 delegate_->OnCaptureCompleted(capture_data); |
36 } | 36 } |
37 | 37 |
38 void IpcVideoFrameCapturer::OnCursorShapeChanged( | 38 void IpcVideoFrameCapturer::OnCursorShapeChanged( |
39 scoped_ptr<media::MouseCursorShape> cursor_shape) { | 39 scoped_ptr<media::MouseCursorShape> cursor_shape) { |
40 if (delegate_) | 40 if (delegate_) |
41 delegate_->OnCursorShapeChanged(cursor_shape.Pass()); | 41 delegate_->OnCursorShapeChanged(cursor_shape.Pass()); |
42 } | 42 } |
43 | 43 |
44 } // namespace remoting | 44 } // namespace remoting |
OLD | NEW |