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

Side by Side Diff: webrtc/modules/video_render/ios/video_render_ios_gles20.mm

Issue 1476453002: Clean up PlatformThread. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: IsRunning DCHECK Created 5 years 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 14 matching lines...) Expand all
25 screen_update_event_(0), 25 screen_update_event_(0),
26 view_(view), 26 view_(view),
27 window_rect_(), 27 window_rect_(),
28 window_width_(0), 28 window_width_(0),
29 window_height_(0), 29 window_height_(0),
30 is_full_screen_(full_screen), 30 is_full_screen_(full_screen),
31 agl_channels_(), 31 agl_channels_(),
32 z_order_to_channel_(), 32 z_order_to_channel_(),
33 gles_context_([view context]), 33 gles_context_([view context]),
34 is_rendering_(true) { 34 is_rendering_(true) {
35 screen_update_thread_ = PlatformThread::CreateThread( 35 screen_update_thread_.reset(new rtc::PlatformThread(
36 ScreenUpdateThreadProc, this, "ScreenUpdateGles20"); 36 ScreenUpdateThreadProc, this, "ScreenUpdateGles20"));
37 screen_update_event_ = EventTimerWrapper::Create(); 37 screen_update_event_ = EventTimerWrapper::Create();
38 GetWindowRect(window_rect_); 38 GetWindowRect(window_rect_);
39 } 39 }
40 40
41 VideoRenderIosGles20::~VideoRenderIosGles20() { 41 VideoRenderIosGles20::~VideoRenderIosGles20() {
42 // Signal event to exit thread, then delete it 42 // Signal event to exit thread, then delete it
43 PlatformThread* thread_wrapper = screen_update_thread_.release(); 43 rtc::PlatformThread* thread_wrapper = screen_update_thread_.release();
44 44
45 if (thread_wrapper) { 45 if (thread_wrapper) {
46 screen_update_event_->Set(); 46 screen_update_event_->Set();
47 screen_update_event_->StopTimer(); 47 screen_update_event_->StopTimer();
48 48
49 thread_wrapper->Stop(); 49 thread_wrapper->Stop();
50 delete thread_wrapper; 50 delete thread_wrapper;
51 delete screen_update_event_; 51 delete screen_update_event_;
52 screen_update_event_ = NULL; 52 screen_update_event_ = NULL;
53 is_rendering_ = FALSE; 53 is_rendering_ = FALSE;
(...skipping 22 matching lines...) Expand all
76 76
77 if (!view_) { 77 if (!view_) {
78 view_ = [[VideoRenderIosView alloc] init]; 78 view_ = [[VideoRenderIosView alloc] init];
79 } 79 }
80 80
81 if (![view_ createContext]) { 81 if (![view_ createContext]) {
82 return -1; 82 return -1;
83 } 83 }
84 84
85 screen_update_thread_->Start(); 85 screen_update_thread_->Start();
86 screen_update_thread_->SetPriority(kRealtimePriority); 86 screen_update_thread_->SetPriority(rtc::kRealtimePriority);
87 87
88 // Start the event triggering the render process 88 // Start the event triggering the render process
89 unsigned int monitor_freq = 60; 89 unsigned int monitor_freq = 60;
90 screen_update_event_->StartTimer(true, 1000 / monitor_freq); 90 screen_update_event_->StartTimer(true, 1000 / monitor_freq);
91 91
92 window_width_ = window_rect_.right - window_rect_.left; 92 window_width_ = window_rect_.right - window_rect_.left;
93 window_height_ = window_rect_.bottom - window_rect_.top; 93 window_height_ = window_rect_.bottom - window_rect_.top;
94 94
95 return 0; 95 return 0;
96 } 96 }
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 if (counter == stream_id) { 276 if (counter == stream_id) {
277 VideoRenderIosChannel* agl_channel = it->second; 277 VideoRenderIosChannel* agl_channel = it->second;
278 agl_channel->SetStreamSettings(0, left, top, right, bottom); 278 agl_channel->SetStreamSettings(0, left, top, right, bottom);
279 } 279 }
280 counter++; 280 counter++;
281 it++; 281 it++;
282 } 282 }
283 283
284 return 0; 284 return 0;
285 } 285 }
OLDNEW
« no previous file with comments | « webrtc/modules/video_render/ios/video_render_ios_gles20.h ('k') | webrtc/modules/video_render/mac/video_render_agl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698