OLD | NEW |
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 |
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 _zOrderToChannel( ), | 388 _zOrderToChannel( ), |
389 _hiviewEventHandlerRef( NULL), | 389 _hiviewEventHandlerRef( NULL), |
390 _windowEventHandlerRef( NULL), | 390 _windowEventHandlerRef( NULL), |
391 _currentViewBounds( ), | 391 _currentViewBounds( ), |
392 _lastViewBounds( ), | 392 _lastViewBounds( ), |
393 _renderingIsPaused( false), | 393 _renderingIsPaused( false), |
394 | 394 |
395 { | 395 { |
396 //WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, _id, "%s"); | 396 //WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, _id, "%s"); |
397 | 397 |
398 _screenUpdateThread = ThreadWrapper::CreateThread( | 398 _screenUpdateThread = PlatformThread::CreateThread(ScreenUpdateThreadProc, |
399 ScreenUpdateThreadProc, this, "ScreenUpdate"); | 399 this, "ScreenUpdate"); |
400 _screenUpdateEvent = EventWrapper::Create(); | 400 _screenUpdateEvent = EventWrapper::Create(); |
401 | 401 |
402 if(!IsValidWindowPtr(_windowRef)) | 402 if(!IsValidWindowPtr(_windowRef)) |
403 { | 403 { |
404 //WEBRTC_TRACE(kTraceError, kTraceVideoRenderer, _id, "%s:%d Invalid Win
dowRef:0x%x", __FUNCTION__, __LINE__, _windowRef); | 404 //WEBRTC_TRACE(kTraceError, kTraceVideoRenderer, _id, "%s:%d Invalid Win
dowRef:0x%x", __FUNCTION__, __LINE__, _windowRef); |
405 } | 405 } |
406 else | 406 else |
407 { | 407 { |
408 //WEBRTC_TRACE(kTraceDebug, kTraceVideoRenderer, _id, "%s:%d WindowRef 0
x%x is valid", __FUNCTION__, __LINE__, _windowRef); | 408 //WEBRTC_TRACE(kTraceDebug, kTraceVideoRenderer, _id, "%s:%d WindowRef 0
x%x is valid", __FUNCTION__, __LINE__, _windowRef); |
409 } | 409 } |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
505 _zOrderToChannel( ), | 505 _zOrderToChannel( ), |
506 _hiviewEventHandlerRef( NULL), | 506 _hiviewEventHandlerRef( NULL), |
507 _windowEventHandlerRef( NULL), | 507 _windowEventHandlerRef( NULL), |
508 _currentViewBounds( ), | 508 _currentViewBounds( ), |
509 _lastViewBounds( ), | 509 _lastViewBounds( ), |
510 _renderingIsPaused( false), | 510 _renderingIsPaused( false), |
511 { | 511 { |
512 //WEBRTC_TRACE(kTraceDebug, "%s:%d Constructor", __FUNCTION__, __LINE__); | 512 //WEBRTC_TRACE(kTraceDebug, "%s:%d Constructor", __FUNCTION__, __LINE__); |
513 // _renderCritSec = CriticalSectionWrapper::CreateCriticalSection(); | 513 // _renderCritSec = CriticalSectionWrapper::CreateCriticalSection(); |
514 | 514 |
515 _screenUpdateThread = ThreadWrapper::CreateThread( | 515 _screenUpdateThread = PlatformThread::CreateThread( |
516 ScreenUpdateThreadProc, this, "ScreenUpdateThread"); | 516 ScreenUpdateThreadProc, this, "ScreenUpdateThread"); |
517 _screenUpdateEvent = EventWrapper::Create(); | 517 _screenUpdateEvent = EventWrapper::Create(); |
518 | 518 |
519 GetWindowRect(_windowRect); | 519 GetWindowRect(_windowRect); |
520 | 520 |
521 _lastViewBounds.origin.x = 0; | 521 _lastViewBounds.origin.x = 0; |
522 _lastViewBounds.origin.y = 0; | 522 _lastViewBounds.origin.y = 0; |
523 _lastViewBounds.size.width = 0; | 523 _lastViewBounds.size.width = 0; |
524 _lastViewBounds.size.height = 0; | 524 _lastViewBounds.size.height = 0; |
525 | 525 |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
670 { | 670 { |
671 status = RemoveEventHandler(_hiviewEventHandlerRef); | 671 status = RemoveEventHandler(_hiviewEventHandlerRef); |
672 if(status != noErr) | 672 if(status != noErr) |
673 { | 673 { |
674 //WEBRTC_TRACE(kTraceDebug, "%s:%d Failed to remove hiview event han
dler: %d", __FUNCTION__, __LINE__, (int)_hiviewEventHandlerRef); | 674 //WEBRTC_TRACE(kTraceDebug, "%s:%d Failed to remove hiview event han
dler: %d", __FUNCTION__, __LINE__, (int)_hiviewEventHandlerRef); |
675 } | 675 } |
676 } | 676 } |
677 #endif | 677 #endif |
678 | 678 |
679 // Signal event to exit thread, then delete it | 679 // Signal event to exit thread, then delete it |
680 ThreadWrapper* tmpPtr = _screenUpdateThread.release(); | 680 PlatformThread* tmpPtr = _screenUpdateThread.release(); |
681 | 681 |
682 if (tmpPtr) | 682 if (tmpPtr) |
683 { | 683 { |
684 _screenUpdateEvent->Set(); | 684 _screenUpdateEvent->Set(); |
685 _screenUpdateEvent->StopTimer(); | 685 _screenUpdateEvent->StopTimer(); |
686 | 686 |
687 tmpPtr->Stop(); | 687 tmpPtr->Stop(); |
688 delete tmpPtr; | 688 delete tmpPtr; |
689 delete _screenUpdateEvent; | 689 delete _screenUpdateEvent; |
690 _screenUpdateEvent = NULL; | 690 _screenUpdateEvent = NULL; |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
849 } | 849 } |
850 zIt++;// = _zOrderToChannel.begin(); | 850 zIt++;// = _zOrderToChannel.begin(); |
851 } | 851 } |
852 | 852 |
853 return 0; | 853 return 0; |
854 } | 854 } |
855 | 855 |
856 int VideoRenderAGL::StopThread() | 856 int VideoRenderAGL::StopThread() |
857 { | 857 { |
858 CriticalSectionScoped cs(&_renderCritSec); | 858 CriticalSectionScoped cs(&_renderCritSec); |
859 ThreadWrapper* tmpPtr = _screenUpdateThread.release(); | 859 PlatformThread* tmpPtr = _screenUpdateThread.release(); |
860 | 860 |
861 if (tmpPtr) | 861 if (tmpPtr) |
862 { | 862 { |
863 _screenUpdateEvent->Set(); | 863 _screenUpdateEvent->Set(); |
864 _renderCritSec.Leave(); | 864 _renderCritSec.Leave(); |
865 tmpPtr->Stop(); | 865 tmpPtr->Stop(); |
866 delete tmpPtr; | 866 delete tmpPtr; |
867 _renderCritSec.Enter(); | 867 _renderCritSec.Enter(); |
868 } | 868 } |
869 | 869 |
(...skipping 1014 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1884 if(FALSE == _screenUpdateEvent->StartTimer(true, 1000/MONITOR_FREQ)) | 1884 if(FALSE == _screenUpdateEvent->StartTimer(true, 1000/MONITOR_FREQ)) |
1885 { | 1885 { |
1886 //WEBRTC_TRACE(kTraceError, kTraceVideoRenderer, _id, "%s:%d Failed
to start screenUpdateEvent", __FUNCTION__, __LINE__); | 1886 //WEBRTC_TRACE(kTraceError, kTraceVideoRenderer, _id, "%s:%d Failed
to start screenUpdateEvent", __FUNCTION__, __LINE__); |
1887 UnlockAGLCntx(); | 1887 UnlockAGLCntx(); |
1888 return -1; | 1888 return -1; |
1889 } | 1889 } |
1890 | 1890 |
1891 return 0; | 1891 return 0; |
1892 } | 1892 } |
1893 | 1893 |
1894 _screenUpdateThread = ThreadWrapper::CreateThread(ScreenUpdateThreadProc, | 1894 _screenUpdateThread = PlatformThread::CreateThread(ScreenUpdateThreadProc, |
1895 this, "ScreenUpdate"); | 1895 this, "ScreenUpdate"); |
1896 _screenUpdateEvent = EventWrapper::Create(); | 1896 _screenUpdateEvent = EventWrapper::Create(); |
1897 | 1897 |
1898 if (!_screenUpdateThread) | 1898 if (!_screenUpdateThread) |
1899 { | 1899 { |
1900 //WEBRTC_TRACE(kTraceError, kTraceVideoRenderer, _id, "%s:%d Failed to s
tart screenUpdateThread", __FUNCTION__, __LINE__); | 1900 //WEBRTC_TRACE(kTraceError, kTraceVideoRenderer, _id, "%s:%d Failed to s
tart screenUpdateThread", __FUNCTION__, __LINE__); |
1901 UnlockAGLCntx(); | 1901 UnlockAGLCntx(); |
1902 return -1; | 1902 return -1; |
1903 } | 1903 } |
1904 | 1904 |
1905 _screenUpdateThread->Start(); | 1905 _screenUpdateThread->Start(); |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1979 _renderCritSec.Enter(); | 1979 _renderCritSec.Enter(); |
1980 } | 1980 } |
1981 void VideoRenderAGL::UnlockAGLCntx() | 1981 void VideoRenderAGL::UnlockAGLCntx() |
1982 { | 1982 { |
1983 _renderCritSec.Leave(); | 1983 _renderCritSec.Leave(); |
1984 } | 1984 } |
1985 | 1985 |
1986 } // namespace webrtc | 1986 } // namespace webrtc |
1987 | 1987 |
1988 #endif // CARBON_RENDERING | 1988 #endif // CARBON_RENDERING |
OLD | NEW |