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

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

Issue 1965733002: NetEq: Implement muted output (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@muted-expand
Patch Set: Add new tests Created 4 years, 7 months 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/neteq/include/neteq.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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 << " Failed to insert packet"; 130 << " Failed to insert packet";
131 return -1; 131 return -1;
132 } 132 }
133 return 0; 133 return 0;
134 } 134 }
135 135
136 int AcmReceiver::GetAudio(int desired_freq_hz, AudioFrame* audio_frame) { 136 int AcmReceiver::GetAudio(int desired_freq_hz, AudioFrame* audio_frame) {
137 // Accessing members, take the lock. 137 // Accessing members, take the lock.
138 rtc::CritScope lock(&crit_sect_); 138 rtc::CritScope lock(&crit_sect_);
139 139
140 if (neteq_->GetAudio(audio_frame) != NetEq::kOK) { 140 bool muted;
141 if (neteq_->GetAudio(audio_frame, &muted) != NetEq::kOK) {
141 LOG(LERROR) << "AcmReceiver::GetAudio - NetEq Failed."; 142 LOG(LERROR) << "AcmReceiver::GetAudio - NetEq Failed.";
142 return -1; 143 return -1;
143 } 144 }
145 RTC_DCHECK(!muted);
144 146
145 const int current_sample_rate_hz = neteq_->last_output_sample_rate_hz(); 147 const int current_sample_rate_hz = neteq_->last_output_sample_rate_hz();
146 148
147 // Update if resampling is required. 149 // Update if resampling is required.
148 const bool need_resampling = 150 const bool need_resampling =
149 (desired_freq_hz != -1) && (current_sample_rate_hz != desired_freq_hz); 151 (desired_freq_hz != -1) && (current_sample_rate_hz != desired_freq_hz);
150 152
151 if (need_resampling && !resampled_last_output_frame_) { 153 if (need_resampling && !resampled_last_output_frame_) {
152 // Prime the resampler with the last frame. 154 // Prime the resampler with the last frame.
153 int16_t temp_output[AudioFrame::kMaxDataSizeSamples]; 155 int16_t temp_output[AudioFrame::kMaxDataSizeSamples];
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 412
411 void AcmReceiver::GetDecodingCallStatistics( 413 void AcmReceiver::GetDecodingCallStatistics(
412 AudioDecodingCallStats* stats) const { 414 AudioDecodingCallStats* stats) const {
413 rtc::CritScope lock(&crit_sect_); 415 rtc::CritScope lock(&crit_sect_);
414 *stats = call_stats_.GetDecodingStatistics(); 416 *stats = call_stats_.GetDecodingStatistics();
415 } 417 }
416 418
417 } // namespace acm2 419 } // namespace acm2
418 420
419 } // namespace webrtc 421 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | webrtc/modules/audio_coding/neteq/include/neteq.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698