| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 while (time_now_ms < runtime_ms) { | 81 while (time_now_ms < runtime_ms) { |
| 82 while (packet_input_time_ms <= time_now_ms) { | 82 while (packet_input_time_ms <= time_now_ms) { |
| 83 // Drop every N packets, where N = FLAGS_lossrate. | 83 // Drop every N packets, where N = FLAGS_lossrate. |
| 84 bool lost = false; | 84 bool lost = false; |
| 85 if (lossrate > 0) { | 85 if (lossrate > 0) { |
| 86 lost = ((rtp_header.header.sequenceNumber - 1) % lossrate) == 0; | 86 lost = ((rtp_header.header.sequenceNumber - 1) % lossrate) == 0; |
| 87 } | 87 } |
| 88 if (!lost) { | 88 if (!lost) { |
| 89 // Insert packet. | 89 // Insert packet. |
| 90 int error = | 90 int error = |
| 91 neteq->InsertPacket(rtp_header.header, input_payload, | 91 neteq->InsertPacket(rtp_header, input_payload, |
| 92 packet_input_time_ms * kSampRateHz / 1000); | 92 packet_input_time_ms * kSampRateHz / 1000); |
| 93 if (error != NetEq::kOK) | 93 if (error != NetEq::kOK) |
| 94 return -1; | 94 return -1; |
| 95 } | 95 } |
| 96 | 96 |
| 97 // Get next packet. | 97 // Get next packet. |
| 98 packet_input_time_ms = rtp_gen.GetRtpHeader(kPayloadType, | 98 packet_input_time_ms = rtp_gen.GetRtpHeader(kPayloadType, |
| 99 kInputBlockSizeSamples, | 99 kInputBlockSizeSamples, |
| 100 &rtp_header); | 100 &rtp_header); |
| 101 input_samples = audio_loop.GetNextBlock(); | 101 input_samples = audio_loop.GetNextBlock(); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 124 drift_flipped = true; | 124 drift_flipped = true; |
| 125 } | 125 } |
| 126 } | 126 } |
| 127 int64_t end_time_ms = clock->TimeInMilliseconds(); | 127 int64_t end_time_ms = clock->TimeInMilliseconds(); |
| 128 delete neteq; | 128 delete neteq; |
| 129 return end_time_ms - start_time_ms; | 129 return end_time_ms - start_time_ms; |
| 130 } | 130 } |
| 131 | 131 |
| 132 } // namespace test | 132 } // namespace test |
| 133 } // namespace webrtc | 133 } // namespace webrtc |
| OLD | NEW |