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 772 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
783 | 783 |
784 if (rtp_stats_callback_) | 784 if (rtp_stats_callback_) |
785 rtp_stats_callback_->DataCountersUpdated(*counters, packet.Ssrc()); | 785 rtp_stats_callback_->DataCountersUpdated(*counters, packet.Ssrc()); |
786 } | 786 } |
787 | 787 |
788 bool RTPSender::IsFecPacket(const RtpPacketToSend& packet) const { | 788 bool RTPSender::IsFecPacket(const RtpPacketToSend& packet) const { |
789 if (!video_) { | 789 if (!video_) { |
790 return false; | 790 return false; |
791 } | 791 } |
792 bool fec_enabled; | 792 bool fec_enabled; |
793 uint8_t pt_red; | 793 int pt_red; |
794 uint8_t pt_fec; | 794 int pt_fec; |
795 video_->GenericFECStatus(&fec_enabled, &pt_red, &pt_fec); | 795 video_->UlpfecConfig(&fec_enabled, &pt_red, &pt_fec); |
796 return fec_enabled && packet.PayloadType() == pt_red && | 796 return fec_enabled && static_cast<int>(packet.PayloadType()) == pt_red && |
797 packet.payload()[0] == pt_fec; | 797 static_cast<int>(packet.payload()[0]) == pt_fec; |
798 } | 798 } |
799 | 799 |
800 size_t RTPSender::TimeToSendPadding(size_t bytes, int probe_cluster_id) { | 800 size_t RTPSender::TimeToSendPadding(size_t bytes, int probe_cluster_id) { |
801 if (audio_configured_ || bytes == 0) | 801 if (audio_configured_ || bytes == 0) |
802 return 0; | 802 return 0; |
803 size_t bytes_sent = TrySendRedundantPayloads(bytes, probe_cluster_id); | 803 size_t bytes_sent = TrySendRedundantPayloads(bytes, probe_cluster_id); |
804 if (bytes_sent < bytes) | 804 if (bytes_sent < bytes) |
805 bytes_sent += SendPadData(bytes - bytes_sent, probe_cluster_id); | 805 bytes_sent += SendPadData(bytes - bytes_sent, probe_cluster_id); |
806 return bytes_sent; | 806 return bytes_sent; |
807 } | 807 } |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1124 | 1124 |
1125 int32_t RTPSender::SetAudioLevel(uint8_t level_d_bov) { | 1125 int32_t RTPSender::SetAudioLevel(uint8_t level_d_bov) { |
1126 return audio_->SetAudioLevel(level_d_bov); | 1126 return audio_->SetAudioLevel(level_d_bov); |
1127 } | 1127 } |
1128 | 1128 |
1129 RtpVideoCodecTypes RTPSender::VideoCodecType() const { | 1129 RtpVideoCodecTypes RTPSender::VideoCodecType() const { |
1130 assert(!audio_configured_ && "Sender is an audio stream!"); | 1130 assert(!audio_configured_ && "Sender is an audio stream!"); |
1131 return video_->VideoCodecType(); | 1131 return video_->VideoCodecType(); |
1132 } | 1132 } |
1133 | 1133 |
1134 void RTPSender::SetGenericFECStatus(bool enable, | 1134 void RTPSender::SetUlpfecConfig(bool enabled, |
1135 uint8_t payload_type_red, | 1135 int red_payload_type, |
1136 uint8_t payload_type_fec) { | 1136 int ulpfec_payload_type) { |
1137 RTC_DCHECK(!audio_configured_); | 1137 RTC_DCHECK(!audio_configured_); |
1138 video_->SetGenericFECStatus(enable, payload_type_red, payload_type_fec); | 1138 video_->SetUlpfecConfig(enabled, red_payload_type, ulpfec_payload_type); |
1139 } | |
1140 | |
1141 void RTPSender::GenericFECStatus(bool* enable, | |
1142 uint8_t* payload_type_red, | |
1143 uint8_t* payload_type_fec) const { | |
1144 RTC_DCHECK(!audio_configured_); | |
1145 video_->GenericFECStatus(enable, payload_type_red, payload_type_fec); | |
1146 } | 1139 } |
1147 | 1140 |
1148 int32_t RTPSender::SetFecParameters( | 1141 int32_t RTPSender::SetFecParameters( |
1149 const FecProtectionParams *delta_params, | 1142 const FecProtectionParams *delta_params, |
1150 const FecProtectionParams *key_params) { | 1143 const FecProtectionParams *key_params) { |
1151 if (audio_configured_) { | 1144 if (audio_configured_) { |
1152 return -1; | 1145 return -1; |
1153 } | 1146 } |
1154 video_->SetFecParameters(delta_params, key_params); | 1147 video_->SetFecParameters(delta_params, key_params); |
1155 return 0; | 1148 return 0; |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1247 rtc::CritScope lock(&send_critsect_); | 1240 rtc::CritScope lock(&send_critsect_); |
1248 | 1241 |
1249 RtpState state; | 1242 RtpState state; |
1250 state.sequence_number = sequence_number_rtx_; | 1243 state.sequence_number = sequence_number_rtx_; |
1251 state.start_timestamp = timestamp_offset_; | 1244 state.start_timestamp = timestamp_offset_; |
1252 | 1245 |
1253 return state; | 1246 return state; |
1254 } | 1247 } |
1255 | 1248 |
1256 } // namespace webrtc | 1249 } // namespace webrtc |
OLD | NEW |