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

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

Issue 2397573006: Using AudioOption to enable audio network adaptor. (Closed)
Patch Set: on comments 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
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 if (!channel_proxy_->EnableAudioNetworkAdaptor(
339 *config_.audio_network_adaptor_config)) {
340 LOG(LS_ERROR) << "Audio network adaptor cannot be enabled on SSRC "
341 << config_.rtp.ssrc;
342 return false;
343 }
344 LOG(LS_INFO) << "Audio network adaptor enabled on SSRC "
345 << config_.rtp.ssrc;
346 } else {
347 channel_proxy_->DisableAudioNetworkAdaptor();
348 }
331 } 349 }
332 350
333 // Set the CN payloadtype and the VAD status. 351 // Set the CN payloadtype and the VAD status.
334 if (send_codec_spec.cng_payload_type != -1) { 352 if (send_codec_spec.cng_payload_type != -1) {
335 // The CN payload type for 8000 Hz clockrate is fixed at 13. 353 // The CN payload type for 8000 Hz clockrate is fixed at 13.
336 if (send_codec_spec.cng_plfreq != 8000) { 354 if (send_codec_spec.cng_plfreq != 8000) {
337 webrtc::PayloadFrequencies cn_freq; 355 webrtc::PayloadFrequencies cn_freq;
338 switch (send_codec_spec.cng_plfreq) { 356 switch (send_codec_spec.cng_plfreq) {
339 case 16000: 357 case 16000:
340 cn_freq = webrtc::kFreq16000Hz; 358 cn_freq = webrtc::kFreq16000Hz;
(...skipping 30 matching lines...) Expand all
371 LOG(LS_WARNING) << "SetVADStatus() failed: " << base->LastError(); 389 LOG(LS_WARNING) << "SetVADStatus() failed: " << base->LastError();
372 return false; 390 return false;
373 } 391 }
374 } 392 }
375 } 393 }
376 return true; 394 return true;
377 } 395 }
378 396
379 } // namespace internal 397 } // namespace internal
380 } // namespace webrtc 398 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698