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 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 | 206 |
207 int AcmReceiver::LeastRequiredDelayMs() const { | 207 int AcmReceiver::LeastRequiredDelayMs() const { |
208 return neteq_->LeastRequiredDelayMs(); | 208 return neteq_->LeastRequiredDelayMs(); |
209 } | 209 } |
210 | 210 |
211 int AcmReceiver::current_sample_rate_hz() const { | 211 int AcmReceiver::current_sample_rate_hz() const { |
212 CriticalSectionScoped lock(crit_sect_.get()); | 212 CriticalSectionScoped lock(crit_sect_.get()); |
213 return current_sample_rate_hz_; | 213 return current_sample_rate_hz_; |
214 } | 214 } |
215 | 215 |
216 // TODO(turajs): use one set of enumerators, e.g. the one defined in | |
217 // common_types.h | |
218 // TODO(henrik.lundin): This method is not used any longer. The call hierarchy | |
219 // stops in voe::Channel::SetNetEQPlayoutMode(). Remove it. | |
220 void AcmReceiver::SetPlayoutMode(AudioPlayoutMode mode) { | |
221 enum NetEqPlayoutMode playout_mode = kPlayoutOn; | |
222 switch (mode) { | |
223 case voice: | |
224 playout_mode = kPlayoutOn; | |
225 break; | |
226 case fax: // No change to background noise mode. | |
227 playout_mode = kPlayoutFax; | |
228 break; | |
229 case streaming: | |
230 playout_mode = kPlayoutStreaming; | |
231 break; | |
232 case off: | |
233 playout_mode = kPlayoutOff; | |
234 break; | |
235 } | |
236 neteq_->SetPlayoutMode(playout_mode); | |
237 } | |
238 | |
239 AudioPlayoutMode AcmReceiver::PlayoutMode() const { | |
240 AudioPlayoutMode acm_mode = voice; | |
241 NetEqPlayoutMode mode = neteq_->PlayoutMode(); | |
242 switch (mode) { | |
243 case kPlayoutOn: | |
244 acm_mode = voice; | |
245 break; | |
246 case kPlayoutOff: | |
247 acm_mode = off; | |
248 break; | |
249 case kPlayoutFax: | |
250 acm_mode = fax; | |
251 break; | |
252 case kPlayoutStreaming: | |
253 acm_mode = streaming; | |
254 break; | |
255 default: | |
256 assert(false); | |
257 } | |
258 return acm_mode; | |
259 } | |
260 | |
261 int AcmReceiver::InsertPacket(const WebRtcRTPHeader& rtp_header, | 216 int AcmReceiver::InsertPacket(const WebRtcRTPHeader& rtp_header, |
262 const uint8_t* incoming_payload, | 217 const uint8_t* incoming_payload, |
263 size_t length_payload) { | 218 size_t length_payload) { |
264 uint32_t receive_timestamp = 0; | 219 uint32_t receive_timestamp = 0; |
265 InitialDelayManager::PacketType packet_type = | 220 InitialDelayManager::PacketType packet_type = |
266 InitialDelayManager::kUndefinedPacket; | 221 InitialDelayManager::kUndefinedPacket; |
267 bool new_codec = false; | 222 bool new_codec = false; |
268 const RTPHeader* header = &rtp_header.header; // Just a shorthand. | 223 const RTPHeader* header = &rtp_header.header; // Just a shorthand. |
269 | 224 |
270 { | 225 { |
(...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
822 | 777 |
823 void AcmReceiver::GetDecodingCallStatistics( | 778 void AcmReceiver::GetDecodingCallStatistics( |
824 AudioDecodingCallStats* stats) const { | 779 AudioDecodingCallStats* stats) const { |
825 CriticalSectionScoped lock(crit_sect_.get()); | 780 CriticalSectionScoped lock(crit_sect_.get()); |
826 *stats = call_stats_.GetDecodingStatistics(); | 781 *stats = call_stats_.GetDecodingStatistics(); |
827 } | 782 } |
828 | 783 |
829 } // namespace acm2 | 784 } // namespace acm2 |
830 | 785 |
831 } // namespace webrtc | 786 } // namespace webrtc |
OLD | NEW |