OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2017 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 | 90 |
91 test::PacketTransport* AudioQualityTest::CreateReceiveTransport() { | 91 test::PacketTransport* AudioQualityTest::CreateReceiveTransport() { |
92 return new test::PacketTransport( | 92 return new test::PacketTransport( |
93 nullptr, this, test::PacketTransport::kReceiver, | 93 nullptr, this, test::PacketTransport::kReceiver, |
94 test::CallTest::payload_type_map_, GetNetworkPipeConfig()); | 94 test::CallTest::payload_type_map_, GetNetworkPipeConfig()); |
95 } | 95 } |
96 | 96 |
97 void AudioQualityTest::ModifyAudioConfigs( | 97 void AudioQualityTest::ModifyAudioConfigs( |
98 AudioSendStream::Config* send_config, | 98 AudioSendStream::Config* send_config, |
99 std::vector<AudioReceiveStream::Config>* receive_configs) { | 99 std::vector<AudioReceiveStream::Config>* receive_configs) { |
100 send_config->send_codec_spec.codec_inst = webrtc::CodecInst{ | 100 // Large bitrate by default. |
101 test::CallTest::kAudioSendPayloadType, "OPUS", 48000, 960, 2, 64000}; | 101 const webrtc::SdpAudioFormat kDefaultFormat("OPUS", 48000, 2, |
| 102 {{"stereo", "1"}}); |
| 103 send_config->send_codec_spec = |
| 104 rtc::Optional<AudioSendStream::Config::SendCodecSpec>( |
| 105 {test::CallTest::kAudioSendPayloadType, kDefaultFormat}); |
102 } | 106 } |
103 | 107 |
104 void AudioQualityTest::PerformTest() { | 108 void AudioQualityTest::PerformTest() { |
105 // Wait until the input audio file is done... | 109 // Wait until the input audio file is done... |
106 send_audio_device_->WaitForRecordingEnd(); | 110 send_audio_device_->WaitForRecordingEnd(); |
107 // and some extra time to account for network delay. | 111 // and some extra time to account for network delay. |
108 SleepMs(GetNetworkPipeConfig().queue_delay_ms + kExtraRecordTimeMs); | 112 SleepMs(GetNetworkPipeConfig().queue_delay_ms + kExtraRecordTimeMs); |
109 } | 113 } |
110 | 114 |
111 void AudioQualityTest::OnTestFinished() { | 115 void AudioQualityTest::OnTestFinished() { |
(...skipping 11 matching lines...) Expand all Loading... |
123 | 127 |
124 TEST_F(LowBandwidthAudioTest, GoodNetworkHighBitrate) { | 128 TEST_F(LowBandwidthAudioTest, GoodNetworkHighBitrate) { |
125 AudioQualityTest test; | 129 AudioQualityTest test; |
126 RunBaseTest(&test); | 130 RunBaseTest(&test); |
127 } | 131 } |
128 | 132 |
129 | 133 |
130 class Mobile2GNetworkTest : public AudioQualityTest { | 134 class Mobile2GNetworkTest : public AudioQualityTest { |
131 void ModifyAudioConfigs(AudioSendStream::Config* send_config, | 135 void ModifyAudioConfigs(AudioSendStream::Config* send_config, |
132 std::vector<AudioReceiveStream::Config>* receive_configs) override { | 136 std::vector<AudioReceiveStream::Config>* receive_configs) override { |
133 send_config->send_codec_spec.codec_inst = CodecInst{ | 137 send_config->send_codec_spec = |
134 test::CallTest::kAudioSendPayloadType, // pltype | 138 rtc::Optional<AudioSendStream::Config::SendCodecSpec>( |
135 "OPUS", // plname | 139 {test::CallTest::kAudioSendPayloadType, |
136 48000, // plfreq | 140 {"OPUS", |
137 2880, // pacsize | 141 48000, |
138 1, // channels | 142 2, |
139 6000 // rate bits/sec | 143 {{"maxaveragebitrate", "6000"}, |
140 }; | 144 {"ptime", "60"}, |
| 145 {"stereo", "1"}}}}); |
141 } | 146 } |
142 | 147 |
143 FakeNetworkPipe::Config GetNetworkPipeConfig() override { | 148 FakeNetworkPipe::Config GetNetworkPipeConfig() override { |
144 FakeNetworkPipe::Config pipe_config; | 149 FakeNetworkPipe::Config pipe_config; |
145 pipe_config.link_capacity_kbps = 12; | 150 pipe_config.link_capacity_kbps = 12; |
146 pipe_config.queue_length_packets = 1500; | 151 pipe_config.queue_length_packets = 1500; |
147 pipe_config.queue_delay_ms = 400; | 152 pipe_config.queue_delay_ms = 400; |
148 return pipe_config; | 153 return pipe_config; |
149 } | 154 } |
150 }; | 155 }; |
151 | 156 |
152 TEST_F(LowBandwidthAudioTest, Mobile2GNetwork) { | 157 TEST_F(LowBandwidthAudioTest, Mobile2GNetwork) { |
153 Mobile2GNetworkTest test; | 158 Mobile2GNetworkTest test; |
154 RunBaseTest(&test); | 159 RunBaseTest(&test); |
155 } | 160 } |
156 | 161 |
157 } // namespace test | 162 } // namespace test |
158 } // namespace webrtc | 163 } // namespace webrtc |
OLD | NEW |