Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(188)

Side by Side Diff: remoting/host/desktop_session_proxy.cc

Issue 11470028: Move screen capturers to remoting/capturer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « remoting/host/desktop_session_proxy.h ('k') | remoting/host/differ.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/desktop_session_proxy.h" 5 #include "remoting/host/desktop_session_proxy.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/platform_file.h" 9 #include "base/platform_file.h"
10 #include "base/single_thread_task_runner.h" 10 #include "base/single_thread_task_runner.h"
11 #include "ipc/ipc_channel_proxy.h" 11 #include "ipc/ipc_channel_proxy.h"
12 #include "ipc/ipc_message_macros.h" 12 #include "ipc/ipc_message_macros.h"
13 #include "remoting/base/capture_data.h" 13 #include "remoting/capturer/capture_data.h"
14 #include "remoting/host/audio_capturer.h" 14 #include "remoting/host/audio_capturer.h"
15 #include "remoting/host/chromoting_messages.h" 15 #include "remoting/host/chromoting_messages.h"
16 #include "remoting/host/ipc_video_frame_capturer.h" 16 #include "remoting/host/ipc_video_frame_capturer.h"
17 #include "remoting/proto/control.pb.h" 17 #include "remoting/proto/control.pb.h"
18 #include "remoting/proto/event.pb.h" 18 #include "remoting/proto/event.pb.h"
19 19
20 #if defined(OS_WIN) 20 #if defined(OS_WIN)
21 #include "base/win/scoped_handle.h" 21 #include "base/win/scoped_handle.h"
22 #endif // defined(OS_WIN) 22 #endif // defined(OS_WIN)
23 23
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 capture_data = new CaptureData( 294 capture_data = new CaptureData(
295 planes, serialized_data.dimensions, 295 planes, serialized_data.dimensions,
296 static_cast<media::VideoFrame::Format>(serialized_data.pixel_format)); 296 static_cast<media::VideoFrame::Format>(serialized_data.pixel_format));
297 capture_data->set_capture_time_ms(serialized_data.capture_time_ms); 297 capture_data->set_capture_time_ms(serialized_data.capture_time_ms);
298 capture_data->set_client_sequence_number( 298 capture_data->set_client_sequence_number(
299 serialized_data.client_sequence_number); 299 serialized_data.client_sequence_number);
300 capture_data->set_dpi(serialized_data.dpi); 300 capture_data->set_dpi(serialized_data.dpi);
301 capture_data->set_shared_buffer(shared_buffer); 301 capture_data->set_shared_buffer(shared_buffer);
302 302
303 if (!serialized_data.dirty_region.empty()) { 303 if (!serialized_data.dirty_region.empty()) {
304 capture_data->mutable_dirty_region().setRects( 304 capture_data->mutable_dirty_region().setRects(
305 &serialized_data.dirty_region[0], 305 &serialized_data.dirty_region[0],
306 serialized_data.dirty_region.size()); 306 serialized_data.dirty_region.size());
307 } 307 }
308 308
309 --pending_capture_frame_requests_; 309 --pending_capture_frame_requests_;
310 PostCaptureCompleted(capture_data); 310 PostCaptureCompleted(capture_data);
311 } 311 }
312 312
313 void DesktopSessionProxy::OnCursorShapeChanged( 313 void DesktopSessionProxy::OnCursorShapeChanged(
314 const std::string& serialized_cursor_shape) { 314 const MouseCursorShape& cursor_shape) {
315 DCHECK(caller_task_runner_->BelongsToCurrentThread()); 315 DCHECK(caller_task_runner_->BelongsToCurrentThread());
316 316 PostCursorShape(
317 scoped_ptr<protocol::CursorShapeInfo> cursor_shape( 317 scoped_ptr<MouseCursorShape>(new MouseCursorShape(cursor_shape)));
318 new protocol::CursorShapeInfo());
319 if (!cursor_shape->ParseFromString(serialized_cursor_shape)) {
320 LOG(ERROR) << "Failed to parse protocol::CursorShapeInfo.";
321 return;
322 }
323
324 PostCursorShape(cursor_shape.Pass());
325 } 318 }
326 319
327 void DesktopSessionProxy::OnInjectClipboardEvent( 320 void DesktopSessionProxy::OnInjectClipboardEvent(
328 const std::string& serialized_event) { 321 const std::string& serialized_event) {
329 DCHECK(caller_task_runner_->BelongsToCurrentThread()); 322 DCHECK(caller_task_runner_->BelongsToCurrentThread());
330 323
331 protocol::ClipboardEvent event; 324 protocol::ClipboardEvent event;
332 if (!event.ParseFromString(serialized_event)) { 325 if (!event.ParseFromString(serialized_event)) {
333 LOG(ERROR) << "Failed to parse protocol::ClipboardEvent."; 326 LOG(ERROR) << "Failed to parse protocol::ClipboardEvent.";
334 return; 327 return;
(...skipping 10 matching lines...) Expand all
345 FROM_HERE, base::Bind(&DesktopSessionProxy::PostCaptureCompleted, 338 FROM_HERE, base::Bind(&DesktopSessionProxy::PostCaptureCompleted,
346 this, capture_data)); 339 this, capture_data));
347 return; 340 return;
348 } 341 }
349 342
350 if (video_capturer_) 343 if (video_capturer_)
351 video_capturer_->OnCaptureCompleted(capture_data); 344 video_capturer_->OnCaptureCompleted(capture_data);
352 } 345 }
353 346
354 void DesktopSessionProxy::PostCursorShape( 347 void DesktopSessionProxy::PostCursorShape(
355 scoped_ptr<protocol::CursorShapeInfo> cursor_shape) { 348 scoped_ptr<MouseCursorShape> cursor_shape) {
356 if (!video_capture_task_runner_->BelongsToCurrentThread()) { 349 if (!video_capture_task_runner_->BelongsToCurrentThread()) {
357 video_capture_task_runner_->PostTask( 350 video_capture_task_runner_->PostTask(
358 FROM_HERE, base::Bind(&DesktopSessionProxy::PostCursorShape, 351 FROM_HERE, base::Bind(&DesktopSessionProxy::PostCursorShape,
359 this, base::Passed(&cursor_shape))); 352 this, base::Passed(&cursor_shape)));
360 return; 353 return;
361 } 354 }
362 355
363 if (video_capturer_) 356 if (video_capturer_)
364 video_capturer_->OnCursorShapeChanged(cursor_shape.Pass()); 357 video_capturer_->OnCursorShapeChanged(cursor_shape.Pass());
365 } 358 }
366 359
367 void DesktopSessionProxy::SendToDesktop(IPC::Message* message) { 360 void DesktopSessionProxy::SendToDesktop(IPC::Message* message) {
368 DCHECK(caller_task_runner_->BelongsToCurrentThread()); 361 DCHECK(caller_task_runner_->BelongsToCurrentThread());
369 362
370 if (desktop_channel_) { 363 if (desktop_channel_) {
371 desktop_channel_->Send(message); 364 desktop_channel_->Send(message);
372 } else { 365 } else {
373 delete message; 366 delete message;
374 } 367 }
375 } 368 }
376 369
377 } // namespace remoting 370 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/desktop_session_proxy.h ('k') | remoting/host/differ.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698