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

Unified Diff: webrtc/video/end_to_end_tests.cc

Issue 2708723003: Introduce new constructor to PlatformThread. (Closed)
Patch Set: Disable RTC_DCHECK in channel_proxy + add TODO 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/system_wrappers/source/critical_section_unittest.cc ('k') | webrtc/video/video_quality_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/video/end_to_end_tests.cc
diff --git a/webrtc/video/end_to_end_tests.cc b/webrtc/video/end_to_end_tests.cc
index bf512d2592c5233493f9c459a686ea95e4fd9bdd..c4005507bd94df7e81a19637ec33e14166129da2 100644
--- a/webrtc/video/end_to_end_tests.cc
+++ b/webrtc/video/end_to_end_tests.cc
@@ -2145,45 +2145,45 @@ TEST_P(EndToEndTest, RembWithSendSideBwe) {
sender_call_ = sender_call;
}
- static bool BitrateStatsPollingThread(void* obj) {
- return static_cast<BweObserver*>(obj)->PollStats();
- }
-
- bool PollStats() {
- if (sender_call_) {
- Call::Stats stats = sender_call_->GetStats();
- switch (state_) {
- case kWaitForFirstRampUp:
- if (stats.send_bandwidth_bps >= remb_bitrate_bps_) {
- state_ = kWaitForRemb;
- remb_bitrate_bps_ /= 2;
- rtp_rtcp_->SetREMBData(
- remb_bitrate_bps_,
- std::vector<uint32_t>(&sender_ssrc_, &sender_ssrc_ + 1));
- rtp_rtcp_->SendRTCP(kRtcpRr);
- }
- break;
-
- case kWaitForRemb:
- if (stats.send_bandwidth_bps == remb_bitrate_bps_) {
- state_ = kWaitForSecondRampUp;
- remb_bitrate_bps_ *= 2;
- rtp_rtcp_->SetREMBData(
- remb_bitrate_bps_,
- std::vector<uint32_t>(&sender_ssrc_, &sender_ssrc_ + 1));
- rtp_rtcp_->SendRTCP(kRtcpRr);
- }
- break;
-
- case kWaitForSecondRampUp:
- if (stats.send_bandwidth_bps == remb_bitrate_bps_) {
- observation_complete_.Set();
- }
- break;
+ static void BitrateStatsPollingThread(void* obj) {
+ static_cast<BweObserver*>(obj)->PollStats();
+ }
+
+ void PollStats() {
+ do {
+ if (sender_call_) {
+ Call::Stats stats = sender_call_->GetStats();
+ switch (state_) {
+ case kWaitForFirstRampUp:
+ if (stats.send_bandwidth_bps >= remb_bitrate_bps_) {
+ state_ = kWaitForRemb;
+ remb_bitrate_bps_ /= 2;
+ rtp_rtcp_->SetREMBData(
+ remb_bitrate_bps_,
+ std::vector<uint32_t>(&sender_ssrc_, &sender_ssrc_ + 1));
+ rtp_rtcp_->SendRTCP(kRtcpRr);
+ }
+ break;
+
+ case kWaitForRemb:
+ if (stats.send_bandwidth_bps == remb_bitrate_bps_) {
+ state_ = kWaitForSecondRampUp;
+ remb_bitrate_bps_ *= 2;
+ rtp_rtcp_->SetREMBData(
+ remb_bitrate_bps_,
+ std::vector<uint32_t>(&sender_ssrc_, &sender_ssrc_ + 1));
+ rtp_rtcp_->SendRTCP(kRtcpRr);
+ }
+ break;
+
+ case kWaitForSecondRampUp:
+ if (stats.send_bandwidth_bps == remb_bitrate_bps_) {
+ observation_complete_.Set();
+ }
+ break;
+ }
}
- }
-
- return !stop_event_.Wait(1000);
+ } while (!stop_event_.Wait(1000));
}
void PerformTest() override {
« no previous file with comments | « webrtc/system_wrappers/source/critical_section_unittest.cc ('k') | webrtc/video/video_quality_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698