2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
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
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
11 #include "webrtc/modules/audio_coding/neteq/interface/neteq.h"
13 #include "webrtc/modules/audio_coding/neteq/accelerate.h"
14 #include "webrtc/modules/audio_coding/neteq/buffer_level_filter.h"
15 #include "webrtc/modules/audio_coding/neteq/decoder_database.h"
16 #include "webrtc/modules/audio_coding/neteq/delay_manager.h"
17 #include "webrtc/modules/audio_coding/neteq/delay_peak_detector.h"
18 #include "webrtc/modules/audio_coding/neteq/dtmf_buffer.h"
19 #include "webrtc/modules/audio_coding/neteq/dtmf_tone_generator.h"
20 #include "webrtc/modules/audio_coding/neteq/expand.h"
21 #include "webrtc/modules/audio_coding/neteq/neteq_impl.h"
22 #include "webrtc/modules/audio_coding/neteq/packet_buffer.h"
23 #include "webrtc/modules/audio_coding/neteq/payload_splitter.h"
24 #include "webrtc/modules/audio_coding/neteq/preemptive_expand.h"
25 #include "webrtc/modules/audio_coding/neteq/timestamp_scaler.h"
29 // Creates all classes needed and inject them into a new NetEqImpl object.
30 // Return the new object.
31 NetEq* NetEq::Create(const NetEq::Config& config) {
32 BufferLevelFilter* buffer_level_filter = new BufferLevelFilter;
33 DecoderDatabase* decoder_database = new DecoderDatabase;
34 DelayPeakDetector* delay_peak_detector = new DelayPeakDetector;
35 DelayManager* delay_manager =
36 new DelayManager(config.max_packets_in_buffer, delay_peak_detector);
37 delay_manager->SetMaximumDelay(config.max_delay_ms);
38 DtmfBuffer* dtmf_buffer = new DtmfBuffer(config.sample_rate_hz);
39 DtmfToneGenerator* dtmf_tone_generator = new DtmfToneGenerator;
40 PacketBuffer* packet_buffer = new PacketBuffer(config.max_packets_in_buffer);
41 PayloadSplitter* payload_splitter = new PayloadSplitter;
42 TimestampScaler* timestamp_scaler = new TimestampScaler(*decoder_database);
43 AccelerateFactory* accelerate_factory = new AccelerateFactory;
44 ExpandFactory* expand_factory = new ExpandFactory;
45 PreemptiveExpandFactory* preemptive_expand_factory =
46 new PreemptiveExpandFactory;
47 return new NetEqImpl(config,
59 preemptive_expand_factory);