| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/screen_recorder.h" | 5 #include "remoting/host/screen_recorder.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 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 i < connections_.end(); ++i) { | 248 i < connections_.end(); ++i) { |
| 249 base::Closure done_task; | 249 base::Closure done_task; |
| 250 | 250 |
| 251 // Call FrameSentCallback() only for the last packet in the first | 251 // Call FrameSentCallback() only for the last packet in the first |
| 252 // connection. | 252 // connection. |
| 253 if (last && i == connections_.begin()) { | 253 if (last && i == connections_.begin()) { |
| 254 done_task = base::Bind(&ScreenRecorder::FrameSentCallback, this, packet); | 254 done_task = base::Bind(&ScreenRecorder::FrameSentCallback, this, packet); |
| 255 } else { | 255 } else { |
| 256 // TODO(hclam): Fix this code since it causes multiple deletion if there's | 256 // TODO(hclam): Fix this code since it causes multiple deletion if there's |
| 257 // more than one connection. | 257 // more than one connection. |
| 258 done_task = base::Bind(&DeletePointer<VideoPacket>, packet); | 258 done_task = base::Bind(&base::DeletePointer<VideoPacket>, packet); |
| 259 } | 259 } |
| 260 | 260 |
| 261 (*i)->video_stub()->ProcessVideoPacket(packet, done_task); | 261 (*i)->video_stub()->ProcessVideoPacket(packet, done_task); |
| 262 } | 262 } |
| 263 } | 263 } |
| 264 | 264 |
| 265 void ScreenRecorder::FrameSentCallback(VideoPacket* packet) { | 265 void ScreenRecorder::FrameSentCallback(VideoPacket* packet) { |
| 266 delete packet; | 266 delete packet; |
| 267 | 267 |
| 268 if (network_stopped_) | 268 if (network_stopped_) |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 static_cast<int>(encode_time.InMilliseconds()); | 335 static_cast<int>(encode_time.InMilliseconds()); |
| 336 packet->set_encode_time_ms(encode_time_ms); | 336 packet->set_encode_time_ms(encode_time_ms); |
| 337 scheduler_.RecordEncodeTime(encode_time); | 337 scheduler_.RecordEncodeTime(encode_time); |
| 338 } | 338 } |
| 339 | 339 |
| 340 network_loop_->PostTask( | 340 network_loop_->PostTask( |
| 341 FROM_HERE, base::Bind(&ScreenRecorder::DoSendVideoPacket, this, packet)); | 341 FROM_HERE, base::Bind(&ScreenRecorder::DoSendVideoPacket, this, packet)); |
| 342 } | 342 } |
| 343 | 343 |
| 344 } // namespace remoting | 344 } // namespace remoting |
| OLD | NEW |