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 enum NetEqOutputType type; | 140 if (neteq_->GetAudio(audio_frame) != NetEq::kOK) { |
141 if (neteq_->GetAudio(audio_frame, &type) != NetEq::kOK) { | |
142 LOG(LERROR) << "AcmReceiver::GetAudio - NetEq Failed."; | 141 LOG(LERROR) << "AcmReceiver::GetAudio - NetEq Failed."; |
143 return -1; | 142 return -1; |
144 } | 143 } |
145 | 144 |
146 const int current_sample_rate_hz = neteq_->last_output_sample_rate_hz(); | 145 const int current_sample_rate_hz = neteq_->last_output_sample_rate_hz(); |
147 | 146 |
148 // Update if resampling is required. | 147 // Update if resampling is required. |
149 const bool need_resampling = | 148 const bool need_resampling = |
150 (desired_freq_hz != -1) && (current_sample_rate_hz != desired_freq_hz); | 149 (desired_freq_hz != -1) && (current_sample_rate_hz != desired_freq_hz); |
151 | 150 |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 | 424 |
426 void AcmReceiver::GetDecodingCallStatistics( | 425 void AcmReceiver::GetDecodingCallStatistics( |
427 AudioDecodingCallStats* stats) const { | 426 AudioDecodingCallStats* stats) const { |
428 rtc::CritScope lock(&crit_sect_); | 427 rtc::CritScope lock(&crit_sect_); |
429 *stats = call_stats_.GetDecodingStatistics(); | 428 *stats = call_stats_.GetDecodingStatistics(); |
430 } | 429 } |
431 | 430 |
432 } // namespace acm2 | 431 } // namespace acm2 |
433 | 432 |
434 } // namespace webrtc | 433 } // namespace webrtc |
OLD | NEW |