OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |