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 |
11 #include <stdio.h> | 11 #include <stdio.h> |
12 | 12 |
13 #include <map> | |
14 | |
15 #include "gflags/gflags.h" | 13 #include "gflags/gflags.h" |
16 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
17 | 15 |
18 #include "webrtc/test/field_trial.h" | 16 #include "webrtc/test/field_trial.h" |
19 #include "webrtc/test/run_test.h" | 17 #include "webrtc/test/run_test.h" |
20 #include "webrtc/typedefs.h" | |
21 #include "webrtc/video/video_quality_test.h" | 18 #include "webrtc/video/video_quality_test.h" |
ivica
2015/09/22 11:15:36
Making the headers look the same as in video/scree
| |
22 | 19 |
23 namespace webrtc { | 20 namespace webrtc { |
24 | |
25 namespace flags { | 21 namespace flags { |
26 | 22 |
23 // Flags common with screenshare loopback, with different default values. | |
27 DEFINE_int32(width, 640, "Video width."); | 24 DEFINE_int32(width, 640, "Video width."); |
28 size_t Width() { | 25 size_t Width() { |
29 return static_cast<size_t>(FLAGS_width); | 26 return static_cast<size_t>(FLAGS_width); |
30 } | 27 } |
31 | 28 |
32 DEFINE_int32(height, 480, "Video height."); | 29 DEFINE_int32(height, 480, "Video height."); |
33 size_t Height() { | 30 size_t Height() { |
34 return static_cast<size_t>(FLAGS_height); | 31 return static_cast<size_t>(FLAGS_height); |
35 } | 32 } |
36 | 33 |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
113 } | 110 } |
114 | 111 |
115 DEFINE_int32( | 112 DEFINE_int32( |
116 tl_discard_threshold, | 113 tl_discard_threshold, |
117 0, | 114 0, |
118 "Discard TLs with id greater or equal the threshold. 0 to disable."); | 115 "Discard TLs with id greater or equal the threshold. 0 to disable."); |
119 size_t TLDiscardThreshold() { | 116 size_t TLDiscardThreshold() { |
120 return static_cast<size_t>(FLAGS_tl_discard_threshold); | 117 return static_cast<size_t>(FLAGS_tl_discard_threshold); |
121 } | 118 } |
122 | 119 |
120 DEFINE_bool(disable_wrapper_frame_dropper, | |
121 false, | |
122 "Disable FrameDropper in the wrapper. " | |
123 "Does not affect drop on capture or PacedSender."); | |
124 | |
125 | |
123 DEFINE_string(clip, | 126 DEFINE_string(clip, |
124 "", | 127 "", |
125 "Name of the clip to show. If empty, using chroma generator."); | 128 "Name of the clip to show. If empty, using chroma generator."); |
126 std::string Clip() { | 129 std::string Clip() { |
127 return static_cast<std::string>(FLAGS_clip); | 130 return static_cast<std::string>(FLAGS_clip); |
128 } | 131 } |
129 | 132 |
130 DEFINE_string( | 133 DEFINE_string( |
131 output_filename, | 134 output_filename, |
132 "", | 135 "", |
(...skipping 28 matching lines...) Expand all Loading... | |
161 { | 164 { |
162 flags::Width(), | 165 flags::Width(), |
163 flags::Height(), | 166 flags::Height(), |
164 flags::Fps(), | 167 flags::Fps(), |
165 flags::MinBitrateKbps() * 1000, | 168 flags::MinBitrateKbps() * 1000, |
166 flags::TargetBitrateKbps() * 1000, | 169 flags::TargetBitrateKbps() * 1000, |
167 flags::MaxBitrateKbps() * 1000, | 170 flags::MaxBitrateKbps() * 1000, |
168 flags::Codec(), | 171 flags::Codec(), |
169 flags::NumTemporalLayers(), | 172 flags::NumTemporalLayers(), |
170 0, // No min transmit bitrate. | 173 0, // No min transmit bitrate. |
174 flags::FLAGS_disable_wrapper_frame_dropper, | |
171 call_bitrate_config, | 175 call_bitrate_config, |
172 flags::TLDiscardThreshold() | 176 flags::TLDiscardThreshold() |
173 }, | 177 }, |
174 {clip}, | 178 {clip}, |
175 {}, // Screenshare specific. | 179 {}, // Screenshare specific. |
176 {graph_title, 0.0, 0.0, flags::DurationSecs(), flags::OutputFilename()}, | 180 {graph_title, 0.0, 0.0, flags::DurationSecs(), flags::OutputFilename()}, |
177 pipe_config, | 181 pipe_config, |
178 flags::FLAGS_logs}; | 182 flags::FLAGS_logs}; |
179 | 183 |
180 VideoQualityTest test; | 184 VideoQualityTest test; |
181 if (flags::OutputFilename().empty()) | 185 if (flags::OutputFilename().empty()) |
182 test.RunWithVideoRenderer(params); | 186 test.RunWithVideoRenderer(params); |
183 else | 187 else |
184 test.RunWithAnalyzer(params); | 188 test.RunWithAnalyzer(params); |
185 } | 189 } |
186 } // namespace webrtc | 190 } // namespace webrtc |
187 | 191 |
188 int main(int argc, char* argv[]) { | 192 int main(int argc, char* argv[]) { |
189 ::testing::InitGoogleTest(&argc, argv); | 193 ::testing::InitGoogleTest(&argc, argv); |
190 google::ParseCommandLineFlags(&argc, &argv, true); | 194 google::ParseCommandLineFlags(&argc, &argv, true); |
191 webrtc::test::InitFieldTrialsFromString( | 195 webrtc::test::InitFieldTrialsFromString( |
192 webrtc::flags::FLAGS_force_fieldtrials); | 196 webrtc::flags::FLAGS_force_fieldtrials); |
193 webrtc::test::RunTest(webrtc::Loopback); | 197 webrtc::test::RunTest(webrtc::Loopback); |
194 return 0; | 198 return 0; |
195 } | 199 } |
OLD | NEW |