| 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 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 TEST(DecisionLogic, CreateAndDestroy) { | 25 TEST(DecisionLogic, CreateAndDestroy) { |
| 26 int fs_hz = 8000; | 26 int fs_hz = 8000; |
| 27 int output_size_samples = fs_hz / 100; // Samples per 10 ms. | 27 int output_size_samples = fs_hz / 100; // Samples per 10 ms. |
| 28 DecoderDatabase decoder_database( | 28 DecoderDatabase decoder_database( |
| 29 std::unique_ptr<MockAudioDecoderFactory>(new MockAudioDecoderFactory)); | 29 std::unique_ptr<MockAudioDecoderFactory>(new MockAudioDecoderFactory)); |
| 30 TickTimer tick_timer; | 30 TickTimer tick_timer; |
| 31 PacketBuffer packet_buffer(10, &tick_timer); | 31 PacketBuffer packet_buffer(10, &tick_timer); |
| 32 DelayPeakDetector delay_peak_detector(&tick_timer); | 32 DelayPeakDetector delay_peak_detector(&tick_timer); |
| 33 DelayManager delay_manager(240, &delay_peak_detector, &tick_timer); | 33 DelayManager delay_manager(240, &delay_peak_detector, &tick_timer); |
| 34 BufferLevelFilter buffer_level_filter; | 34 BufferLevelFilter buffer_level_filter; |
| 35 DecisionLogic* logic = DecisionLogic::Create(fs_hz, output_size_samples, | 35 DecisionLogic* logic = DecisionLogic::Create( |
| 36 kPlayoutOn, &decoder_database, | 36 fs_hz, output_size_samples, kPlayoutOn, &decoder_database, packet_buffer, |
| 37 packet_buffer, &delay_manager, | 37 &delay_manager, &buffer_level_filter, &tick_timer); |
| 38 &buffer_level_filter); | |
| 39 delete logic; | 38 delete logic; |
| 40 logic = DecisionLogic::Create(fs_hz, output_size_samples, | 39 logic = DecisionLogic::Create( |
| 41 kPlayoutStreaming, | 40 fs_hz, output_size_samples, kPlayoutStreaming, &decoder_database, |
| 42 &decoder_database, | 41 packet_buffer, &delay_manager, &buffer_level_filter, &tick_timer); |
| 43 packet_buffer, &delay_manager, | |
| 44 &buffer_level_filter); | |
| 45 delete logic; | 42 delete logic; |
| 46 logic = DecisionLogic::Create(fs_hz, output_size_samples, | 43 logic = DecisionLogic::Create( |
| 47 kPlayoutFax, | 44 fs_hz, output_size_samples, kPlayoutFax, &decoder_database, packet_buffer, |
| 48 &decoder_database, | 45 &delay_manager, &buffer_level_filter, &tick_timer); |
| 49 packet_buffer, &delay_manager, | |
| 50 &buffer_level_filter); | |
| 51 delete logic; | 46 delete logic; |
| 52 logic = DecisionLogic::Create(fs_hz, output_size_samples, | 47 logic = DecisionLogic::Create( |
| 53 kPlayoutOff, | 48 fs_hz, output_size_samples, kPlayoutOff, &decoder_database, packet_buffer, |
| 54 &decoder_database, | 49 &delay_manager, &buffer_level_filter, &tick_timer); |
| 55 packet_buffer, &delay_manager, | |
| 56 &buffer_level_filter); | |
| 57 delete logic; | 50 delete logic; |
| 58 } | 51 } |
| 59 | 52 |
| 60 // TODO(hlundin): Write more tests. | 53 // TODO(hlundin): Write more tests. |
| 61 | 54 |
| 62 } // namespace webrtc | 55 } // namespace webrtc |
| OLD | NEW |