| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 } | 306 } |
| 307 | 307 |
| 308 int32_t AcmReceiver::AddCodec(int acm_codec_id, | 308 int32_t AcmReceiver::AddCodec(int acm_codec_id, |
| 309 uint8_t payload_type, | 309 uint8_t payload_type, |
| 310 int channels, | 310 int channels, |
| 311 int sample_rate_hz, | 311 int sample_rate_hz, |
| 312 AudioDecoder* audio_decoder) { | 312 AudioDecoder* audio_decoder) { |
| 313 const auto neteq_decoder = [acm_codec_id, channels]() -> NetEqDecoder { | 313 const auto neteq_decoder = [acm_codec_id, channels]() -> NetEqDecoder { |
| 314 if (acm_codec_id == -1) | 314 if (acm_codec_id == -1) |
| 315 return NetEqDecoder::kDecoderArbitrary; // External decoder. | 315 return NetEqDecoder::kDecoderArbitrary; // External decoder. |
| 316 const rtc::Maybe<RentACodec::CodecId> cid = | 316 const rtc::Optional<RentACodec::CodecId> cid = |
| 317 RentACodec::CodecIdFromIndex(acm_codec_id); | 317 RentACodec::CodecIdFromIndex(acm_codec_id); |
| 318 RTC_DCHECK(cid) << "Invalid codec index: " << acm_codec_id; | 318 RTC_DCHECK(cid) << "Invalid codec index: " << acm_codec_id; |
| 319 const rtc::Maybe<NetEqDecoder> ned = | 319 const rtc::Optional<NetEqDecoder> ned = |
| 320 RentACodec::NetEqDecoderFromCodecId(*cid, channels); | 320 RentACodec::NetEqDecoderFromCodecId(*cid, channels); |
| 321 RTC_DCHECK(ned) << "Invalid codec ID: " << static_cast<int>(*cid); | 321 RTC_DCHECK(ned) << "Invalid codec ID: " << static_cast<int>(*cid); |
| 322 return *ned; | 322 return *ned; |
| 323 }(); | 323 }(); |
| 324 | 324 |
| 325 CriticalSectionScoped lock(crit_sect_.get()); | 325 CriticalSectionScoped lock(crit_sect_.get()); |
| 326 | 326 |
| 327 // The corresponding NetEq decoder ID. | 327 // The corresponding NetEq decoder ID. |
| 328 // If this codec has been registered before. | 328 // If this codec has been registered before. |
| 329 auto it = decoders_.find(payload_type); | 329 auto it = decoders_.find(payload_type); |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 539 | 539 |
| 540 void AcmReceiver::GetDecodingCallStatistics( | 540 void AcmReceiver::GetDecodingCallStatistics( |
| 541 AudioDecodingCallStats* stats) const { | 541 AudioDecodingCallStats* stats) const { |
| 542 CriticalSectionScoped lock(crit_sect_.get()); | 542 CriticalSectionScoped lock(crit_sect_.get()); |
| 543 *stats = call_stats_.GetDecodingStatistics(); | 543 *stats = call_stats_.GetDecodingStatistics(); |
| 544 } | 544 } |
| 545 | 545 |
| 546 } // namespace acm2 | 546 } // namespace acm2 |
| 547 | 547 |
| 548 } // namespace webrtc | 548 } // namespace webrtc |
| OLD | NEW |