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 848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
859 return others; | 859 return others; |
860 #endif | 860 #endif |
861 } | 861 } |
862 | 862 |
863 protected: | 863 protected: |
864 struct ExternalDecoder { | 864 struct ExternalDecoder { |
865 int rtp_payload_type; | 865 int rtp_payload_type; |
866 AudioDecoder* external_decoder; | 866 AudioDecoder* external_decoder; |
867 int sample_rate_hz; | 867 int sample_rate_hz; |
868 int num_channels; | 868 int num_channels; |
| 869 std::string name; |
869 }; | 870 }; |
870 | 871 |
871 void Run(int output_freq_hz, | 872 void Run(int output_freq_hz, |
872 const std::string& checksum_ref, | 873 const std::string& checksum_ref, |
873 const std::vector<ExternalDecoder>& external_decoders) { | 874 const std::vector<ExternalDecoder>& external_decoders) { |
874 const std::string input_file_name = | 875 const std::string input_file_name = |
875 webrtc::test::ResourcePath("audio_coding/neteq_universal_new", "rtp"); | 876 webrtc::test::ResourcePath("audio_coding/neteq_universal_new", "rtp"); |
876 rtc::scoped_ptr<test::RtpFileSource> packet_source( | 877 rtc::scoped_ptr<test::RtpFileSource> packet_source( |
877 test::RtpFileSource::Create(input_file_name)); | 878 test::RtpFileSource::Create(input_file_name)); |
878 #ifdef WEBRTC_ANDROID | 879 #ifdef WEBRTC_ANDROID |
(...skipping 15 matching lines...) Expand all Loading... |
894 | 895 |
895 test::AcmReceiveTestOldApi test( | 896 test::AcmReceiveTestOldApi test( |
896 packet_source.get(), | 897 packet_source.get(), |
897 &output, | 898 &output, |
898 output_freq_hz, | 899 output_freq_hz, |
899 test::AcmReceiveTestOldApi::kArbitraryChannels); | 900 test::AcmReceiveTestOldApi::kArbitraryChannels); |
900 ASSERT_NO_FATAL_FAILURE(test.RegisterNetEqTestCodecs()); | 901 ASSERT_NO_FATAL_FAILURE(test.RegisterNetEqTestCodecs()); |
901 for (const auto& ed : external_decoders) { | 902 for (const auto& ed : external_decoders) { |
902 ASSERT_EQ(0, test.RegisterExternalReceiveCodec( | 903 ASSERT_EQ(0, test.RegisterExternalReceiveCodec( |
903 ed.rtp_payload_type, ed.external_decoder, | 904 ed.rtp_payload_type, ed.external_decoder, |
904 ed.sample_rate_hz, ed.num_channels)); | 905 ed.sample_rate_hz, ed.num_channels, ed.name)); |
905 } | 906 } |
906 test.Run(); | 907 test.Run(); |
907 | 908 |
908 std::string checksum_string = checksum.Finish(); | 909 std::string checksum_string = checksum.Finish(); |
909 EXPECT_EQ(checksum_ref, checksum_string); | 910 EXPECT_EQ(checksum_ref, checksum_string); |
910 | 911 |
911 // Delete the output file. | 912 // Delete the output file. |
912 remove(output_file_name.c_str()); | 913 remove(output_file_name.c_str()); |
913 } | 914 } |
914 }; | 915 }; |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1019 .Times(AtLeast(1)) | 1020 .Times(AtLeast(1)) |
1020 .WillRepeatedly(Invoke(&decoder, &AudioDecoderPcmU::HasDecodePlc)); | 1021 .WillRepeatedly(Invoke(&decoder, &AudioDecoderPcmU::HasDecodePlc)); |
1021 EXPECT_CALL(mock_decoder, PacketDuration(_, _)) | 1022 EXPECT_CALL(mock_decoder, PacketDuration(_, _)) |
1022 .Times(AtLeast(1)) | 1023 .Times(AtLeast(1)) |
1023 .WillRepeatedly(Invoke(&decoder, &AudioDecoderPcmU::PacketDuration)); | 1024 .WillRepeatedly(Invoke(&decoder, &AudioDecoderPcmU::PacketDuration)); |
1024 ExternalDecoder ed; | 1025 ExternalDecoder ed; |
1025 ed.rtp_payload_type = 0; | 1026 ed.rtp_payload_type = 0; |
1026 ed.external_decoder = &mock_decoder; | 1027 ed.external_decoder = &mock_decoder; |
1027 ed.sample_rate_hz = 8000; | 1028 ed.sample_rate_hz = 8000; |
1028 ed.num_channels = 1; | 1029 ed.num_channels = 1; |
| 1030 ed.name = "MockPCMU"; |
1029 std::vector<ExternalDecoder> external_decoders; | 1031 std::vector<ExternalDecoder> external_decoders; |
1030 external_decoders.push_back(ed); | 1032 external_decoders.push_back(ed); |
1031 | 1033 |
1032 Run(48000, PlatformChecksum("aa7c232f63a67b2a72703593bdd172e0", | 1034 Run(48000, PlatformChecksum("aa7c232f63a67b2a72703593bdd172e0", |
1033 "0155665e93067c4e89256b944dd11999", | 1035 "0155665e93067c4e89256b944dd11999", |
1034 "4ee2730fa1daae755e8a8fd3abd779ec"), | 1036 "4ee2730fa1daae755e8a8fd3abd779ec"), |
1035 external_decoders); | 1037 external_decoders); |
1036 | 1038 |
1037 EXPECT_CALL(mock_decoder, Die()); | 1039 EXPECT_CALL(mock_decoder, Die()); |
1038 } | 1040 } |
(...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1794 Run(16000, 8000, 1000); | 1796 Run(16000, 8000, 1000); |
1795 } | 1797 } |
1796 | 1798 |
1797 TEST_F(AcmSwitchingOutputFrequencyOldApi, Toggle8KhzTo16Khz) { | 1799 TEST_F(AcmSwitchingOutputFrequencyOldApi, Toggle8KhzTo16Khz) { |
1798 Run(8000, 16000, 1000); | 1800 Run(8000, 16000, 1000); |
1799 } | 1801 } |
1800 | 1802 |
1801 #endif | 1803 #endif |
1802 | 1804 |
1803 } // namespace webrtc | 1805 } // namespace webrtc |
OLD | NEW |