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

Side by Side Diff: media/cast/transport/pacing/paced_sender.cc

Issue 302913004: Cast: cancel re-sending if a later nack packet says the receiver doesn't want it anymore (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 6 months 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "media/cast/transport/pacing/paced_sender.h" 5 #include "media/cast/transport/pacing/paced_sender.h"
6 6
7 #include "base/big_endian.h" 7 #include "base/big_endian.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 10
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 packet, 97 packet,
98 base::Bind(&PacedSender::SendStoredPackets, 98 base::Bind(&PacedSender::SendStoredPackets,
99 weak_factory_.GetWeakPtr()))) { 99 weak_factory_.GetWeakPtr()))) {
100 state_ = State_TransportBlocked; 100 state_ = State_TransportBlocked;
101 } 101 }
102 102
103 } 103 }
104 return true; 104 return true;
105 } 105 }
106 106
107 void PacedSender::CancelSendingPacket(const PacketKey& packet_key) {
108 packet_list_.erase(packet_key);
109 }
110
107 PacketRef PacedSender::GetNextPacket(PacketType* packet_type) { 111 PacketRef PacedSender::GetNextPacket(PacketType* packet_type) {
108 std::map<PacketKey, std::pair<PacketType, PacketRef> >::iterator i; 112 std::map<PacketKey, std::pair<PacketType, PacketRef> >::iterator i;
109 i = packet_list_.begin(); 113 i = packet_list_.begin();
110 DCHECK(i != packet_list_.end()); 114 DCHECK(i != packet_list_.end());
111 *packet_type = i->second.first; 115 *packet_type = i->second.first;
112 PacketRef ret = i->second.second; 116 PacketRef ret = i->second.second;
113 packet_list_.erase(i); 117 packet_list_.erase(i);
114 return ret; 118 return ret;
115 } 119 }
116 120
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 CastLoggingEvent event = retransmit ? 227 CastLoggingEvent event = retransmit ?
224 PACKET_RETRANSMITTED : PACKET_SENT_TO_NETWORK; 228 PACKET_RETRANSMITTED : PACKET_SENT_TO_NETWORK;
225 EventMediaType media_type = is_audio ? AUDIO_EVENT : VIDEO_EVENT; 229 EventMediaType media_type = is_audio ? AUDIO_EVENT : VIDEO_EVENT;
226 logging_->InsertSinglePacketEvent(clock_->NowTicks(), event, media_type, 230 logging_->InsertSinglePacketEvent(clock_->NowTicks(), event, media_type,
227 packet); 231 packet);
228 } 232 }
229 233
230 } // namespace transport 234 } // namespace transport
231 } // namespace cast 235 } // namespace cast
232 } // namespace media 236 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698