OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 fflush (stdout); | 202 fflush (stdout); |
203 } | 203 } |
204 | 204 |
205 in_file_a_.Read10MsData(audio_frame); | 205 in_file_a_.Read10MsData(audio_frame); |
206 ASSERT_GE(acm_a_->Add10MsData(audio_frame), 0); | 206 ASSERT_GE(acm_a_->Add10MsData(audio_frame), 0); |
207 bool muted; | 207 bool muted; |
208 ASSERT_EQ(0, | 208 ASSERT_EQ(0, |
209 acm_b_->PlayoutData10Ms(out_freq_hz_b, &audio_frame, &muted)); | 209 acm_b_->PlayoutData10Ms(out_freq_hz_b, &audio_frame, &muted)); |
210 RTC_DCHECK(!muted); | 210 RTC_DCHECK(!muted); |
211 out_file_b_.Write10MsData( | 211 out_file_b_.Write10MsData( |
212 audio_frame.data_, | 212 audio_frame.data(), |
213 audio_frame.samples_per_channel_ * audio_frame.num_channels_); | 213 audio_frame.samples_per_channel_ * audio_frame.num_channels_); |
214 received_ts = channel_a2b_->LastInTimestamp(); | 214 received_ts = channel_a2b_->LastInTimestamp(); |
215 rtc::Optional<uint32_t> playout_timestamp = acm_b_->PlayoutTimestamp(); | 215 rtc::Optional<uint32_t> playout_timestamp = acm_b_->PlayoutTimestamp(); |
216 ASSERT_TRUE(playout_timestamp); | 216 ASSERT_TRUE(playout_timestamp); |
217 inst_delay_sec = static_cast<uint32_t>(received_ts - *playout_timestamp) / | 217 inst_delay_sec = static_cast<uint32_t>(received_ts - *playout_timestamp) / |
218 static_cast<double>(encoding_sample_rate_hz_); | 218 static_cast<double>(encoding_sample_rate_hz_); |
219 | 219 |
220 if (num_frames > 10) | 220 if (num_frames > 10) |
221 average_delay = 0.95 * average_delay + 0.05 * inst_delay_sec; | 221 average_delay = 0.95 * average_delay + 0.05 * inst_delay_sec; |
222 | 222 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 test_setting.codec.num_channels = FLAGS_num_channels; | 259 test_setting.codec.num_channels = FLAGS_num_channels; |
260 test_setting.acm.dtx = FLAGS_dtx; | 260 test_setting.acm.dtx = FLAGS_dtx; |
261 test_setting.acm.fec = FLAGS_fec; | 261 test_setting.acm.fec = FLAGS_fec; |
262 test_setting.packet_loss = FLAGS_packet_loss; | 262 test_setting.packet_loss = FLAGS_packet_loss; |
263 | 263 |
264 webrtc::DelayTest delay_test; | 264 webrtc::DelayTest delay_test; |
265 delay_test.Initialize(); | 265 delay_test.Initialize(); |
266 delay_test.Perform(&test_setting, 1, 240, "delay_test"); | 266 delay_test.Perform(&test_setting, 1, 240, "delay_test"); |
267 return 0; | 267 return 0; |
268 } | 268 } |
OLD | NEW |