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

Side by Side Diff: webrtc/audio/audio_receive_stream.cc

Issue 1604563002: Add send-side BWE to WebRtcVoiceEngine under a finch experiment. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Comments addressed. Created 4 years, 11 months 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) 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2015 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 std::stringstream ss; 66 std::stringstream ss;
67 ss << "{rtp: " << rtp.ToString(); 67 ss << "{rtp: " << rtp.ToString();
68 ss << ", receive_transport: " 68 ss << ", receive_transport: "
69 << (receive_transport ? "(Transport)" : "nullptr"); 69 << (receive_transport ? "(Transport)" : "nullptr");
70 ss << ", rtcp_send_transport: " 70 ss << ", rtcp_send_transport: "
71 << (rtcp_send_transport ? "(Transport)" : "nullptr"); 71 << (rtcp_send_transport ? "(Transport)" : "nullptr");
72 ss << ", voe_channel_id: " << voe_channel_id; 72 ss << ", voe_channel_id: " << voe_channel_id;
73 if (!sync_group.empty()) { 73 if (!sync_group.empty()) {
74 ss << ", sync_group: " << sync_group; 74 ss << ", sync_group: " << sync_group;
75 } 75 }
76 ss << ", combined_audio_video_bwe: "
77 << (combined_audio_video_bwe ? "true" : "false");
78 ss << '}'; 76 ss << '}';
79 return ss.str(); 77 return ss.str();
80 } 78 }
81 79
82 namespace internal { 80 namespace internal {
83 AudioReceiveStream::AudioReceiveStream( 81 AudioReceiveStream::AudioReceiveStream(
84 CongestionController* congestion_controller, 82 CongestionController* congestion_controller,
85 const webrtc::AudioReceiveStream::Config& config, 83 const webrtc::AudioReceiveStream::Config& config,
86 const rtc::scoped_refptr<webrtc::AudioState>& audio_state) 84 const rtc::scoped_refptr<webrtc::AudioState>& audio_state)
87 : config_(config), 85 : config_(config),
(...skipping 24 matching lines...) Expand all
112 bool registered = rtp_header_parser_->RegisterRtpHeaderExtension( 110 bool registered = rtp_header_parser_->RegisterRtpHeaderExtension(
113 kRtpExtensionTransportSequenceNumber, extension.id); 111 kRtpExtensionTransportSequenceNumber, extension.id);
114 RTC_DCHECK(registered); 112 RTC_DCHECK(registered);
115 } else { 113 } else {
116 RTC_NOTREACHED() << "Unsupported RTP extension."; 114 RTC_NOTREACHED() << "Unsupported RTP extension.";
117 } 115 }
118 } 116 }
119 // Configure bandwidth estimation. 117 // Configure bandwidth estimation.
120 channel_proxy_->SetCongestionControlObjects( 118 channel_proxy_->SetCongestionControlObjects(
121 nullptr, nullptr, congestion_controller->packet_router()); 119 nullptr, nullptr, congestion_controller->packet_router());
122 if (config.combined_audio_video_bwe) { 120 if (UseSendSideBwe(config)) {
123 if (UseSendSideBwe(config)) { 121 remote_bitrate_estimator_ =
124 remote_bitrate_estimator_ = 122 congestion_controller->GetRemoteBitrateEstimator(true);
the sun 2016/01/22 10:45:16 The logic here has changed - is there no need to g
stefan-webrtc 2016/01/25 10:21:22 No there is no need for that, it should only be us
125 congestion_controller->GetRemoteBitrateEstimator(true);
126 } else {
127 remote_bitrate_estimator_ =
128 congestion_controller->GetRemoteBitrateEstimator(false);
129 }
130 RTC_DCHECK(remote_bitrate_estimator_);
131 } 123 }
132 } 124 }
133 125
134 AudioReceiveStream::~AudioReceiveStream() { 126 AudioReceiveStream::~AudioReceiveStream() {
135 RTC_DCHECK(thread_checker_.CalledOnValidThread()); 127 RTC_DCHECK(thread_checker_.CalledOnValidThread());
136 LOG(LS_INFO) << "~AudioReceiveStream: " << config_.ToString(); 128 LOG(LS_INFO) << "~AudioReceiveStream: " << config_.ToString();
137 channel_proxy_->SetCongestionControlObjects(nullptr, nullptr, nullptr); 129 channel_proxy_->SetCongestionControlObjects(nullptr, nullptr, nullptr);
138 if (remote_bitrate_estimator_) { 130 if (remote_bitrate_estimator_) {
139 remote_bitrate_estimator_->RemoveStream(config_.rtp.remote_ssrc); 131 remote_bitrate_estimator_->RemoveStream(config_.rtp.remote_ssrc);
140 } 132 }
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 240
249 VoiceEngine* AudioReceiveStream::voice_engine() const { 241 VoiceEngine* AudioReceiveStream::voice_engine() const {
250 internal::AudioState* audio_state = 242 internal::AudioState* audio_state =
251 static_cast<internal::AudioState*>(audio_state_.get()); 243 static_cast<internal::AudioState*>(audio_state_.get());
252 VoiceEngine* voice_engine = audio_state->voice_engine(); 244 VoiceEngine* voice_engine = audio_state->voice_engine();
253 RTC_DCHECK(voice_engine); 245 RTC_DCHECK(voice_engine);
254 return voice_engine; 246 return voice_engine;
255 } 247 }
256 } // namespace internal 248 } // namespace internal
257 } // namespace webrtc 249 } // namespace webrtc
OLDNEW
« no previous file with comments | « talk/media/webrtc/webrtcvoiceengine_unittest.cc ('k') | webrtc/audio/audio_receive_stream_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698