Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(36)

Side by Side Diff: webrtc/modules/audio_coding/main/acm2/acm_receiver.cc

Issue 1425133002: ACM/NetEq: Restructure how post-decode VAD is enabled (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@acm-recv-nack
Patch Set: Actually doing something with the new config Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | webrtc/modules/audio_coding/main/include/audio_coding_module.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | webrtc/modules/audio_coding/main/include/audio_coding_module.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698