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

Side by Side Diff: webrtc/modules/rtp_rtcp/source/rtp_sender.cc

Issue 2496113003: Update RTPSender::IsFecPacket for FlexFEC. (Closed)
Patch Set: Created 4 years, 1 month 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 789 matching lines...) Expand 10 before | Expand all | Expand 10 after
800 CountPacket(&counters->retransmitted, packet); 800 CountPacket(&counters->retransmitted, packet);
801 nack_bitrate_sent_.Update(packet.size(), now_ms); 801 nack_bitrate_sent_.Update(packet.size(), now_ms);
802 } 802 }
803 CountPacket(&counters->transmitted, packet); 803 CountPacket(&counters->transmitted, packet);
804 804
805 if (rtp_stats_callback_) 805 if (rtp_stats_callback_)
806 rtp_stats_callback_->DataCountersUpdated(*counters, packet.Ssrc()); 806 rtp_stats_callback_->DataCountersUpdated(*counters, packet.Ssrc());
807 } 807 }
808 808
809 bool RTPSender::IsFecPacket(const RtpPacketToSend& packet) const { 809 bool RTPSender::IsFecPacket(const RtpPacketToSend& packet) const {
810 if (!video_) { 810 if (!video_)
811 return false; 811 return false;
812 } 812
813 // FlexFEC.
814 if (packet.Ssrc() == FlexfecSsrc())
815 return true;
816
817 // RED+ULPFEC.
813 int pt_red; 818 int pt_red;
814 int pt_fec; 819 int pt_fec;
815 video_->GetUlpfecConfig(&pt_red, &pt_fec); 820 video_->GetUlpfecConfig(&pt_red, &pt_fec);
816 const bool fec_enabled = (pt_fec != -1); 821 return static_cast<int>(packet.PayloadType()) == pt_red &&
brandtr 2016/11/14 08:01:34 This was weird. If for some reason a FEC packet wa
danilchap 2016/11/14 10:23:39 look like leftover from older refactorings, agree
817 return fec_enabled && static_cast<int>(packet.PayloadType()) == pt_red &&
818 static_cast<int>(packet.payload()[0]) == pt_fec; 822 static_cast<int>(packet.payload()[0]) == pt_fec;
819 } 823 }
820 824
821 size_t RTPSender::TimeToSendPadding(size_t bytes, int probe_cluster_id) { 825 size_t RTPSender::TimeToSendPadding(size_t bytes, int probe_cluster_id) {
822 if (audio_configured_ || bytes == 0) 826 if (audio_configured_ || bytes == 0)
823 return 0; 827 return 0;
824 size_t bytes_sent = TrySendRedundantPayloads(bytes, probe_cluster_id); 828 size_t bytes_sent = TrySendRedundantPayloads(bytes, probe_cluster_id);
825 if (bytes_sent < bytes) 829 if (bytes_sent < bytes)
826 bytes_sent += SendPadData(bytes - bytes_sent, probe_cluster_id); 830 bytes_sent += SendPadData(bytes - bytes_sent, probe_cluster_id);
827 return bytes_sent; 831 return bytes_sent;
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after
1277 rtc::CritScope lock(&send_critsect_); 1281 rtc::CritScope lock(&send_critsect_);
1278 1282
1279 RtpState state; 1283 RtpState state;
1280 state.sequence_number = sequence_number_rtx_; 1284 state.sequence_number = sequence_number_rtx_;
1281 state.start_timestamp = timestamp_offset_; 1285 state.start_timestamp = timestamp_offset_;
1282 1286
1283 return state; 1287 return state;
1284 } 1288 }
1285 1289
1286 } // namespace webrtc 1290 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698