| 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 771 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 782 CountPacket(&counters->transmitted, packet); | 782 CountPacket(&counters->transmitted, packet); |
| 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; | |
| 793 int pt_red; | 792 int pt_red; |
| 794 int pt_fec; | 793 int pt_fec; |
| 795 video_->UlpfecConfig(&fec_enabled, &pt_red, &pt_fec); | 794 video_->UlpfecConfig(&pt_red, &pt_fec); |
| 795 const bool fec_enabled = (pt_fec != -1); |
| 796 return fec_enabled && static_cast<int>(packet.PayloadType()) == pt_red && | 796 return fec_enabled && static_cast<int>(packet.PayloadType()) == pt_red && |
| 797 static_cast<int>(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); |
| (...skipping 318 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::SetUlpfecConfig(bool enabled, | 1134 void RTPSender::SetUlpfecConfig(int red_payload_type, int ulpfec_payload_type) { |
| 1135 int red_payload_type, | |
| 1136 int ulpfec_payload_type) { | |
| 1137 RTC_DCHECK(!audio_configured_); | 1135 RTC_DCHECK(!audio_configured_); |
| 1138 video_->SetUlpfecConfig(enabled, red_payload_type, ulpfec_payload_type); | 1136 video_->SetUlpfecConfig(red_payload_type, ulpfec_payload_type); |
| 1139 } | 1137 } |
| 1140 | 1138 |
| 1141 int32_t RTPSender::SetFecParameters( | 1139 int32_t RTPSender::SetFecParameters( |
| 1142 const FecProtectionParams *delta_params, | 1140 const FecProtectionParams *delta_params, |
| 1143 const FecProtectionParams *key_params) { | 1141 const FecProtectionParams *key_params) { |
| 1144 if (audio_configured_) { | 1142 if (audio_configured_) { |
| 1145 return -1; | 1143 return -1; |
| 1146 } | 1144 } |
| 1147 video_->SetFecParameters(delta_params, key_params); | 1145 video_->SetFecParameters(delta_params, key_params); |
| 1148 return 0; | 1146 return 0; |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1240 rtc::CritScope lock(&send_critsect_); | 1238 rtc::CritScope lock(&send_critsect_); |
| 1241 | 1239 |
| 1242 RtpState state; | 1240 RtpState state; |
| 1243 state.sequence_number = sequence_number_rtx_; | 1241 state.sequence_number = sequence_number_rtx_; |
| 1244 state.start_timestamp = timestamp_offset_; | 1242 state.start_timestamp = timestamp_offset_; |
| 1245 | 1243 |
| 1246 return state; | 1244 return state; |
| 1247 } | 1245 } |
| 1248 | 1246 |
| 1249 } // namespace webrtc | 1247 } // namespace webrtc |
| OLD | NEW |