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

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

Issue 2397573006: Using AudioOption to enable audio network adaptor. (Closed)
Patch Set: fixing some problems 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 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 LOG(LS_INFO) << "Attempt to set maximum playback rate to " 380 LOG(LS_INFO) << "Attempt to set maximum playback rate to "
381 << send_codec_spec.opus_max_playback_rate 381 << send_codec_spec.opus_max_playback_rate
382 << " Hz on channel " << channel; 382 << " Hz on channel " << channel;
383 if (codec->SetOpusMaxPlaybackRate( 383 if (codec->SetOpusMaxPlaybackRate(
384 channel, send_codec_spec.opus_max_playback_rate) == -1) { 384 channel, send_codec_spec.opus_max_playback_rate) == -1) {
385 LOG_RTCERR2(SetOpusMaxPlaybackRate, channel, 385 LOG_RTCERR2(SetOpusMaxPlaybackRate, channel,
386 send_codec_spec.opus_max_playback_rate, base->LastError()); 386 send_codec_spec.opus_max_playback_rate, base->LastError());
387 return false; 387 return false;
388 } 388 }
389 } 389 }
390
391 if (config_.audio_network_adaptor_config) {
the sun 2016/10/25 09:25:46 Is the invariant that max/min_ptime_ms must be set
minyue-webrtc 2016/10/27 14:33:10 They are parsed from SDP. This is checked down in
392 // Audio network adaptor is only allowed for Opus currently.
393 // |SetReceiverFrameLengthRange| needs to be called before
394 // |EnableAudioNetworkAdaptor|.
395 channel_proxy_->SetReceiverFrameLengthRange(send_codec_spec.min_ptime_ms,
396 send_codec_spec.max_ptime_ms);
397 if (!channel_proxy_->EnableAudioNetworkAdaptor(
398 *config_.audio_network_adaptor_config)) {
399 LOG(LS_ERROR) << "Audio network adaptor cannot be enabled on SSRC "
400 << config_.rtp.ssrc;
401 return false;
402 }
403 LOG(LS_INFO) << "Audio network adaptor enabled on SSRC "
404 << config_.rtp.ssrc;
405 } else {
406 channel_proxy_->DisableAudioNetworkAdaptor();
407 }
390 } 408 }
391 409
392 // Set the CN payloadtype and the VAD status. 410 // Set the CN payloadtype and the VAD status.
393 if (send_codec_spec.cng_payload_type != -1) { 411 if (send_codec_spec.cng_payload_type != -1) {
394 // The CN payload type for 8000 Hz clockrate is fixed at 13. 412 // The CN payload type for 8000 Hz clockrate is fixed at 13.
395 if (send_codec_spec.cng_plfreq != 8000) { 413 if (send_codec_spec.cng_plfreq != 8000) {
396 webrtc::PayloadFrequencies cn_freq; 414 webrtc::PayloadFrequencies cn_freq;
397 switch (send_codec_spec.cng_plfreq) { 415 switch (send_codec_spec.cng_plfreq) {
398 case 16000: 416 case 16000:
399 cn_freq = webrtc::kFreq16000Hz; 417 cn_freq = webrtc::kFreq16000Hz;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 LOG_RTCERR2(SetVADStatus, channel, true, base->LastError()); 451 LOG_RTCERR2(SetVADStatus, channel, true, base->LastError());
434 return false; 452 return false;
435 } 453 }
436 } 454 }
437 } 455 }
438 return true; 456 return true;
439 } 457 }
440 458
441 } // namespace internal 459 } // namespace internal
442 } // namespace webrtc 460 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698