| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2004 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2004 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 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 voe_codec.pltype = in.id; | 364 voe_codec.pltype = in.id; |
| 365 | 365 |
| 366 // Set bitrate if specified. | 366 // Set bitrate if specified. |
| 367 if (multi_rate && in.bitrate != 0) { | 367 if (multi_rate && in.bitrate != 0) { |
| 368 voe_codec.rate = in.bitrate; | 368 voe_codec.rate = in.bitrate; |
| 369 } | 369 } |
| 370 | 370 |
| 371 // Reset G722 sample rate to 16000 to match WebRTC. | 371 // Reset G722 sample rate to 16000 to match WebRTC. |
| 372 MaybeFixupG722(&voe_codec, 16000); | 372 MaybeFixupG722(&voe_codec, 16000); |
| 373 | 373 |
| 374 // Apply codec-specific settings. | |
| 375 if (IsCodec(codec, kIsacCodecName)) { | |
| 376 // If ISAC and an explicit bitrate is not specified, | |
| 377 // enable auto bitrate adjustment. | |
| 378 voe_codec.rate = (in.bitrate > 0) ? in.bitrate : -1; | |
| 379 } | |
| 380 *out = voe_codec; | 374 *out = voe_codec; |
| 381 } | 375 } |
| 382 return true; | 376 return true; |
| 383 } | 377 } |
| 384 } | 378 } |
| 385 return false; | 379 return false; |
| 386 } | 380 } |
| 387 | 381 |
| 388 static bool IsCodecMultiRate(const webrtc::CodecInst& codec) { | 382 static bool IsCodecMultiRate(const webrtc::CodecInst& codec) { |
| 389 for (size_t i = 0; i < arraysize(kCodecPrefs); ++i) { | 383 for (size_t i = 0; i < arraysize(kCodecPrefs); ++i) { |
| (...skipping 2321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2711 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); | 2705 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); |
| 2712 const auto it = send_streams_.find(ssrc); | 2706 const auto it = send_streams_.find(ssrc); |
| 2713 if (it != send_streams_.end()) { | 2707 if (it != send_streams_.end()) { |
| 2714 return it->second->channel(); | 2708 return it->second->channel(); |
| 2715 } | 2709 } |
| 2716 return -1; | 2710 return -1; |
| 2717 } | 2711 } |
| 2718 } // namespace cricket | 2712 } // namespace cricket |
| 2719 | 2713 |
| 2720 #endif // HAVE_WEBRTC_VOICE | 2714 #endif // HAVE_WEBRTC_VOICE |
| OLD | NEW |