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/desktop_session_agent.h" | 5 #include "remoting/host/desktop_session_agent.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
319 base::Bind(&DesktopSessionAgent::SendToNetwork, this)))); | 319 base::Bind(&DesktopSessionAgent::SendToNetwork, this)))); |
320 mouse_cursor_monitor_ = desktop_environment_->CreateMouseCursorMonitor(); | 320 mouse_cursor_monitor_ = desktop_environment_->CreateMouseCursorMonitor(); |
321 mouse_cursor_monitor_->Init(this, webrtc::MouseCursorMonitor::SHAPE_ONLY); | 321 mouse_cursor_monitor_->Init(this, webrtc::MouseCursorMonitor::SHAPE_ONLY); |
322 } | 322 } |
323 | 323 |
324 void DesktopSessionAgent::OnCaptureCompleted(webrtc::DesktopFrame* frame) { | 324 void DesktopSessionAgent::OnCaptureCompleted(webrtc::DesktopFrame* frame) { |
325 DCHECK(caller_task_runner_->BelongsToCurrentThread()); | 325 DCHECK(caller_task_runner_->BelongsToCurrentThread()); |
326 | 326 |
327 last_frame_.reset(frame); | 327 last_frame_.reset(frame); |
328 | 328 |
329 if (!frame) { | |
Sergey Ulanov
2016/05/19 22:23:52
I don't think we can just ignore the error here. T
Hzj_jie
2016/05/20 00:11:15
Yes, I paused this review because of the screen fr
| |
330 return; | |
331 } | |
332 | |
329 current_size_ = frame->size(); | 333 current_size_ = frame->size(); |
330 | 334 |
331 // Serialize webrtc::DesktopFrame. | 335 // Serialize webrtc::DesktopFrame. |
332 SerializedDesktopFrame serialized_frame; | 336 SerializedDesktopFrame serialized_frame; |
333 serialized_frame.shared_buffer_id = frame->shared_memory()->id(); | 337 serialized_frame.shared_buffer_id = frame->shared_memory()->id(); |
334 serialized_frame.bytes_per_row = frame->stride(); | 338 serialized_frame.bytes_per_row = frame->stride(); |
335 serialized_frame.dimensions = frame->size(); | 339 serialized_frame.dimensions = frame->size(); |
336 serialized_frame.capture_time_ms = frame->capture_time_ms(); | 340 serialized_frame.capture_time_ms = frame->capture_time_ms(); |
337 serialized_frame.dpi = frame->dpi(); | 341 serialized_frame.dpi = frame->dpi(); |
338 for (webrtc::DesktopRegion::Iterator i(frame->updated_region()); | 342 for (webrtc::DesktopRegion::Iterator i(frame->updated_region()); |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
578 } | 582 } |
579 } | 583 } |
580 | 584 |
581 void DesktopSessionAgent::StopAudioCapturer() { | 585 void DesktopSessionAgent::StopAudioCapturer() { |
582 DCHECK(audio_capture_task_runner_->BelongsToCurrentThread()); | 586 DCHECK(audio_capture_task_runner_->BelongsToCurrentThread()); |
583 | 587 |
584 audio_capturer_.reset(); | 588 audio_capturer_.reset(); |
585 } | 589 } |
586 | 590 |
587 } // namespace remoting | 591 } // namespace remoting |
OLD | NEW |