Chromium Code Reviews

Side by Side Diff: webrtc/modules/audio_coding/neteq/neteq_impl.cc

Issue 1928293002: NetEq: Use a BuiltinAudioDecoderFactory to create decoders (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rejigger Opus config Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
OLDNEW
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/neteq/accelerate.h" 26 #include "webrtc/modules/audio_coding/neteq/accelerate.h"
26 #include "webrtc/modules/audio_coding/neteq/background_noise.h" 27 #include "webrtc/modules/audio_coding/neteq/background_noise.h"
27 #include "webrtc/modules/audio_coding/neteq/buffer_level_filter.h" 28 #include "webrtc/modules/audio_coding/neteq/buffer_level_filter.h"
28 #include "webrtc/modules/audio_coding/neteq/comfort_noise.h" 29 #include "webrtc/modules/audio_coding/neteq/comfort_noise.h"
29 #include "webrtc/modules/audio_coding/neteq/decision_logic.h" 30 #include "webrtc/modules/audio_coding/neteq/decision_logic.h"
30 #include "webrtc/modules/audio_coding/neteq/decoder_database.h" 31 #include "webrtc/modules/audio_coding/neteq/decoder_database.h"
31 #include "webrtc/modules/audio_coding/neteq/defines.h" 32 #include "webrtc/modules/audio_coding/neteq/defines.h"
32 #include "webrtc/modules/audio_coding/neteq/delay_manager.h" 33 #include "webrtc/modules/audio_coding/neteq/delay_manager.h"
33 #include "webrtc/modules/audio_coding/neteq/delay_peak_detector.h" 34 #include "webrtc/modules/audio_coding/neteq/delay_peak_detector.h"
34 #include "webrtc/modules/audio_coding/neteq/dtmf_buffer.h" 35 #include "webrtc/modules/audio_coding/neteq/dtmf_buffer.h"
(...skipping 15 matching lines...)
50 // 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
51 // 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
52 // enables). 53 // enables).
53 #define LEGACY_BITEXACT 54 #define LEGACY_BITEXACT
54 55
55 namespace webrtc { 56 namespace webrtc {
56 57
57 NetEqImpl::Dependencies::Dependencies(const NetEq::Config& config) 58 NetEqImpl::Dependencies::Dependencies(const NetEq::Config& config)
58 : tick_timer(new TickTimer), 59 : tick_timer(new TickTimer),
59 buffer_level_filter(new BufferLevelFilter), 60 buffer_level_filter(new BufferLevelFilter),
60 decoder_database(new DecoderDatabase), 61 decoder_database(new DecoderDatabase(CreateBuiltinAudioDecoderFactory())),
61 delay_peak_detector(new DelayPeakDetector(tick_timer.get())), 62 delay_peak_detector(new DelayPeakDetector(tick_timer.get())),
62 delay_manager(new DelayManager(config.max_packets_in_buffer, 63 delay_manager(new DelayManager(config.max_packets_in_buffer,
63 delay_peak_detector.get(), 64 delay_peak_detector.get(),
64 tick_timer.get())), 65 tick_timer.get())),
65 dtmf_buffer(new DtmfBuffer(config.sample_rate_hz)), 66 dtmf_buffer(new DtmfBuffer(config.sample_rate_hz)),
66 dtmf_tone_generator(new DtmfToneGenerator), 67 dtmf_tone_generator(new DtmfToneGenerator),
67 packet_buffer( 68 packet_buffer(
68 new PacketBuffer(config.max_packets_in_buffer, tick_timer.get())), 69 new PacketBuffer(config.max_packets_in_buffer, tick_timer.get())),
69 payload_splitter(new PayloadSplitter), 70 payload_splitter(new PayloadSplitter),
70 timestamp_scaler(new TimestampScaler(*decoder_database)), 71 timestamp_scaler(new TimestampScaler(*decoder_database)),
(...skipping 2049 matching lines...)
2120 2121
2121 void NetEqImpl::CreateDecisionLogic() { 2122 void NetEqImpl::CreateDecisionLogic() {
2122 decision_logic_.reset(DecisionLogic::Create(fs_hz_, output_size_samples_, 2123 decision_logic_.reset(DecisionLogic::Create(fs_hz_, output_size_samples_,
2123 playout_mode_, 2124 playout_mode_,
2124 decoder_database_.get(), 2125 decoder_database_.get(),
2125 *packet_buffer_.get(), 2126 *packet_buffer_.get(),
2126 delay_manager_.get(), 2127 delay_manager_.get(),
2127 buffer_level_filter_.get())); 2128 buffer_level_filter_.get()));
2128 } 2129 }
2129 } // namespace webrtc 2130 } // namespace webrtc
OLDNEW

Powered by Google App Engine