| 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 800 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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; | 820 bool fec_enabled; |
| 821 uint8_t pt_red; | 821 int pt_red; |
| 822 uint8_t pt_fec; | 822 int pt_fec; |
| 823 video_->GenericFECStatus(&fec_enabled, &pt_red, &pt_fec); | 823 video_->UlpfecConfig(&fec_enabled, &pt_red, &pt_fec); |
| 824 return fec_enabled && packet.PayloadType() == pt_red && | 824 return fec_enabled && static_cast<int>(packet.PayloadType()) == pt_red && |
| 825 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); |
| 834 return bytes_sent; | 834 return bytes_sent; |
| 835 } | 835 } |
| (...skipping 354 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::SetGenericFECStatus(bool enable, | 1200 void RTPSender::SetUlpfecConfig(bool enabled, |
| 1201 uint8_t payload_type_red, | 1201 int red_payload_type, |
| 1202 uint8_t payload_type_fec) { | 1202 int ulpfec_payload_type) { |
| 1203 RTC_DCHECK(!audio_configured_); | 1203 RTC_DCHECK(!audio_configured_); |
| 1204 video_->SetGenericFECStatus(enable, payload_type_red, payload_type_fec); | 1204 video_->SetUlpfecConfig(enabled, red_payload_type, ulpfec_payload_type); |
| 1205 } | |
| 1206 | |
| 1207 void RTPSender::GenericFECStatus(bool* enable, | |
| 1208 uint8_t* payload_type_red, | |
| 1209 uint8_t* payload_type_fec) const { | |
| 1210 RTC_DCHECK(!audio_configured_); | |
| 1211 video_->GenericFECStatus(enable, payload_type_red, payload_type_fec); | |
| 1212 } | 1205 } |
| 1213 | 1206 |
| 1214 int32_t RTPSender::SetFecParameters( | 1207 int32_t RTPSender::SetFecParameters( |
| 1215 const FecProtectionParams *delta_params, | 1208 const FecProtectionParams *delta_params, |
| 1216 const FecProtectionParams *key_params) { | 1209 const FecProtectionParams *key_params) { |
| 1217 if (audio_configured_) { | 1210 if (audio_configured_) { |
| 1218 return -1; | 1211 return -1; |
| 1219 } | 1212 } |
| 1220 video_->SetFecParameters(delta_params, key_params); | 1213 video_->SetFecParameters(delta_params, key_params); |
| 1221 return 0; | 1214 return 0; |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1313 rtc::CritScope lock(&send_critsect_); | 1306 rtc::CritScope lock(&send_critsect_); |
| 1314 | 1307 |
| 1315 RtpState state; | 1308 RtpState state; |
| 1316 state.sequence_number = sequence_number_rtx_; | 1309 state.sequence_number = sequence_number_rtx_; |
| 1317 state.start_timestamp = timestamp_offset_; | 1310 state.start_timestamp = timestamp_offset_; |
| 1318 | 1311 |
| 1319 return state; | 1312 return state; |
| 1320 } | 1313 } |
| 1321 | 1314 |
| 1322 } // namespace webrtc | 1315 } // namespace webrtc |
| OLD | NEW |