aboutsummaryrefslogtreecommitdiff
path: root/webrtc/modules/audio_processing
diff options
context:
space:
mode:
authorPeter Boström <pbos@webrtc.org>2015-11-26 17:45:47 +0100
committerPeter Boström <pbos@webrtc.org>2015-11-26 16:45:57 +0000
commit8c38e8b9b96d72317d6ce94c1442113b4e385dcb (patch)
tree3c10fadf87e9a42790edf03b20162a42db091373 /webrtc/modules/audio_processing
parentad113e50d251c95adcf501ed29f8312ad1193a35 (diff)
downloadwebrtc-8c38e8b9b96d72317d6ce94c1442113b4e385dcb.tar.gz
Clean up PlatformThread.
* Move PlatformThread to rtc::. * Remove ::CreateThread factory method. * Make non-scoped_ptr from a lot of invocations. * Make Start/Stop void. * Remove rtc::Thread priorities, which were unused and would collide. * Add ::IsRunning() to PlatformThread. BUG= R=tommi@webrtc.org Review URL: https://codereview.webrtc.org/1476453002 . Cr-Commit-Position: refs/heads/master@{#10812}
Diffstat (limited to 'webrtc/modules/audio_processing')
-rw-r--r--webrtc/modules/audio_processing/audio_processing_impl_locking_unittest.cc36
1 files changed, 15 insertions, 21 deletions
diff --git a/webrtc/modules/audio_processing/audio_processing_impl_locking_unittest.cc b/webrtc/modules/audio_processing/audio_processing_impl_locking_unittest.cc
index a440a76cce..dcbaa28541 100644
--- a/webrtc/modules/audio_processing/audio_processing_impl_locking_unittest.cc
+++ b/webrtc/modules/audio_processing/audio_processing_impl_locking_unittest.cc
@@ -444,21 +444,21 @@ class AudioProcessingImplLockTest
// Start the threads used in the test.
void StartThreads() {
- ASSERT_TRUE(render_thread_->Start());
- render_thread_->SetPriority(kRealtimePriority);
- ASSERT_TRUE(capture_thread_->Start());
- capture_thread_->SetPriority(kRealtimePriority);
- ASSERT_TRUE(stats_thread_->Start());
- stats_thread_->SetPriority(kNormalPriority);
+ render_thread_.Start();
+ render_thread_.SetPriority(rtc::kRealtimePriority);
+ capture_thread_.Start();
+ capture_thread_.SetPriority(rtc::kRealtimePriority);
+ stats_thread_.Start();
+ stats_thread_.SetPriority(rtc::kNormalPriority);
}
// Event handler for the test.
const rtc::scoped_ptr<EventWrapper> test_complete_;
// Thread related variables.
- rtc::scoped_ptr<PlatformThread> render_thread_;
- rtc::scoped_ptr<PlatformThread> capture_thread_;
- rtc::scoped_ptr<PlatformThread> stats_thread_;
+ rtc::PlatformThread render_thread_;
+ rtc::PlatformThread capture_thread_;
+ rtc::PlatformThread stats_thread_;
mutable test::Random rand_gen_;
rtc::scoped_ptr<AudioProcessing> apm_;
@@ -472,15 +472,9 @@ class AudioProcessingImplLockTest
AudioProcessingImplLockTest::AudioProcessingImplLockTest()
: test_complete_(EventWrapper::Create()),
- render_thread_(PlatformThread::CreateThread(RenderProcessorThreadFunc,
- this,
- "render")),
- capture_thread_(PlatformThread::CreateThread(CaptureProcessorThreadFunc,
- this,
- "capture")),
- stats_thread_(PlatformThread::CreateThread(StatsProcessorThreadFunc,
- this,
- "stats")),
+ render_thread_(RenderProcessorThreadFunc, this, "render"),
+ capture_thread_(CaptureProcessorThreadFunc, this, "capture"),
+ stats_thread_(StatsProcessorThreadFunc, this, "stats"),
rand_gen_(42U),
apm_(AudioProcessingImpl::Create()),
render_thread_state_(kMaxFrameSize,
@@ -553,9 +547,9 @@ void AudioProcessingImplLockTest::SetUp() {
}
void AudioProcessingImplLockTest::TearDown() {
- render_thread_->Stop();
- capture_thread_->Stop();
- stats_thread_->Stop();
+ render_thread_.Stop();
+ capture_thread_.Stop();
+ stats_thread_.Stop();
}
StatsProcessor::StatsProcessor(test::Random* rand_gen,