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 #ifndef WEBRTC_MODULES_AUDIO_CODING_NETEQ_NETEQ_IMPL_H_ | 11 #ifndef WEBRTC_MODULES_AUDIO_CODING_NETEQ_NETEQ_IMPL_H_ |
12 #define WEBRTC_MODULES_AUDIO_CODING_NETEQ_NETEQ_IMPL_H_ | 12 #define WEBRTC_MODULES_AUDIO_CODING_NETEQ_NETEQ_IMPL_H_ |
13 | 13 |
14 #include <memory> | 14 #include <memory> |
15 #include <string> | 15 #include <string> |
16 | 16 |
17 #include "webrtc/base/constructormagic.h" | 17 #include "webrtc/base/constructormagic.h" |
18 #include "webrtc/base/criticalsection.h" | 18 #include "webrtc/base/criticalsection.h" |
19 #include "webrtc/base/thread_annotations.h" | 19 #include "webrtc/base/thread_annotations.h" |
20 #include "webrtc/modules/audio_coding/neteq/audio_multi_vector.h" | 20 #include "webrtc/modules/audio_coding/neteq/audio_multi_vector.h" |
21 #include "webrtc/modules/audio_coding/neteq/defines.h" | 21 #include "webrtc/modules/audio_coding/neteq/defines.h" |
22 #include "webrtc/modules/audio_coding/neteq/include/neteq.h" | 22 #include "webrtc/modules/audio_coding/neteq/include/neteq.h" |
23 #include "webrtc/modules/audio_coding/neteq/packet.h" // Declare PacketList. | 23 #include "webrtc/modules/audio_coding/neteq/packet.h" // Declare PacketList. |
24 #include "webrtc/modules/audio_coding/neteq/random_vector.h" | 24 #include "webrtc/modules/audio_coding/neteq/random_vector.h" |
25 #include "webrtc/modules/audio_coding/neteq/rtcp.h" | 25 #include "webrtc/modules/audio_coding/neteq/rtcp.h" |
26 #include "webrtc/modules/audio_coding/neteq/statistics_calculator.h" | 26 #include "webrtc/modules/audio_coding/neteq/statistics_calculator.h" |
| 27 #include "webrtc/modules/audio_coding/neteq/tick_timer.h" |
27 #include "webrtc/typedefs.h" | 28 #include "webrtc/typedefs.h" |
28 | 29 |
29 namespace webrtc { | 30 namespace webrtc { |
30 | 31 |
31 // Forward declarations. | 32 // Forward declarations. |
32 class Accelerate; | 33 class Accelerate; |
33 class BackgroundNoise; | 34 class BackgroundNoise; |
34 class BufferLevelFilter; | 35 class BufferLevelFilter; |
35 class ComfortNoise; | 36 class ComfortNoise; |
36 class DecisionLogic; | 37 class DecisionLogic; |
(...skipping 24 matching lines...) Expand all Loading... |
61 kNormalSpeech, | 62 kNormalSpeech, |
62 kPLC, | 63 kPLC, |
63 kCNG, | 64 kCNG, |
64 kPLCCNG, | 65 kPLCCNG, |
65 kVadPassive | 66 kVadPassive |
66 }; | 67 }; |
67 | 68 |
68 // Creates a new NetEqImpl object. The object will assume ownership of all | 69 // Creates a new NetEqImpl object. The object will assume ownership of all |
69 // injected dependencies, and will delete them when done. | 70 // injected dependencies, and will delete them when done. |
70 NetEqImpl(const NetEq::Config& config, | 71 NetEqImpl(const NetEq::Config& config, |
| 72 std::unique_ptr<TickTimer> tick_timer, |
71 BufferLevelFilter* buffer_level_filter, | 73 BufferLevelFilter* buffer_level_filter, |
72 DecoderDatabase* decoder_database, | 74 DecoderDatabase* decoder_database, |
73 DelayManager* delay_manager, | 75 DelayManager* delay_manager, |
74 DelayPeakDetector* delay_peak_detector, | 76 DelayPeakDetector* delay_peak_detector, |
75 DtmfBuffer* dtmf_buffer, | 77 DtmfBuffer* dtmf_buffer, |
76 DtmfToneGenerator* dtmf_tone_generator, | 78 DtmfToneGenerator* dtmf_tone_generator, |
77 PacketBuffer* packet_buffer, | 79 PacketBuffer* packet_buffer, |
78 PayloadSplitter* payload_splitter, | 80 PayloadSplitter* payload_splitter, |
79 TimestampScaler* timestamp_scaler, | 81 TimestampScaler* timestamp_scaler, |
80 AccelerateFactory* accelerate_factory, | 82 AccelerateFactory* accelerate_factory, |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 OutputType LastOutputType() EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); | 323 OutputType LastOutputType() EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); |
322 | 324 |
323 // Updates Expand and Merge. | 325 // Updates Expand and Merge. |
324 virtual void UpdatePlcComponents(int fs_hz, size_t channels) | 326 virtual void UpdatePlcComponents(int fs_hz, size_t channels) |
325 EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); | 327 EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); |
326 | 328 |
327 // Creates DecisionLogic object with the mode given by |playout_mode_|. | 329 // Creates DecisionLogic object with the mode given by |playout_mode_|. |
328 virtual void CreateDecisionLogic() EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); | 330 virtual void CreateDecisionLogic() EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); |
329 | 331 |
330 rtc::CriticalSection crit_sect_; | 332 rtc::CriticalSection crit_sect_; |
| 333 const std::unique_ptr<TickTimer> tick_timer_ GUARDED_BY(crit_sect_); |
331 const std::unique_ptr<BufferLevelFilter> buffer_level_filter_ | 334 const std::unique_ptr<BufferLevelFilter> buffer_level_filter_ |
332 GUARDED_BY(crit_sect_); | 335 GUARDED_BY(crit_sect_); |
333 const std::unique_ptr<DecoderDatabase> decoder_database_ | 336 const std::unique_ptr<DecoderDatabase> decoder_database_ |
334 GUARDED_BY(crit_sect_); | 337 GUARDED_BY(crit_sect_); |
335 const std::unique_ptr<DelayManager> delay_manager_ GUARDED_BY(crit_sect_); | 338 const std::unique_ptr<DelayManager> delay_manager_ GUARDED_BY(crit_sect_); |
336 const std::unique_ptr<DelayPeakDetector> delay_peak_detector_ | 339 const std::unique_ptr<DelayPeakDetector> delay_peak_detector_ |
337 GUARDED_BY(crit_sect_); | 340 GUARDED_BY(crit_sect_); |
338 const std::unique_ptr<DtmfBuffer> dtmf_buffer_ GUARDED_BY(crit_sect_); | 341 const std::unique_ptr<DtmfBuffer> dtmf_buffer_ GUARDED_BY(crit_sect_); |
339 const std::unique_ptr<DtmfToneGenerator> dtmf_tone_generator_ | 342 const std::unique_ptr<DtmfToneGenerator> dtmf_tone_generator_ |
340 GUARDED_BY(crit_sect_); | 343 GUARDED_BY(crit_sect_); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 bool first_packet_ GUARDED_BY(crit_sect_); | 385 bool first_packet_ GUARDED_BY(crit_sect_); |
383 int error_code_ GUARDED_BY(crit_sect_); // Store last error code. | 386 int error_code_ GUARDED_BY(crit_sect_); // Store last error code. |
384 int decoder_error_code_ GUARDED_BY(crit_sect_); | 387 int decoder_error_code_ GUARDED_BY(crit_sect_); |
385 const BackgroundNoiseMode background_noise_mode_ GUARDED_BY(crit_sect_); | 388 const BackgroundNoiseMode background_noise_mode_ GUARDED_BY(crit_sect_); |
386 NetEqPlayoutMode playout_mode_ GUARDED_BY(crit_sect_); | 389 NetEqPlayoutMode playout_mode_ GUARDED_BY(crit_sect_); |
387 bool enable_fast_accelerate_ GUARDED_BY(crit_sect_); | 390 bool enable_fast_accelerate_ GUARDED_BY(crit_sect_); |
388 std::unique_ptr<Nack> nack_ GUARDED_BY(crit_sect_); | 391 std::unique_ptr<Nack> nack_ GUARDED_BY(crit_sect_); |
389 bool nack_enabled_ GUARDED_BY(crit_sect_); | 392 bool nack_enabled_ GUARDED_BY(crit_sect_); |
390 AudioFrame::VADActivity last_vad_activity_ GUARDED_BY(crit_sect_) = | 393 AudioFrame::VADActivity last_vad_activity_ GUARDED_BY(crit_sect_) = |
391 AudioFrame::kVadPassive; | 394 AudioFrame::kVadPassive; |
| 395 std::unique_ptr<TickTimer::Stopwatch> generated_noise_stopwatch_ |
| 396 GUARDED_BY(crit_sect_); |
392 | 397 |
393 private: | 398 private: |
394 RTC_DISALLOW_COPY_AND_ASSIGN(NetEqImpl); | 399 RTC_DISALLOW_COPY_AND_ASSIGN(NetEqImpl); |
395 }; | 400 }; |
396 | 401 |
397 } // namespace webrtc | 402 } // namespace webrtc |
398 #endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_NETEQ_IMPL_H_ | 403 #endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_NETEQ_IMPL_H_ |
OLD | NEW |