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

Unified Diff: webrtc/video/video_quality_test.cc

Issue 1476453002: Clean up PlatformThread. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: IsRunning DCHECK Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/video/video_capture_input.cc ('k') | webrtc/video_engine/vie_channel.h » ('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 da522970dc5e4734b094be96859bcf90e0f1b273..09c1037ec749e50edd240688179c8c8d26dc9d9b 100644
--- a/webrtc/video/video_quality_test.cc
+++ b/webrtc/video/video_quality_test.cc
@@ -69,6 +69,7 @@ class VideoAnalyzer : public PacketReceiver,
rtp_timestamp_delta_(0),
avg_psnr_threshold_(avg_psnr_threshold),
avg_ssim_threshold_(avg_ssim_threshold),
+ stats_polling_thread_(&PollStatsThread, this, "StatsPoller"),
comparison_available_event_(EventWrapper::Create()),
done_(EventWrapper::Create()) {
// Create thread pool for CPU-expensive PSNR/SSIM calculations.
@@ -91,19 +92,17 @@ class VideoAnalyzer : public PacketReceiver,
}
for (uint32_t i = 0; i < num_cores; ++i) {
- rtc::scoped_ptr<PlatformThread> thread = PlatformThread::CreateThread(
- &FrameComparisonThread, this, "Analyzer");
- EXPECT_TRUE(thread->Start());
- comparison_thread_pool_.push_back(thread.release());
+ rtc::PlatformThread* thread =
+ new rtc::PlatformThread(&FrameComparisonThread, this, "Analyzer");
+ thread->Start();
+ comparison_thread_pool_.push_back(thread);
}
- stats_polling_thread_ =
- PlatformThread::CreateThread(&PollStatsThread, this, "StatsPoller");
}
~VideoAnalyzer() {
- for (PlatformThread* thread : comparison_thread_pool_) {
- EXPECT_TRUE(thread->Stop());
+ for (rtc::PlatformThread* thread : comparison_thread_pool_) {
+ thread->Stop();
delete thread;
}
}
@@ -221,7 +220,7 @@ class VideoAnalyzer : public PacketReceiver,
// at time-out check if frames_processed is going up. If so, give it more
// time, otherwise fail. Hopefully this will reduce test flakiness.
- EXPECT_TRUE(stats_polling_thread_->Start());
+ stats_polling_thread_.Start();
int last_frames_processed = -1;
EventTypeWrapper eventType;
@@ -257,7 +256,7 @@ class VideoAnalyzer : public PacketReceiver,
// since it uses the send_stream_ reference that might be reclaimed after
// returning from this method.
done_->Set();
- EXPECT_TRUE(stats_polling_thread_->Stop());
+ stats_polling_thread_.Stop();
}
VideoCaptureInput* input_;
@@ -602,8 +601,8 @@ class VideoAnalyzer : public PacketReceiver,
const double avg_ssim_threshold_;
rtc::CriticalSection comparison_lock_;
- std::vector<PlatformThread*> comparison_thread_pool_;
- rtc::scoped_ptr<PlatformThread> stats_polling_thread_;
+ std::vector<rtc::PlatformThread*> comparison_thread_pool_;
+ rtc::PlatformThread stats_polling_thread_;
const rtc::scoped_ptr<EventWrapper> comparison_available_event_;
std::deque<FrameComparison> comparisons_ GUARDED_BY(comparison_lock_);
const rtc::scoped_ptr<EventWrapper> done_;
« no previous file with comments | « webrtc/video/video_capture_input.cc ('k') | webrtc/video_engine/vie_channel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698