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 797 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
808 } | 808 } |
809 return 0; | 809 return 0; |
810 } | 810 } |
811 | 811 |
812 int NetEqImpl::GetAudioInternal(AudioFrame* audio_frame) { | 812 int NetEqImpl::GetAudioInternal(AudioFrame* audio_frame) { |
813 PacketList packet_list; | 813 PacketList packet_list; |
814 DtmfEvent dtmf_event; | 814 DtmfEvent dtmf_event; |
815 Operations operation; | 815 Operations operation; |
816 bool play_dtmf; | 816 bool play_dtmf; |
817 tick_timer_->Increment(); | 817 tick_timer_->Increment(); |
| 818 stats_.IncreaseCounter(output_size_samples_, fs_hz_); |
818 int return_value = GetDecision(&operation, &packet_list, &dtmf_event, | 819 int return_value = GetDecision(&operation, &packet_list, &dtmf_event, |
819 &play_dtmf); | 820 &play_dtmf); |
820 if (return_value != 0) { | 821 if (return_value != 0) { |
821 last_mode_ = kModeError; | 822 last_mode_ = kModeError; |
822 return return_value; | 823 return return_value; |
823 } | 824 } |
824 | 825 |
825 AudioDecoder::SpeechType speech_type; | 826 AudioDecoder::SpeechType speech_type; |
826 int length = 0; | 827 int length = 0; |
827 int decode_return_value = Decode(&packet_list, &operation, | 828 int decode_return_value = Decode(&packet_list, &operation, |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1022 } | 1023 } |
1023 | 1024 |
1024 int NetEqImpl::GetDecision(Operations* operation, | 1025 int NetEqImpl::GetDecision(Operations* operation, |
1025 PacketList* packet_list, | 1026 PacketList* packet_list, |
1026 DtmfEvent* dtmf_event, | 1027 DtmfEvent* dtmf_event, |
1027 bool* play_dtmf) { | 1028 bool* play_dtmf) { |
1028 // Initialize output variables. | 1029 // Initialize output variables. |
1029 *play_dtmf = false; | 1030 *play_dtmf = false; |
1030 *operation = kUndefined; | 1031 *operation = kUndefined; |
1031 | 1032 |
1032 // Increment time counters. | |
1033 stats_.IncreaseCounter(output_size_samples_, fs_hz_); | |
1034 | |
1035 assert(sync_buffer_.get()); | 1033 assert(sync_buffer_.get()); |
1036 uint32_t end_timestamp = sync_buffer_->end_timestamp(); | 1034 uint32_t end_timestamp = sync_buffer_->end_timestamp(); |
1037 if (!new_codec_) { | 1035 if (!new_codec_) { |
1038 const uint32_t five_seconds_samples = 5 * fs_hz_; | 1036 const uint32_t five_seconds_samples = 5 * fs_hz_; |
1039 packet_buffer_->DiscardOldPackets(end_timestamp, five_seconds_samples); | 1037 packet_buffer_->DiscardOldPackets(end_timestamp, five_seconds_samples); |
1040 } | 1038 } |
1041 const RTPHeader* header = packet_buffer_->NextRtpHeader(); | 1039 const RTPHeader* header = packet_buffer_->NextRtpHeader(); |
1042 | 1040 |
1043 RTC_DCHECK(!generated_noise_stopwatch_ || | 1041 RTC_DCHECK(!generated_noise_stopwatch_ || |
1044 generated_noise_stopwatch_->ElapsedTicks() >= 1); | 1042 generated_noise_stopwatch_->ElapsedTicks() >= 1); |
(...skipping 1101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2146 } | 2144 } |
2147 } | 2145 } |
2148 | 2146 |
2149 void NetEqImpl::CreateDecisionLogic() { | 2147 void NetEqImpl::CreateDecisionLogic() { |
2150 decision_logic_.reset(DecisionLogic::Create( | 2148 decision_logic_.reset(DecisionLogic::Create( |
2151 fs_hz_, output_size_samples_, playout_mode_, decoder_database_.get(), | 2149 fs_hz_, output_size_samples_, playout_mode_, decoder_database_.get(), |
2152 *packet_buffer_.get(), delay_manager_.get(), buffer_level_filter_.get(), | 2150 *packet_buffer_.get(), delay_manager_.get(), buffer_level_filter_.get(), |
2153 tick_timer_.get())); | 2151 tick_timer_.get())); |
2154 } | 2152 } |
2155 } // namespace webrtc | 2153 } // namespace webrtc |
OLD | NEW |