OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 17 matching lines...) Expand all Loading... |
28 #include "webrtc/modules/audio_coding/codecs/mock/mock_audio_encoder.h" | 28 #include "webrtc/modules/audio_coding/codecs/mock/mock_audio_encoder.h" |
29 #include "webrtc/modules/audio_coding/include/audio_coding_module.h" | 29 #include "webrtc/modules/audio_coding/include/audio_coding_module.h" |
30 #include "webrtc/modules/audio_coding/include/audio_coding_module_typedefs.h" | 30 #include "webrtc/modules/audio_coding/include/audio_coding_module_typedefs.h" |
31 #include "webrtc/modules/audio_coding/neteq/audio_decoder_impl.h" | 31 #include "webrtc/modules/audio_coding/neteq/audio_decoder_impl.h" |
32 #include "webrtc/modules/audio_coding/neteq/mock/mock_audio_decoder.h" | 32 #include "webrtc/modules/audio_coding/neteq/mock/mock_audio_decoder.h" |
33 #include "webrtc/modules/audio_coding/neteq/tools/audio_checksum.h" | 33 #include "webrtc/modules/audio_coding/neteq/tools/audio_checksum.h" |
34 #include "webrtc/modules/audio_coding/neteq/tools/audio_loop.h" | 34 #include "webrtc/modules/audio_coding/neteq/tools/audio_loop.h" |
35 #include "webrtc/modules/audio_coding/neteq/tools/constant_pcm_packet_source.h" | 35 #include "webrtc/modules/audio_coding/neteq/tools/constant_pcm_packet_source.h" |
36 #include "webrtc/modules/audio_coding/neteq/tools/input_audio_file.h" | 36 #include "webrtc/modules/audio_coding/neteq/tools/input_audio_file.h" |
37 #include "webrtc/modules/audio_coding/neteq/tools/output_audio_file.h" | 37 #include "webrtc/modules/audio_coding/neteq/tools/output_audio_file.h" |
| 38 #include "webrtc/modules/audio_coding/neteq/tools/output_wav_file.h" |
38 #include "webrtc/modules/audio_coding/neteq/tools/packet.h" | 39 #include "webrtc/modules/audio_coding/neteq/tools/packet.h" |
39 #include "webrtc/modules/audio_coding/neteq/tools/rtp_file_source.h" | 40 #include "webrtc/modules/audio_coding/neteq/tools/rtp_file_source.h" |
40 #include "webrtc/modules/include/module_common_types.h" | 41 #include "webrtc/modules/include/module_common_types.h" |
41 #include "webrtc/system_wrappers/include/clock.h" | 42 #include "webrtc/system_wrappers/include/clock.h" |
42 #include "webrtc/system_wrappers/include/event_wrapper.h" | 43 #include "webrtc/system_wrappers/include/event_wrapper.h" |
43 #include "webrtc/system_wrappers/include/sleep.h" | 44 #include "webrtc/system_wrappers/include/sleep.h" |
44 #include "webrtc/test/gtest.h" | 45 #include "webrtc/test/gtest.h" |
45 #include "webrtc/test/testsupport/fileutils.h" | 46 #include "webrtc/test/testsupport/fileutils.h" |
46 | 47 |
47 using ::testing::AtLeast; | 48 using ::testing::AtLeast; |
(...skipping 899 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
947 packet_source->FilterOutPayloadType(104); // iSAC-swb. | 948 packet_source->FilterOutPayloadType(104); // iSAC-swb. |
948 #endif | 949 #endif |
949 | 950 |
950 test::AudioChecksum checksum; | 951 test::AudioChecksum checksum; |
951 const std::string output_file_name = | 952 const std::string output_file_name = |
952 webrtc::test::OutputPath() + | 953 webrtc::test::OutputPath() + |
953 ::testing::UnitTest::GetInstance() | 954 ::testing::UnitTest::GetInstance() |
954 ->current_test_info() | 955 ->current_test_info() |
955 ->test_case_name() + | 956 ->test_case_name() + |
956 "_" + ::testing::UnitTest::GetInstance()->current_test_info()->name() + | 957 "_" + ::testing::UnitTest::GetInstance()->current_test_info()->name() + |
957 "_output.pcm"; | 958 "_output.wav"; |
958 test::OutputAudioFile output_file(output_file_name); | 959 test::OutputWavFile output_file(output_file_name, output_freq_hz); |
959 test::AudioSinkFork output(&checksum, &output_file); | 960 test::AudioSinkFork output(&checksum, &output_file); |
960 | 961 |
961 test::AcmReceiveTestOldApi test( | 962 test::AcmReceiveTestOldApi test( |
962 packet_source.get(), &output, output_freq_hz, | 963 packet_source.get(), &output, output_freq_hz, |
963 test::AcmReceiveTestOldApi::kArbitraryChannels, | 964 test::AcmReceiveTestOldApi::kArbitraryChannels, |
964 std::move(decoder_factory)); | 965 std::move(decoder_factory)); |
965 ASSERT_NO_FATAL_FAILURE(test.RegisterNetEqTestCodecs()); | 966 ASSERT_NO_FATAL_FAILURE(test.RegisterNetEqTestCodecs()); |
966 decoder_reg(test.get_acm()); | 967 decoder_reg(test.get_acm()); |
967 test.Run(); | 968 test.Run(); |
968 | 969 |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1163 test::AcmReceiveTestOldApi::NumOutputChannels expected_channels) { | 1164 test::AcmReceiveTestOldApi::NumOutputChannels expected_channels) { |
1164 // Set up the receiver used to decode the packets and verify the decoded | 1165 // Set up the receiver used to decode the packets and verify the decoded |
1165 // output. | 1166 // output. |
1166 test::AudioChecksum audio_checksum; | 1167 test::AudioChecksum audio_checksum; |
1167 const std::string output_file_name = | 1168 const std::string output_file_name = |
1168 webrtc::test::OutputPath() + | 1169 webrtc::test::OutputPath() + |
1169 ::testing::UnitTest::GetInstance() | 1170 ::testing::UnitTest::GetInstance() |
1170 ->current_test_info() | 1171 ->current_test_info() |
1171 ->test_case_name() + | 1172 ->test_case_name() + |
1172 "_" + ::testing::UnitTest::GetInstance()->current_test_info()->name() + | 1173 "_" + ::testing::UnitTest::GetInstance()->current_test_info()->name() + |
1173 "_output.pcm"; | 1174 "_output.wav"; |
1174 test::OutputAudioFile output_file(output_file_name); | 1175 const int kOutputFreqHz = 8000; |
| 1176 test::OutputWavFile output_file(output_file_name, kOutputFreqHz); |
1175 // Have the output audio sent both to file and to the checksum calculator. | 1177 // Have the output audio sent both to file and to the checksum calculator. |
1176 test::AudioSinkFork output(&audio_checksum, &output_file); | 1178 test::AudioSinkFork output(&audio_checksum, &output_file); |
1177 const int kOutputFreqHz = 8000; | |
1178 test::AcmReceiveTestOldApi receive_test(this, &output, kOutputFreqHz, | 1179 test::AcmReceiveTestOldApi receive_test(this, &output, kOutputFreqHz, |
1179 expected_channels, | 1180 expected_channels, |
1180 CreateBuiltinAudioDecoderFactory()); | 1181 CreateBuiltinAudioDecoderFactory()); |
1181 ASSERT_NO_FATAL_FAILURE(receive_test.RegisterDefaultCodecs()); | 1182 ASSERT_NO_FATAL_FAILURE(receive_test.RegisterDefaultCodecs()); |
1182 | 1183 |
1183 // This is where the actual test is executed. | 1184 // This is where the actual test is executed. |
1184 receive_test.Run(); | 1185 receive_test.Run(); |
1185 | 1186 |
1186 // Extract and verify the audio checksum. | 1187 // Extract and verify the audio checksum. |
1187 std::string checksum_string = audio_checksum.Finish(); | 1188 std::string checksum_string = audio_checksum.Finish(); |
(...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1875 Run(16000, 8000, 1000); | 1876 Run(16000, 8000, 1000); |
1876 } | 1877 } |
1877 | 1878 |
1878 TEST_F(AcmSwitchingOutputFrequencyOldApi, Toggle8KhzTo16Khz) { | 1879 TEST_F(AcmSwitchingOutputFrequencyOldApi, Toggle8KhzTo16Khz) { |
1879 Run(8000, 16000, 1000); | 1880 Run(8000, 16000, 1000); |
1880 } | 1881 } |
1881 | 1882 |
1882 #endif | 1883 #endif |
1883 | 1884 |
1884 } // namespace webrtc | 1885 } // namespace webrtc |
OLD | NEW |