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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 | 121 |
122 AcmReceiver::AcmReceiver(const AudioCodingModule::Config& config) | 122 AcmReceiver::AcmReceiver(const AudioCodingModule::Config& config) |
123 : crit_sect_(CriticalSectionWrapper::CreateCriticalSection()), | 123 : crit_sect_(CriticalSectionWrapper::CreateCriticalSection()), |
124 id_(config.id), | 124 id_(config.id), |
125 last_audio_decoder_(nullptr), | 125 last_audio_decoder_(nullptr), |
126 previous_audio_activity_(AudioFrame::kVadPassive), | 126 previous_audio_activity_(AudioFrame::kVadPassive), |
127 current_sample_rate_hz_(config.neteq_config.sample_rate_hz), | 127 current_sample_rate_hz_(config.neteq_config.sample_rate_hz), |
128 audio_buffer_(new int16_t[AudioFrame::kMaxDataSizeSamples]), | 128 audio_buffer_(new int16_t[AudioFrame::kMaxDataSizeSamples]), |
129 last_audio_buffer_(new int16_t[AudioFrame::kMaxDataSizeSamples]), | 129 last_audio_buffer_(new int16_t[AudioFrame::kMaxDataSizeSamples]), |
130 neteq_(NetEq::Create(config.neteq_config)), | 130 neteq_(NetEq::Create(config.neteq_config)), |
131 vad_enabled_(true), | 131 vad_enabled_(config.neteq_config.enable_post_decode_vad), |
132 clock_(config.clock), | 132 clock_(config.clock), |
133 resampled_last_output_frame_(true), | 133 resampled_last_output_frame_(true), |
134 av_sync_(false), | 134 av_sync_(false), |
135 initial_delay_manager_(), | 135 initial_delay_manager_(), |
136 missing_packets_sync_stream_(), | 136 missing_packets_sync_stream_(), |
137 late_packets_sync_stream_() { | 137 late_packets_sync_stream_() { |
138 assert(clock_); | 138 assert(clock_); |
139 | |
140 // Make sure we are on the same page as NetEq. Post-decode VAD is disabled by | |
141 // default in NetEq4, however, Audio Conference Mixer relies on VAD decision | |
142 // and fails if VAD decision is not provided. | |
143 if (vad_enabled_) | |
144 neteq_->EnableVad(); | |
145 else | |
146 neteq_->DisableVad(); | |
147 | |
148 memset(audio_buffer_.get(), 0, AudioFrame::kMaxDataSizeSamples); | 139 memset(audio_buffer_.get(), 0, AudioFrame::kMaxDataSizeSamples); |
149 memset(last_audio_buffer_.get(), 0, AudioFrame::kMaxDataSizeSamples); | 140 memset(last_audio_buffer_.get(), 0, AudioFrame::kMaxDataSizeSamples); |
150 } | 141 } |
151 | 142 |
152 AcmReceiver::~AcmReceiver() { | 143 AcmReceiver::~AcmReceiver() { |
153 delete neteq_; | 144 delete neteq_; |
154 } | 145 } |
155 | 146 |
156 int AcmReceiver::SetMinimumDelay(int delay_ms) { | 147 int AcmReceiver::SetMinimumDelay(int delay_ms) { |
157 if (neteq_->SetMinimumDelay(delay_ms)) | 148 if (neteq_->SetMinimumDelay(delay_ms)) |
(...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
728 | 719 |
729 void AcmReceiver::GetDecodingCallStatistics( | 720 void AcmReceiver::GetDecodingCallStatistics( |
730 AudioDecodingCallStats* stats) const { | 721 AudioDecodingCallStats* stats) const { |
731 CriticalSectionScoped lock(crit_sect_.get()); | 722 CriticalSectionScoped lock(crit_sect_.get()); |
732 *stats = call_stats_.GetDecodingStatistics(); | 723 *stats = call_stats_.GetDecodingStatistics(); |
733 } | 724 } |
734 | 725 |
735 } // namespace acm2 | 726 } // namespace acm2 |
736 | 727 |
737 } // namespace webrtc | 728 } // namespace webrtc |
OLD | NEW |