| 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 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 acm_stat->addedSamples = neteq_stat.added_zero_samples; | 307 acm_stat->addedSamples = neteq_stat.added_zero_samples; |
| 308 acm_stat->meanWaitingTimeMs = neteq_stat.mean_waiting_time_ms; | 308 acm_stat->meanWaitingTimeMs = neteq_stat.mean_waiting_time_ms; |
| 309 acm_stat->medianWaitingTimeMs = neteq_stat.median_waiting_time_ms; | 309 acm_stat->medianWaitingTimeMs = neteq_stat.median_waiting_time_ms; |
| 310 acm_stat->minWaitingTimeMs = neteq_stat.min_waiting_time_ms; | 310 acm_stat->minWaitingTimeMs = neteq_stat.min_waiting_time_ms; |
| 311 acm_stat->maxWaitingTimeMs = neteq_stat.max_waiting_time_ms; | 311 acm_stat->maxWaitingTimeMs = neteq_stat.max_waiting_time_ms; |
| 312 } | 312 } |
| 313 | 313 |
| 314 int AcmReceiver::DecoderByPayloadType(uint8_t payload_type, | 314 int AcmReceiver::DecoderByPayloadType(uint8_t payload_type, |
| 315 CodecInst* codec) const { | 315 CodecInst* codec) const { |
| 316 rtc::CritScope lock(&crit_sect_); | 316 rtc::CritScope lock(&crit_sect_); |
| 317 auto it = decoders_.find(payload_type); | 317 const rtc::Optional<CodecInst> ci = neteq_->GetDecoder(payload_type); |
| 318 if (it == decoders_.end()) { | 318 if (ci) { |
| 319 *codec = *ci; |
| 320 return 0; |
| 321 } else { |
| 319 LOG(LERROR) << "AcmReceiver::DecoderByPayloadType " | 322 LOG(LERROR) << "AcmReceiver::DecoderByPayloadType " |
| 320 << static_cast<int>(payload_type); | 323 << static_cast<int>(payload_type); |
| 321 return -1; | 324 return -1; |
| 322 } | 325 } |
| 323 const Decoder& decoder = it->second; | |
| 324 *codec = *RentACodec::CodecInstById( | |
| 325 *RentACodec::CodecIdFromIndex(decoder.acm_codec_id)); | |
| 326 codec->pltype = decoder.payload_type; | |
| 327 codec->channels = decoder.channels; | |
| 328 codec->plfreq = decoder.sample_rate_hz; | |
| 329 return 0; | |
| 330 } | 326 } |
| 331 | 327 |
| 332 int AcmReceiver::EnableNack(size_t max_nack_list_size) { | 328 int AcmReceiver::EnableNack(size_t max_nack_list_size) { |
| 333 neteq_->EnableNack(max_nack_list_size); | 329 neteq_->EnableNack(max_nack_list_size); |
| 334 return 0; | 330 return 0; |
| 335 } | 331 } |
| 336 | 332 |
| 337 void AcmReceiver::DisableNack() { | 333 void AcmReceiver::DisableNack() { |
| 338 neteq_->DisableNack(); | 334 neteq_->DisableNack(); |
| 339 } | 335 } |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 | 370 |
| 375 void AcmReceiver::GetDecodingCallStatistics( | 371 void AcmReceiver::GetDecodingCallStatistics( |
| 376 AudioDecodingCallStats* stats) const { | 372 AudioDecodingCallStats* stats) const { |
| 377 rtc::CritScope lock(&crit_sect_); | 373 rtc::CritScope lock(&crit_sect_); |
| 378 *stats = call_stats_.GetDecodingStatistics(); | 374 *stats = call_stats_.GetDecodingStatistics(); |
| 379 } | 375 } |
| 380 | 376 |
| 381 } // namespace acm2 | 377 } // namespace acm2 |
| 382 | 378 |
| 383 } // namespace webrtc | 379 } // namespace webrtc |
| OLD | NEW |