henrik.lundin@webrtc.org | 9a40081 | 2013-01-29 12:09:21 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
| 3 | * |
| 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. |
| 9 | */ |
| 10 | |
| 11 | #include "webrtc/modules/audio_coding/neteq4/interface/neteq.h" |
| 12 | |
| 13 | #include "webrtc/modules/audio_coding/neteq4/buffer_level_filter.h" |
| 14 | #include "webrtc/modules/audio_coding/neteq4/decoder_database.h" |
| 15 | #include "webrtc/modules/audio_coding/neteq4/delay_manager.h" |
| 16 | #include "webrtc/modules/audio_coding/neteq4/delay_peak_detector.h" |
| 17 | #include "webrtc/modules/audio_coding/neteq4/dtmf_buffer.h" |
| 18 | #include "webrtc/modules/audio_coding/neteq4/dtmf_tone_generator.h" |
| 19 | #include "webrtc/modules/audio_coding/neteq4/neteq_impl.h" |
| 20 | #include "webrtc/modules/audio_coding/neteq4/packet_buffer.h" |
| 21 | #include "webrtc/modules/audio_coding/neteq4/payload_splitter.h" |
| 22 | #include "webrtc/modules/audio_coding/neteq4/timestamp_scaler.h" |
| 23 | |
| 24 | namespace webrtc { |
| 25 | |
| 26 | // Creates all classes needed and inject them into a new NetEqImpl object. |
| 27 | // Return the new object. |
| 28 | NetEq* NetEq::Create(int sample_rate_hz) { |
| 29 | BufferLevelFilter* buffer_level_filter = new BufferLevelFilter; |
| 30 | DecoderDatabase* decoder_database = new DecoderDatabase; |
| 31 | DelayPeakDetector* delay_peak_detector = new DelayPeakDetector; |
| 32 | DelayManager* delay_manager = new DelayManager(kMaxNumPacketsInBuffer, |
| 33 | delay_peak_detector); |
| 34 | DtmfBuffer* dtmf_buffer = new DtmfBuffer(sample_rate_hz); |
| 35 | DtmfToneGenerator* dtmf_tone_generator = new DtmfToneGenerator; |
| 36 | PacketBuffer* packet_buffer = new PacketBuffer(kMaxNumPacketsInBuffer, |
| 37 | kMaxBytesInBuffer); |
| 38 | PayloadSplitter* payload_splitter = new PayloadSplitter; |
| 39 | TimestampScaler* timestamp_scaler = new TimestampScaler(*decoder_database); |
| 40 | return new NetEqImpl(sample_rate_hz, |
| 41 | buffer_level_filter, |
| 42 | decoder_database, |
| 43 | delay_manager, |
| 44 | delay_peak_detector, |
| 45 | dtmf_buffer, |
| 46 | dtmf_tone_generator, |
| 47 | packet_buffer, |
| 48 | payload_splitter, |
| 49 | timestamp_scaler); |
| 50 | } |
| 51 | |
| 52 | } // namespace webrtc |