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

Side by Side Diff: webrtc/modules/audio_coding/codecs/opus/audio_encoder_opus.cc

Issue 2390883004: Hooking up audio network adaptor to VoE. (Closed)
Patch Set: Created 4 years, 2 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) 2014 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2014 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 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 229
230 void AudioEncoderOpus::OnReceivedUplinkBandwidth(int uplink_bandwidth_bps) { 230 void AudioEncoderOpus::OnReceivedUplinkBandwidth(int uplink_bandwidth_bps) {
231 if (!audio_network_adaptor_) 231 if (!audio_network_adaptor_)
232 return; 232 return;
233 audio_network_adaptor_->SetUplinkBandwidth(uplink_bandwidth_bps); 233 audio_network_adaptor_->SetUplinkBandwidth(uplink_bandwidth_bps);
234 ApplyAudioNetworkAdaptor(); 234 ApplyAudioNetworkAdaptor();
235 } 235 }
236 236
237 void AudioEncoderOpus::OnReceivedUplinkPacketLossFraction( 237 void AudioEncoderOpus::OnReceivedUplinkPacketLossFraction(
238 float uplink_packet_loss_fraction) { 238 float uplink_packet_loss_fraction) {
239 if (!audio_network_adaptor_) 239 if (!audio_network_adaptor_) {
240 return; 240 return AudioEncoder::OnReceivedTargetAudioBitrate(
241 uplink_packet_loss_fraction);
242 }
kwiberg-webrtc 2016/10/06 09:46:13 Better to just duplicate that one line from the de
minyue-webrtc 2016/10/11 09:00:22 Done.
241 audio_network_adaptor_->SetUplinkPacketLossFraction( 243 audio_network_adaptor_->SetUplinkPacketLossFraction(
242 uplink_packet_loss_fraction); 244 uplink_packet_loss_fraction);
243 ApplyAudioNetworkAdaptor(); 245 ApplyAudioNetworkAdaptor();
244 } 246 }
245 247
246 void AudioEncoderOpus::OnReceivedTargetAudioBitrate( 248 void AudioEncoderOpus::OnReceivedTargetAudioBitrate(
247 int target_audio_bitrate_bps) { 249 int target_audio_bitrate_bps) {
248 if (!audio_network_adaptor_) 250 if (!audio_network_adaptor_)
249 return; 251 return AudioEncoder::OnReceivedTargetAudioBitrate(target_audio_bitrate_bps);
kwiberg-webrtc 2016/10/06 09:46:13 Same.
minyue-webrtc 2016/10/11 09:00:22 Done.
250 audio_network_adaptor_->SetTargetAudioBitrate(target_audio_bitrate_bps); 252 audio_network_adaptor_->SetTargetAudioBitrate(target_audio_bitrate_bps);
251 ApplyAudioNetworkAdaptor(); 253 ApplyAudioNetworkAdaptor();
252 } 254 }
253 255
254 void AudioEncoderOpus::OnReceivedRtt(int rtt_ms) { 256 void AudioEncoderOpus::OnReceivedRtt(int rtt_ms) {
255 if (!audio_network_adaptor_) 257 if (!audio_network_adaptor_)
256 return; 258 return;
257 audio_network_adaptor_->SetRtt(rtt_ms); 259 audio_network_adaptor_->SetRtt(rtt_ms);
258 ApplyAudioNetworkAdaptor(); 260 ApplyAudioNetworkAdaptor();
259 } 261 }
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 398
397 SetTargetBitrate(*config.bitrate_bps); 399 SetTargetBitrate(*config.bitrate_bps);
398 SetFrameLength(*config.frame_length_ms); 400 SetFrameLength(*config.frame_length_ms);
399 SetFec(*config.enable_fec); 401 SetFec(*config.enable_fec);
400 SetProjectedPacketLossRate(*config.uplink_packet_loss_fraction); 402 SetProjectedPacketLossRate(*config.uplink_packet_loss_fraction);
401 SetDtx(*config.enable_dtx); 403 SetDtx(*config.enable_dtx);
402 SetNumChannelsToEncode(*config.num_channels); 404 SetNumChannelsToEncode(*config.num_channels);
403 } 405 }
404 406
405 } // namespace webrtc 407 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698