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 799 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
810 CountPacket(&counters->transmitted, packet); | 810 CountPacket(&counters->transmitted, packet); |
811 | 811 |
812 if (rtp_stats_callback_) | 812 if (rtp_stats_callback_) |
813 rtp_stats_callback_->DataCountersUpdated(*counters, packet.Ssrc()); | 813 rtp_stats_callback_->DataCountersUpdated(*counters, packet.Ssrc()); |
814 } | 814 } |
815 | 815 |
816 bool RTPSender::IsFecPacket(const RtpPacketToSend& packet) const { | 816 bool RTPSender::IsFecPacket(const RtpPacketToSend& packet) const { |
817 if (!video_) { | 817 if (!video_) { |
818 return false; | 818 return false; |
819 } | 819 } |
820 bool fec_enabled; | |
821 int pt_red; | 820 int pt_red; |
822 int pt_fec; | 821 int pt_fec; |
823 video_->UlpfecConfig(&fec_enabled, &pt_red, &pt_fec); | 822 video_->UlpfecConfig(&pt_red, &pt_fec); |
| 823 const bool fec_enabled = (pt_fec != -1); |
824 return fec_enabled && static_cast<int>(packet.PayloadType()) == pt_red && | 824 return fec_enabled && static_cast<int>(packet.PayloadType()) == pt_red && |
825 static_cast<int>(packet.payload()[0]) == pt_fec; | 825 static_cast<int>(packet.payload()[0]) == pt_fec; |
826 } | 826 } |
827 | 827 |
828 size_t RTPSender::TimeToSendPadding(size_t bytes, int probe_cluster_id) { | 828 size_t RTPSender::TimeToSendPadding(size_t bytes, int probe_cluster_id) { |
829 if (audio_configured_ || bytes == 0) | 829 if (audio_configured_ || bytes == 0) |
830 return 0; | 830 return 0; |
831 size_t bytes_sent = TrySendRedundantPayloads(bytes, probe_cluster_id); | 831 size_t bytes_sent = TrySendRedundantPayloads(bytes, probe_cluster_id); |
832 if (bytes_sent < bytes) | 832 if (bytes_sent < bytes) |
833 bytes_sent += SendPadData(bytes - bytes_sent, probe_cluster_id); | 833 bytes_sent += SendPadData(bytes - bytes_sent, probe_cluster_id); |
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1190 | 1190 |
1191 int32_t RTPSender::SetAudioLevel(uint8_t level_d_bov) { | 1191 int32_t RTPSender::SetAudioLevel(uint8_t level_d_bov) { |
1192 return audio_->SetAudioLevel(level_d_bov); | 1192 return audio_->SetAudioLevel(level_d_bov); |
1193 } | 1193 } |
1194 | 1194 |
1195 RtpVideoCodecTypes RTPSender::VideoCodecType() const { | 1195 RtpVideoCodecTypes RTPSender::VideoCodecType() const { |
1196 assert(!audio_configured_ && "Sender is an audio stream!"); | 1196 assert(!audio_configured_ && "Sender is an audio stream!"); |
1197 return video_->VideoCodecType(); | 1197 return video_->VideoCodecType(); |
1198 } | 1198 } |
1199 | 1199 |
1200 void RTPSender::SetUlpfecConfig(bool enabled, | 1200 void RTPSender::SetUlpfecConfig(int red_payload_type, int ulpfec_payload_type) { |
1201 int red_payload_type, | |
1202 int ulpfec_payload_type) { | |
1203 RTC_DCHECK(!audio_configured_); | 1201 RTC_DCHECK(!audio_configured_); |
1204 video_->SetUlpfecConfig(enabled, red_payload_type, ulpfec_payload_type); | 1202 video_->SetUlpfecConfig(red_payload_type, ulpfec_payload_type); |
1205 } | 1203 } |
1206 | 1204 |
1207 int32_t RTPSender::SetFecParameters( | 1205 int32_t RTPSender::SetFecParameters( |
1208 const FecProtectionParams *delta_params, | 1206 const FecProtectionParams *delta_params, |
1209 const FecProtectionParams *key_params) { | 1207 const FecProtectionParams *key_params) { |
1210 if (audio_configured_) { | 1208 if (audio_configured_) { |
1211 return -1; | 1209 return -1; |
1212 } | 1210 } |
1213 video_->SetFecParameters(delta_params, key_params); | 1211 video_->SetFecParameters(delta_params, key_params); |
1214 return 0; | 1212 return 0; |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1306 rtc::CritScope lock(&send_critsect_); | 1304 rtc::CritScope lock(&send_critsect_); |
1307 | 1305 |
1308 RtpState state; | 1306 RtpState state; |
1309 state.sequence_number = sequence_number_rtx_; | 1307 state.sequence_number = sequence_number_rtx_; |
1310 state.start_timestamp = timestamp_offset_; | 1308 state.start_timestamp = timestamp_offset_; |
1311 | 1309 |
1312 return state; | 1310 return state; |
1313 } | 1311 } |
1314 | 1312 |
1315 } // namespace webrtc | 1313 } // namespace webrtc |
OLD | NEW |