Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(80)

Side by Side Diff: webrtc/video/video_loopback.cc

Issue 2117493002: Auto pause video streams based on encoder target bitrate. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 DEFINE_int32(target_bitrate, 800, "Stream target bitrate in kbps."); 49 DEFINE_int32(target_bitrate, 800, "Stream target bitrate in kbps.");
50 int TargetBitrateKbps() { 50 int TargetBitrateKbps() {
51 return static_cast<int>(FLAGS_target_bitrate); 51 return static_cast<int>(FLAGS_target_bitrate);
52 } 52 }
53 53
54 DEFINE_int32(max_bitrate, 800, "Call and stream max bitrate in kbps."); 54 DEFINE_int32(max_bitrate, 800, "Call and stream max bitrate in kbps.");
55 int MaxBitrateKbps() { 55 int MaxBitrateKbps() {
56 return static_cast<int>(FLAGS_max_bitrate); 56 return static_cast<int>(FLAGS_max_bitrate);
57 } 57 }
58 58
59 DEFINE_bool(suspend_below_min_bitrate,
60 false,
61 "Suspends video below the configured min bitrate.");
62
59 DEFINE_int32(num_temporal_layers, 63 DEFINE_int32(num_temporal_layers,
60 1, 64 1,
61 "Number of temporal layers. Set to 1-4 to override."); 65 "Number of temporal layers. Set to 1-4 to override.");
62 int NumTemporalLayers() { 66 int NumTemporalLayers() {
63 return static_cast<int>(FLAGS_num_temporal_layers); 67 return static_cast<int>(FLAGS_num_temporal_layers);
64 } 68 }
65 69
66 // Flags common with screenshare loopback, with equal default values. 70 // Flags common with screenshare loopback, with equal default values.
67 DEFINE_string(codec, "VP8", "Video codec to use."); 71 DEFINE_string(codec, "VP8", "Video codec to use.");
68 std::string Codec() { 72 std::string Codec() {
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 pipe_config.allow_reordering = flags::FLAGS_allow_reordering; 220 pipe_config.allow_reordering = flags::FLAGS_allow_reordering;
217 221
218 Call::Config::BitrateConfig call_bitrate_config; 222 Call::Config::BitrateConfig call_bitrate_config;
219 call_bitrate_config.min_bitrate_bps = flags::MinBitrateKbps() * 1000; 223 call_bitrate_config.min_bitrate_bps = flags::MinBitrateKbps() * 1000;
220 call_bitrate_config.start_bitrate_bps = flags::StartBitrateKbps() * 1000; 224 call_bitrate_config.start_bitrate_bps = flags::StartBitrateKbps() * 1000;
221 call_bitrate_config.max_bitrate_bps = flags::MaxBitrateKbps() * 1000; 225 call_bitrate_config.max_bitrate_bps = flags::MaxBitrateKbps() * 1000;
222 226
223 VideoQualityTest::Params params{ 227 VideoQualityTest::Params params{
224 {flags::Width(), flags::Height(), flags::Fps(), 228 {flags::Width(), flags::Height(), flags::Fps(),
225 flags::MinBitrateKbps() * 1000, flags::TargetBitrateKbps() * 1000, 229 flags::MinBitrateKbps() * 1000, flags::TargetBitrateKbps() * 1000,
226 flags::MaxBitrateKbps() * 1000, flags::Codec(), 230 flags::MaxBitrateKbps() * 1000,
231 flags::FLAGS_suspend_below_min_bitrate,
232 flags::Codec(),
227 flags::NumTemporalLayers(), flags::SelectedTL(), 233 flags::NumTemporalLayers(), flags::SelectedTL(),
228 0, // No min transmit bitrate. 234 0, // No min transmit bitrate.
229 call_bitrate_config, 235 call_bitrate_config,
230 flags::FLAGS_send_side_bwe, 236 flags::FLAGS_send_side_bwe,
231 flags::FLAGS_use_fec}, 237 flags::FLAGS_use_fec},
232 {flags::Clip()}, 238 {flags::Clip()},
233 {}, // Screenshare specific. 239 {}, // Screenshare specific.
234 {"video", 0.0, 0.0, flags::DurationSecs(), flags::OutputFilename(), 240 {"video", 0.0, 0.0, flags::DurationSecs(), flags::OutputFilename(),
235 flags::GraphTitle()}, 241 flags::GraphTitle()},
236 pipe_config, 242 pipe_config,
(...skipping 19 matching lines...) Expand all
256 } // namespace webrtc 262 } // namespace webrtc
257 263
258 int main(int argc, char* argv[]) { 264 int main(int argc, char* argv[]) {
259 ::testing::InitGoogleTest(&argc, argv); 265 ::testing::InitGoogleTest(&argc, argv);
260 google::ParseCommandLineFlags(&argc, &argv, true); 266 google::ParseCommandLineFlags(&argc, &argv, true);
261 webrtc::test::InitFieldTrialsFromString( 267 webrtc::test::InitFieldTrialsFromString(
262 webrtc::flags::FLAGS_force_fieldtrials); 268 webrtc::flags::FLAGS_force_fieldtrials);
263 webrtc::test::RunTest(webrtc::Loopback); 269 webrtc::test::RunTest(webrtc::Loopback);
264 return 0; 270 return 0;
265 } 271 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698