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 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 output_sample_rate_hz > 16000 ? AudioFrame::kVadActive | 319 output_sample_rate_hz > 16000 ? AudioFrame::kVadActive |
320 : AudioFrame::kVadPassive; | 320 : AudioFrame::kVadPassive; |
321 | 321 |
322 // Expect the first output timestamp to be 5*fs/8000 samples before the | 322 // Expect the first output timestamp to be 5*fs/8000 samples before the |
323 // first inserted timestamp (because of NetEq's look-ahead). (This value is | 323 // first inserted timestamp (because of NetEq's look-ahead). (This value is |
324 // defined in Expand::overlap_length_.) | 324 // defined in Expand::overlap_length_.) |
325 uint32_t expected_output_ts = last_packet_send_timestamp_ - | 325 uint32_t expected_output_ts = last_packet_send_timestamp_ - |
326 rtc::CheckedDivExact(5 * output_sample_rate_hz, 8000); | 326 rtc::CheckedDivExact(5 * output_sample_rate_hz, 8000); |
327 | 327 |
328 AudioFrame frame; | 328 AudioFrame frame; |
| 329 EXPECT_EQ(0, receiver_->GetAudio(output_sample_rate_hz, &frame)); |
| 330 // Expect timestamp = 0 before first packet is inserted. |
| 331 EXPECT_EQ(0u, frame.timestamp_); |
329 for (int i = 0; i < 5; ++i) { | 332 for (int i = 0; i < 5; ++i) { |
330 InsertOnePacketOfSilence(codec.id); | 333 InsertOnePacketOfSilence(codec.id); |
331 for (int k = 0; k < num_10ms_frames; ++k) { | 334 for (int k = 0; k < num_10ms_frames; ++k) { |
332 EXPECT_EQ(0, receiver_->GetAudio(output_sample_rate_hz, &frame)); | 335 EXPECT_EQ(0, receiver_->GetAudio(output_sample_rate_hz, &frame)); |
333 EXPECT_EQ(expected_output_ts, frame.timestamp_); | 336 EXPECT_EQ(expected_output_ts, frame.timestamp_); |
334 expected_output_ts += 10 * samples_per_ms; | 337 expected_output_ts += 10 * samples_per_ms; |
335 EXPECT_EQ(10 * samples_per_ms, frame.samples_per_channel_); | 338 EXPECT_EQ(10 * samples_per_ms, frame.samples_per_channel_); |
336 EXPECT_EQ(output_sample_rate_hz, frame.sample_rate_hz_); | 339 EXPECT_EQ(output_sample_rate_hz, frame.sample_rate_hz_); |
337 EXPECT_EQ(output_channels, frame.num_channels_); | 340 EXPECT_EQ(output_channels, frame.num_channels_); |
338 EXPECT_EQ(AudioFrame::kNormalSpeech, frame.speech_type_); | 341 EXPECT_EQ(AudioFrame::kNormalSpeech, frame.speech_type_); |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
487 receiver_->last_packet_sample_rate_hz()); | 490 receiver_->last_packet_sample_rate_hz()); |
488 EXPECT_EQ(0, receiver_->LastAudioCodec(&codec)); | 491 EXPECT_EQ(0, receiver_->LastAudioCodec(&codec)); |
489 EXPECT_TRUE(CodecsEqual(c.inst, codec)); | 492 EXPECT_TRUE(CodecsEqual(c.inst, codec)); |
490 } | 493 } |
491 } | 494 } |
492 #endif | 495 #endif |
493 | 496 |
494 } // namespace acm2 | 497 } // namespace acm2 |
495 | 498 |
496 } // namespace webrtc | 499 } // namespace webrtc |
OLD | NEW |