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 847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
858 return others; | 858 return others; |
859 #endif | 859 #endif |
860 } | 860 } |
861 | 861 |
862 protected: | 862 protected: |
863 struct ExternalDecoder { | 863 struct ExternalDecoder { |
864 int rtp_payload_type; | 864 int rtp_payload_type; |
865 AudioDecoder* external_decoder; | 865 AudioDecoder* external_decoder; |
866 int sample_rate_hz; | 866 int sample_rate_hz; |
867 int num_channels; | 867 int num_channels; |
| 868 std::string name; |
868 }; | 869 }; |
869 | 870 |
870 void Run(int output_freq_hz, | 871 void Run(int output_freq_hz, |
871 const std::string& checksum_ref, | 872 const std::string& checksum_ref, |
872 const std::vector<ExternalDecoder>& external_decoders) { | 873 const std::vector<ExternalDecoder>& external_decoders) { |
873 const std::string input_file_name = | 874 const std::string input_file_name = |
874 webrtc::test::ResourcePath("audio_coding/neteq_universal_new", "rtp"); | 875 webrtc::test::ResourcePath("audio_coding/neteq_universal_new", "rtp"); |
875 rtc::scoped_ptr<test::RtpFileSource> packet_source( | 876 rtc::scoped_ptr<test::RtpFileSource> packet_source( |
876 test::RtpFileSource::Create(input_file_name)); | 877 test::RtpFileSource::Create(input_file_name)); |
877 #ifdef WEBRTC_ANDROID | 878 #ifdef WEBRTC_ANDROID |
(...skipping 15 matching lines...) Expand all Loading... |
893 | 894 |
894 test::AcmReceiveTestOldApi test( | 895 test::AcmReceiveTestOldApi test( |
895 packet_source.get(), | 896 packet_source.get(), |
896 &output, | 897 &output, |
897 output_freq_hz, | 898 output_freq_hz, |
898 test::AcmReceiveTestOldApi::kArbitraryChannels); | 899 test::AcmReceiveTestOldApi::kArbitraryChannels); |
899 ASSERT_NO_FATAL_FAILURE(test.RegisterNetEqTestCodecs()); | 900 ASSERT_NO_FATAL_FAILURE(test.RegisterNetEqTestCodecs()); |
900 for (const auto& ed : external_decoders) { | 901 for (const auto& ed : external_decoders) { |
901 ASSERT_EQ(0, test.RegisterExternalReceiveCodec( | 902 ASSERT_EQ(0, test.RegisterExternalReceiveCodec( |
902 ed.rtp_payload_type, ed.external_decoder, | 903 ed.rtp_payload_type, ed.external_decoder, |
903 ed.sample_rate_hz, ed.num_channels)); | 904 ed.sample_rate_hz, ed.num_channels, ed.name)); |
904 } | 905 } |
905 test.Run(); | 906 test.Run(); |
906 | 907 |
907 std::string checksum_string = checksum.Finish(); | 908 std::string checksum_string = checksum.Finish(); |
908 EXPECT_EQ(checksum_ref, checksum_string); | 909 EXPECT_EQ(checksum_ref, checksum_string); |
909 } | 910 } |
910 }; | 911 }; |
911 | 912 |
912 #if (defined(WEBRTC_CODEC_ISAC) || defined(WEBRTC_CODEC_ISAC)) && \ | 913 #if (defined(WEBRTC_CODEC_ISAC) || defined(WEBRTC_CODEC_ISAC)) && \ |
913 defined(WEBRTC_CODEC_ILBC) && defined(WEBRTC_CODEC_G722) | 914 defined(WEBRTC_CODEC_ILBC) && defined(WEBRTC_CODEC_G722) |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
993 .Times(AtLeast(1)) | 994 .Times(AtLeast(1)) |
994 .WillRepeatedly(Invoke(&decoder, &AudioDecoderPcmU::HasDecodePlc)); | 995 .WillRepeatedly(Invoke(&decoder, &AudioDecoderPcmU::HasDecodePlc)); |
995 EXPECT_CALL(mock_decoder, PacketDuration(_, _)) | 996 EXPECT_CALL(mock_decoder, PacketDuration(_, _)) |
996 .Times(AtLeast(1)) | 997 .Times(AtLeast(1)) |
997 .WillRepeatedly(Invoke(&decoder, &AudioDecoderPcmU::PacketDuration)); | 998 .WillRepeatedly(Invoke(&decoder, &AudioDecoderPcmU::PacketDuration)); |
998 ExternalDecoder ed; | 999 ExternalDecoder ed; |
999 ed.rtp_payload_type = 0; | 1000 ed.rtp_payload_type = 0; |
1000 ed.external_decoder = &mock_decoder; | 1001 ed.external_decoder = &mock_decoder; |
1001 ed.sample_rate_hz = 8000; | 1002 ed.sample_rate_hz = 8000; |
1002 ed.num_channels = 1; | 1003 ed.num_channels = 1; |
| 1004 ed.name = "MockPCMU"; |
1003 std::vector<ExternalDecoder> external_decoders; | 1005 std::vector<ExternalDecoder> external_decoders; |
1004 external_decoders.push_back(ed); | 1006 external_decoders.push_back(ed); |
1005 | 1007 |
1006 Run(48000, PlatformChecksum("aa7c232f63a67b2a72703593bdd172e0", | 1008 Run(48000, PlatformChecksum("aa7c232f63a67b2a72703593bdd172e0", |
1007 "0155665e93067c4e89256b944dd11999", | 1009 "0155665e93067c4e89256b944dd11999", |
1008 "4ee2730fa1daae755e8a8fd3abd779ec"), | 1010 "4ee2730fa1daae755e8a8fd3abd779ec"), |
1009 external_decoders); | 1011 external_decoders); |
1010 | 1012 |
1011 EXPECT_CALL(mock_decoder, Die()); | 1013 EXPECT_CALL(mock_decoder, Die()); |
1012 } | 1014 } |
(...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1762 Run(16000, 8000, 1000); | 1764 Run(16000, 8000, 1000); |
1763 } | 1765 } |
1764 | 1766 |
1765 TEST_F(AcmSwitchingOutputFrequencyOldApi, Toggle8KhzTo16Khz) { | 1767 TEST_F(AcmSwitchingOutputFrequencyOldApi, Toggle8KhzTo16Khz) { |
1766 Run(8000, 16000, 1000); | 1768 Run(8000, 16000, 1000); |
1767 } | 1769 } |
1768 | 1770 |
1769 #endif | 1771 #endif |
1770 | 1772 |
1771 } // namespace webrtc | 1773 } // namespace webrtc |
OLD | NEW |