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

Side by Side Diff: webrtc/call/call_perf_tests.cc

Issue 2672793002: Change rtc::VideoSinkWants to have target and a max pixel count (Closed)
Patch Set: Minor tweaks Created 3 years, 10 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
« no previous file with comments | « no previous file | webrtc/media/base/adaptedvideotracksource.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 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 472 matching lines...) Expand 10 before | Expand all | Expand 10 after
483 test::FrameGeneratorCapturer* frame_generator_capturer) override { 483 test::FrameGeneratorCapturer* frame_generator_capturer) override {
484 frame_generator_capturer->SetSinkWantsObserver(this); 484 frame_generator_capturer->SetSinkWantsObserver(this);
485 } 485 }
486 486
487 // OnSinkWantsChanged is called when FrameGeneratorCapturer::AddOrUpdateSink 487 // OnSinkWantsChanged is called when FrameGeneratorCapturer::AddOrUpdateSink
488 // is called. 488 // is called.
489 void OnSinkWantsChanged(rtc::VideoSinkInterface<VideoFrame>* sink, 489 void OnSinkWantsChanged(rtc::VideoSinkInterface<VideoFrame>* sink,
490 const rtc::VideoSinkWants& wants) override { 490 const rtc::VideoSinkWants& wants) override {
491 // First expect CPU overuse. Then expect CPU underuse when the encoder 491 // First expect CPU overuse. Then expect CPU underuse when the encoder
492 // delay has been decreased. 492 // delay has been decreased.
493 if (wants.max_pixel_count) { 493 if (wants.target_pixel_count) {
494 // Target pixel count set indicates we want to move from a lower res
495 // to a higher.
stefan-webrtc 2017/02/06 13:39:49 It's hard to understand why target_pixel_count mea
nisse-webrtc 2017/02/06 13:42:40 As far as I understand, it could be used to target
sprang_webrtc 2017/02/06 13:49:53 That's correct. I guess this is a more an integrat
stefan-webrtc 2017/02/06 14:01:28 Maybe update the comment to make that clear, i.e.,
sprang_webrtc 2017/02/06 14:44:08 Done.
496 EXPECT_FALSE(expect_lower_resolution_wants_);
497 observation_complete_.Set();
498 } else if (wants.max_pixel_count) {
499 // No target set, but max is applied indicates we are overusing and want
500 // a lower resolution.
494 EXPECT_TRUE(expect_lower_resolution_wants_); 501 EXPECT_TRUE(expect_lower_resolution_wants_);
495 expect_lower_resolution_wants_ = false; 502 expect_lower_resolution_wants_ = false;
496 encoder_.SetDelay(2); 503 encoder_.SetDelay(2);
497 } else if (wants.max_pixel_count_step_up) {
498 EXPECT_FALSE(expect_lower_resolution_wants_);
499 observation_complete_.Set();
500 } 504 }
501 } 505 }
502 506
503 void ModifyVideoConfigs( 507 void ModifyVideoConfigs(
504 VideoSendStream::Config* send_config, 508 VideoSendStream::Config* send_config,
505 std::vector<VideoReceiveStream::Config>* receive_configs, 509 std::vector<VideoReceiveStream::Config>* receive_configs,
506 VideoEncoderConfig* encoder_config) override { 510 VideoEncoderConfig* encoder_config) override {
507 send_config->encoder_settings.encoder = &encoder_; 511 send_config->encoder_settings.encoder = &encoder_;
508 } 512 }
509 513
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
727 uint32_t last_set_bitrate_kbps_; 731 uint32_t last_set_bitrate_kbps_;
728 VideoSendStream* send_stream_; 732 VideoSendStream* send_stream_;
729 test::FrameGeneratorCapturer* frame_generator_; 733 test::FrameGeneratorCapturer* frame_generator_;
730 VideoEncoderConfig encoder_config_; 734 VideoEncoderConfig encoder_config_;
731 } test; 735 } test;
732 736
733 RunBaseTest(&test); 737 RunBaseTest(&test);
734 } 738 }
735 739
736 } // namespace webrtc 740 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | webrtc/media/base/adaptedvideotracksource.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698