OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 "Name of a target graph data file. If set, no preview will be shown."); | 133 "Name of a target graph data file. If set, no preview will be shown."); |
134 std::string OutputFilename() { | 134 std::string OutputFilename() { |
135 return static_cast<std::string>(FLAGS_output_filename); | 135 return static_cast<std::string>(FLAGS_output_filename); |
136 } | 136 } |
137 | 137 |
138 DEFINE_int32(duration, 60, "Duration of the test in seconds."); | 138 DEFINE_int32(duration, 60, "Duration of the test in seconds."); |
139 int DurationSecs() { | 139 int DurationSecs() { |
140 return static_cast<int>(FLAGS_duration); | 140 return static_cast<int>(FLAGS_duration); |
141 } | 141 } |
142 | 142 |
| 143 DEFINE_bool(send_side_bwe, true, "Use send-side bandwidth estimation"); |
| 144 |
143 } // namespace flags | 145 } // namespace flags |
144 | 146 |
145 void Loopback() { | 147 void Loopback() { |
146 FakeNetworkPipe::Config pipe_config; | 148 FakeNetworkPipe::Config pipe_config; |
147 pipe_config.loss_percent = flags::LossPercent(); | 149 pipe_config.loss_percent = flags::LossPercent(); |
148 pipe_config.link_capacity_kbps = flags::LinkCapacityKbps(); | 150 pipe_config.link_capacity_kbps = flags::LinkCapacityKbps(); |
149 pipe_config.queue_length_packets = flags::QueueSize(); | 151 pipe_config.queue_length_packets = flags::QueueSize(); |
150 pipe_config.queue_delay_ms = flags::AvgPropagationDelayMs(); | 152 pipe_config.queue_delay_ms = flags::AvgPropagationDelayMs(); |
151 pipe_config.delay_standard_deviation_ms = flags::StdPropagationDelayMs(); | 153 pipe_config.delay_standard_deviation_ms = flags::StdPropagationDelayMs(); |
152 | 154 |
153 Call::Config::BitrateConfig call_bitrate_config; | 155 Call::Config::BitrateConfig call_bitrate_config; |
154 call_bitrate_config.min_bitrate_bps = flags::MinBitrateKbps() * 1000; | 156 call_bitrate_config.min_bitrate_bps = flags::MinBitrateKbps() * 1000; |
155 call_bitrate_config.start_bitrate_bps = flags::StartBitrateKbps() * 1000; | 157 call_bitrate_config.start_bitrate_bps = flags::StartBitrateKbps() * 1000; |
156 call_bitrate_config.max_bitrate_bps = flags::MaxBitrateKbps() * 1000; | 158 call_bitrate_config.max_bitrate_bps = flags::MaxBitrateKbps() * 1000; |
157 | 159 |
158 std::string clip = flags::Clip(); | 160 std::string clip = flags::Clip(); |
159 std::string graph_title = clip.empty() ? "" : "video " + clip; | 161 std::string graph_title = clip.empty() ? "" : "video " + clip; |
160 VideoQualityTest::Params params{ | 162 VideoQualityTest::Params params{ |
161 { | 163 {flags::Width(), flags::Height(), flags::Fps(), |
162 flags::Width(), | 164 flags::MinBitrateKbps() * 1000, flags::TargetBitrateKbps() * 1000, |
163 flags::Height(), | 165 flags::MaxBitrateKbps() * 1000, flags::Codec(), |
164 flags::Fps(), | 166 flags::NumTemporalLayers(), |
165 flags::MinBitrateKbps() * 1000, | 167 0, // No min transmit bitrate. |
166 flags::TargetBitrateKbps() * 1000, | 168 call_bitrate_config, flags::TLDiscardThreshold(), |
167 flags::MaxBitrateKbps() * 1000, | 169 flags::FLAGS_send_side_bwe}, |
168 flags::Codec(), | |
169 flags::NumTemporalLayers(), | |
170 0, // No min transmit bitrate. | |
171 call_bitrate_config, | |
172 flags::TLDiscardThreshold() | |
173 }, | |
174 {clip}, | 170 {clip}, |
175 {}, // Screenshare specific. | 171 {}, // Screenshare specific. |
176 {graph_title, 0.0, 0.0, flags::DurationSecs(), flags::OutputFilename()}, | 172 {graph_title, 0.0, 0.0, flags::DurationSecs(), flags::OutputFilename()}, |
177 pipe_config, | 173 pipe_config, |
178 flags::FLAGS_logs}; | 174 flags::FLAGS_logs}; |
179 | 175 |
180 VideoQualityTest test; | 176 VideoQualityTest test; |
181 if (flags::OutputFilename().empty()) | 177 if (flags::OutputFilename().empty()) |
182 test.RunWithVideoRenderer(params); | 178 test.RunWithVideoRenderer(params); |
183 else | 179 else |
184 test.RunWithAnalyzer(params); | 180 test.RunWithAnalyzer(params); |
185 } | 181 } |
186 } // namespace webrtc | 182 } // namespace webrtc |
187 | 183 |
188 int main(int argc, char* argv[]) { | 184 int main(int argc, char* argv[]) { |
189 ::testing::InitGoogleTest(&argc, argv); | 185 ::testing::InitGoogleTest(&argc, argv); |
190 google::ParseCommandLineFlags(&argc, &argv, true); | 186 google::ParseCommandLineFlags(&argc, &argv, true); |
191 webrtc::test::InitFieldTrialsFromString( | 187 webrtc::test::InitFieldTrialsFromString( |
192 webrtc::flags::FLAGS_force_fieldtrials); | 188 webrtc::flags::FLAGS_force_fieldtrials); |
193 webrtc::test::RunTest(webrtc::Loopback); | 189 webrtc::test::RunTest(webrtc::Loopback); |
194 return 0; | 190 return 0; |
195 } | 191 } |
OLD | NEW |