OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
191 | 191 |
192 if (protect_media_packet) | 192 if (protect_media_packet) |
193 flexfec_sender_->AddRtpPacketAndGenerateFec(*media_packet); | 193 flexfec_sender_->AddRtpPacketAndGenerateFec(*media_packet); |
194 | 194 |
195 SendVideoPacket(std::move(media_packet), media_packet_storage); | 195 SendVideoPacket(std::move(media_packet), media_packet_storage); |
196 | 196 |
197 if (flexfec_sender_->FecAvailable()) { | 197 if (flexfec_sender_->FecAvailable()) { |
198 std::vector<std::unique_ptr<RtpPacketToSend>> fec_packets = | 198 std::vector<std::unique_ptr<RtpPacketToSend>> fec_packets = |
199 flexfec_sender_->GetFecPackets(); | 199 flexfec_sender_->GetFecPackets(); |
200 for (auto& fec_packet : fec_packets) { | 200 for (auto& fec_packet : fec_packets) { |
201 size_t packet_length = fec_packet->size(); | |
201 uint32_t timestamp = fec_packet->Timestamp(); | 202 uint32_t timestamp = fec_packet->Timestamp(); |
202 uint16_t seq_num = fec_packet->SequenceNumber(); | 203 uint16_t seq_num = fec_packet->SequenceNumber(); |
203 if (rtp_sender_->SendToNetwork(std::move(fec_packet), kDontRetransmit, | 204 if (rtp_sender_->SendToNetwork(std::move(fec_packet), kDontRetransmit, |
204 RtpPacketSender::kLowPriority)) { | 205 RtpPacketSender::kLowPriority)) { |
205 // TODO(brandtr): Wire up stats here. | 206 rtc::CritScope cs(&stats_crit_); |
207 fec_bitrate_.Update(packet_length, clock_->TimeInMilliseconds()); | |
danilchap
2017/01/23 12:42:39
add/extend a unittest for this.
brandtr
2017/01/24 09:42:27
Done.
| |
206 TRACE_EVENT_INSTANT2(TRACE_DISABLED_BY_DEFAULT("webrtc_rtp"), | 208 TRACE_EVENT_INSTANT2(TRACE_DISABLED_BY_DEFAULT("webrtc_rtp"), |
207 "Video::PacketFlexfec", "timestamp", timestamp, | 209 "Video::PacketFlexfec", "timestamp", timestamp, |
208 "seqnum", seq_num); | 210 "seqnum", seq_num); |
209 } else { | 211 } else { |
210 LOG(LS_WARNING) << "Failed to send FlexFEC packet " << seq_num; | 212 LOG(LS_WARNING) << "Failed to send FlexFEC packet " << seq_num; |
211 } | 213 } |
212 } | 214 } |
213 } | 215 } |
214 } | 216 } |
215 | 217 |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
415 rtc::CritScope cs(&crit_); | 417 rtc::CritScope cs(&crit_); |
416 return retransmission_settings_; | 418 return retransmission_settings_; |
417 } | 419 } |
418 | 420 |
419 void RTPSenderVideo::SetSelectiveRetransmissions(uint8_t settings) { | 421 void RTPSenderVideo::SetSelectiveRetransmissions(uint8_t settings) { |
420 rtc::CritScope cs(&crit_); | 422 rtc::CritScope cs(&crit_); |
421 retransmission_settings_ = settings; | 423 retransmission_settings_ = settings; |
422 } | 424 } |
423 | 425 |
424 } // namespace webrtc | 426 } // namespace webrtc |
OLD | NEW |