| 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 24 matching lines...) Expand all Loading... |
| 35 #include "webrtc/modules/audio_coding/neteq/expand.h" | 35 #include "webrtc/modules/audio_coding/neteq/expand.h" |
| 36 #include "webrtc/modules/audio_coding/neteq/merge.h" | 36 #include "webrtc/modules/audio_coding/neteq/merge.h" |
| 37 #include "webrtc/modules/audio_coding/neteq/nack.h" | 37 #include "webrtc/modules/audio_coding/neteq/nack.h" |
| 38 #include "webrtc/modules/audio_coding/neteq/normal.h" | 38 #include "webrtc/modules/audio_coding/neteq/normal.h" |
| 39 #include "webrtc/modules/audio_coding/neteq/packet_buffer.h" | 39 #include "webrtc/modules/audio_coding/neteq/packet_buffer.h" |
| 40 #include "webrtc/modules/audio_coding/neteq/packet.h" | 40 #include "webrtc/modules/audio_coding/neteq/packet.h" |
| 41 #include "webrtc/modules/audio_coding/neteq/payload_splitter.h" | 41 #include "webrtc/modules/audio_coding/neteq/payload_splitter.h" |
| 42 #include "webrtc/modules/audio_coding/neteq/post_decode_vad.h" | 42 #include "webrtc/modules/audio_coding/neteq/post_decode_vad.h" |
| 43 #include "webrtc/modules/audio_coding/neteq/preemptive_expand.h" | 43 #include "webrtc/modules/audio_coding/neteq/preemptive_expand.h" |
| 44 #include "webrtc/modules/audio_coding/neteq/sync_buffer.h" | 44 #include "webrtc/modules/audio_coding/neteq/sync_buffer.h" |
| 45 #include "webrtc/modules/audio_coding/neteq/tick_timer.h" |
| 45 #include "webrtc/modules/audio_coding/neteq/timestamp_scaler.h" | 46 #include "webrtc/modules/audio_coding/neteq/timestamp_scaler.h" |
| 46 #include "webrtc/modules/include/module_common_types.h" | 47 #include "webrtc/modules/include/module_common_types.h" |
| 47 | 48 |
| 48 // Modify the code to obtain backwards bit-exactness. Once bit-exactness is no | 49 // Modify the code to obtain backwards bit-exactness. Once bit-exactness is no |
| 49 // longer required, this #define should be removed (and the code that it | 50 // longer required, this #define should be removed (and the code that it |
| 50 // enables). | 51 // enables). |
| 51 #define LEGACY_BITEXACT | 52 #define LEGACY_BITEXACT |
| 52 | 53 |
| 53 namespace webrtc { | 54 namespace webrtc { |
| 54 | 55 |
| 55 NetEqImpl::NetEqImpl(const NetEq::Config& config, | 56 NetEqImpl::NetEqImpl(const NetEq::Config& config, |
| 57 std::unique_ptr<TickTimer> tick_timer, |
| 56 BufferLevelFilter* buffer_level_filter, | 58 BufferLevelFilter* buffer_level_filter, |
| 57 DecoderDatabase* decoder_database, | 59 DecoderDatabase* decoder_database, |
| 58 DelayManager* delay_manager, | 60 DelayManager* delay_manager, |
| 59 DelayPeakDetector* delay_peak_detector, | 61 DelayPeakDetector* delay_peak_detector, |
| 60 DtmfBuffer* dtmf_buffer, | 62 DtmfBuffer* dtmf_buffer, |
| 61 DtmfToneGenerator* dtmf_tone_generator, | 63 DtmfToneGenerator* dtmf_tone_generator, |
| 62 PacketBuffer* packet_buffer, | 64 PacketBuffer* packet_buffer, |
| 63 PayloadSplitter* payload_splitter, | 65 PayloadSplitter* payload_splitter, |
| 64 TimestampScaler* timestamp_scaler, | 66 TimestampScaler* timestamp_scaler, |
| 65 AccelerateFactory* accelerate_factory, | 67 AccelerateFactory* accelerate_factory, |
| 66 ExpandFactory* expand_factory, | 68 ExpandFactory* expand_factory, |
| 67 PreemptiveExpandFactory* preemptive_expand_factory, | 69 PreemptiveExpandFactory* preemptive_expand_factory, |
| 68 bool create_components) | 70 bool create_components) |
| 69 : buffer_level_filter_(buffer_level_filter), | 71 : tick_timer_(std::move(tick_timer)), |
| 72 buffer_level_filter_(buffer_level_filter), |
| 70 decoder_database_(decoder_database), | 73 decoder_database_(decoder_database), |
| 71 delay_manager_(delay_manager), | 74 delay_manager_(delay_manager), |
| 72 delay_peak_detector_(delay_peak_detector), | 75 delay_peak_detector_(delay_peak_detector), |
| 73 dtmf_buffer_(dtmf_buffer), | 76 dtmf_buffer_(dtmf_buffer), |
| 74 dtmf_tone_generator_(dtmf_tone_generator), | 77 dtmf_tone_generator_(dtmf_tone_generator), |
| 75 packet_buffer_(packet_buffer), | 78 packet_buffer_(packet_buffer), |
| 76 payload_splitter_(payload_splitter), | 79 payload_splitter_(payload_splitter), |
| 77 timestamp_scaler_(timestamp_scaler), | 80 timestamp_scaler_(timestamp_scaler), |
| 78 vad_(new PostDecodeVad()), | 81 vad_(new PostDecodeVad()), |
| 79 expand_factory_(expand_factory), | 82 expand_factory_(expand_factory), |
| (...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 781 delay_manager_->ResetPacketIatCount(); | 784 delay_manager_->ResetPacketIatCount(); |
| 782 } | 785 } |
| 783 return 0; | 786 return 0; |
| 784 } | 787 } |
| 785 | 788 |
| 786 int NetEqImpl::GetAudioInternal(AudioFrame* audio_frame) { | 789 int NetEqImpl::GetAudioInternal(AudioFrame* audio_frame) { |
| 787 PacketList packet_list; | 790 PacketList packet_list; |
| 788 DtmfEvent dtmf_event; | 791 DtmfEvent dtmf_event; |
| 789 Operations operation; | 792 Operations operation; |
| 790 bool play_dtmf; | 793 bool play_dtmf; |
| 794 tick_timer_->Increment(); |
| 791 int return_value = GetDecision(&operation, &packet_list, &dtmf_event, | 795 int return_value = GetDecision(&operation, &packet_list, &dtmf_event, |
| 792 &play_dtmf); | 796 &play_dtmf); |
| 793 if (return_value != 0) { | 797 if (return_value != 0) { |
| 794 last_mode_ = kModeError; | 798 last_mode_ = kModeError; |
| 795 return return_value; | 799 return return_value; |
| 796 } | 800 } |
| 797 | 801 |
| 798 AudioDecoder::SpeechType speech_type; | 802 AudioDecoder::SpeechType speech_type; |
| 799 int length = 0; | 803 int length = 0; |
| 800 int decode_return_value = Decode(&packet_list, &operation, | 804 int decode_return_value = Decode(&packet_list, &operation, |
| (...skipping 1294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2095 | 2099 |
| 2096 void NetEqImpl::CreateDecisionLogic() { | 2100 void NetEqImpl::CreateDecisionLogic() { |
| 2097 decision_logic_.reset(DecisionLogic::Create(fs_hz_, output_size_samples_, | 2101 decision_logic_.reset(DecisionLogic::Create(fs_hz_, output_size_samples_, |
| 2098 playout_mode_, | 2102 playout_mode_, |
| 2099 decoder_database_.get(), | 2103 decoder_database_.get(), |
| 2100 *packet_buffer_.get(), | 2104 *packet_buffer_.get(), |
| 2101 delay_manager_.get(), | 2105 delay_manager_.get(), |
| 2102 buffer_level_filter_.get())); | 2106 buffer_level_filter_.get())); |
| 2103 } | 2107 } |
| 2104 } // namespace webrtc | 2108 } // namespace webrtc |
| OLD | NEW |