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

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

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

Powered by Google App Engine
This is Rietveld 408576698