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

Unified Diff: webrtc/video/video_quality_test.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/video/end_to_end_tests.cc ('k') | webrtc/voice_engine/channel_proxy.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/video/video_quality_test.cc
diff --git a/webrtc/video/video_quality_test.cc b/webrtc/video/video_quality_test.cc
index b754d295485342a208420502be117e28ab1ee87e..c8e379e4e96217fe4c031a7f41991f5d52d02bcc 100644
--- a/webrtc/video/video_quality_test.cc
+++ b/webrtc/video/video_quality_test.cc
@@ -555,37 +555,34 @@ class VideoAnalyzer : public PacketReceiver,
comparison_available_event_.Set();
}
- static bool PollStatsThread(void* obj) {
- return static_cast<VideoAnalyzer*>(obj)->PollStats();
+ static void PollStatsThread(void* obj) {
+ static_cast<VideoAnalyzer*>(obj)->PollStats();
}
- bool PollStats() {
- if (done_.Wait(kSendStatsPollingIntervalMs))
- return false;
-
- rtc::CritScope crit(&comparison_lock_);
-
- VideoSendStream::Stats send_stats = send_stream_->GetStats();
- // It's not certain that we yet have estimates for any of these stats. Check
- // that they are positive before mixing them in.
- if (send_stats.encode_frame_rate > 0)
- encode_frame_rate_.AddSample(send_stats.encode_frame_rate);
- if (send_stats.avg_encode_time_ms > 0)
- encode_time_ms_.AddSample(send_stats.avg_encode_time_ms);
- if (send_stats.encode_usage_percent > 0)
- encode_usage_percent_.AddSample(send_stats.encode_usage_percent);
- if (send_stats.media_bitrate_bps > 0)
- media_bitrate_bps_.AddSample(send_stats.media_bitrate_bps);
-
- if (receive_stream_ != nullptr) {
- VideoReceiveStream::Stats receive_stats = receive_stream_->GetStats();
- if (receive_stats.decode_ms > 0)
- decode_time_ms_.AddSample(receive_stats.decode_ms);
- if (receive_stats.max_decode_ms > 0)
- decode_time_max_ms_.AddSample(receive_stats.max_decode_ms);
+ void PollStats() {
+ while (!done_.Wait(kSendStatsPollingIntervalMs)) {
+ rtc::CritScope crit(&comparison_lock_);
+
+ VideoSendStream::Stats send_stats = send_stream_->GetStats();
+ // It's not certain that we yet have estimates for any of these stats.
+ // Check that they are positive before mixing them in.
+ if (send_stats.encode_frame_rate > 0)
+ encode_frame_rate_.AddSample(send_stats.encode_frame_rate);
+ if (send_stats.avg_encode_time_ms > 0)
+ encode_time_ms_.AddSample(send_stats.avg_encode_time_ms);
+ if (send_stats.encode_usage_percent > 0)
+ encode_usage_percent_.AddSample(send_stats.encode_usage_percent);
+ if (send_stats.media_bitrate_bps > 0)
+ media_bitrate_bps_.AddSample(send_stats.media_bitrate_bps);
+
+ if (receive_stream_ != nullptr) {
+ VideoReceiveStream::Stats receive_stats = receive_stream_->GetStats();
+ if (receive_stats.decode_ms > 0)
+ decode_time_ms_.AddSample(receive_stats.decode_ms);
+ if (receive_stats.max_decode_ms > 0)
+ decode_time_max_ms_.AddSample(receive_stats.max_decode_ms);
+ }
}
-
- return true;
}
static bool FrameComparisonThread(void* obj) {
« no previous file with comments | « webrtc/video/end_to_end_tests.cc ('k') | webrtc/voice_engine/channel_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698