OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 // Test to verify correct stereo and multi-channel operation. | 11 // Test to verify correct stereo and multi-channel operation. |
12 | 12 |
13 #include <algorithm> | 13 #include <algorithm> |
14 #include <memory> | 14 #include <memory> |
15 #include <string> | 15 #include <string> |
16 #include <list> | 16 #include <list> |
17 | 17 |
18 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
| 19 #include "webrtc/modules/audio_coding/codecs/builtin_audio_decoder_factory.h" |
19 #include "webrtc/modules/audio_coding/codecs/pcm16b/pcm16b.h" | 20 #include "webrtc/modules/audio_coding/codecs/pcm16b/pcm16b.h" |
20 #include "webrtc/modules/audio_coding/neteq/include/neteq.h" | 21 #include "webrtc/modules/audio_coding/neteq/include/neteq.h" |
21 #include "webrtc/modules/audio_coding/neteq/tools/input_audio_file.h" | 22 #include "webrtc/modules/audio_coding/neteq/tools/input_audio_file.h" |
22 #include "webrtc/modules/audio_coding/neteq/tools/rtp_generator.h" | 23 #include "webrtc/modules/audio_coding/neteq/tools/rtp_generator.h" |
23 #include "webrtc/modules/include/module_common_types.h" | 24 #include "webrtc/modules/include/module_common_types.h" |
24 #include "webrtc/test/testsupport/fileutils.h" | 25 #include "webrtc/test/testsupport/fileutils.h" |
25 | 26 |
26 namespace webrtc { | 27 namespace webrtc { |
27 | 28 |
28 struct TestParameters { | 29 struct TestParameters { |
(...skipping 27 matching lines...) Expand all Loading... |
56 static_cast<size_t>(frame_size_ms_ * samples_per_ms_)), | 57 static_cast<size_t>(frame_size_ms_ * samples_per_ms_)), |
57 output_size_samples_(10 * samples_per_ms_), | 58 output_size_samples_(10 * samples_per_ms_), |
58 rtp_generator_mono_(samples_per_ms_), | 59 rtp_generator_mono_(samples_per_ms_), |
59 rtp_generator_(samples_per_ms_), | 60 rtp_generator_(samples_per_ms_), |
60 payload_size_bytes_(0), | 61 payload_size_bytes_(0), |
61 multi_payload_size_bytes_(0), | 62 multi_payload_size_bytes_(0), |
62 last_send_time_(0), | 63 last_send_time_(0), |
63 last_arrival_time_(0) { | 64 last_arrival_time_(0) { |
64 NetEq::Config config; | 65 NetEq::Config config; |
65 config.sample_rate_hz = sample_rate_hz_; | 66 config.sample_rate_hz = sample_rate_hz_; |
66 neteq_mono_ = NetEq::Create(config); | 67 rtc::scoped_refptr<AudioDecoderFactory> factory = |
67 neteq_ = NetEq::Create(config); | 68 CreateBuiltinAudioDecoderFactory(); |
| 69 neteq_mono_ = NetEq::Create(config, factory); |
| 70 neteq_ = NetEq::Create(config, factory); |
68 input_ = new int16_t[frame_size_samples_]; | 71 input_ = new int16_t[frame_size_samples_]; |
69 encoded_ = new uint8_t[2 * frame_size_samples_]; | 72 encoded_ = new uint8_t[2 * frame_size_samples_]; |
70 input_multi_channel_ = new int16_t[frame_size_samples_ * num_channels_]; | 73 input_multi_channel_ = new int16_t[frame_size_samples_ * num_channels_]; |
71 encoded_multi_channel_ = new uint8_t[frame_size_samples_ * 2 * | 74 encoded_multi_channel_ = new uint8_t[frame_size_samples_ * 2 * |
72 num_channels_]; | 75 num_channels_]; |
73 } | 76 } |
74 | 77 |
75 ~NetEqStereoTest() { | 78 ~NetEqStereoTest() { |
76 delete neteq_mono_; | 79 delete neteq_mono_; |
77 delete neteq_; | 80 delete neteq_; |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
424 | 427 |
425 INSTANTIATE_TEST_CASE_P(MultiChannel, | 428 INSTANTIATE_TEST_CASE_P(MultiChannel, |
426 NetEqStereoTestDelays, | 429 NetEqStereoTestDelays, |
427 ::testing::ValuesIn(GetTestParameters())); | 430 ::testing::ValuesIn(GetTestParameters())); |
428 | 431 |
429 INSTANTIATE_TEST_CASE_P(MultiChannel, | 432 INSTANTIATE_TEST_CASE_P(MultiChannel, |
430 NetEqStereoTestLosses, | 433 NetEqStereoTestLosses, |
431 ::testing::ValuesIn(GetTestParameters())); | 434 ::testing::ValuesIn(GetTestParameters())); |
432 | 435 |
433 } // namespace webrtc | 436 } // namespace webrtc |
OLD | NEW |