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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 | 91 |
92 void RunTest(int num_loops) { | 92 void RunTest(int num_loops) { |
93 // Get next input packets (mono and multi-channel). | 93 // Get next input packets (mono and multi-channel). |
94 uint32_t next_send_time; | 94 uint32_t next_send_time; |
95 uint32_t next_arrival_time; | 95 uint32_t next_arrival_time; |
96 do { | 96 do { |
97 next_send_time = GetNewPacket(); | 97 next_send_time = GetNewPacket(); |
98 next_arrival_time = GetArrivalTime(next_send_time); | 98 next_arrival_time = GetArrivalTime(next_send_time); |
99 } while (Lost()); // If lost, immediately read the next packet. | 99 } while (Lost()); // If lost, immediately read the next packet. |
100 | 100 |
101 EXPECT_CALL(*external_decoder_, | 101 EXPECT_CALL( |
102 Decode(_, payload_size_bytes_, 1000 * samples_per_ms_, _, _, _)) | 102 *external_decoder_, |
| 103 DecodeInternal(_, payload_size_bytes_, 1000 * samples_per_ms_, _, _)) |
103 .Times(NumExpectedDecodeCalls(num_loops)); | 104 .Times(NumExpectedDecodeCalls(num_loops)); |
104 | 105 |
105 uint32_t time_now = 0; | 106 uint32_t time_now = 0; |
106 for (int k = 0; k < num_loops; ++k) { | 107 for (int k = 0; k < num_loops; ++k) { |
107 while (time_now >= next_arrival_time) { | 108 while (time_now >= next_arrival_time) { |
108 InsertPacket(rtp_header_, rtc::ArrayView<const uint8_t>( | 109 InsertPacket(rtp_header_, rtc::ArrayView<const uint8_t>( |
109 encoded_, payload_size_bytes_), | 110 encoded_, payload_size_bytes_), |
110 next_arrival_time); | 111 next_arrival_time); |
111 // Get next input packet. | 112 // Get next input packet. |
112 do { | 113 do { |
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
449 kStartSeqeunceNumber, | 450 kStartSeqeunceNumber, |
450 kStartTimestamp, | 451 kStartTimestamp, |
451 kJumpFromTimestamp, | 452 kJumpFromTimestamp, |
452 kJumpToTimestamp)); | 453 kJumpToTimestamp)); |
453 | 454 |
454 RunTest(130); // Run 130 laps @ 10 ms each in the test loop. | 455 RunTest(130); // Run 130 laps @ 10 ms each in the test loop. |
455 EXPECT_EQ(kRecovered, test_state_); | 456 EXPECT_EQ(kRecovered, test_state_); |
456 } | 457 } |
457 | 458 |
458 } // namespace webrtc | 459 } // namespace webrtc |
OLD | NEW |