OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/protocol/video_frame_pump.h" | 5 #include "remoting/protocol/video_frame_pump.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <memory> | 8 #include <memory> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 | 231 |
232 void VideoFramePump::OnVideoPacketSent() { | 232 void VideoFramePump::OnVideoPacketSent() { |
233 DCHECK(thread_checker_.CalledOnValidThread()); | 233 DCHECK(thread_checker_.CalledOnValidThread()); |
234 | 234 |
235 send_pending_ = false; | 235 send_pending_ = false; |
236 capture_scheduler_.OnFrameSent(); | 236 capture_scheduler_.OnFrameSent(); |
237 keep_alive_timer_.Reset(); | 237 keep_alive_timer_.Reset(); |
238 | 238 |
239 // Send next packet if any. | 239 // Send next packet if any. |
240 if (!pending_packets_.empty()) { | 240 if (!pending_packets_.empty()) { |
241 std::unique_ptr<PacketWithTimestamps> next(pending_packets_.front()); | 241 std::unique_ptr<PacketWithTimestamps> next = |
242 pending_packets_.weak_erase(pending_packets_.begin()); | 242 std::move(pending_packets_.front()); |
| 243 pending_packets_.erase(pending_packets_.begin()); |
243 SendPacket(std::move(next)); | 244 SendPacket(std::move(next)); |
244 } | 245 } |
245 } | 246 } |
246 | 247 |
247 void VideoFramePump::SendKeepAlivePacket() { | 248 void VideoFramePump::SendKeepAlivePacket() { |
248 DCHECK(thread_checker_.CalledOnValidThread()); | 249 DCHECK(thread_checker_.CalledOnValidThread()); |
249 | 250 |
250 video_stub_->ProcessVideoPacket( | 251 video_stub_->ProcessVideoPacket( |
251 base::MakeUnique<VideoPacket>(), | 252 base::MakeUnique<VideoPacket>(), |
252 base::Bind(&VideoFramePump::OnKeepAlivePacketSent, | 253 base::Bind(&VideoFramePump::OnKeepAlivePacketSent, |
253 weak_factory_.GetWeakPtr())); | 254 weak_factory_.GetWeakPtr())); |
254 } | 255 } |
255 | 256 |
256 void VideoFramePump::OnKeepAlivePacketSent() { | 257 void VideoFramePump::OnKeepAlivePacketSent() { |
257 DCHECK(thread_checker_.CalledOnValidThread()); | 258 DCHECK(thread_checker_.CalledOnValidThread()); |
258 | 259 |
259 keep_alive_timer_.Reset(); | 260 keep_alive_timer_.Reset(); |
260 } | 261 } |
261 | 262 |
262 } // namespace protocol | 263 } // namespace protocol |
263 } // namespace remoting | 264 } // namespace remoting |
OLD | NEW |