OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/net/rtp/rtp_sender.h" | 5 #include "media/cast/net/rtp/rtp_sender.h" |
6 | 6 |
7 #include "base/big_endian.h" | 7 #include "base/big_endian.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/rand_util.h" | 9 #include "base/rand_util.h" |
10 #include "media/cast/constants.h" | 10 #include "media/cast/constants.h" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 bool resend_last = missing_packet_set.find(kRtcpCastLastPacket) != | 70 bool resend_last = missing_packet_set.find(kRtcpCastLastPacket) != |
71 missing_packet_set.end(); | 71 missing_packet_set.end(); |
72 | 72 |
73 const SendPacketVector* stored_packets = storage_.GetFrame8(frame_id); | 73 const SendPacketVector* stored_packets = storage_.GetFrame8(frame_id); |
74 if (!stored_packets) | 74 if (!stored_packets) |
75 continue; | 75 continue; |
76 | 76 |
77 for (SendPacketVector::const_iterator it = stored_packets->begin(); | 77 for (SendPacketVector::const_iterator it = stored_packets->begin(); |
78 it != stored_packets->end(); ++it) { | 78 it != stored_packets->end(); ++it) { |
79 const PacketKey& packet_key = it->first; | 79 const PacketKey& packet_key = it->first; |
80 const uint16 packet_id = packet_key.second.second; | 80 const uint16 packet_id = packet_key.packet_id; |
81 | 81 |
82 // Should we resend the packet? | 82 // Should we resend the packet? |
83 bool resend = resend_all; | 83 bool resend = resend_all; |
84 | 84 |
85 // Should we resend it because it's in the missing_packet_set? | 85 // Should we resend it because it's in the missing_packet_set? |
86 if (!resend && | 86 if (!resend && |
87 missing_packet_set.find(packet_id) != missing_packet_set.end()) { | 87 missing_packet_set.find(packet_id) != missing_packet_set.end()) { |
88 resend = true; | 88 resend = true; |
89 } | 89 } |
90 | 90 |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 int64 RtpSender::GetLastByteSentForFrame(uint32 frame_id) { | 154 int64 RtpSender::GetLastByteSentForFrame(uint32 frame_id) { |
155 const SendPacketVector* stored_packets = storage_.GetFrame8(frame_id & 0xFF); | 155 const SendPacketVector* stored_packets = storage_.GetFrame8(frame_id & 0xFF); |
156 if (!stored_packets) | 156 if (!stored_packets) |
157 return 0; | 157 return 0; |
158 PacketKey last_packet_key = stored_packets->rbegin()->first; | 158 PacketKey last_packet_key = stored_packets->rbegin()->first; |
159 return transport_->GetLastByteSentForPacket(last_packet_key); | 159 return transport_->GetLastByteSentForPacket(last_packet_key); |
160 } | 160 } |
161 | 161 |
162 } // namespace cast | 162 } // namespace cast |
163 } // namespace media | 163 } // namespace media |
OLD | NEW |