diff --git a/src/modules/video_render/main/source/Android/video_render_android_impl.cc b/src/modules/video_render/main/source/Android/video_render_android_impl.cc index 22fa659df9..8df91d2982 100644 --- a/src/modules/video_render/main/source/Android/video_render_android_impl.cc +++ b/src/modules/video_render/main/source/Android/video_render_android_impl.cc @@ -78,7 +78,7 @@ VideoRenderAndroid::~VideoRenderAndroid() WebRtc_Word32 VideoRenderAndroid::ChangeUniqueId(const WebRtc_Word32 id) { - CriticalSectionScoped cs(_critSect); + CriticalSectionScoped cs(&_critSect); _id = id; return 0; @@ -96,7 +96,7 @@ VideoRenderAndroid::AddIncomingRenderStream(const WebRtc_UWord32 streamId, const float right, const float bottom) { - CriticalSectionScoped cs(_critSect); + CriticalSectionScoped cs(&_critSect); AndroidStream* renderStream = NULL; MapItem* item = _streamsMap.Find(streamId); @@ -129,7 +129,7 @@ VideoRenderAndroid::AddIncomingRenderStream(const WebRtc_UWord32 streamId, WebRtc_Word32 VideoRenderAndroid::DeleteIncomingRenderStream( const WebRtc_UWord32 streamId) { - CriticalSectionScoped cs(_critSect); + CriticalSectionScoped cs(&_critSect); MapItem* item = _streamsMap.Find(streamId); if (item) @@ -160,7 +160,7 @@ WebRtc_Word32 VideoRenderAndroid::GetIncomingRenderStreamProperties( WebRtc_Word32 VideoRenderAndroid::StartRender() { - CriticalSectionScoped cs(_critSect); + CriticalSectionScoped cs(&_critSect); if (_javaRenderThread) { @@ -201,7 +201,7 @@ WebRtc_Word32 VideoRenderAndroid::StopRender() WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, _id, "%s:", __FUNCTION__); { - CriticalSectionScoped cs(_critSect); + CriticalSectionScoped cs(&_critSect); if (!_javaRenderThread) { return -1; @@ -211,7 +211,7 @@ WebRtc_Word32 VideoRenderAndroid::StopRender() } _javaShutdownEvent.Wait(3000); - CriticalSectionScoped cs(_critSect); + CriticalSectionScoped cs(&_critSect); _javaRenderThread->SetNotAlive(); if (_javaRenderThread->Stop()) { @@ -230,7 +230,7 @@ WebRtc_Word32 VideoRenderAndroid::StopRender() void VideoRenderAndroid::ReDraw() { - CriticalSectionScoped cs(_critSect); + CriticalSectionScoped cs(&_critSect); if (_lastJavaRenderEvent < TickTime::MillisecondTimestamp() - 20) // Allow redraw if it was more than 20ms since last. { _lastJavaRenderEvent = TickTime::MillisecondTimestamp(); @@ -247,7 +247,7 @@ bool VideoRenderAndroid::JavaRenderThreadProcess() { _javaRenderEvent.Wait(1000); - CriticalSectionScoped cs(_critSect); + CriticalSectionScoped cs(&_critSect); if (!_javaRenderJniEnv) { // try to attach the thread and get the env diff --git a/src/modules/video_render/main/source/external/video_render_external_impl.cc b/src/modules/video_render/main/source/external/video_render_external_impl.cc index 7abb09a063..690be5a620 100644 --- a/src/modules/video_render/main/source/external/video_render_external_impl.cc +++ b/src/modules/video_render/main/source/external/video_render_external_impl.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. + * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source @@ -34,14 +34,14 @@ WebRtc_Word32 VideoRenderExternalImpl::Init() WebRtc_Word32 VideoRenderExternalImpl::ChangeUniqueId(const WebRtc_Word32 id) { - CriticalSectionScoped cs(_critSect); + CriticalSectionScoped cs(&_critSect); _id = id; return 0; } WebRtc_Word32 VideoRenderExternalImpl::ChangeWindow(void* window) { - CriticalSectionScoped cs(_critSect); + CriticalSectionScoped cs(&_critSect); return 0; } @@ -53,14 +53,14 @@ VideoRenderExternalImpl::AddIncomingRenderStream(const WebRtc_UWord32 streamId, const float right, const float bottom) { - CriticalSectionScoped cs(_critSect); + CriticalSectionScoped cs(&_critSect); return this; } WebRtc_Word32 VideoRenderExternalImpl::DeleteIncomingRenderStream( const WebRtc_UWord32 streamId) { - CriticalSectionScoped cs(_critSect); + CriticalSectionScoped cs(&_critSect); return 0; } @@ -72,7 +72,7 @@ WebRtc_Word32 VideoRenderExternalImpl::GetIncomingRenderStreamProperties( float& right, float& bottom) const { - CriticalSectionScoped cs(_critSect); + CriticalSectionScoped cs(&_critSect); zOrder = 0; left = 0; @@ -85,13 +85,13 @@ WebRtc_Word32 VideoRenderExternalImpl::GetIncomingRenderStreamProperties( WebRtc_Word32 VideoRenderExternalImpl::StartRender() { - CriticalSectionScoped cs(_critSect); + CriticalSectionScoped cs(&_critSect); return 0; } WebRtc_Word32 VideoRenderExternalImpl::StopRender() { - CriticalSectionScoped cs(_critSect); + CriticalSectionScoped cs(&_critSect); return 0; } @@ -107,7 +107,7 @@ RawVideoType VideoRenderExternalImpl::PerferedVideoType() bool VideoRenderExternalImpl::FullScreen() { - CriticalSectionScoped cs(_critSect); + CriticalSectionScoped cs(&_critSect); return _fullscreen; } @@ -124,7 +124,7 @@ WebRtc_Word32 VideoRenderExternalImpl::GetScreenResolution( WebRtc_UWord32& screenWidth, WebRtc_UWord32& screenHeight) const { - CriticalSectionScoped cs(_critSect); + CriticalSectionScoped cs(&_critSect); screenWidth = 0; screenHeight = 0; return 0; @@ -133,7 +133,7 @@ WebRtc_Word32 VideoRenderExternalImpl::GetScreenResolution( WebRtc_UWord32 VideoRenderExternalImpl::RenderFrameRate( const WebRtc_UWord32 streamId) { - CriticalSectionScoped cs(_critSect); + CriticalSectionScoped cs(&_critSect); return 0; } @@ -144,7 +144,7 @@ WebRtc_Word32 VideoRenderExternalImpl::SetStreamCropping( const float right, const float bottom) { - CriticalSectionScoped cs(_critSect); + CriticalSectionScoped cs(&_critSect); return 0; } @@ -156,14 +156,14 @@ WebRtc_Word32 VideoRenderExternalImpl::ConfigureRenderer( const float right, const float bottom) { - CriticalSectionScoped cs(_critSect); + CriticalSectionScoped cs(&_critSect); return 0; } WebRtc_Word32 VideoRenderExternalImpl::SetTransparentBackground( const bool enable) { - CriticalSectionScoped cs(_critSect); + CriticalSectionScoped cs(&_critSect); return 0; } @@ -178,7 +178,7 @@ WebRtc_Word32 VideoRenderExternalImpl::SetText( const float right, const float bottom) { - CriticalSectionScoped cs(_critSect); + CriticalSectionScoped cs(&_critSect); return 0; } @@ -190,7 +190,7 @@ WebRtc_Word32 VideoRenderExternalImpl::SetBitmap(const void* bitMap, const float right, const float bottom) { - CriticalSectionScoped cs(_critSect); + CriticalSectionScoped cs(&_critSect); return 0; } diff --git a/src/modules/video_render/main/source/incoming_video_stream.cc b/src/modules/video_render/main/source/incoming_video_stream.cc index 418a325fa4..f7371ac992 100644 --- a/src/modules/video_render/main/source/incoming_video_stream.cc +++ b/src/modules/video_render/main/source/incoming_video_stream.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. + * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source @@ -82,7 +82,7 @@ IncomingVideoStream::~IncomingVideoStream() WebRtc_Word32 IncomingVideoStream::ChangeModuleId(const WebRtc_Word32 id) { - CriticalSectionScoped cs(_streamCritsect); + CriticalSectionScoped cs(&_streamCritsect); _moduleId = id; return 0; @@ -91,7 +91,7 @@ WebRtc_Word32 IncomingVideoStream::ChangeModuleId(const WebRtc_Word32 id) VideoRenderCallback* IncomingVideoStream::ModuleCallback() { - CriticalSectionScoped cs(_streamCritsect); + CriticalSectionScoped cs(&_streamCritsect); return this; } @@ -99,7 +99,7 @@ WebRtc_Word32 IncomingVideoStream::RenderFrame(const WebRtc_UWord32 streamId, VideoFrame& videoFrame) { - CriticalSectionScoped csS(_streamCritsect); + CriticalSectionScoped csS(&_streamCritsect); WEBRTC_TRACE(kTraceStream, kTraceVideoRenderer, _moduleId, "%s for stream %d, render time: %u", __FUNCTION__, _streamId, videoFrame.RenderTimeMs()); @@ -148,7 +148,7 @@ WebRtc_Word32 IncomingVideoStream::RenderFrame(const WebRtc_UWord32 streamId, } // Insert frame - CriticalSectionScoped csB(_bufferCritsect); + CriticalSectionScoped csB(&_bufferCritsect); if (_renderBuffers.AddFrame(&videoFrame) == 1) _deliverBufferEvent.Set(); @@ -157,21 +157,21 @@ WebRtc_Word32 IncomingVideoStream::RenderFrame(const WebRtc_UWord32 streamId, WebRtc_Word32 IncomingVideoStream::SetStartImage(const VideoFrame& videoFrame) { - CriticalSectionScoped csS(_threadCritsect); + CriticalSectionScoped csS(&_threadCritsect); return _startImage.CopyFrame(videoFrame); } WebRtc_Word32 IncomingVideoStream::SetTimeoutImage(const VideoFrame& videoFrame, const WebRtc_UWord32 timeout) { - CriticalSectionScoped csS(_threadCritsect); + CriticalSectionScoped csS(&_threadCritsect); _timeoutTime = timeout; return _timeoutImage.CopyFrame(videoFrame); } WebRtc_Word32 IncomingVideoStream::SetRenderCallback(VideoRenderCallback* renderCallback) { - CriticalSectionScoped cs(_streamCritsect); + CriticalSectionScoped cs(&_streamCritsect); WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, _moduleId, "%s(%x) for stream %d", __FUNCTION__, renderCallback, @@ -184,7 +184,7 @@ WebRtc_Word32 IncomingVideoStream::EnableMirroring(const bool enable, const bool mirrorXAxis, const bool mirrorYAxis) { - CriticalSectionScoped cs(_streamCritsect); + CriticalSectionScoped cs(&_streamCritsect); _mirrorFramesEnabled = enable; _mirroring.mirrorXAxis = mirrorXAxis; _mirroring.mirrorYAxis = mirrorYAxis; @@ -194,7 +194,7 @@ WebRtc_Word32 IncomingVideoStream::EnableMirroring(const bool enable, WebRtc_Word32 IncomingVideoStream::SetExternalCallback(VideoRenderCallback* externalCallback) { - CriticalSectionScoped cs(_streamCritsect); + CriticalSectionScoped cs(&_streamCritsect); WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, _moduleId, "%s(%x) for stream %d", __FUNCTION__, externalCallback, @@ -208,7 +208,7 @@ WebRtc_Word32 IncomingVideoStream::SetExternalCallback(VideoRenderCallback* exte WebRtc_Word32 IncomingVideoStream::Start() { - CriticalSectionScoped csS(_streamCritsect); + CriticalSectionScoped csS(&_streamCritsect); WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, _moduleId, "%s for stream %d", __FUNCTION__, _streamId); if (_running) @@ -218,7 +218,7 @@ WebRtc_Word32 IncomingVideoStream::Start() return 0; } - CriticalSectionScoped csT(_threadCritsect); + CriticalSectionScoped csT(&_threadCritsect); assert(_ptrIncomingRenderThread == NULL); _ptrIncomingRenderThread @@ -252,7 +252,7 @@ WebRtc_Word32 IncomingVideoStream::Start() WebRtc_Word32 IncomingVideoStream::Stop() { - CriticalSectionScoped csStream(_streamCritsect); + CriticalSectionScoped csStream(&_streamCritsect); WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, _moduleId, "%s for stream %d", __FUNCTION__, _streamId); @@ -294,8 +294,8 @@ WebRtc_Word32 IncomingVideoStream::Stop() WebRtc_Word32 IncomingVideoStream::Reset() { - CriticalSectionScoped csStream(_streamCritsect); - CriticalSectionScoped csBuffer(_bufferCritsect); + CriticalSectionScoped csStream(&_streamCritsect); + CriticalSectionScoped csBuffer(&_bufferCritsect); _renderBuffers.ReleaseAllFrames(); return 0; @@ -303,13 +303,13 @@ WebRtc_Word32 IncomingVideoStream::Reset() WebRtc_UWord32 IncomingVideoStream::StreamId() const { - CriticalSectionScoped csStream(_streamCritsect); + CriticalSectionScoped csStream(&_streamCritsect); return _streamId; } WebRtc_UWord32 IncomingVideoStream::IncomingRate() const { - CriticalSectionScoped cs(_streamCritsect); + CriticalSectionScoped cs(&_streamCritsect); return _incomingRate; } @@ -396,7 +396,7 @@ bool IncomingVideoStream::IncomingVideoStreamProcess() // We're done with this frame, delete it. if (ptrFrameToRender) { - CriticalSectionScoped cs(_bufferCritsect); + CriticalSectionScoped cs(&_bufferCritsect); _lastRenderedFrame.SwapFrame(*ptrFrameToRender); _renderBuffers.ReturnFrame(ptrFrameToRender); } @@ -405,7 +405,7 @@ bool IncomingVideoStream::IncomingVideoStreamProcess() } WebRtc_Word32 IncomingVideoStream::GetLastRenderedFrame(VideoFrame& videoFrame) const { - CriticalSectionScoped cs(_bufferCritsect); + CriticalSectionScoped cs(&_bufferCritsect); return videoFrame.CopyFrame(_lastRenderedFrame); } diff --git a/src/modules/video_render/main/source/linux/video_render_linux_impl.cc b/src/modules/video_render/main/source/linux/video_render_linux_impl.cc index a5e311abf8..3dc8ebce95 100644 --- a/src/modules/video_render/main/source/linux/video_render_linux_impl.cc +++ b/src/modules/video_render/main/source/linux/video_render_linux_impl.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. + * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source @@ -43,7 +43,7 @@ WebRtc_Word32 VideoRenderLinuxImpl::Init() WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, _id, "%s", __FUNCTION__); - CriticalSectionScoped cs(_renderLinuxCritsect); + CriticalSectionScoped cs(&_renderLinuxCritsect); _ptrX11Render = new VideoX11Render((Window) _ptrWindow); if (!_ptrX11Render) { @@ -64,7 +64,7 @@ WebRtc_Word32 VideoRenderLinuxImpl::Init() WebRtc_Word32 VideoRenderLinuxImpl::ChangeUniqueId(const WebRtc_Word32 id) { - CriticalSectionScoped cs(_renderLinuxCritsect); + CriticalSectionScoped cs(&_renderLinuxCritsect); _id = id; return 0; @@ -75,7 +75,7 @@ WebRtc_Word32 VideoRenderLinuxImpl::ChangeWindow(void* window) WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, _id, "%s", __FUNCTION__); - CriticalSectionScoped cs(_renderLinuxCritsect); + CriticalSectionScoped cs(&_renderLinuxCritsect); _ptrWindow = window; if (_ptrX11Render) @@ -96,7 +96,7 @@ VideoRenderCallback* VideoRenderLinuxImpl::AddIncomingRenderStream( { WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, _id, "%s", __FUNCTION__); - CriticalSectionScoped cs(_renderLinuxCritsect); + CriticalSectionScoped cs(&_renderLinuxCritsect); VideoRenderCallback* renderCallback = NULL; if (_ptrX11Render) @@ -127,7 +127,7 @@ WebRtc_Word32 VideoRenderLinuxImpl::DeleteIncomingRenderStream( { WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, _id, "%s", __FUNCTION__); - CriticalSectionScoped cs(_renderLinuxCritsect); + CriticalSectionScoped cs(&_renderLinuxCritsect); if (_ptrX11Render) { @@ -146,7 +146,7 @@ WebRtc_Word32 VideoRenderLinuxImpl::GetIncomingRenderStreamProperties( { WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, _id, "%s", __FUNCTION__); - CriticalSectionScoped cs(_renderLinuxCritsect); + CriticalSectionScoped cs(&_renderLinuxCritsect); if (_ptrX11Render) { diff --git a/src/modules/video_render/main/source/linux/video_x11_channel.cc b/src/modules/video_render/main/source/linux/video_x11_channel.cc index 5f8bfa1042..4d574e3d8d 100644 --- a/src/modules/video_render/main/source/linux/video_x11_channel.cc +++ b/src/modules/video_render/main/source/linux/video_x11_channel.cc @@ -46,7 +46,7 @@ VideoX11Channel::~VideoX11Channel() WebRtc_Word32 VideoX11Channel::RenderFrame(const WebRtc_UWord32 streamId, VideoFrame& videoFrame) { - CriticalSectionScoped cs(_crit); + CriticalSectionScoped cs(&_crit); if (_width != (WebRtc_Word32) videoFrame.Width() || _height != (WebRtc_Word32) videoFrame.Height()) { @@ -63,7 +63,7 @@ WebRtc_Word32 VideoX11Channel::FrameSizeChange(WebRtc_Word32 width, WebRtc_Word32 height, WebRtc_Word32 /*numberOfStreams */) { - CriticalSectionScoped cs(_crit); + CriticalSectionScoped cs(&_crit); if (_prepared) { RemoveRenderer(); @@ -80,7 +80,7 @@ WebRtc_Word32 VideoX11Channel::DeliverFrame(unsigned char* buffer, WebRtc_Word32 bufferSize, unsigned WebRtc_Word32 /*timeStamp90kHz*/) { - CriticalSectionScoped cs(_crit); + CriticalSectionScoped cs(&_crit); if (!_prepared) { return 0; @@ -119,7 +119,7 @@ WebRtc_Word32 VideoX11Channel::Init(Window window, float left, float top, { WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, _Id, "%s", __FUNCTION__); - CriticalSectionScoped cs(_crit); + CriticalSectionScoped cs(&_crit); _window = window; _left = left; @@ -188,7 +188,7 @@ WebRtc_Word32 VideoX11Channel::ChangeWindow(Window window) { WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, _Id, "%s", __FUNCTION__); - CriticalSectionScoped cs(_crit); + CriticalSectionScoped cs(&_crit); // Stop the rendering, if we are rendering... RemoveRenderer(); @@ -224,7 +224,7 @@ WebRtc_Word32 VideoX11Channel::ReleaseWindow() { WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, _Id, "%s", __FUNCTION__); - CriticalSectionScoped cs(_crit); + CriticalSectionScoped cs(&_crit); RemoveRenderer(); if (_gc) { @@ -244,7 +244,7 @@ WebRtc_Word32 VideoX11Channel::CreateLocalRenderer(WebRtc_Word32 width, { WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, _Id, "%s", __FUNCTION__); - CriticalSectionScoped cs(_crit); + CriticalSectionScoped cs(&_crit); if (!_window || !_display) { diff --git a/src/modules/video_render/main/source/linux/video_x11_render.cc b/src/modules/video_render/main/source/linux/video_x11_render.cc index a3543e39c4..9e29fe3827 100644 --- a/src/modules/video_render/main/source/linux/video_x11_render.cc +++ b/src/modules/video_render/main/source/linux/video_x11_render.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. + * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source @@ -29,7 +29,7 @@ VideoX11Render::~VideoX11Render() WebRtc_Word32 VideoX11Render::Init() { - CriticalSectionScoped cs(_critSect); + CriticalSectionScoped cs(&_critSect); _streamIdToX11ChannelMap.clear(); @@ -38,7 +38,7 @@ WebRtc_Word32 VideoX11Render::Init() WebRtc_Word32 VideoX11Render::ChangeWindow(Window window) { - CriticalSectionScoped cs(_critSect); + CriticalSectionScoped cs(&_critSect); VideoX11Channel* renderChannel = NULL; std::map::iterator iter = @@ -67,7 +67,7 @@ VideoX11Channel* VideoX11Render::CreateX11RenderChannel( const float right, const float bottom) { - CriticalSectionScoped cs(_critSect); + CriticalSectionScoped cs(&_critSect); VideoX11Channel* renderChannel = NULL; std::map::iterator iter = @@ -101,7 +101,7 @@ VideoX11Channel* VideoX11Render::CreateX11RenderChannel( WebRtc_Word32 VideoX11Render::DeleteX11RenderChannel(WebRtc_Word32 streamId) { - CriticalSectionScoped cs(_critSect); + CriticalSectionScoped cs(&_critSect); std::map::iterator iter = _streamIdToX11ChannelMap.find(streamId); @@ -131,7 +131,7 @@ WebRtc_Word32 VideoX11Render::GetIncomingStreamProperties( float& right, float& bottom) { - CriticalSectionScoped cs(_critSect); + CriticalSectionScoped cs(&_critSect); std::map::iterator iter = _streamIdToX11ChannelMap.find(streamId); diff --git a/src/modules/video_render/main/source/mac/video_render_agl.cc b/src/modules/video_render/main/source/mac/video_render_agl.cc index e968865ff0..fc78b93574 100644 --- a/src/modules/video_render/main/source/mac/video_render_agl.cc +++ b/src/modules/video_render/main/source/mac/video_render_agl.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. + * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source @@ -813,7 +813,7 @@ k int VideoRenderAGL::DeleteAllAGLChannels() { - CriticalSectionScoped cs(_renderCritSec); + CriticalSectionScoped cs(&_renderCritSec); //WEBRTC_TRACE(kTraceInfo, "%s:%d Deleting all AGL channels", __FUNCTION__, __LINE__); //int i = 0 ; @@ -835,7 +835,7 @@ int VideoRenderAGL::DeleteAllAGLChannels() int VideoRenderAGL::DeleteAGLChannel(int channel) { - CriticalSectionScoped cs(_renderCritSec); + CriticalSectionScoped cs(&_renderCritSec); //WEBRTC_TRACE(kTraceDebug, "%s:%d Deleting AGL channel %d", __FUNCTION__, __LINE__, channel); std::map::iterator it; @@ -867,7 +867,7 @@ int VideoRenderAGL::DeleteAGLChannel(int channel) int VideoRenderAGL::StopThread() { - CriticalSectionScoped cs(_renderCritSec); + CriticalSectionScoped cs(&_renderCritSec); ThreadWrapper* tmpPtr = _screenUpdateThread; //_screenUpdateThread = NULL; @@ -889,14 +889,14 @@ int VideoRenderAGL::StopThread() bool VideoRenderAGL::IsFullScreen() { - CriticalSectionScoped cs(_renderCritSec); + CriticalSectionScoped cs(&_renderCritSec); return _fullScreen; } bool VideoRenderAGL::HasChannels() { - CriticalSectionScoped cs(_renderCritSec); + CriticalSectionScoped cs(&_renderCritSec); if (_aglChannels.begin() != _aglChannels.end()) { @@ -908,7 +908,7 @@ bool VideoRenderAGL::HasChannels() bool VideoRenderAGL::HasChannel(int channel) { - CriticalSectionScoped cs(_renderCritSec); + CriticalSectionScoped cs(&_renderCritSec); std::map::iterator it = _aglChannels.find(channel); if (it != _aglChannels.end()) @@ -922,7 +922,7 @@ bool VideoRenderAGL::HasChannel(int channel) int VideoRenderAGL::GetChannels(std::list& channelList) { - CriticalSectionScoped cs(_renderCritSec); + CriticalSectionScoped cs(&_renderCritSec); std::map::iterator it = _aglChannels.begin(); while (it != _aglChannels.end()) @@ -937,7 +937,7 @@ int VideoRenderAGL::GetChannels(std::list& channelList) VideoChannelAGL* VideoRenderAGL::ConfigureAGLChannel(int channel, int zOrder, float startWidth, float startHeight, float stopWidth, float stopHeight) { - CriticalSectionScoped cs(_renderCritSec); + CriticalSectionScoped cs(&_renderCritSec); std::map::iterator it = _aglChannels.find(channel); diff --git a/src/modules/video_render/main/source/mac/video_render_mac_carbon_impl.cc b/src/modules/video_render/main/source/mac/video_render_mac_carbon_impl.cc index 88dc1e638c..aec73bc318 100644 --- a/src/modules/video_render/main/source/mac/video_render_mac_carbon_impl.cc +++ b/src/modules/video_render/main/source/mac/video_render_mac_carbon_impl.cc @@ -42,7 +42,7 @@ VideoRenderMacCarbonImpl::~VideoRenderMacCarbonImpl() WebRtc_Word32 VideoRenderMacCarbonImpl::Init() { - CriticalSectionScoped cs(_renderMacCarbonCritsect); + CriticalSectionScoped cs(&_renderMacCarbonCritsect); WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, _id, "%s:%d", __FUNCTION__, __LINE__); if (!_ptrWindow) @@ -101,7 +101,7 @@ VideoRenderMacCarbonImpl::ChangeUniqueId(const WebRtc_Word32 id) { return -1; - CriticalSectionScoped cs(_renderMacCarbonCritsect); + CriticalSectionScoped cs(&_renderMacCarbonCritsect); WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, _id, "%s", __FUNCTION__); _id = id; @@ -117,7 +117,7 @@ WebRtc_Word32 VideoRenderMacCarbonImpl::ChangeWindow(void* window) { return -1; - CriticalSectionScoped cs(_renderMacCarbonCritsect); + CriticalSectionScoped cs(&_renderMacCarbonCritsect); WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, _id, "%s changing ID to ", __FUNCTION__, window); if (window == NULL) @@ -141,7 +141,7 @@ VideoRenderMacCarbonImpl::AddIncomingRenderStream(const WebRtc_UWord32 streamId, const float bottom) { - CriticalSectionScoped cs(_renderMacCarbonCritsect); + CriticalSectionScoped cs(&_renderMacCarbonCritsect); WEBRTC_TRACE(kTraceDebug, kTraceVideoRenderer, _id, "%s", __FUNCTION__); VideoChannelAGL* AGLChannel = NULL; @@ -163,7 +163,7 @@ VideoRenderMacCarbonImpl::DeleteIncomingRenderStream(const WebRtc_UWord32 stream { WEBRTC_TRACE(kTraceDebug, kTraceVideoRenderer, _id, "%s:%d", __FUNCTION__, __LINE__); - CriticalSectionScoped cs(_renderMacCarbonCritsect); + CriticalSectionScoped cs(&_renderMacCarbonCritsect); _ptrCarbonRender->DeleteAGLChannel(streamId); return 0; @@ -224,7 +224,7 @@ WebRtc_Word32 VideoRenderMacCarbonImpl::GetScreenResolution(WebRtc_UWord32& screenWidth, WebRtc_UWord32& screenHeight) const { - CriticalSectionScoped cs(_renderMacCarbonCritsect); + CriticalSectionScoped cs(&_renderMacCarbonCritsect); //NSScreen* mainScreen = [NSScreen mainScreen]; //NSRect frame = [mainScreen frame]; @@ -237,7 +237,7 @@ VideoRenderMacCarbonImpl::GetScreenResolution(WebRtc_UWord32& screenWidth, WebRtc_UWord32 VideoRenderMacCarbonImpl::RenderFrameRate(const WebRtc_UWord32 streamId) { - CriticalSectionScoped cs(_renderMacCarbonCritsect); + CriticalSectionScoped cs(&_renderMacCarbonCritsect); return 0; } diff --git a/src/modules/video_render/main/source/mac/video_render_mac_cocoa_impl.mm b/src/modules/video_render/main/source/mac/video_render_mac_cocoa_impl.mm index 4698b6ec06..bc5057f8b3 100644 --- a/src/modules/video_render/main/source/mac/video_render_mac_cocoa_impl.mm +++ b/src/modules/video_render/main/source/mac/video_render_mac_cocoa_impl.mm @@ -48,7 +48,7 @@ WebRtc_Word32 VideoRenderMacCocoaImpl::Init() { - CriticalSectionScoped cs(_renderMacCocoaCritsect); + CriticalSectionScoped cs(&_renderMacCocoaCritsect); WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, _id, "%s:%d", __FUNCTION__, __LINE__); // cast ptrWindow from void* to CocoaRenderer. Void* was once NSOpenGLView, and CocoaRenderer is NSOpenGLView. @@ -71,7 +71,7 @@ VideoRenderMacCocoaImpl::Init() WebRtc_Word32 VideoRenderMacCocoaImpl::ChangeUniqueId(const WebRtc_Word32 id) { - CriticalSectionScoped cs(_renderMacCocoaCritsect); + CriticalSectionScoped cs(&_renderMacCocoaCritsect); WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, _id, "%s", __FUNCTION__); _id = id; @@ -87,7 +87,7 @@ WebRtc_Word32 VideoRenderMacCocoaImpl::ChangeWindow(void* window) { - CriticalSectionScoped cs(_renderMacCocoaCritsect); + CriticalSectionScoped cs(&_renderMacCocoaCritsect); WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, _id, "%s changing ID to ", __FUNCTION__, window); if (window == NULL) @@ -111,7 +111,7 @@ VideoRenderMacCocoaImpl::AddIncomingRenderStream(const WebRtc_UWord32 streamId, const float right, const float bottom) { - CriticalSectionScoped cs(_renderMacCocoaCritsect); + CriticalSectionScoped cs(&_renderMacCocoaCritsect); WEBRTC_TRACE(kTraceDebug, kTraceVideoRenderer, _id, "%s", __FUNCTION__); VideoChannelNSOpenGL* nsOpenGLChannel = NULL; @@ -132,7 +132,7 @@ WebRtc_Word32 VideoRenderMacCocoaImpl::DeleteIncomingRenderStream(const WebRtc_UWord32 streamId) { WEBRTC_TRACE(kTraceDebug, kTraceVideoRenderer, _id, "Constructor %s:%d", __FUNCTION__, __LINE__); - CriticalSectionScoped cs(_renderMacCocoaCritsect); + CriticalSectionScoped cs(&_renderMacCocoaCritsect); _ptrCocoaRender->DeleteNSGLChannel(streamId); return 0; @@ -192,7 +192,7 @@ WebRtc_Word32 VideoRenderMacCocoaImpl::GetScreenResolution(WebRtc_UWord32& screenWidth, WebRtc_UWord32& screenHeight) const { - CriticalSectionScoped cs(_renderMacCocoaCritsect); + CriticalSectionScoped cs(&_renderMacCocoaCritsect); NSScreen* mainScreen = [NSScreen mainScreen]; NSRect frame = [mainScreen frame]; @@ -205,7 +205,7 @@ VideoRenderMacCocoaImpl::GetScreenResolution(WebRtc_UWord32& screenWidth, WebRtc_UWord32 VideoRenderMacCocoaImpl::RenderFrameRate(const WebRtc_UWord32 streamId) { - CriticalSectionScoped cs(_renderMacCocoaCritsect); + CriticalSectionScoped cs(&_renderMacCocoaCritsect); return 0; } diff --git a/src/modules/video_render/main/source/mac/video_render_nsopengl.mm b/src/modules/video_render/main/source/mac/video_render_nsopengl.mm index 4f1a6c5cf5..e63f50cda5 100644 --- a/src/modules/video_render/main/source/mac/video_render_nsopengl.mm +++ b/src/modules/video_render/main/source/mac/video_render_nsopengl.mm @@ -749,7 +749,7 @@ int VideoRenderNSOpenGL::Init() VideoChannelNSOpenGL* VideoRenderNSOpenGL::CreateNSGLChannel(int channel, int zOrder, float startWidth, float startHeight, float stopWidth, float stopHeight) { - CriticalSectionScoped cs(_nsglContextCritSec); + CriticalSectionScoped cs(&_nsglContextCritSec); if (HasChannel(channel)) { @@ -784,7 +784,7 @@ VideoChannelNSOpenGL* VideoRenderNSOpenGL::CreateNSGLChannel(int channel, int zO int VideoRenderNSOpenGL::DeleteAllNSGLChannels() { - CriticalSectionScoped cs(_nsglContextCritSec); + CriticalSectionScoped cs(&_nsglContextCritSec); std::map::iterator it; it = _nsglChannels.begin(); @@ -803,7 +803,7 @@ int VideoRenderNSOpenGL::DeleteAllNSGLChannels() WebRtc_Word32 VideoRenderNSOpenGL::DeleteNSGLChannel(const WebRtc_UWord32 channel) { - CriticalSectionScoped cs(_nsglContextCritSec); + CriticalSectionScoped cs(&_nsglContextCritSec); std::map::iterator it; it = _nsglChannels.find(channel); @@ -839,7 +839,7 @@ WebRtc_Word32 VideoRenderNSOpenGL::GetChannelProperties(const WebRtc_UWord16 str float& bottom) { - CriticalSectionScoped cs(_nsglContextCritSec); + CriticalSectionScoped cs(&_nsglContextCritSec); bool channelFound = false; @@ -902,13 +902,13 @@ int VideoRenderNSOpenGL::StopThread() bool VideoRenderNSOpenGL::IsFullScreen() { - CriticalSectionScoped cs(_nsglContextCritSec); + CriticalSectionScoped cs(&_nsglContextCritSec); return _fullScreen; } bool VideoRenderNSOpenGL::HasChannels() { - CriticalSectionScoped cs(_nsglContextCritSec); + CriticalSectionScoped cs(&_nsglContextCritSec); if (_nsglChannels.begin() != _nsglChannels.end()) { @@ -920,7 +920,7 @@ bool VideoRenderNSOpenGL::HasChannels() bool VideoRenderNSOpenGL::HasChannel(int channel) { - CriticalSectionScoped cs(_nsglContextCritSec); + CriticalSectionScoped cs(&_nsglContextCritSec); std::map::iterator it = _nsglChannels.find(channel); @@ -934,7 +934,7 @@ bool VideoRenderNSOpenGL::HasChannel(int channel) int VideoRenderNSOpenGL::GetChannels(std::list& channelList) { - CriticalSectionScoped cs(_nsglContextCritSec); + CriticalSectionScoped cs(&_nsglContextCritSec); std::map::iterator it = _nsglChannels.begin(); @@ -950,7 +950,7 @@ int VideoRenderNSOpenGL::GetChannels(std::list& channelList) VideoChannelNSOpenGL* VideoRenderNSOpenGL::ConfigureNSGLChannel(int channel, int zOrder, float startWidth, float startHeight, float stopWidth, float stopHeight) { - CriticalSectionScoped cs(_nsglContextCritSec); + CriticalSectionScoped cs(&_nsglContextCritSec); std::map::iterator it = _nsglChannels.find(channel); @@ -1066,7 +1066,7 @@ bool VideoRenderNSOpenGL::ScreenUpdateProcess() int VideoRenderNSOpenGL::CreateMixingContext() { - CriticalSectionScoped cs(_nsglContextCritSec); + CriticalSectionScoped cs(&_nsglContextCritSec); if(_fullScreen) { @@ -1160,7 +1160,7 @@ int VideoRenderNSOpenGL::DisplayBuffers() int VideoRenderNSOpenGL::GetWindowRect(Rect& rect) { - CriticalSectionScoped cs(_nsglContextCritSec); + CriticalSectionScoped cs(&_nsglContextCritSec); if (_windowRef) { @@ -1191,7 +1191,7 @@ int VideoRenderNSOpenGL::GetWindowRect(Rect& rect) WebRtc_Word32 VideoRenderNSOpenGL::ChangeUniqueID(WebRtc_Word32 id) { - CriticalSectionScoped cs(_nsglContextCritSec); + CriticalSectionScoped cs(&_nsglContextCritSec); _id = id; return 0; } diff --git a/src/modules/video_render/main/source/video_render_impl.cc b/src/modules/video_render/main/source/video_render_impl.cc index 616d03beba..10122442dd 100644 --- a/src/modules/video_render/main/source/video_render_impl.cc +++ b/src/modules/video_render/main/source/video_render_impl.cc @@ -322,7 +322,7 @@ ModuleVideoRenderImpl::~ModuleVideoRenderImpl() WebRtc_Word32 ModuleVideoRenderImpl::ChangeUniqueId(const WebRtc_Word32 id) { - CriticalSectionScoped cs(_moduleCrit); + CriticalSectionScoped cs(&_moduleCrit); _id = id; @@ -348,14 +348,14 @@ WebRtc_Word32 ModuleVideoRenderImpl::Process() void* ModuleVideoRenderImpl::Window() { - CriticalSectionScoped cs(_moduleCrit); + CriticalSectionScoped cs(&_moduleCrit); return _ptrWindow; } WebRtc_Word32 ModuleVideoRenderImpl::ChangeWindow(void* window) { - CriticalSectionScoped cs(_moduleCrit); + CriticalSectionScoped cs(&_moduleCrit); #ifdef WEBRTC_INCLUDE_INTERNAL_VIDEO_RENDER @@ -409,14 +409,14 @@ WebRtc_Word32 ModuleVideoRenderImpl::ChangeWindow(void* window) WebRtc_Word32 ModuleVideoRenderImpl::Id() { - CriticalSectionScoped cs(_moduleCrit); + CriticalSectionScoped cs(&_moduleCrit); return _id; } WebRtc_UWord32 ModuleVideoRenderImpl::GetIncomingFrameRate( const WebRtc_UWord32 streamId) { - CriticalSectionScoped cs(_moduleCrit); + CriticalSectionScoped cs(&_moduleCrit); MapItem* mapItem = _streamRenderMap.Find(streamId); if (mapItem == NULL) @@ -446,7 +446,7 @@ ModuleVideoRenderImpl::AddIncomingRenderStream(const WebRtc_UWord32 streamId, const float right, const float bottom) { - CriticalSectionScoped cs(_moduleCrit); + CriticalSectionScoped cs(&_moduleCrit); if (!_ptrRenderer) { @@ -506,7 +506,7 @@ ModuleVideoRenderImpl::AddIncomingRenderStream(const WebRtc_UWord32 streamId, WebRtc_Word32 ModuleVideoRenderImpl::DeleteIncomingRenderStream( const WebRtc_UWord32 streamId) { - CriticalSectionScoped cs(_moduleCrit); + CriticalSectionScoped cs(&_moduleCrit); if (!_ptrRenderer) { @@ -537,7 +537,7 @@ WebRtc_Word32 ModuleVideoRenderImpl::AddExternalRenderCallback( const WebRtc_UWord32 streamId, VideoRenderCallback* renderObject) { - CriticalSectionScoped cs(_moduleCrit); + CriticalSectionScoped cs(&_moduleCrit); MapItem* mapItem = _streamRenderMap.Find(streamId); if (!mapItem) @@ -565,7 +565,7 @@ WebRtc_Word32 ModuleVideoRenderImpl::GetIncomingRenderStreamProperties( float& right, float& bottom) const { - CriticalSectionScoped cs(_moduleCrit); + CriticalSectionScoped cs(&_moduleCrit); if (!_ptrRenderer) { @@ -581,7 +581,7 @@ WebRtc_Word32 ModuleVideoRenderImpl::GetIncomingRenderStreamProperties( WebRtc_UWord32 ModuleVideoRenderImpl::GetNumIncomingRenderStreams() const { - CriticalSectionScoped cs(_moduleCrit); + CriticalSectionScoped cs(&_moduleCrit); return (WebRtc_UWord32) _streamRenderMap.Size(); } @@ -589,7 +589,7 @@ WebRtc_UWord32 ModuleVideoRenderImpl::GetNumIncomingRenderStreams() const bool ModuleVideoRenderImpl::HasIncomingRenderStream( const WebRtc_UWord32 streamId) const { - CriticalSectionScoped cs(_moduleCrit); + CriticalSectionScoped cs(&_moduleCrit); bool hasStream = false; if (_streamRenderMap.Find(streamId) != NULL) @@ -608,7 +608,7 @@ WebRtc_Word32 ModuleVideoRenderImpl::RegisterRawFrameCallback( WebRtc_Word32 ModuleVideoRenderImpl::StartRender(const WebRtc_UWord32 streamId) { - CriticalSectionScoped cs(_moduleCrit); + CriticalSectionScoped cs(&_moduleCrit); if (!_ptrRenderer) { @@ -641,7 +641,7 @@ WebRtc_Word32 ModuleVideoRenderImpl::StartRender(const WebRtc_UWord32 streamId) WebRtc_Word32 ModuleVideoRenderImpl::StopRender(const WebRtc_UWord32 streamId) { - CriticalSectionScoped cs(_moduleCrit); + CriticalSectionScoped cs(&_moduleCrit); if (!_ptrRenderer) { @@ -669,7 +669,7 @@ WebRtc_Word32 ModuleVideoRenderImpl::StopRender(const WebRtc_UWord32 streamId) WebRtc_Word32 ModuleVideoRenderImpl::ResetRender() { - CriticalSectionScoped cs(_moduleCrit); + CriticalSectionScoped cs(&_moduleCrit); WebRtc_Word32 error = 0; @@ -690,7 +690,7 @@ WebRtc_Word32 ModuleVideoRenderImpl::ResetRender() RawVideoType ModuleVideoRenderImpl::PreferredVideoType() const { - CriticalSectionScoped cs(_moduleCrit); + CriticalSectionScoped cs(&_moduleCrit); if (_ptrRenderer == NULL) { @@ -702,7 +702,7 @@ RawVideoType ModuleVideoRenderImpl::PreferredVideoType() const bool ModuleVideoRenderImpl::IsFullScreen() { - CriticalSectionScoped cs(_moduleCrit); + CriticalSectionScoped cs(&_moduleCrit); if (!_ptrRenderer) { @@ -717,7 +717,7 @@ WebRtc_Word32 ModuleVideoRenderImpl::GetScreenResolution( WebRtc_UWord32& screenWidth, WebRtc_UWord32& screenHeight) const { - CriticalSectionScoped cs(_moduleCrit); + CriticalSectionScoped cs(&_moduleCrit); if (!_ptrRenderer) { @@ -731,7 +731,7 @@ WebRtc_Word32 ModuleVideoRenderImpl::GetScreenResolution( WebRtc_UWord32 ModuleVideoRenderImpl::RenderFrameRate( const WebRtc_UWord32 streamId) { - CriticalSectionScoped cs(_moduleCrit); + CriticalSectionScoped cs(&_moduleCrit); if (!_ptrRenderer) { @@ -749,7 +749,7 @@ WebRtc_Word32 ModuleVideoRenderImpl::SetStreamCropping( const float right, const float bottom) { - CriticalSectionScoped cs(_moduleCrit); + CriticalSectionScoped cs(&_moduleCrit); if (!_ptrRenderer) { @@ -762,7 +762,7 @@ WebRtc_Word32 ModuleVideoRenderImpl::SetStreamCropping( WebRtc_Word32 ModuleVideoRenderImpl::SetTransparentBackground(const bool enable) { - CriticalSectionScoped cs(_moduleCrit); + CriticalSectionScoped cs(&_moduleCrit); if (!_ptrRenderer) { @@ -789,7 +789,7 @@ WebRtc_Word32 ModuleVideoRenderImpl::SetText( const float right, const float bottom) { - CriticalSectionScoped cs(_moduleCrit); + CriticalSectionScoped cs(&_moduleCrit); if (!_ptrRenderer) { @@ -809,7 +809,7 @@ WebRtc_Word32 ModuleVideoRenderImpl::SetBitmap(const void* bitMap, const float right, const float bottom) { - CriticalSectionScoped cs(_moduleCrit); + CriticalSectionScoped cs(&_moduleCrit); if (!_ptrRenderer) { @@ -825,7 +825,7 @@ WebRtc_Word32 ModuleVideoRenderImpl::GetLastRenderedFrame( const WebRtc_UWord32 streamId, VideoFrame &frame) const { - CriticalSectionScoped cs(_moduleCrit); + CriticalSectionScoped cs(&_moduleCrit); if (!_ptrRenderer) { @@ -862,7 +862,7 @@ WebRtc_Word32 ModuleVideoRenderImpl::ConfigureRenderer( const float right, const float bottom) { - CriticalSectionScoped cs(_moduleCrit); + CriticalSectionScoped cs(&_moduleCrit); if (!_ptrRenderer) { @@ -878,7 +878,7 @@ WebRtc_Word32 ModuleVideoRenderImpl::SetStartImage( const WebRtc_UWord32 streamId, const VideoFrame& videoFrame) { - CriticalSectionScoped cs(_moduleCrit); + CriticalSectionScoped cs(&_moduleCrit); if (!_ptrRenderer) { @@ -913,7 +913,7 @@ WebRtc_Word32 ModuleVideoRenderImpl::SetTimeoutImage( const VideoFrame& videoFrame, const WebRtc_UWord32 timeout) { - CriticalSectionScoped cs(_moduleCrit); + CriticalSectionScoped cs(&_moduleCrit); if (!_ptrRenderer) { @@ -947,7 +947,7 @@ WebRtc_Word32 ModuleVideoRenderImpl::MirrorRenderStream(const int renderId, const bool mirrorXAxis, const bool mirrorYAxis) { - CriticalSectionScoped cs(_moduleCrit); + CriticalSectionScoped cs(&_moduleCrit); if (!_ptrRenderer) { diff --git a/src/modules/video_render/main/source/windows/video_render_direct3d9.cc b/src/modules/video_render/main/source/windows/video_render_direct3d9.cc index 00bc41b6ba..7e2509dad2 100644 --- a/src/modules/video_render/main/source/windows/video_render_direct3d9.cc +++ b/src/modules/video_render/main/source/windows/video_render_direct3d9.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. + * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source @@ -116,7 +116,7 @@ int D3D9Channel::FrameSizeChange(int width, int height, int numberOfStreams) "FrameSizeChange, wifth: %d, height: %d, streams: %d", width, height, numberOfStreams); - CriticalSectionScoped cs(*_critSect); + CriticalSectionScoped cs(_critSect); _width = width; _height = height; @@ -145,7 +145,7 @@ int D3D9Channel::FrameSizeChange(int width, int height, int numberOfStreams) WebRtc_Word32 D3D9Channel::RenderFrame(const WebRtc_UWord32 streamId, VideoFrame& videoFrame) { - CriticalSectionScoped cs(*_critSect); + CriticalSectionScoped cs(_critSect); if (_width != videoFrame.Width() || _height != videoFrame.Height()) { if (FrameSizeChange(videoFrame.Width(), videoFrame.Height(), 1) == -1) @@ -165,7 +165,7 @@ int D3D9Channel::DeliverFrame(unsigned char* buffer, WEBRTC_TRACE(kTraceStream, kTraceVideo, -1, "DeliverFrame to D3D9Channel"); - CriticalSectionScoped cs(*_critSect); + CriticalSectionScoped cs(_critSect); //FIXME if _bufferIsUpdated is still true (not be renderred), do we what to update the texture?) //probably not @@ -219,7 +219,7 @@ int D3D9Channel::RenderOffFrame() { WEBRTC_TRACE(kTraceStream, kTraceVideo, -1, "Frame has been rendered to the screen."); - CriticalSectionScoped cs(*_critSect); + CriticalSectionScoped cs(_critSect); _bufferIsUpdated = false; return 0; } @@ -227,7 +227,7 @@ int D3D9Channel::RenderOffFrame() // Called by d3d channel owner to check if the texture is updated int D3D9Channel::IsUpdated(bool& isUpdated) { - CriticalSectionScoped cs(*_critSect); + CriticalSectionScoped cs(_critSect); isUpdated = _bufferIsUpdated; return 0; } @@ -235,13 +235,13 @@ int D3D9Channel::IsUpdated(bool& isUpdated) // Called by d3d channel owner to get the texture LPDIRECT3DTEXTURE9 D3D9Channel::GetTexture() { - CriticalSectionScoped cs(*_critSect); + CriticalSectionScoped cs(_critSect); return _pTexture; } int D3D9Channel::ReleaseTexture() { - CriticalSectionScoped cs(*_critSect); + CriticalSectionScoped cs(_critSect); //release the texture if (_pTexture != NULL) @@ -255,7 +255,7 @@ int D3D9Channel::ReleaseTexture() int D3D9Channel::RecreateTexture(LPDIRECT3DDEVICE9 pd3DDevice) { - CriticalSectionScoped cs(*_critSect); + CriticalSectionScoped cs(_critSect); _pd3dDevice = pd3DDevice; @@ -421,7 +421,7 @@ int VideoRenderDirect3D9::ResetDevice() WEBRTC_TRACE(kTraceInfo, kTraceVideo, -1, "VideoRenderDirect3D9::ResetDevice"); - CriticalSectionScoped cs(_refD3DCritsect); + CriticalSectionScoped cs(&_refD3DCritsect); //release the channel texture std::map::iterator it; @@ -552,7 +552,7 @@ WebRtc_Word32 VideoRenderDirect3D9::Init() WEBRTC_TRACE(kTraceInfo, kTraceVideo, -1, "VideoRenderDirect3D9::Init"); - CriticalSectionScoped cs(_refD3DCritsect); + CriticalSectionScoped cs(&_refD3DCritsect); // Start rendering thread... if (!_screenUpdateThread) @@ -586,7 +586,7 @@ WebRtc_Word32 VideoRenderDirect3D9::ChangeWindow(void* window) int VideoRenderDirect3D9::UpdateRenderSurface() { - CriticalSectionScoped cs(_refD3DCritsect); + CriticalSectionScoped cs(&_refD3DCritsect); // Check if there are any updated buffers bool updated = false; @@ -692,7 +692,7 @@ int VideoRenderDirect3D9::SetTransparentColor(LPDIRECT3DTEXTURE9 pTexture, if (!pTexture) return -1; - CriticalSectionScoped cs(_refD3DCritsect); + CriticalSectionScoped cs(&_refD3DCritsect); if (SUCCEEDED(pTexture->LockRect(0, &lr, NULL, D3DLOCK_DISCARD))) { for (DWORD y = 0; y < height; y++) @@ -774,7 +774,7 @@ bool VideoRenderDirect3D9::ScreenUpdateProcess() int VideoRenderDirect3D9::CloseDevice() { - CriticalSectionScoped cs(_refD3DCritsect); + CriticalSectionScoped cs(&_refD3DCritsect); WEBRTC_TRACE(kTraceInfo, kTraceVideo, -1, "VideoRenderDirect3D9::CloseDevice"); @@ -827,7 +827,7 @@ D3D9Channel* VideoRenderDirect3D9::GetD3DChannel(int channel) WebRtc_Word32 VideoRenderDirect3D9::DeleteChannel(const WebRtc_UWord32 streamId) { - CriticalSectionScoped cs(_refD3DCritsect); + CriticalSectionScoped cs(&_refD3DCritsect); std::multimap::iterator it; @@ -861,7 +861,7 @@ VideoRenderCallback* VideoRenderDirect3D9::CreateChannel(const WebRtc_UWord32 ch const float right, const float bottom) { - CriticalSectionScoped cs(_refD3DCritsect); + CriticalSectionScoped cs(&_refD3DCritsect); //FIXME this should be done in VideoAPIWindows? stop the frame deliver first //remove the old channel @@ -1036,7 +1036,7 @@ WebRtc_Word32 VideoRenderDirect3D9::SetBitmap(const void* bitMap, return -1; } - CriticalSectionScoped cs(_refD3DCritsect); + CriticalSectionScoped cs(&_refD3DCritsect); unsigned char* srcPtr; HGDIOBJ oldhand; diff --git a/src/modules/video_render/main/source/windows/video_render_directdraw.cc b/src/modules/video_render/main/source/windows/video_render_directdraw.cc index 034f7106bc..42d076e109 100644 --- a/src/modules/video_render/main/source/windows/video_render_directdraw.cc +++ b/src/modules/video_render/main/source/windows/video_render_directdraw.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. + * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source @@ -422,7 +422,7 @@ DirectDrawChannel::~DirectDrawChannel() void DirectDrawChannel::AddRef() { - CriticalSectionScoped cs(*_critSect); + CriticalSectionScoped cs(_critSect); _refCount++; } @@ -454,7 +454,7 @@ void DirectDrawChannel::SetStreamSettings(VideoRenderDirectDraw* DDobj, lookupID <<= 11; lookupID += streamId; - CriticalSectionScoped cs(*_critSect); + CriticalSectionScoped cs(_critSect); DirectDrawStreamSettings* streamSettings = NULL; @@ -490,7 +490,7 @@ void DirectDrawChannel::SetStreamCropSettings(VideoRenderDirectDraw* DDObj, lookupID <<= 11; lookupID += streamId; - CriticalSectionScoped cs(*_critSect); + CriticalSectionScoped cs(_critSect); DirectDrawStreamSettings* streamSettings = NULL; std::map::iterator it = @@ -516,7 +516,7 @@ int DirectDrawChannel::GetStreamSettings(VideoRenderDirectDraw* DDObj, float& stopWidth, float& stopHeight) { - CriticalSectionScoped cs(*_critSect); + CriticalSectionScoped cs(_critSect); unsigned long long lookupID = reinterpret_cast (DDObj); lookupID &= 0xffffffffffffffe0; @@ -542,13 +542,13 @@ int DirectDrawChannel::GetStreamSettings(VideoRenderDirectDraw* DDObj, bool DirectDrawChannel::IsOffScreenSurfaceUpdated(VideoRenderDirectDraw* DDobj) { - CriticalSectionScoped cs(*_critSect); + CriticalSectionScoped cs(_critSect); return _offScreenSurfaceUpdated; } void DirectDrawChannel::GetLargestSize(RECT* mixingRect) { - CriticalSectionScoped cs(*_critSect); + CriticalSectionScoped cs(_critSect); if (mixingRect) { if (mixingRect->bottom < _height) @@ -571,7 +571,7 @@ int DirectDrawChannel::ChangeDeliverColorFormat(bool useScreenType) WebRtc_Word32 DirectDrawChannel::RenderFrame(const WebRtc_UWord32 streamId, VideoFrame& videoFrame) { - CriticalSectionScoped cs(*_critSect); + CriticalSectionScoped cs(_critSect); if (_width != videoFrame.Width() || _height != videoFrame.Height()) { if (FrameSizeChange(videoFrame.Width(), videoFrame.Height(), 1) == -1) @@ -586,7 +586,7 @@ WebRtc_Word32 DirectDrawChannel::RenderFrame(const WebRtc_UWord32 streamId, int DirectDrawChannel::FrameSizeChange(int width, int height, int numberOfStreams) { - CriticalSectionScoped cs(*_critSect); + CriticalSectionScoped cs(_critSect); if (_directDraw == NULL) { @@ -899,7 +899,7 @@ int DirectDrawChannel::FrameSizeChange(int width, int height, int DirectDrawChannel::DeliverFrame(unsigned char* buffer, int bufferSize, unsigned int /*timeStamp90KHz*/) { - CriticalSectionScoped cs(*_critSect); + CriticalSectionScoped cs(_critSect); if (CalcBufferSize(_incomingVideoType, _width, _height) != bufferSize) @@ -1086,7 +1086,7 @@ int DirectDrawChannel::BlitFromOffscreenBufferToMixingBuffer( lookupID <<= 11; lookupID += streamID; - CriticalSectionScoped cs(*_critSect); + CriticalSectionScoped cs(_critSect); if (_offScreenSurface == NULL) { @@ -1674,7 +1674,7 @@ WebRtc_Word32 VideoRenderDirectDraw::GetGraphicsMemory( WebRtc_UWord64& totalMemory, WebRtc_UWord64& availableMemory) { - CriticalSectionScoped cs(*_confCritSect); + CriticalSectionScoped cs(_confCritSect); if (_totalMemory == -1 || _availableMemory == -1) { @@ -1690,7 +1690,7 @@ WebRtc_Word32 VideoRenderDirectDraw::GetGraphicsMemory( int VideoRenderDirectDraw::GetScreenResolution(int& screenWidth, int& screenHeight) { - CriticalSectionScoped cs(*_confCritSect); + CriticalSectionScoped cs(_confCritSect); screenWidth = _screenRect.right - _screenRect.left; screenHeight = _screenRect.bottom - _screenRect.top; @@ -1699,7 +1699,7 @@ int VideoRenderDirectDraw::GetScreenResolution(int& screenWidth, int VideoRenderDirectDraw::UpdateSystemCPUUsage(int systemCPU) { - CriticalSectionScoped cs(*_confCritSect); + CriticalSectionScoped cs(_confCritSect); if (systemCPU <= 100 && systemCPU >= 0) { _systemCPUUsage = systemCPU; @@ -2395,7 +2395,7 @@ int VideoRenderDirectDraw::AddDirectDrawChannel(int channel, DirectDrawChannel* VideoRenderDirectDraw::ShareDirectDrawChannel( int channel) { - CriticalSectionScoped cs(*_confCritSect); + CriticalSectionScoped cs(_confCritSect); DirectDrawChannel* obj = NULL; @@ -2411,7 +2411,7 @@ DirectDrawChannel* VideoRenderDirectDraw::ShareDirectDrawChannel( WebRtc_Word32 VideoRenderDirectDraw::DeleteChannel(const WebRtc_UWord32 channel) { - CriticalSectionScoped cs(*_confCritSect); + CriticalSectionScoped cs(_confCritSect); // Remove the old z order @@ -2449,7 +2449,7 @@ WebRtc_Word32 VideoRenderDirectDraw::GetStreamSettings(const WebRtc_UWord32 chan float& stopWidth, float& stopHeight) { - CriticalSectionScoped cs(*_confCritSect); + CriticalSectionScoped cs(_confCritSect); std::map::iterator ddIt; ddIt = _directDrawChannels.find(channel & 0x0000ffff); @@ -2488,7 +2488,7 @@ WebRtc_Word32 VideoRenderDirectDraw::GetStreamSettings(const WebRtc_UWord32 chan int VideoRenderDirectDraw::GetChannels(std::list& channelList) { - CriticalSectionScoped cs(*_confCritSect); + CriticalSectionScoped cs(_confCritSect); std::map::iterator ddIt; ddIt = _directDrawChannels.begin(); @@ -2508,7 +2508,7 @@ int VideoRenderDirectDraw::GetChannels(std::list& channelList) bool VideoRenderDirectDraw::HasChannel(int channel) { - CriticalSectionScoped cs(*_confCritSect); + CriticalSectionScoped cs(_confCritSect); std::map::iterator ddIt; ddIt = _directDrawChannels.find(channel & 0x0000ffff); @@ -2521,7 +2521,7 @@ bool VideoRenderDirectDraw::HasChannel(int channel) bool VideoRenderDirectDraw::HasChannels() { - CriticalSectionScoped cs(*_confCritSect); + CriticalSectionScoped cs(_confCritSect); if (_directDrawChannels.begin() != _directDrawChannels.end()) { @@ -2552,7 +2552,7 @@ DirectDrawChannel* VideoRenderDirectDraw::ConfigureDirectDrawChannel(int channel // Only support one stream per channel, is demuxing done outside if DD. streamID = 0; - CriticalSectionScoped cs(*_confCritSect); + CriticalSectionScoped cs(_confCritSect); if (!_canStretch) { @@ -2625,7 +2625,7 @@ WebRtc_Word32 VideoRenderDirectDraw::SetCropping(const WebRtc_UWord32 channel, float left, float top, float right, float bottom) { - CriticalSectionScoped cs(*_confCritSect); + CriticalSectionScoped cs(_confCritSect); if (!_canStretch) { if (left != 0.0f || top != 0.0f || right != 1.0f || bottom != 1.0f) @@ -2696,7 +2696,7 @@ WebRtc_Word32 VideoRenderDirectDraw::SetText(const WebRtc_UWord8 textId, { DirectDrawTextSettings* textSetting = NULL; - CriticalSectionScoped cs(*_confCritSect); + CriticalSectionScoped cs(_confCritSect); _frameChanged = true; @@ -2784,7 +2784,7 @@ WebRtc_Word32 VideoRenderDirectDraw::SetBitmap(const void* bitMap, { DirectDrawBitmapSettings* bitmapSetting = NULL; - CriticalSectionScoped cs(*_confCritSect); + CriticalSectionScoped cs(_confCritSect); _frameChanged = true; std::map::iterator it; @@ -2905,7 +2905,7 @@ WebRtc_Word32 VideoRenderDirectDraw::SetBitmap(const void* bitMap, WebRtc_Word32 VideoRenderDirectDraw::SetTransparentBackground( const bool enable) { - CriticalSectionScoped cs(*_confCritSect); + CriticalSectionScoped cs(_confCritSect); if (_supportTransparency) { diff --git a/src/modules/video_render/main/source/windows/video_render_windows_impl.cc b/src/modules/video_render/main/source/windows/video_render_windows_impl.cc index 6f2237fd3f..cdc74bb437 100644 --- a/src/modules/video_render/main/source/windows/video_render_windows_impl.cc +++ b/src/modules/video_render/main/source/windows/video_render_windows_impl.cc @@ -99,14 +99,14 @@ WebRtc_Word32 VideoRenderWindowsImpl::Init() WebRtc_Word32 VideoRenderWindowsImpl::ChangeUniqueId(const WebRtc_Word32 id) { - CriticalSectionScoped cs(_renderWindowsCritsect); + CriticalSectionScoped cs(&_renderWindowsCritsect); _id = id; return 0; } WebRtc_Word32 VideoRenderWindowsImpl::ChangeWindow(void* window) { - CriticalSectionScoped cs(_renderWindowsCritsect); + CriticalSectionScoped cs(&_renderWindowsCritsect); if (!_ptrRendererWin) { return -1; @@ -125,7 +125,7 @@ VideoRenderWindowsImpl::AddIncomingRenderStream(const WebRtc_UWord32 streamId, const float right, const float bottom) { - CriticalSectionScoped cs(_renderWindowsCritsect); + CriticalSectionScoped cs(&_renderWindowsCritsect); VideoRenderCallback* renderCallback = NULL; if (!_ptrRendererWin) @@ -143,7 +143,7 @@ VideoRenderWindowsImpl::AddIncomingRenderStream(const WebRtc_UWord32 streamId, WebRtc_Word32 VideoRenderWindowsImpl::DeleteIncomingRenderStream( const WebRtc_UWord32 streamId) { - CriticalSectionScoped cs(_renderWindowsCritsect); + CriticalSectionScoped cs(&_renderWindowsCritsect); WebRtc_Word32 error = -1; if (!_ptrRendererWin) { @@ -163,7 +163,7 @@ WebRtc_Word32 VideoRenderWindowsImpl::GetIncomingRenderStreamProperties( float& right, float& bottom) const { - CriticalSectionScoped cs(_renderWindowsCritsect); + CriticalSectionScoped cs(&_renderWindowsCritsect); zOrder = 0; left = 0; top = 0; @@ -184,7 +184,7 @@ WebRtc_Word32 VideoRenderWindowsImpl::GetIncomingRenderStreamProperties( WebRtc_Word32 VideoRenderWindowsImpl::StartRender() { - CriticalSectionScoped cs(_renderWindowsCritsect); + CriticalSectionScoped cs(&_renderWindowsCritsect); WebRtc_Word32 error = -1; if (!_ptrRendererWin) { @@ -198,7 +198,7 @@ WebRtc_Word32 VideoRenderWindowsImpl::StartRender() WebRtc_Word32 VideoRenderWindowsImpl::StopRender() { - CriticalSectionScoped cs(_renderWindowsCritsect); + CriticalSectionScoped cs(&_renderWindowsCritsect); WebRtc_Word32 error = -1; if (!_ptrRendererWin) { @@ -222,7 +222,7 @@ RawVideoType VideoRenderWindowsImpl::PerferedVideoType() bool VideoRenderWindowsImpl::FullScreen() { - CriticalSectionScoped cs(_renderWindowsCritsect); + CriticalSectionScoped cs(&_renderWindowsCritsect); bool fullscreen = false; if (!_ptrRendererWin) { @@ -253,7 +253,7 @@ WebRtc_Word32 VideoRenderWindowsImpl::GetScreenResolution( WebRtc_UWord32& screenWidth, WebRtc_UWord32& screenHeight) const { - CriticalSectionScoped cs(_renderWindowsCritsect); + CriticalSectionScoped cs(&_renderWindowsCritsect); screenWidth = 0; screenHeight = 0; return 0; @@ -262,7 +262,7 @@ WebRtc_Word32 VideoRenderWindowsImpl::GetScreenResolution( WebRtc_UWord32 VideoRenderWindowsImpl::RenderFrameRate( const WebRtc_UWord32 streamId) { - CriticalSectionScoped cs(_renderWindowsCritsect); + CriticalSectionScoped cs(&_renderWindowsCritsect); return 0; } @@ -273,7 +273,7 @@ WebRtc_Word32 VideoRenderWindowsImpl::SetStreamCropping( const float right, const float bottom) { - CriticalSectionScoped cs(_renderWindowsCritsect); + CriticalSectionScoped cs(&_renderWindowsCritsect); WebRtc_Word32 error = -1; if (!_ptrRendererWin) { @@ -294,7 +294,7 @@ WebRtc_Word32 VideoRenderWindowsImpl::ConfigureRenderer( const float right, const float bottom) { - CriticalSectionScoped cs(_renderWindowsCritsect); + CriticalSectionScoped cs(&_renderWindowsCritsect); WebRtc_Word32 error = -1; if (!_ptrRendererWin) { @@ -311,7 +311,7 @@ WebRtc_Word32 VideoRenderWindowsImpl::ConfigureRenderer( WebRtc_Word32 VideoRenderWindowsImpl::SetTransparentBackground( const bool enable) { - CriticalSectionScoped cs(_renderWindowsCritsect); + CriticalSectionScoped cs(&_renderWindowsCritsect); WebRtc_Word32 error = -1; if (!_ptrRendererWin) { @@ -334,7 +334,7 @@ WebRtc_Word32 VideoRenderWindowsImpl::SetText( const float right, const float bottom) { - CriticalSectionScoped cs(_renderWindowsCritsect); + CriticalSectionScoped cs(&_renderWindowsCritsect); WebRtc_Word32 error = -1; if (!_ptrRendererWin) { @@ -356,7 +356,7 @@ WebRtc_Word32 VideoRenderWindowsImpl::SetBitmap(const void* bitMap, const float right, const float bottom) { - CriticalSectionScoped cs(_renderWindowsCritsect); + CriticalSectionScoped cs(&_renderWindowsCritsect); WebRtc_Word32 error = -1; if (!_ptrRendererWin) {