Index: trunk/src/remoting/host/desktop_session_agent.cc |
=================================================================== |
--- trunk/src/remoting/host/desktop_session_agent.cc (revision 248137) |
+++ trunk/src/remoting/host/desktop_session_agent.cc (working copy) |
@@ -27,7 +27,6 @@ |
#include "remoting/protocol/input_event_tracker.h" |
#include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" |
#include "third_party/webrtc/modules/desktop_capture/desktop_frame.h" |
-#include "third_party/webrtc/modules/desktop_capture/mouse_cursor.h" |
#include "third_party/webrtc/modules/desktop_capture/shared_memory.h" |
namespace remoting { |
@@ -293,12 +292,10 @@ |
FROM_HERE, base::Bind(&DesktopSessionAgent::StartAudioCapturer, this)); |
} |
- // Start the video capturer and mouse cursor monitor. |
+ // Start the video capturer. |
video_capturer_ = desktop_environment_->CreateVideoCapturer(); |
- mouse_cursor_monitor_ = desktop_environment_->CreateMouseCursorMonitor(); |
video_capture_task_runner_->PostTask( |
- FROM_HERE, base::Bind( |
- &DesktopSessionAgent::StartVideoCapturerAndMouseMonitor, this)); |
+ FROM_HERE, base::Bind(&DesktopSessionAgent::StartVideoCapturer, this)); |
} |
void DesktopSessionAgent::OnCaptureCompleted(webrtc::DesktopFrame* frame) { |
@@ -324,22 +321,16 @@ |
new ChromotingDesktopNetworkMsg_CaptureCompleted(serialized_frame)); |
} |
-void DesktopSessionAgent::OnMouseCursor(webrtc::MouseCursor* cursor) { |
+void DesktopSessionAgent::OnCursorShapeChanged( |
+ webrtc::MouseCursorShape* cursor_shape) { |
DCHECK(video_capture_task_runner_->BelongsToCurrentThread()); |
- scoped_ptr<webrtc::MouseCursor> owned_cursor(cursor); |
+ scoped_ptr<webrtc::MouseCursorShape> owned_cursor(cursor_shape); |
- SendToNetwork( |
- new ChromotingDesktopNetworkMsg_MouseCursor(*owned_cursor)); |
+ SendToNetwork(new ChromotingDesktopNetworkMsg_CursorShapeChanged( |
+ *cursor_shape)); |
} |
-void DesktopSessionAgent::OnMouseCursorPosition( |
- webrtc::MouseCursorMonitor::CursorState state, |
- const webrtc::DesktopVector& position) { |
- // We're not subscribing to mouse position changes. |
- NOTREACHED(); |
-} |
- |
void DesktopSessionAgent::InjectClipboardEvent( |
const protocol::ClipboardEvent& event) { |
DCHECK(caller_task_runner_->BelongsToCurrentThread()); |
@@ -413,8 +404,7 @@ |
// Stop the video capturer. |
video_capture_task_runner_->PostTask( |
- FROM_HERE, base::Bind( |
- &DesktopSessionAgent::StopVideoCapturerAndMouseMonitor, this)); |
+ FROM_HERE, base::Bind(&DesktopSessionAgent::StopVideoCapturer, this)); |
} |
} |
@@ -426,8 +416,6 @@ |
return; |
} |
- mouse_cursor_monitor_->Capture(); |
- |
// webrtc::ScreenCapturer supports a very few (currently 2) outstanding |
// capture requests. The requests are serialized on |
// |video_capture_task_runner()| task runner. If the client issues more |
@@ -524,24 +512,20 @@ |
audio_capturer_.reset(); |
} |
-void DesktopSessionAgent::StartVideoCapturerAndMouseMonitor() { |
+void DesktopSessionAgent::StartVideoCapturer() { |
DCHECK(video_capture_task_runner_->BelongsToCurrentThread()); |
if (video_capturer_) { |
+ video_capturer_->SetMouseShapeObserver(this); |
video_capturer_->Start(this); |
} |
- |
- if (mouse_cursor_monitor_) { |
- mouse_cursor_monitor_->Init(this, webrtc::MouseCursorMonitor::SHAPE_ONLY); |
- } |
} |
-void DesktopSessionAgent::StopVideoCapturerAndMouseMonitor() { |
+void DesktopSessionAgent::StopVideoCapturer() { |
DCHECK(video_capture_task_runner_->BelongsToCurrentThread()); |
video_capturer_.reset(); |
last_frame_.reset(); |
- mouse_cursor_monitor_.reset(); |
// Video capturer must delete all buffers. |
DCHECK_EQ(shared_buffers_, 0); |