| 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 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 << static_cast<int>(header->payloadType) | 338 << static_cast<int>(header->payloadType) |
| 339 << " Failed to insert packet"; | 339 << " Failed to insert packet"; |
| 340 return -1; | 340 return -1; |
| 341 } | 341 } |
| 342 return 0; | 342 return 0; |
| 343 } | 343 } |
| 344 | 344 |
| 345 int AcmReceiver::GetAudio(int desired_freq_hz, AudioFrame* audio_frame) { | 345 int AcmReceiver::GetAudio(int desired_freq_hz, AudioFrame* audio_frame) { |
| 346 enum NetEqOutputType type; | 346 enum NetEqOutputType type; |
| 347 size_t samples_per_channel; | 347 size_t samples_per_channel; |
| 348 int num_channels; | 348 size_t num_channels; |
| 349 bool return_silence = false; | 349 bool return_silence = false; |
| 350 | 350 |
| 351 { | 351 { |
| 352 // Accessing members, take the lock. | 352 // Accessing members, take the lock. |
| 353 CriticalSectionScoped lock(crit_sect_.get()); | 353 CriticalSectionScoped lock(crit_sect_.get()); |
| 354 | 354 |
| 355 if (av_sync_) { | 355 if (av_sync_) { |
| 356 assert(initial_delay_manager_.get()); | 356 assert(initial_delay_manager_.get()); |
| 357 assert(late_packets_sync_stream_.get()); | 357 assert(late_packets_sync_stream_.get()); |
| 358 return_silence = GetSilence(desired_freq_hz, audio_frame); | 358 return_silence = GetSilence(desired_freq_hz, audio_frame); |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 468 } else { | 468 } else { |
| 469 // Remain 0 until we have a valid |playout_timestamp|. | 469 // Remain 0 until we have a valid |playout_timestamp|. |
| 470 audio_frame->timestamp_ = 0; | 470 audio_frame->timestamp_ = 0; |
| 471 } | 471 } |
| 472 | 472 |
| 473 return 0; | 473 return 0; |
| 474 } | 474 } |
| 475 | 475 |
| 476 int32_t AcmReceiver::AddCodec(int acm_codec_id, | 476 int32_t AcmReceiver::AddCodec(int acm_codec_id, |
| 477 uint8_t payload_type, | 477 uint8_t payload_type, |
| 478 int channels, | 478 size_t channels, |
| 479 int sample_rate_hz, | 479 int sample_rate_hz, |
| 480 AudioDecoder* audio_decoder) { | 480 AudioDecoder* audio_decoder) { |
| 481 assert(acm_codec_id >= 0); | 481 assert(acm_codec_id >= 0); |
| 482 NetEqDecoder neteq_decoder = ACMCodecDB::neteq_decoders_[acm_codec_id]; | 482 NetEqDecoder neteq_decoder = ACMCodecDB::neteq_decoders_[acm_codec_id]; |
| 483 | 483 |
| 484 // Make sure the right decoder is registered for Opus. | 484 // Make sure the right decoder is registered for Opus. |
| 485 if (neteq_decoder == kDecoderOpus && channels == 2) { | 485 if (neteq_decoder == kDecoderOpus && channels == 2) { |
| 486 neteq_decoder = kDecoderOpus_2ch; | 486 neteq_decoder = kDecoderOpus_2ch; |
| 487 } | 487 } |
| 488 | 488 |
| (...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 839 | 839 |
| 840 void AcmReceiver::GetDecodingCallStatistics( | 840 void AcmReceiver::GetDecodingCallStatistics( |
| 841 AudioDecodingCallStats* stats) const { | 841 AudioDecodingCallStats* stats) const { |
| 842 CriticalSectionScoped lock(crit_sect_.get()); | 842 CriticalSectionScoped lock(crit_sect_.get()); |
| 843 *stats = call_stats_.GetDecodingStatistics(); | 843 *stats = call_stats_.GetDecodingStatistics(); |
| 844 } | 844 } |
| 845 | 845 |
| 846 } // namespace acm2 | 846 } // namespace acm2 |
| 847 | 847 |
| 848 } // namespace webrtc | 848 } // namespace webrtc |
| OLD | NEW |