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 const rtc::Optional<CodecInst> ci = neteq_->GetDecoder(payload_type); | 317 auto it = decoders_.find(payload_type); |
318 if (ci) { | 318 if (it == decoders_.end()) { |
319 *codec = *ci; | |
320 return 0; | |
321 } else { | |
322 LOG(LERROR) << "AcmReceiver::DecoderByPayloadType " | 319 LOG(LERROR) << "AcmReceiver::DecoderByPayloadType " |
323 << static_cast<int>(payload_type); | 320 << static_cast<int>(payload_type); |
324 return -1; | 321 return -1; |
325 } | 322 } |
| 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; |
326 } | 330 } |
327 | 331 |
328 int AcmReceiver::EnableNack(size_t max_nack_list_size) { | 332 int AcmReceiver::EnableNack(size_t max_nack_list_size) { |
329 neteq_->EnableNack(max_nack_list_size); | 333 neteq_->EnableNack(max_nack_list_size); |
330 return 0; | 334 return 0; |
331 } | 335 } |
332 | 336 |
333 void AcmReceiver::DisableNack() { | 337 void AcmReceiver::DisableNack() { |
334 neteq_->DisableNack(); | 338 neteq_->DisableNack(); |
335 } | 339 } |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 | 374 |
371 void AcmReceiver::GetDecodingCallStatistics( | 375 void AcmReceiver::GetDecodingCallStatistics( |
372 AudioDecodingCallStats* stats) const { | 376 AudioDecodingCallStats* stats) const { |
373 rtc::CritScope lock(&crit_sect_); | 377 rtc::CritScope lock(&crit_sect_); |
374 *stats = call_stats_.GetDecodingStatistics(); | 378 *stats = call_stats_.GetDecodingStatistics(); |
375 } | 379 } |
376 | 380 |
377 } // namespace acm2 | 381 } // namespace acm2 |
378 | 382 |
379 } // namespace webrtc | 383 } // namespace webrtc |
OLD | NEW |