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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 if (neteq_->InsertPacket(rtp_header, incoming_payload, receive_timestamp) < | 125 if (neteq_->InsertPacket(rtp_header, incoming_payload, receive_timestamp) < |
126 0) { | 126 0) { |
127 LOG(LERROR) << "AcmReceiver::InsertPacket " | 127 LOG(LERROR) << "AcmReceiver::InsertPacket " |
128 << static_cast<int>(header->payloadType) | 128 << static_cast<int>(header->payloadType) |
129 << " Failed to insert packet"; | 129 << " Failed to insert packet"; |
130 return -1; | 130 return -1; |
131 } | 131 } |
132 return 0; | 132 return 0; |
133 } | 133 } |
134 | 134 |
135 int AcmReceiver::GetAudio(int desired_freq_hz, AudioFrame* audio_frame) { | 135 int AcmReceiver::GetAudio(int desired_freq_hz, |
| 136 AudioFrame* audio_frame, |
| 137 bool* muted) { |
136 // Accessing members, take the lock. | 138 // Accessing members, take the lock. |
137 rtc::CritScope lock(&crit_sect_); | 139 rtc::CritScope lock(&crit_sect_); |
138 | 140 |
139 bool muted; | 141 if (neteq_->GetAudio(audio_frame, muted) != NetEq::kOK) { |
140 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 } |
144 RTC_DCHECK(!muted); | |
145 | 145 |
146 const int current_sample_rate_hz = neteq_->last_output_sample_rate_hz(); | 146 const int current_sample_rate_hz = neteq_->last_output_sample_rate_hz(); |
147 | 147 |
148 // Update if resampling is required. | 148 // Update if resampling is required. |
149 const bool need_resampling = | 149 const bool need_resampling = |
150 (desired_freq_hz != -1) && (current_sample_rate_hz != desired_freq_hz); | 150 (desired_freq_hz != -1) && (current_sample_rate_hz != desired_freq_hz); |
151 | 151 |
152 if (need_resampling && !resampled_last_output_frame_) { | 152 if (need_resampling && !resampled_last_output_frame_) { |
153 // Prime the resampler with the last frame. | 153 // Prime the resampler with the last frame. |
154 int16_t temp_output[AudioFrame::kMaxDataSizeSamples]; | 154 int16_t temp_output[AudioFrame::kMaxDataSizeSamples]; |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
411 | 411 |
412 void AcmReceiver::GetDecodingCallStatistics( | 412 void AcmReceiver::GetDecodingCallStatistics( |
413 AudioDecodingCallStats* stats) const { | 413 AudioDecodingCallStats* stats) const { |
414 rtc::CritScope lock(&crit_sect_); | 414 rtc::CritScope lock(&crit_sect_); |
415 *stats = call_stats_.GetDecodingStatistics(); | 415 *stats = call_stats_.GetDecodingStatistics(); |
416 } | 416 } |
417 | 417 |
418 } // namespace acm2 | 418 } // namespace acm2 |
419 | 419 |
420 } // namespace webrtc | 420 } // namespace webrtc |
OLD | NEW |