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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 congestion_controller_->SetChannelRembStatus(true, false, | 189 congestion_controller_->SetChannelRembStatus(true, false, |
190 vie_channel_->rtp_rtcp()); | 190 vie_channel_->rtp_rtcp()); |
191 | 191 |
192 // Enable NACK, FEC or both. | 192 // Enable NACK, FEC or both. |
193 const bool enable_protection_nack = config_.rtp.nack.rtp_history_ms > 0; | 193 const bool enable_protection_nack = config_.rtp.nack.rtp_history_ms > 0; |
194 const bool enable_protection_fec = config_.rtp.fec.red_payload_type != -1; | 194 const bool enable_protection_fec = config_.rtp.fec.red_payload_type != -1; |
195 // TODO(changbin): Should set RTX for RED mapping in RTP sender in future. | 195 // TODO(changbin): Should set RTX for RED mapping in RTP sender in future. |
196 vie_channel_->SetProtectionMode(enable_protection_nack, enable_protection_fec, | 196 vie_channel_->SetProtectionMode(enable_protection_nack, enable_protection_fec, |
197 config_.rtp.fec.red_payload_type, | 197 config_.rtp.fec.red_payload_type, |
198 config_.rtp.fec.ulpfec_payload_type); | 198 config_.rtp.fec.ulpfec_payload_type); |
199 vie_encoder_->UpdateProtectionMethod(enable_protection_nack, | 199 vie_encoder_->SetProtectionMethod(enable_protection_nack, |
200 enable_protection_fec); | 200 enable_protection_fec); |
201 | 201 |
202 ConfigureSsrcs(); | 202 ConfigureSsrcs(); |
203 | 203 |
204 vie_channel_->SetRTCPCName(config_.rtp.c_name.c_str()); | 204 vie_channel_->SetRTCPCName(config_.rtp.c_name.c_str()); |
205 | 205 |
206 input_.reset(new internal::VideoCaptureInput( | 206 input_.reset(new internal::VideoCaptureInput( |
207 module_process_thread_, vie_encoder_.get(), config_.local_renderer, | 207 module_process_thread_, vie_encoder_.get(), config_.local_renderer, |
208 &stats_proxy_, this, config_.encoding_time_observer)); | 208 &stats_proxy_, this, config_.encoding_time_observer)); |
209 | 209 |
210 // 28 to match packet overhead in ModuleRtpRtcpImpl. | 210 // 28 to match packet overhead in ModuleRtpRtcpImpl. |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
556 | 556 |
557 if (vie_channel_->SetSendCodec(video_codec, false) != 0) { | 557 if (vie_channel_->SetSendCodec(video_codec, false) != 0) { |
558 LOG(LS_ERROR) << "Failed to set send codec."; | 558 LOG(LS_ERROR) << "Failed to set send codec."; |
559 return false; | 559 return false; |
560 } | 560 } |
561 | 561 |
562 // Not all configured SSRCs have to be utilized (simulcast senders don't have | 562 // Not all configured SSRCs have to be utilized (simulcast senders don't have |
563 // to send on all SSRCs at once etc.) | 563 // to send on all SSRCs at once etc.) |
564 std::vector<uint32_t> used_ssrcs = config_.rtp.ssrcs; | 564 std::vector<uint32_t> used_ssrcs = config_.rtp.ssrcs; |
565 used_ssrcs.resize(static_cast<size_t>(video_codec.numberOfSimulcastStreams)); | 565 used_ssrcs.resize(static_cast<size_t>(video_codec.numberOfSimulcastStreams)); |
566 | |
567 // Update used SSRCs. | |
568 vie_encoder_->SetSsrcs(used_ssrcs); | 566 vie_encoder_->SetSsrcs(used_ssrcs); |
569 | 567 |
570 // Update the protection mode, we might be switching NACK/FEC. | |
571 vie_encoder_->UpdateProtectionMethod(vie_encoder_->nack_enabled(), | |
572 vie_channel_->IsSendingFecEnabled()); | |
573 | |
574 // Restart the media flow | 568 // Restart the media flow |
575 vie_encoder_->Restart(); | 569 vie_encoder_->Restart(); |
576 | 570 |
577 return true; | 571 return true; |
578 } | 572 } |
579 | 573 |
580 } // namespace internal | 574 } // namespace internal |
581 } // namespace webrtc | 575 } // namespace webrtc |
OLD | NEW |