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

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

Issue 2397573006: Using AudioOption to enable audio network adaptor. (Closed)
Patch Set: fixing a unittest Created 4 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
« no previous file with comments | « webrtc/api/call/audio_send_stream.cc ('k') | webrtc/audio/audio_send_stream_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 // If opus_max_playback_rate <= 0, the default maximum playback rate 321 // If opus_max_playback_rate <= 0, the default maximum playback rate
322 // (48 kHz) will be used. 322 // (48 kHz) will be used.
323 if (send_codec_spec.opus_max_playback_rate > 0) { 323 if (send_codec_spec.opus_max_playback_rate > 0) {
324 if (codec->SetOpusMaxPlaybackRate( 324 if (codec->SetOpusMaxPlaybackRate(
325 channel, send_codec_spec.opus_max_playback_rate) != 0) { 325 channel, send_codec_spec.opus_max_playback_rate) != 0) {
326 LOG(LS_WARNING) << "SetOpusMaxPlaybackRate() failed: " 326 LOG(LS_WARNING) << "SetOpusMaxPlaybackRate() failed: "
327 << base->LastError(); 327 << base->LastError();
328 return false; 328 return false;
329 } 329 }
330 } 330 }
331
332 if (config_.audio_network_adaptor_config) {
333 // Audio network adaptor is only allowed for Opus currently.
334 // |SetReceiverFrameLengthRange| needs to be called before
335 // |EnableAudioNetworkAdaptor|.
336 channel_proxy_->SetReceiverFrameLengthRange(send_codec_spec.min_ptime_ms,
337 send_codec_spec.max_ptime_ms);
338 channel_proxy_->EnableAudioNetworkAdaptor(
339 *config_.audio_network_adaptor_config);
340 LOG(LS_INFO) << "Audio network adaptor enabled on SSRC "
341 << config_.rtp.ssrc;
342 } else {
343 channel_proxy_->DisableAudioNetworkAdaptor();
344 }
331 } 345 }
332 346
333 // Set the CN payloadtype and the VAD status. 347 // Set the CN payloadtype and the VAD status.
334 if (send_codec_spec.cng_payload_type != -1) { 348 if (send_codec_spec.cng_payload_type != -1) {
335 // The CN payload type for 8000 Hz clockrate is fixed at 13. 349 // The CN payload type for 8000 Hz clockrate is fixed at 13.
336 if (send_codec_spec.cng_plfreq != 8000) { 350 if (send_codec_spec.cng_plfreq != 8000) {
337 webrtc::PayloadFrequencies cn_freq; 351 webrtc::PayloadFrequencies cn_freq;
338 switch (send_codec_spec.cng_plfreq) { 352 switch (send_codec_spec.cng_plfreq) {
339 case 16000: 353 case 16000:
340 cn_freq = webrtc::kFreq16000Hz; 354 cn_freq = webrtc::kFreq16000Hz;
(...skipping 30 matching lines...) Expand all
371 LOG(LS_WARNING) << "SetVADStatus() failed: " << base->LastError(); 385 LOG(LS_WARNING) << "SetVADStatus() failed: " << base->LastError();
372 return false; 386 return false;
373 } 387 }
374 } 388 }
375 } 389 }
376 return true; 390 return true;
377 } 391 }
378 392
379 } // namespace internal 393 } // namespace internal
380 } // namespace webrtc 394 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/api/call/audio_send_stream.cc ('k') | webrtc/audio/audio_send_stream_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698