OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
56 // The time the packet was sent out on the network. | 56 // The time the packet was sent out on the network. |
57 const int64_t send_time_; | 57 const int64_t send_time_; |
58 // The time the packet should arrive at the receiver. | 58 // The time the packet should arrive at the receiver. |
59 int64_t arrival_time_; | 59 int64_t arrival_time_; |
60 }; | 60 }; |
61 | 61 |
62 // Class faking a network link. This is a simple and naive solution just faking | 62 // Class faking a network link. This is a simple and naive solution just faking |
63 // capacity and adding an extra transport delay in addition to the capacity | 63 // capacity and adding an extra transport delay in addition to the capacity |
64 // introduced delay. | 64 // introduced delay. |
65 | 65 |
66 // TODO(mflodman) Add random and bursty packet loss. | |
mflodman
2016/08/03 12:56:54
This has already been implemented.
| |
67 class FakeNetworkPipe { | 66 class FakeNetworkPipe { |
68 public: | 67 public: |
69 struct Config { | 68 struct Config { |
70 Config() {} | 69 Config() {} |
71 // Queue length in number of packets. | 70 // Queue length in number of packets. |
72 size_t queue_length_packets = 0; | 71 size_t queue_length_packets = 0; |
73 // Delay in addition to capacity induced delay. | 72 // Delay in addition to capacity induced delay. |
74 int queue_delay_ms = 0; | 73 int queue_delay_ms = 0; |
75 // Standard deviation of the extra delay. | 74 // Standard deviation of the extra delay. |
76 int delay_standard_deviation_ms = 0; | 75 int delay_standard_deviation_ms = 0; |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
146 double prob_start_bursting_; | 145 double prob_start_bursting_; |
147 | 146 |
148 int64_t next_process_time_; | 147 int64_t next_process_time_; |
149 | 148 |
150 RTC_DISALLOW_COPY_AND_ASSIGN(FakeNetworkPipe); | 149 RTC_DISALLOW_COPY_AND_ASSIGN(FakeNetworkPipe); |
151 }; | 150 }; |
152 | 151 |
153 } // namespace webrtc | 152 } // namespace webrtc |
154 | 153 |
155 #endif // WEBRTC_TEST_FAKE_NETWORK_PIPE_H_ | 154 #endif // WEBRTC_TEST_FAKE_NETWORK_PIPE_H_ |
OLD | NEW |