OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 CHECK_EQ(0, vie_channel_->SetSendVideoRotationStatus(true, id)); | 140 CHECK_EQ(0, vie_channel_->SetSendVideoRotationStatus(true, id)); |
141 } else { | 141 } else { |
142 RTC_NOTREACHED() << "Registering unsupported RTP extension."; | 142 RTC_NOTREACHED() << "Registering unsupported RTP extension."; |
143 } | 143 } |
144 } | 144 } |
145 | 145 |
146 // TODO(pbos): Consider configuring REMB in Call. | 146 // TODO(pbos): Consider configuring REMB in Call. |
147 channel_group_->SetChannelRembStatus(true, false, vie_channel_); | 147 channel_group_->SetChannelRembStatus(true, false, vie_channel_); |
148 | 148 |
149 // Enable NACK, FEC or both. | 149 // Enable NACK, FEC or both. |
150 bool enable_protection_nack = false; | 150 const bool enable_protection_nack = config_.rtp.nack.rtp_history_ms > 0; |
151 bool enable_protection_fec = false; | 151 const bool enable_protection_fec = config_.rtp.fec.red_payload_type != -1; |
152 if (config_.rtp.fec.red_payload_type != -1) { | 152 // TODO(changbin): Should set RTX for RED mapping in RTP sender in future. |
153 enable_protection_fec = true; | 153 vie_channel_->SetProtectionMode(enable_protection_nack, enable_protection_fec, |
154 DCHECK(config_.rtp.fec.ulpfec_payload_type != -1); | 154 config_.rtp.fec.red_payload_type, |
155 if (config_.rtp.nack.rtp_history_ms > 0) { | 155 config_.rtp.fec.ulpfec_payload_type); |
156 enable_protection_nack = true; | |
157 vie_channel_->SetHybridNACKFECStatus( | |
158 true, static_cast<unsigned char>(config_.rtp.fec.red_payload_type), | |
159 static_cast<unsigned char>(config_.rtp.fec.ulpfec_payload_type)); | |
160 } else { | |
161 vie_channel_->SetFECStatus( | |
162 true, static_cast<unsigned char>(config_.rtp.fec.red_payload_type), | |
163 static_cast<unsigned char>(config_.rtp.fec.ulpfec_payload_type)); | |
164 } | |
165 // TODO(changbin): Should set RTX for RED mapping in RTP sender in future. | |
166 } else { | |
167 enable_protection_nack = config_.rtp.nack.rtp_history_ms > 0; | |
168 vie_channel_->SetNACKStatus(config_.rtp.nack.rtp_history_ms > 0); | |
169 } | |
170 vie_encoder_->UpdateProtectionMethod(enable_protection_nack, | 156 vie_encoder_->UpdateProtectionMethod(enable_protection_nack, |
171 enable_protection_fec); | 157 enable_protection_fec); |
172 | 158 |
173 ConfigureSsrcs(); | 159 ConfigureSsrcs(); |
174 | 160 |
175 vie_channel_->SetRTCPCName(config_.rtp.c_name.c_str()); | 161 vie_channel_->SetRTCPCName(config_.rtp.c_name.c_str()); |
176 | 162 |
177 input_.reset(new internal::VideoCaptureInput( | 163 input_.reset(new internal::VideoCaptureInput( |
178 module_process_thread_, vie_encoder_, config_.local_renderer, | 164 module_process_thread_, vie_encoder_, config_.local_renderer, |
179 &stats_proxy_, overuse_observer)); | 165 &stats_proxy_, overuse_observer)); |
180 | 166 |
181 // 28 to match packet overhead in ModuleRtpRtcpImpl. | 167 // 28 to match packet overhead in ModuleRtpRtcpImpl. |
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
518 vie_channel_->IsSendingFecEnabled()); | 504 vie_channel_->IsSendingFecEnabled()); |
519 | 505 |
520 // Restart the media flow | 506 // Restart the media flow |
521 vie_encoder_->Restart(); | 507 vie_encoder_->Restart(); |
522 | 508 |
523 return true; | 509 return true; |
524 } | 510 } |
525 | 511 |
526 } // namespace internal | 512 } // namespace internal |
527 } // namespace webrtc | 513 } // namespace webrtc |
OLD | NEW |