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

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

Issue 2716643002: Add framerate to VideoSinkWants and ability to signal on overuse (Closed)
Patch Set: Comments Created 3 years, 9 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 | « webrtc/call/bitrate_estimator_tests.cc ('k') | 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 476 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 frame_generator_capturer->ChangeResolution(1920, 1080); 487 frame_generator_capturer->ChangeResolution(1920, 1080);
488 } 488 }
489 489
490 // OnSinkWantsChanged is called when FrameGeneratorCapturer::AddOrUpdateSink 490 // OnSinkWantsChanged is called when FrameGeneratorCapturer::AddOrUpdateSink
491 // is called. 491 // is called.
492 void OnSinkWantsChanged(rtc::VideoSinkInterface<VideoFrame>* sink, 492 void OnSinkWantsChanged(rtc::VideoSinkInterface<VideoFrame>* sink,
493 const rtc::VideoSinkWants& wants) override { 493 const rtc::VideoSinkWants& wants) override {
494 // First expect CPU overuse. Then expect CPU underuse when the encoder 494 // First expect CPU overuse. Then expect CPU underuse when the encoder
495 // delay has been decreased. 495 // delay has been decreased.
496 if (wants.target_pixel_count && 496 if (wants.target_pixel_count &&
497 *wants.target_pixel_count < 497 *wants.target_pixel_count < wants.max_pixel_count) {
498 wants.max_pixel_count.value_or(std::numeric_limits<int>::max())) {
499 // On adapting up, ViEEncoder::VideoSourceProxy will set the target 498 // On adapting up, ViEEncoder::VideoSourceProxy will set the target
500 // pixel count to a step up from the current and the max value to 499 // pixel count to a step up from the current and the max value to
501 // something higher than the target. 500 // something higher than the target.
502 EXPECT_FALSE(expect_lower_resolution_wants_); 501 EXPECT_FALSE(expect_lower_resolution_wants_);
503 observation_complete_.Set(); 502 observation_complete_.Set();
504 } else if (wants.max_pixel_count) { 503 } else if (wants.max_pixel_count < std::numeric_limits<int>::max()) {
505 // On adapting down, ViEEncoder::VideoSourceProxy will set only the max 504 // On adapting down, ViEEncoder::VideoSourceProxy will set only the max
506 // pixel count, leaving the target unset. 505 // pixel count, leaving the target unset.
507 EXPECT_TRUE(expect_lower_resolution_wants_); 506 EXPECT_TRUE(expect_lower_resolution_wants_);
508 expect_lower_resolution_wants_ = false; 507 expect_lower_resolution_wants_ = false;
509 encoder_.SetDelay(2); 508 encoder_.SetDelay(2);
510 } 509 }
511 } 510 }
512 511
513 void ModifyVideoConfigs( 512 void ModifyVideoConfigs(
514 VideoSendStream::Config* send_config, 513 VideoSendStream::Config* send_config,
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
738 uint32_t last_set_bitrate_kbps_; 737 uint32_t last_set_bitrate_kbps_;
739 VideoSendStream* send_stream_; 738 VideoSendStream* send_stream_;
740 test::FrameGeneratorCapturer* frame_generator_; 739 test::FrameGeneratorCapturer* frame_generator_;
741 VideoEncoderConfig encoder_config_; 740 VideoEncoderConfig encoder_config_;
742 } test; 741 } test;
743 742
744 RunBaseTest(&test); 743 RunBaseTest(&test);
745 } 744 }
746 745
747 } // namespace webrtc 746 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/call/bitrate_estimator_tests.cc ('k') | webrtc/media/base/adaptedvideotracksource.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698