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 769 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
780 CountPacket(&counters->retransmitted, packet); | 780 CountPacket(&counters->retransmitted, packet); |
781 nack_bitrate_sent_.Update(packet.size(), now_ms); | 781 nack_bitrate_sent_.Update(packet.size(), now_ms); |
782 } | 782 } |
783 CountPacket(&counters->transmitted, packet); | 783 CountPacket(&counters->transmitted, packet); |
784 | 784 |
785 if (rtp_stats_callback_) | 785 if (rtp_stats_callback_) |
786 rtp_stats_callback_->DataCountersUpdated(*counters, packet.Ssrc()); | 786 rtp_stats_callback_->DataCountersUpdated(*counters, packet.Ssrc()); |
787 } | 787 } |
788 | 788 |
789 bool RTPSender::IsFecPacket(const RtpPacketToSend& packet) const { | 789 bool RTPSender::IsFecPacket(const RtpPacketToSend& packet) const { |
790 if (!video_) { | 790 if (!video_) |
791 return false; | 791 return false; |
792 } | 792 |
| 793 // FlexFEC. |
| 794 if (packet.Ssrc() == FlexfecSsrc()) |
| 795 return true; |
| 796 |
| 797 // RED+ULPFEC. |
793 int pt_red; | 798 int pt_red; |
794 int pt_fec; | 799 int pt_fec; |
795 video_->GetUlpfecConfig(&pt_red, &pt_fec); | 800 video_->GetUlpfecConfig(&pt_red, &pt_fec); |
796 const bool fec_enabled = (pt_fec != -1); | 801 return static_cast<int>(packet.PayloadType()) == pt_red && |
797 return fec_enabled && static_cast<int>(packet.PayloadType()) == pt_red && | |
798 static_cast<int>(packet.payload()[0]) == pt_fec; | 802 static_cast<int>(packet.payload()[0]) == pt_fec; |
799 } | 803 } |
800 | 804 |
801 size_t RTPSender::TimeToSendPadding(size_t bytes, int probe_cluster_id) { | 805 size_t RTPSender::TimeToSendPadding(size_t bytes, int probe_cluster_id) { |
802 if (audio_configured_ || bytes == 0) | 806 if (audio_configured_ || bytes == 0) |
803 return 0; | 807 return 0; |
804 size_t bytes_sent = TrySendRedundantPayloads(bytes, probe_cluster_id); | 808 size_t bytes_sent = TrySendRedundantPayloads(bytes, probe_cluster_id); |
805 if (bytes_sent < bytes) | 809 if (bytes_sent < bytes) |
806 bytes_sent += SendPadData(bytes - bytes_sent, probe_cluster_id); | 810 bytes_sent += SendPadData(bytes - bytes_sent, probe_cluster_id); |
807 return bytes_sent; | 811 return bytes_sent; |
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1238 rtc::CritScope lock(&send_critsect_); | 1242 rtc::CritScope lock(&send_critsect_); |
1239 | 1243 |
1240 RtpState state; | 1244 RtpState state; |
1241 state.sequence_number = sequence_number_rtx_; | 1245 state.sequence_number = sequence_number_rtx_; |
1242 state.start_timestamp = timestamp_offset_; | 1246 state.start_timestamp = timestamp_offset_; |
1243 | 1247 |
1244 return state; | 1248 return state; |
1245 } | 1249 } |
1246 | 1250 |
1247 } // namespace webrtc | 1251 } // namespace webrtc |
OLD | NEW |