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

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

Issue 2488833004: Reland of Issue 2434073003: Extract bitrate allocation ... (Closed)
Patch Set: Rebase Created 4 years, 1 month 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/test/fake_encoder.cc ('k') | webrtc/video/video_encoder.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 #include <algorithm> 10 #include <algorithm>
(...skipping 2532 matching lines...) Expand 10 before | Expand all | Expand 10 after
2543 } 2543 }
2544 2544
2545 void ModifyVideoConfigs( 2545 void ModifyVideoConfigs(
2546 VideoSendStream::Config* send_config, 2546 VideoSendStream::Config* send_config,
2547 std::vector<VideoReceiveStream::Config>* receive_configs, 2547 std::vector<VideoReceiveStream::Config>* receive_configs,
2548 VideoEncoderConfig* encoder_config) override { 2548 VideoEncoderConfig* encoder_config) override {
2549 send_config->encoder_settings.encoder = this; 2549 send_config->encoder_settings.encoder = this;
2550 RTC_DCHECK_EQ(1u, encoder_config->number_of_streams); 2550 RTC_DCHECK_EQ(1u, encoder_config->number_of_streams);
2551 } 2551 }
2552 2552
2553 int32_t SetRates(uint32_t new_target_bitrate, uint32_t framerate) override { 2553 int32_t SetRateAllocation(const BitrateAllocation& rate_allocation,
2554 uint32_t framerate) override {
2554 // Make sure not to trigger on any default zero bitrates. 2555 // Make sure not to trigger on any default zero bitrates.
2555 if (new_target_bitrate == 0) 2556 if (rate_allocation.get_sum_bps() == 0)
2556 return 0; 2557 return 0;
2557 rtc::CritScope lock(&crit_); 2558 rtc::CritScope lock(&crit_);
2558 bitrate_kbps_ = new_target_bitrate; 2559 bitrate_kbps_ = rate_allocation.get_sum_kbps();
2559 observation_complete_.Set(); 2560 observation_complete_.Set();
2560 return 0; 2561 return 0;
2561 } 2562 }
2562 2563
2563 void PerformTest() override { 2564 void PerformTest() override {
2564 ASSERT_TRUE(Wait()) 2565 ASSERT_TRUE(Wait())
2565 << "Timed out while waiting for encoder SetRates() call."; 2566 << "Timed out while waiting for encoder SetRates() call.";
2566 WaitForEncoderTargetBitrateMatchStats(); 2567 WaitForEncoderTargetBitrateMatchStats();
2567 send_stream_->Stop(); 2568 send_stream_->Stop();
2568 WaitForStatsReportZeroTargetBitrate(); 2569 WaitForStatsReportZeroTargetBitrate();
(...skipping 1340 matching lines...) Expand 10 before | Expand all | Expand 10 after
3909 std::unique_ptr<VideoEncoder> encoder_; 3910 std::unique_ptr<VideoEncoder> encoder_;
3910 std::unique_ptr<VideoDecoder> decoder_; 3911 std::unique_ptr<VideoDecoder> decoder_;
3911 rtc::CriticalSection crit_; 3912 rtc::CriticalSection crit_;
3912 int recorded_frames_ GUARDED_BY(crit_); 3913 int recorded_frames_ GUARDED_BY(crit_);
3913 } test(this); 3914 } test(this);
3914 3915
3915 RunBaseTest(&test); 3916 RunBaseTest(&test);
3916 } 3917 }
3917 3918
3918 } // namespace webrtc 3919 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/test/fake_encoder.cc ('k') | webrtc/video/video_encoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698