| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 CHECK_NETEQ_NETWORK_STATS(clockdrift_ppm); | 170 CHECK_NETEQ_NETWORK_STATS(clockdrift_ppm); |
| 171 CHECK_NETEQ_NETWORK_STATS(added_zero_samples); | 171 CHECK_NETEQ_NETWORK_STATS(added_zero_samples); |
| 172 | 172 |
| 173 #undef CHECK_NETEQ_NETWORK_STATS | 173 #undef CHECK_NETEQ_NETWORK_STATS |
| 174 | 174 |
| 175 // Compare with CurrentDelay, which should be identical. | 175 // Compare with CurrentDelay, which should be identical. |
| 176 EXPECT_EQ(stats.current_buffer_size_ms, neteq()->CurrentDelayMs()); | 176 EXPECT_EQ(stats.current_buffer_size_ms, neteq()->CurrentDelayMs()); |
| 177 } | 177 } |
| 178 | 178 |
| 179 void RunTest(int num_loops, NetEqNetworkStatsCheck expects) { | 179 void RunTest(int num_loops, NetEqNetworkStatsCheck expects) { |
| 180 NetEqOutputType output_type; | |
| 181 uint32_t time_now; | 180 uint32_t time_now; |
| 182 uint32_t next_send_time; | 181 uint32_t next_send_time; |
| 183 | 182 |
| 184 // Initiate |last_lost_time_|. | 183 // Initiate |last_lost_time_|. |
| 185 time_now = next_send_time = last_lost_time_ = | 184 time_now = next_send_time = last_lost_time_ = |
| 186 rtp_generator_->GetRtpHeader(kPayloadType, frame_size_samples_, | 185 rtp_generator_->GetRtpHeader(kPayloadType, frame_size_samples_, |
| 187 &rtp_header_); | 186 &rtp_header_); |
| 188 for (int k = 0; k < num_loops; ++k) { | 187 for (int k = 0; k < num_loops; ++k) { |
| 189 // Delay by one frame such that the FEC can come in. | 188 // Delay by one frame such that the FEC can come in. |
| 190 while (time_now + kFrameSizeMs >= next_send_time) { | 189 while (time_now + kFrameSizeMs >= next_send_time) { |
| 191 next_send_time = rtp_generator_->GetRtpHeader(kPayloadType, | 190 next_send_time = rtp_generator_->GetRtpHeader(kPayloadType, |
| 192 frame_size_samples_, | 191 frame_size_samples_, |
| 193 &rtp_header_); | 192 &rtp_header_); |
| 194 if (!Lost(next_send_time)) { | 193 if (!Lost(next_send_time)) { |
| 195 InsertPacket(rtp_header_, payload_, next_send_time); | 194 InsertPacket(rtp_header_, payload_, next_send_time); |
| 196 } | 195 } |
| 197 } | 196 } |
| 198 GetOutputAudio(&output_frame_, &output_type); | 197 GetOutputAudio(&output_frame_); |
| 199 time_now += kOutputLengthMs; | 198 time_now += kOutputLengthMs; |
| 200 } | 199 } |
| 201 CheckNetworkStatistics(expects); | 200 CheckNetworkStatistics(expects); |
| 202 neteq()->FlushBuffers(); | 201 neteq()->FlushBuffers(); |
| 203 } | 202 } |
| 204 | 203 |
| 205 void DecodeFecTest() { | 204 void DecodeFecTest() { |
| 206 external_decoder_->set_fec_enabled(false); | 205 external_decoder_->set_fec_enabled(false); |
| 207 NetEqNetworkStatsCheck expects = { | 206 NetEqNetworkStatsCheck expects = { |
| 208 kIgnore, // current_buffer_size_ms | 207 kIgnore, // current_buffer_size_ms |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 test.NoiseExpansionTest(); | 291 test.NoiseExpansionTest(); |
| 293 EXPECT_CALL(decoder, Die()).Times(1); | 292 EXPECT_CALL(decoder, Die()).Times(1); |
| 294 } | 293 } |
| 295 | 294 |
| 296 } // namespace test | 295 } // namespace test |
| 297 } // namespace webrtc | 296 } // namespace webrtc |
| 298 | 297 |
| 299 | 298 |
| 300 | 299 |
| 301 | 300 |
| OLD | NEW |