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 |
11 #include "webrtc/modules/audio_coding/neteq/neteq_impl.h" | 11 #include "webrtc/modules/audio_coding/neteq/neteq_impl.h" |
12 | 12 |
13 #include <assert.h> | 13 #include <assert.h> |
14 #include <memory.h> // memset | 14 #include <memory.h> // memset |
15 | 15 |
16 #include <algorithm> | 16 #include <algorithm> |
17 #include <vector> | 17 #include <vector> |
18 | 18 |
19 #include "webrtc/base/checks.h" | 19 #include "webrtc/base/checks.h" |
20 #include "webrtc/base/logging.h" | 20 #include "webrtc/base/logging.h" |
21 #include "webrtc/base/safe_conversions.h" | 21 #include "webrtc/base/safe_conversions.h" |
22 #include "webrtc/base/trace_event.h" | 22 #include "webrtc/base/trace_event.h" |
23 #include "webrtc/common_audio/signal_processing/include/signal_processing_librar y.h" | 23 #include "webrtc/common_audio/signal_processing/include/signal_processing_librar y.h" |
24 #include "webrtc/modules/audio_coding/codecs/audio_decoder.h" | 24 #include "webrtc/modules/audio_coding/codecs/audio_decoder.h" |
25 #include "webrtc/modules/audio_coding/codecs/builtin_audio_decoder_factory.h" | 25 #include "webrtc/modules/audio_coding/codecs/builtin_audio_decoder_factory.h" |
ossu
2016/05/18 16:09:25
This one should go.
| |
26 #include "webrtc/modules/audio_coding/neteq/accelerate.h" | 26 #include "webrtc/modules/audio_coding/neteq/accelerate.h" |
27 #include "webrtc/modules/audio_coding/neteq/background_noise.h" | 27 #include "webrtc/modules/audio_coding/neteq/background_noise.h" |
28 #include "webrtc/modules/audio_coding/neteq/buffer_level_filter.h" | 28 #include "webrtc/modules/audio_coding/neteq/buffer_level_filter.h" |
29 #include "webrtc/modules/audio_coding/neteq/comfort_noise.h" | 29 #include "webrtc/modules/audio_coding/neteq/comfort_noise.h" |
30 #include "webrtc/modules/audio_coding/neteq/decision_logic.h" | 30 #include "webrtc/modules/audio_coding/neteq/decision_logic.h" |
31 #include "webrtc/modules/audio_coding/neteq/decoder_database.h" | 31 #include "webrtc/modules/audio_coding/neteq/decoder_database.h" |
32 #include "webrtc/modules/audio_coding/neteq/defines.h" | 32 #include "webrtc/modules/audio_coding/neteq/defines.h" |
33 #include "webrtc/modules/audio_coding/neteq/delay_manager.h" | 33 #include "webrtc/modules/audio_coding/neteq/delay_manager.h" |
34 #include "webrtc/modules/audio_coding/neteq/delay_peak_detector.h" | 34 #include "webrtc/modules/audio_coding/neteq/delay_peak_detector.h" |
35 #include "webrtc/modules/audio_coding/neteq/dtmf_buffer.h" | 35 #include "webrtc/modules/audio_coding/neteq/dtmf_buffer.h" |
(...skipping 12 matching lines...) Expand all Loading... | |
48 #include "webrtc/modules/audio_coding/neteq/timestamp_scaler.h" | 48 #include "webrtc/modules/audio_coding/neteq/timestamp_scaler.h" |
49 #include "webrtc/modules/include/module_common_types.h" | 49 #include "webrtc/modules/include/module_common_types.h" |
50 | 50 |
51 // Modify the code to obtain backwards bit-exactness. Once bit-exactness is no | 51 // Modify the code to obtain backwards bit-exactness. Once bit-exactness is no |
52 // longer required, this #define should be removed (and the code that it | 52 // longer required, this #define should be removed (and the code that it |
53 // enables). | 53 // enables). |
54 #define LEGACY_BITEXACT | 54 #define LEGACY_BITEXACT |
55 | 55 |
56 namespace webrtc { | 56 namespace webrtc { |
57 | 57 |
58 NetEqImpl::Dependencies::Dependencies(const NetEq::Config& config) | 58 NetEqImpl::Dependencies::Dependencies( |
59 const NetEq::Config& config, | |
60 const rtc::scoped_refptr<AudioDecoderFactory>& decoder_factory) | |
59 : tick_timer(new TickTimer), | 61 : tick_timer(new TickTimer), |
60 buffer_level_filter(new BufferLevelFilter), | 62 buffer_level_filter(new BufferLevelFilter), |
61 decoder_database(new DecoderDatabase(CreateBuiltinAudioDecoderFactory())), | 63 decoder_database(new DecoderDatabase(decoder_factory)), |
62 delay_peak_detector(new DelayPeakDetector(tick_timer.get())), | 64 delay_peak_detector(new DelayPeakDetector(tick_timer.get())), |
63 delay_manager(new DelayManager(config.max_packets_in_buffer, | 65 delay_manager(new DelayManager(config.max_packets_in_buffer, |
64 delay_peak_detector.get(), | 66 delay_peak_detector.get(), |
65 tick_timer.get())), | 67 tick_timer.get())), |
66 dtmf_buffer(new DtmfBuffer(config.sample_rate_hz)), | 68 dtmf_buffer(new DtmfBuffer(config.sample_rate_hz)), |
67 dtmf_tone_generator(new DtmfToneGenerator), | 69 dtmf_tone_generator(new DtmfToneGenerator), |
68 packet_buffer( | 70 packet_buffer( |
69 new PacketBuffer(config.max_packets_in_buffer, tick_timer.get())), | 71 new PacketBuffer(config.max_packets_in_buffer, tick_timer.get())), |
70 payload_splitter(new PayloadSplitter), | 72 payload_splitter(new PayloadSplitter), |
71 timestamp_scaler(new TimestampScaler(*decoder_database)), | 73 timestamp_scaler(new TimestampScaler(*decoder_database)), |
(...skipping 2091 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2163 } | 2165 } |
2164 } | 2166 } |
2165 | 2167 |
2166 void NetEqImpl::CreateDecisionLogic() { | 2168 void NetEqImpl::CreateDecisionLogic() { |
2167 decision_logic_.reset(DecisionLogic::Create( | 2169 decision_logic_.reset(DecisionLogic::Create( |
2168 fs_hz_, output_size_samples_, playout_mode_, decoder_database_.get(), | 2170 fs_hz_, output_size_samples_, playout_mode_, decoder_database_.get(), |
2169 *packet_buffer_.get(), delay_manager_.get(), buffer_level_filter_.get(), | 2171 *packet_buffer_.get(), delay_manager_.get(), buffer_level_filter_.get(), |
2170 tick_timer_.get())); | 2172 tick_timer_.get())); |
2171 } | 2173 } |
2172 } // namespace webrtc | 2174 } // namespace webrtc |
OLD | NEW |