Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(78)

Side by Side Diff: webrtc/video/video_send_stream.cc

Issue 1433703002: Remove contention between RTCP packets and encoding. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: make sure encoder_config_ is set before adding bitrate observers, to update based on current simulc… Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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,
stefan-webrtc 2015/11/10 15:15:26 Why did you move this? If it needs to be here it s
pbos-webrtc 2015/11/10 15:18:51 Didn't move it, the call below was a no-op but the
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 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 550
551 if (vie_channel_->SetSendCodec(video_codec, false) != 0) { 551 if (vie_channel_->SetSendCodec(video_codec, false) != 0) {
552 LOG(LS_ERROR) << "Failed to set send codec."; 552 LOG(LS_ERROR) << "Failed to set send codec.";
553 return false; 553 return false;
554 } 554 }
555 555
556 // Not all configured SSRCs have to be utilized (simulcast senders don't have 556 // Not all configured SSRCs have to be utilized (simulcast senders don't have
557 // to send on all SSRCs at once etc.) 557 // to send on all SSRCs at once etc.)
558 std::vector<uint32_t> used_ssrcs = config_.rtp.ssrcs; 558 std::vector<uint32_t> used_ssrcs = config_.rtp.ssrcs;
559 used_ssrcs.resize(static_cast<size_t>(video_codec.numberOfSimulcastStreams)); 559 used_ssrcs.resize(static_cast<size_t>(video_codec.numberOfSimulcastStreams));
560
561 // Update used SSRCs.
562 vie_encoder_->SetSsrcs(used_ssrcs); 560 vie_encoder_->SetSsrcs(used_ssrcs);
563 561
564 // Update the protection mode, we might be switching NACK/FEC.
565 vie_encoder_->UpdateProtectionMethod(vie_encoder_->nack_enabled(),
566 vie_channel_->IsSendingFecEnabled());
567
568 // Restart the media flow 562 // Restart the media flow
569 vie_encoder_->Restart(); 563 vie_encoder_->Restart();
570 564
571 return true; 565 return true;
572 } 566 }
573 567
574 } // namespace internal 568 } // namespace internal
575 } // namespace webrtc 569 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698