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

Side by Side Diff: webrtc/modules/video_render/mac/video_render_nsopengl.mm

Issue 1469013002: Move ThreadWrapper to ProcessThread in base. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: removed comment 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 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
11 #include "webrtc/engine_configurations.h" 11 #include "webrtc/engine_configurations.h"
12 #if defined(COCOA_RENDERING) 12 #if defined(COCOA_RENDERING)
13 13
14 #include "webrtc/base/platform_thread.h"
14 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" 15 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h"
15 #include "webrtc/modules/video_render/mac/video_render_nsopengl.h" 16 #include "webrtc/modules/video_render/mac/video_render_nsopengl.h"
16 #include "webrtc/system_wrappers/include/critical_section_wrapper.h" 17 #include "webrtc/system_wrappers/include/critical_section_wrapper.h"
17 #include "webrtc/system_wrappers/include/event_wrapper.h" 18 #include "webrtc/system_wrappers/include/event_wrapper.h"
18 #include "webrtc/system_wrappers/include/thread_wrapper.h"
19 #include "webrtc/system_wrappers/include/trace.h" 19 #include "webrtc/system_wrappers/include/trace.h"
20 20
21 namespace webrtc { 21 namespace webrtc {
22 22
23 VideoChannelNSOpenGL::VideoChannelNSOpenGL(NSOpenGLContext *nsglContext, int iId , VideoRenderNSOpenGL* owner) : 23 VideoChannelNSOpenGL::VideoChannelNSOpenGL(NSOpenGLContext *nsglContext, int iId , VideoRenderNSOpenGL* owner) :
24 _nsglContext( nsglContext), 24 _nsglContext( nsglContext),
25 _id( iId), 25 _id( iId),
26 _owner( owner), 26 _owner( owner),
27 _width( 0), 27 _width( 0),
28 _height( 0), 28 _height( 0),
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 _fullScreenWindow( nil), 371 _fullScreenWindow( nil),
372 _windowRect( ), 372 _windowRect( ),
373 _windowWidth( 0), 373 _windowWidth( 0),
374 _windowHeight( 0), 374 _windowHeight( 0),
375 _nsglChannels( ), 375 _nsglChannels( ),
376 _zOrderToChannel( ), 376 _zOrderToChannel( ),
377 _renderingIsPaused (FALSE), 377 _renderingIsPaused (FALSE),
378 _windowRefSuperView(NULL), 378 _windowRefSuperView(NULL),
379 _windowRefSuperViewFrame(NSMakeRect(0,0,0,0)) 379 _windowRefSuperViewFrame(NSMakeRect(0,0,0,0))
380 { 380 {
381 _screenUpdateThread = ThreadWrapper::CreateThread(ScreenUpdateThreadProc, 381 _screenUpdateThread = PlatformThread::CreateThread(
382 this, "ScreenUpdateNSOpenGL"); 382 ScreenUpdateThreadProc, this, "ScreenUpdateNSOpenGL");
383 } 383 }
384 384
385 int VideoRenderNSOpenGL::ChangeWindow(CocoaRenderView* newWindowRef) 385 int VideoRenderNSOpenGL::ChangeWindow(CocoaRenderView* newWindowRef)
386 { 386 {
387 387
388 LockAGLCntx(); 388 LockAGLCntx();
389 389
390 _windowRef = newWindowRef; 390 _windowRef = newWindowRef;
391 391
392 if(CreateMixingContext() == -1) 392 if(CreateMixingContext() == -1)
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
650 [_windowRef setFrame:_windowRefSuperViewFrame]; 650 [_windowRef setFrame:_windowRefSuperViewFrame];
651 } 651 }
652 652
653 WEBRTC_TRACE(kTraceDebug, kTraceVideoRenderer, 0, "%s:%d Attempting to release fullscreen window", __FUNCTION__, __LINE__); 653 WEBRTC_TRACE(kTraceDebug, kTraceVideoRenderer, 0, "%s:%d Attempting to release fullscreen window", __FUNCTION__, __LINE__);
654 [_fullScreenWindow releaseFullScreen]; 654 [_fullScreenWindow releaseFullScreen];
655 655
656 } 656 }
657 } 657 }
658 658
659 // Signal event to exit thread, then delete it 659 // Signal event to exit thread, then delete it
660 ThreadWrapper* tmpPtr = _screenUpdateThread.release(); 660 PlatformThread* tmpPtr = _screenUpdateThread.release();
661 661
662 if (tmpPtr) 662 if (tmpPtr)
663 { 663 {
664 _screenUpdateEvent->Set(); 664 _screenUpdateEvent->Set();
665 _screenUpdateEvent->StopTimer(); 665 _screenUpdateEvent->StopTimer();
666 666
667 if (tmpPtr->Stop()) 667 if (tmpPtr->Stop())
668 { 668 {
669 delete tmpPtr; 669 delete tmpPtr;
670 } 670 }
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
857 857
858 return -1; 858 return -1;
859 } 859 }
860 860
861 return 0; 861 return 0;
862 } 862 }
863 863
864 int VideoRenderNSOpenGL::StopThread() 864 int VideoRenderNSOpenGL::StopThread()
865 { 865 {
866 866
867 ThreadWrapper* tmpPtr = _screenUpdateThread.release(); 867 PlatformThread* tmpPtr = _screenUpdateThread.release();
868 WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, _id, 868 WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, _id,
869 "%s Stopping thread ", __FUNCTION__, tmpPtr); 869 "%s Stopping thread ", __FUNCTION__, tmpPtr);
870 870
871 if (tmpPtr) 871 if (tmpPtr)
872 { 872 {
873 _screenUpdateEvent->Set(); 873 _screenUpdateEvent->Set();
874 if (tmpPtr->Stop()) 874 if (tmpPtr->Stop())
875 { 875 {
876 delete tmpPtr; 876 delete tmpPtr;
877 } 877 }
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
1242 } 1242 }
1243 1243
1244 1244
1245 1245
1246 */ 1246 */
1247 1247
1248 1248
1249 } // namespace webrtc 1249 } // namespace webrtc
1250 1250
1251 #endif // COCOA_RENDERING 1251 #endif // COCOA_RENDERING
OLDNEW
« no previous file with comments | « webrtc/modules/video_render/mac/video_render_nsopengl.h ('k') | webrtc/modules/video_render/windows/video_render_direct3d9.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698