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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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_output; |
141 if (neteq_->GetAudio(audio_frame, &muted_output) != 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_output); | |
hlundin-webrtc
2016/05/10 12:28:15
This DCHECK will be removed when the functionality
| |
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 Loading... | |
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 |
OLD | NEW |