Chromium Code Reviews| Index: webrtc/modules/remote_bitrate_estimator/test/bwe_test.h |
| diff --git a/webrtc/modules/remote_bitrate_estimator/test/bwe_test.h b/webrtc/modules/remote_bitrate_estimator/test/bwe_test.h |
| index 303aca528c50afe4b14ab139138c67bd768fb26f..46399a0e313a2b58fd3d7232f890ba8d74a8e42b 100644 |
| --- a/webrtc/modules/remote_bitrate_estimator/test/bwe_test.h |
| +++ b/webrtc/modules/remote_bitrate_estimator/test/bwe_test.h |
| @@ -69,6 +69,36 @@ class BweTest { |
| BweTest(); |
| ~BweTest(); |
| + void RunChoke(BandwidthEstimatorType bwe_type, |
| + std::vector<int> capacities_kbps); |
| + |
| + void RunVariableCapacitySingleFlow(BandwidthEstimatorType bwe_type); |
| + void RunVariableCapacityTwoFlows(BandwidthEstimatorType bwe_type); |
| + void RunBidirectionalFlow(BandwidthEstimatorType bwe_type); |
| + void RunRoundTripTimeFairness(BandwidthEstimatorType bwe_type); |
| + void RunLongTcpFairness(BandwidthEstimatorType bwe_type); |
| + void RunMultipleShortTcpFairness(BandwidthEstimatorType bwe_type, |
| + std::vector<int> tcp_file_sizes_bytes, |
| + std::vector<int64_t> tcp_starting_times_ms); |
| + void RunPauseResumeFlows(BandwidthEstimatorType bwe_type); |
| + |
| + void RunFairnessTest(BandwidthEstimatorType bwe_type, |
| + size_t num_media_flows, |
| + size_t num_tcp_flows, |
| + int64_t run_time_seconds, |
| + int capacity_kbps, |
| + int64_t max_delay_ms, |
| + int64_t rtt_ms, |
| + int64_t max_jitter_ms, |
| + const int64_t* offsets_ms); |
| + |
| + void set_plot_available_capacity(bool plot) { |
| + plot_total_available_capacity_ = plot; |
| + } |
| + |
| + static std::vector<int> GetFileSizesBytes(int num_files); |
| + static std::vector<int64_t> GetStartingTimesMs(int num_files); |
| + |
| protected: |
| void SetUp(); |
| @@ -87,13 +117,6 @@ class BweTest { |
| std::map<int, Stats<double>> flow_delay_ms, |
| std::map<int, Stats<double>> flow_throughput_kbps); |
| - void RunFairnessTest(BandwidthEstimatorType bwe_type, |
| - size_t num_media_flows, |
| - size_t num_tcp_flows, |
| - int64_t run_time_seconds, |
| - int capacity_kbps, |
| - int max_delay_ms); |
| - |
| Link downlink_; |
| Link uplink_; |
| @@ -107,9 +130,53 @@ class BweTest { |
| int64_t simulation_interval_ms_; |
| std::vector<Link*> links_; |
| Packets packets_; |
| + bool plot_total_available_capacity_; |
| DISALLOW_COPY_AND_ASSIGN(BweTest); |
| }; |
| + |
| +// Default Evaluation parameters: |
| +// Link capacity: 4000ms; |
| +// Queueing delay capacity: 300ms. |
| +// One-Way propagation delay: 50ms. |
| +// Jitter model: Truncated gaussian. |
| +// Maximum end-to-end jitter: 30ms = 2*standard_deviation. |
| +// Bottleneck queue type: Drop tail. |
| +// Path loss ratio: 0%. |
| + |
| +const int kOneWayDelayMs = 50; |
| +const int kMaxQueueingDelayMs = 300; |
| +const int kMaxCapacityKbps = 4000; |
| +const int kMaxJitterMs = 15; |
| + |
| +struct DefaultEvaluationFilter { |
| + DefaultEvaluationFilter(PacketProcessorListener* listener, int flow_id) |
| + : choke(listener, flow_id), |
| + delay(listener, flow_id), |
| + jitter(listener, flow_id) { |
| + SetDefaultParameters(this); |
| + } |
| + |
| + DefaultEvaluationFilter(PacketProcessorListener* listener, |
| + const FlowIds& flow_ids) |
| + : choke(listener, flow_ids), |
| + delay(listener, flow_ids), |
| + jitter(listener, flow_ids) { |
| + SetDefaultParameters(this); |
|
stefan-webrtc
2015/07/21 12:12:32
This is weird. Why not just SetDefaultParameters()
magalhaesc
2015/07/21 14:46:53
Right.
It was supposed to be static, but actually
|
| + } |
| + |
| + void SetDefaultParameters(DefaultEvaluationFilter* filter) { |
| + filter->delay.SetOneWayDelayMs(kOneWayDelayMs); |
| + filter->choke.set_max_delay_ms(kMaxQueueingDelayMs); |
| + filter->choke.set_capacity_kbps(kMaxCapacityKbps); |
| + filter->jitter.SetMaxJitter(kMaxJitterMs); |
| + } |
| + |
| + ChokeFilter choke; |
| + DelayFilter delay; |
| + JitterFilter jitter; |
| +}; |
| + |
| } // namespace bwe |
| } // namespace testing |
| } // namespace webrtc |