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/video_scheduler.h" | 5 #include "remoting/host/video_scheduler.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 if (!capturer_) | 115 if (!capturer_) |
116 return; | 116 return; |
117 | 117 |
118 scoped_ptr<protocol::CursorShapeInfo> cursor_proto( | 118 scoped_ptr<protocol::CursorShapeInfo> cursor_proto( |
119 new protocol::CursorShapeInfo()); | 119 new protocol::CursorShapeInfo()); |
120 cursor_proto->set_width(cursor->image()->size().width()); | 120 cursor_proto->set_width(cursor->image()->size().width()); |
121 cursor_proto->set_height(cursor->image()->size().height()); | 121 cursor_proto->set_height(cursor->image()->size().height()); |
122 cursor_proto->set_hotspot_x(cursor->hotspot().x()); | 122 cursor_proto->set_hotspot_x(cursor->hotspot().x()); |
123 cursor_proto->set_hotspot_y(cursor->hotspot().y()); | 123 cursor_proto->set_hotspot_y(cursor->hotspot().y()); |
124 | 124 |
125 std::string data; | 125 cursor_proto->set_data(std::string()); |
126 uint8_t* current_row = cursor->image()->data(); | 126 uint8_t* current_row = cursor->image()->data(); |
127 for (int y = 0; y < cursor->image()->size().height(); ++y) { | 127 for (int y = 0; y < cursor->image()->size().height(); ++y) { |
128 cursor_proto->mutable_data()->append( | 128 cursor_proto->mutable_data()->append( |
129 current_row, | 129 current_row, |
130 current_row + cursor->image()->size().width() * | 130 current_row + cursor->image()->size().width() * |
131 webrtc::DesktopFrame::kBytesPerPixel); | 131 webrtc::DesktopFrame::kBytesPerPixel); |
132 current_row += cursor->image()->stride(); | 132 current_row += cursor->image()->stride(); |
133 } | 133 } |
134 | 134 |
135 network_task_runner_->PostTask( | 135 network_task_runner_->PostTask( |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 frame.reset(); | 398 frame.reset(); |
399 | 399 |
400 scheduler_.RecordEncodeTime( | 400 scheduler_.RecordEncodeTime( |
401 base::TimeDelta::FromMilliseconds(packet->encode_time_ms())); | 401 base::TimeDelta::FromMilliseconds(packet->encode_time_ms())); |
402 network_task_runner_->PostTask( | 402 network_task_runner_->PostTask( |
403 FROM_HERE, base::Bind(&VideoScheduler::SendVideoPacket, this, | 403 FROM_HERE, base::Bind(&VideoScheduler::SendVideoPacket, this, |
404 base::Passed(&packet))); | 404 base::Passed(&packet))); |
405 } | 405 } |
406 | 406 |
407 } // namespace remoting | 407 } // namespace remoting |
OLD | NEW |