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

Unified Diff: webrtc/common_video/incoming_video_stream.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
Index: webrtc/common_video/incoming_video_stream.cc
diff --git a/webrtc/common_video/incoming_video_stream.cc b/webrtc/common_video/incoming_video_stream.cc
index 010a57ed5b14793a3a9f55f742bc3a0c1543ccad..1272ecc5bbc3cca20294206f325d30cfded13259 100644
--- a/webrtc/common_video/incoming_video_stream.cc
+++ b/webrtc/common_video/incoming_video_stream.cc
@@ -138,19 +138,17 @@ int32_t IncomingVideoStream::Start() {
CriticalSectionScoped csT(thread_critsect_.get());
assert(incoming_render_thread_ == NULL);
- incoming_render_thread_ = PlatformThread::CreateThread(
- IncomingVideoStreamThreadFun, this, "IncomingVideoStreamThread");
+ incoming_render_thread_.reset(new rtc::PlatformThread(
+ IncomingVideoStreamThreadFun, this, "IncomingVideoStreamThread"));
if (!incoming_render_thread_) {
return -1;
}
- if (incoming_render_thread_->Start()) {
- } else {
- return -1;
- }
- incoming_render_thread_->SetPriority(kRealtimePriority);
+ incoming_render_thread_->Start();
+ incoming_render_thread_->SetPriority(rtc::kRealtimePriority);
deliver_buffer_event_->StartTimer(false, kEventStartupTimeMs);
}
+
running_ = true;
return 0;
}
@@ -162,7 +160,7 @@ int32_t IncomingVideoStream::Stop() {
return 0;
}
- PlatformThread* thread = NULL;
+ rtc::PlatformThread* thread = NULL;
{
CriticalSectionScoped cs_thread(thread_critsect_.get());
if (incoming_render_thread_) {
@@ -176,11 +174,8 @@ int32_t IncomingVideoStream::Stop() {
}
}
if (thread) {
- if (thread->Stop()) {
- delete thread;
- } else {
- assert(false);
- }
+ thread->Stop();
+ delete thread;
}
running_ = false;
return 0;

Powered by Google App Engine
This is Rietveld 408576698