OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 // Deprecated. | 308 // Deprecated. |
309 // TODO(henrik.lundin) Delete. | 309 // TODO(henrik.lundin) Delete. |
310 NetEqPlayoutMode NetEqImpl::PlayoutMode() const { | 310 NetEqPlayoutMode NetEqImpl::PlayoutMode() const { |
311 CriticalSectionScoped lock(crit_sect_.get()); | 311 CriticalSectionScoped lock(crit_sect_.get()); |
312 return playout_mode_; | 312 return playout_mode_; |
313 } | 313 } |
314 | 314 |
315 int NetEqImpl::NetworkStatistics(NetEqNetworkStatistics* stats) { | 315 int NetEqImpl::NetworkStatistics(NetEqNetworkStatistics* stats) { |
316 CriticalSectionScoped lock(crit_sect_.get()); | 316 CriticalSectionScoped lock(crit_sect_.get()); |
317 assert(decoder_database_.get()); | 317 assert(decoder_database_.get()); |
318 const int total_samples_in_buffers = packet_buffer_->NumSamplesInBuffer( | 318 const int total_samples_in_buffers = |
319 decoder_database_.get(), decoder_frame_length_) + | 319 packet_buffer_->NumSamplesInBuffer(decoder_database_.get(), |
320 static_cast<int>(sync_buffer_->FutureLength()); | 320 decoder_frame_length_) + |
| 321 static_cast<int>(sync_buffer_->FutureLength()); |
321 assert(delay_manager_.get()); | 322 assert(delay_manager_.get()); |
322 assert(decision_logic_.get()); | 323 assert(decision_logic_.get()); |
323 stats_.GetNetworkStatistics(fs_hz_, total_samples_in_buffers, | 324 stats_.GetNetworkStatistics(fs_hz_, total_samples_in_buffers, |
324 decoder_frame_length_, *delay_manager_.get(), | 325 decoder_frame_length_, *delay_manager_.get(), |
325 *decision_logic_.get(), stats); | 326 *decision_logic_.get(), stats); |
326 return 0; | 327 return 0; |
327 } | 328 } |
328 | 329 |
329 void NetEqImpl::WaitingTimes(std::vector<int>* waiting_times) { | 330 void NetEqImpl::WaitingTimes(std::vector<int>* waiting_times) { |
330 CriticalSectionScoped lock(crit_sect_.get()); | 331 CriticalSectionScoped lock(crit_sect_.get()); |
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
697 } else if (delay_manager_->last_pack_cng_or_dtmf() == -1) { | 698 } else if (delay_manager_->last_pack_cng_or_dtmf() == -1) { |
698 // This is first "normal" packet after CNG or DTMF. | 699 // This is first "normal" packet after CNG or DTMF. |
699 // Reset packet time counter and measure time until next packet, | 700 // Reset packet time counter and measure time until next packet, |
700 // but don't update statistics. | 701 // but don't update statistics. |
701 delay_manager_->set_last_pack_cng_or_dtmf(0); | 702 delay_manager_->set_last_pack_cng_or_dtmf(0); |
702 delay_manager_->ResetPacketIatCount(); | 703 delay_manager_->ResetPacketIatCount(); |
703 } | 704 } |
704 return 0; | 705 return 0; |
705 } | 706 } |
706 | 707 |
707 int NetEqImpl::GetAudioInternal(size_t max_length, int16_t* output, | 708 int NetEqImpl::GetAudioInternal(size_t max_length, |
708 int* samples_per_channel, int* num_channels) { | 709 int16_t* output, |
| 710 int* samples_per_channel, |
| 711 int* num_channels) { |
709 PacketList packet_list; | 712 PacketList packet_list; |
710 DtmfEvent dtmf_event; | 713 DtmfEvent dtmf_event; |
711 Operations operation; | 714 Operations operation; |
712 bool play_dtmf; | 715 bool play_dtmf; |
713 int return_value = GetDecision(&operation, &packet_list, &dtmf_event, | 716 int return_value = GetDecision(&operation, &packet_list, &dtmf_event, |
714 &play_dtmf); | 717 &play_dtmf); |
715 if (return_value != 0) { | 718 if (return_value != 0) { |
716 LOG_FERR1(LS_WARNING, GetDecision, return_value); | 719 LOG_FERR1(LS_WARNING, GetDecision, return_value); |
717 assert(false); | 720 assert(false); |
718 last_mode_ = kModeError; | 721 last_mode_ = kModeError; |
(...skipping 1271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1990 | 1993 |
1991 void NetEqImpl::CreateDecisionLogic() { | 1994 void NetEqImpl::CreateDecisionLogic() { |
1992 decision_logic_.reset(DecisionLogic::Create(fs_hz_, output_size_samples_, | 1995 decision_logic_.reset(DecisionLogic::Create(fs_hz_, output_size_samples_, |
1993 playout_mode_, | 1996 playout_mode_, |
1994 decoder_database_.get(), | 1997 decoder_database_.get(), |
1995 *packet_buffer_.get(), | 1998 *packet_buffer_.get(), |
1996 delay_manager_.get(), | 1999 delay_manager_.get(), |
1997 buffer_level_filter_.get())); | 2000 buffer_level_filter_.get())); |
1998 } | 2001 } |
1999 } // namespace webrtc | 2002 } // namespace webrtc |
OLD | NEW |