Updated stable to r2917.

git-svn-id: http://webrtc.googlecode.com/svn/stable/src@2918 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/build/arm_neon.gypi b/build/arm_neon.gypi
index 53c3b53..30d040b 100644
--- a/build/arm_neon.gypi
+++ b/build/arm_neon.gypi
@@ -20,16 +20,11 @@
 # }
 
 {
-  'conditions': [
-    ['OS=="android"', {
-      'cflags!': [
-        '-mfpu=vfpv3-d16',
-      ],
-      'cflags': [
-        '-mfpu=neon',
-        '-mfloat-abi=softfp',
-        '-flax-vector-conversions',
-      ],
-    }],
+  'cflags!': [
+    '-mfpu=vfpv3-d16',
+  ],
+  'cflags': [
+    '-mfpu=neon',
+    '-flax-vector-conversions',
   ],
 }
diff --git a/common_video/libyuv/include/scaler.h b/common_video/libyuv/include/scaler.h
index 8851194..8838844 100644
--- a/common_video/libyuv/include/scaler.h
+++ b/common_video/libyuv/include/scaler.h
@@ -16,7 +16,6 @@
 #define WEBRTC_COMMON_VIDEO_LIBYUV_INCLUDE_SCALER_H_
 
 #include "common_video/libyuv/include/webrtc_libyuv.h"
-#include "common_video/interface/i420_video_frame.h"
 #include "typedefs.h"
 
 namespace webrtc {
@@ -48,13 +47,9 @@
   // Return value: 0 - OK,
   //               -1 - parameter error
   //               -2 - scaler not set
-  // TODO(mikhal): Remove legacy implementation of old VideoFrame.
   int Scale(const VideoFrame& src_frame,
             VideoFrame* dst_frame);
 
-  int Scale(const I420VideoFrame& src_frame,
-             I420VideoFrame* dst_frame);
-
  private:
   // Determine if the VideoTypes are currently supported.
   bool SupportedVideoType(VideoType src_video_type,
diff --git a/common_video/libyuv/scaler.cc b/common_video/libyuv/scaler.cc
index 5851b2a..1304e0d 100644
--- a/common_video/libyuv/scaler.cc
+++ b/common_video/libyuv/scaler.cc
@@ -84,35 +84,6 @@
                            libyuv::FilterMode(method_));
 }
 
-
-// TODO(mikhal): Add test to new function. Currently not used.
-int Scaler::Scale(const I420VideoFrame& src_frame,
-                  I420VideoFrame* dst_frame) {
-  assert(dst_frame);
-  // TODO(mikhal): Add isEmpty
-  //  if (src_frame.Buffer() == NULL || src_frame.Length() == 0)
-  //    return -1;
-  if (!set_)
-    return -2;
-
-  // TODO(mikhal): Setting stride equal to width - should align.
-  dst_frame->CreateEmptyFrame(dst_width_, dst_height_, dst_width_ ,
-                              (dst_width_ + 1) / 2, (dst_width_ + 1) / 2);
-
-  return libyuv::I420Scale(src_frame.buffer(kYPlane), src_frame.stride(kYPlane),
-                           src_frame.buffer(kUPlane), src_frame.stride(kYPlane),
-                           src_frame.buffer(kVPlane), src_frame.stride(kYPlane),
-                           src_width_, src_height_,
-                           dst_frame->buffer(kYPlane),
-                           dst_frame->stride(kYPlane),
-                           dst_frame->buffer(kYPlane),
-                           dst_frame->stride(kYPlane),
-                           dst_frame->buffer(kYPlane),
-                           dst_frame->stride(kYPlane),
-                           dst_width_, dst_height_,
-                           libyuv::FilterMode(method_));
-}
-
 // TODO(mikhal): Add support for more types.
 bool Scaler::SupportedVideoType(VideoType src_video_type,
                                 VideoType dst_video_type) {
diff --git a/modules/rtp_rtcp/source/rtp_packet_history.cc b/modules/rtp_rtcp/source/rtp_packet_history.cc
index df5caf1..791fbf9 100644
--- a/modules/rtp_rtcp/source/rtp_packet_history.cc
+++ b/modules/rtp_rtcp/source/rtp_packet_history.cc
@@ -43,7 +43,7 @@
 
 void RTPPacketHistory::Allocate(uint16_t number_to_store) {
   assert(number_to_store > 0);
-  webrtc::CriticalSectionScoped cs(*critsect_); 
+  CriticalSectionScoped cs(critsect_);
   if (store_) {
     WEBRTC_TRACE(kTraceWarning, kTraceRtpRtcp, -1,
         "SetStorePacketsStatus already set, number: %d", number_to_store);
@@ -60,7 +60,7 @@
 }
 
 void RTPPacketHistory::Free() {
-  webrtc::CriticalSectionScoped cs(*critsect_);
+  CriticalSectionScoped cs(critsect_);
   if (!store_) {
     return;
   }
@@ -83,7 +83,7 @@
 }
 
 bool RTPPacketHistory::StorePackets() const {
-  webrtc::CriticalSectionScoped cs(*critsect_);
+  CriticalSectionScoped cs(critsect_);
   return store_;
 }
 
@@ -114,7 +114,7 @@
     return 0;
   }
 
-  webrtc::CriticalSectionScoped cs(*critsect_);
+  CriticalSectionScoped cs(critsect_);
   if (!store_) {
     return 0;
   }
@@ -152,7 +152,7 @@
 }
 
 bool RTPPacketHistory::HasRTPPacket(uint16_t sequence_number) const {
-  webrtc::CriticalSectionScoped cs(*critsect_);
+  CriticalSectionScoped cs(critsect_);
   if (!store_) {
     return false;
   }
@@ -177,7 +177,7 @@
                                     uint16_t* packet_length,
                                     int64_t* stored_time_ms,
                                     StorageType* type) const {
-  webrtc::CriticalSectionScoped cs(*critsect_);
+  CriticalSectionScoped cs(critsect_);
   if (!store_) {
     return false;
   }
@@ -224,7 +224,7 @@
 }
 
 void RTPPacketHistory::UpdateResendTime(uint16_t sequence_number) {
-  webrtc::CriticalSectionScoped cs(*critsect_);
+  CriticalSectionScoped cs(critsect_);
   if (!store_) {
     return;
   }
diff --git a/modules/rtp_rtcp/source/transmission_bucket.cc b/modules/rtp_rtcp/source/transmission_bucket.cc
index 6808b10..8b9af2d 100644
--- a/modules/rtp_rtcp/source/transmission_bucket.cc
+++ b/modules/rtp_rtcp/source/transmission_bucket.cc
@@ -49,7 +49,7 @@
 }
 
 void TransmissionBucket::Reset() {
-  webrtc::CriticalSectionScoped cs(*critsect_);
+  CriticalSectionScoped cs(critsect_);
   accumulator_ = 0;
   bytes_rem_interval_ = 0;
   packets_.clear();
@@ -58,7 +58,7 @@
 void TransmissionBucket::Fill(uint16_t seq_num,
                               uint32_t timestamp,
                               uint16_t num_bytes) {
-  webrtc::CriticalSectionScoped cs(*critsect_);
+  CriticalSectionScoped cs(critsect_);
   accumulator_ += num_bytes;
 
   Packet p(seq_num, timestamp, num_bytes, clock_->GetTimeInMS());
@@ -66,14 +66,14 @@
 }
 
 bool TransmissionBucket::Empty() {
-  webrtc::CriticalSectionScoped cs(*critsect_);
+  CriticalSectionScoped cs(critsect_);
   return packets_.empty();
 }
 
 void TransmissionBucket::UpdateBytesPerInterval(
     uint32_t delta_time_ms,
     uint16_t target_bitrate_kbps) {
-  webrtc::CriticalSectionScoped cs(*critsect_);
+  CriticalSectionScoped cs(critsect_);
 
   uint32_t bytes_per_interval = 
       kBytesPerIntervalMargin * (target_bitrate_kbps * delta_time_ms / 8);
@@ -86,7 +86,7 @@
 }
 
 int32_t TransmissionBucket::GetNextPacket() {
-  webrtc::CriticalSectionScoped cs(*critsect_);
+  CriticalSectionScoped cs(critsect_);
 
   if (accumulator_ == 0) {
     // Empty.
diff --git a/modules/video_processing/main/source/video_processing_impl.cc b/modules/video_processing/main/source/video_processing_impl.cc
index 3619996..8a470a9 100644
--- a/modules/video_processing/main/source/video_processing_impl.cc
+++ b/modules/video_processing/main/source/video_processing_impl.cc
@@ -65,7 +65,7 @@
 WebRtc_Word32
 VideoProcessingModuleImpl::ChangeUniqueId(const WebRtc_Word32 id)
 {
-    CriticalSectionScoped mutex(_mutex);
+    CriticalSectionScoped mutex(&_mutex);
     _id = id;
     _brightnessDetection.ChangeUniqueId(id);
     _deflickering.ChangeUniqueId(id);
@@ -77,7 +77,7 @@
 WebRtc_Word32
 VideoProcessingModuleImpl::Id() const
 {
-    CriticalSectionScoped mutex(_mutex);
+    CriticalSectionScoped mutex(&_mutex);
     return _id;
 }
 
@@ -103,7 +103,7 @@
 void
 VideoProcessingModuleImpl::Reset()
 {
-    CriticalSectionScoped mutex(_mutex);
+    CriticalSectionScoped mutex(&_mutex);
     _deflickering.Reset();
     _denoising.Reset();
     _brightnessDetection.Reset();
@@ -225,7 +225,7 @@
                                             const WebRtc_UWord32 timestamp,
                                             FrameStats& stats)
 {
-    CriticalSectionScoped mutex(_mutex);
+    CriticalSectionScoped mutex(&_mutex);
     return _deflickering.ProcessFrame(frame, width, height, timestamp, stats);
 }
 
@@ -240,7 +240,7 @@
                                          const WebRtc_UWord32 width,
                                          const WebRtc_UWord32 height)
 {
-    CriticalSectionScoped mutex(_mutex);
+    CriticalSectionScoped mutex(&_mutex);
     return _denoising.ProcessFrame(frame, width, height);
 }
 
@@ -257,7 +257,7 @@
                                                    const WebRtc_UWord32 height,
                                                    const FrameStats& stats)
 {
-    CriticalSectionScoped mutex(_mutex);
+    CriticalSectionScoped mutex(&_mutex);
     return _brightnessDetection.ProcessFrame(frame, width, height, stats);
 }
 
@@ -265,7 +265,7 @@
 void 
 VideoProcessingModuleImpl::EnableTemporalDecimation(bool enable)
 {
-    CriticalSectionScoped mutex(_mutex);
+    CriticalSectionScoped mutex(&_mutex);
     _framePreProcessor.EnableTemporalDecimation(enable);
 }
 
@@ -273,14 +273,14 @@
 void 
 VideoProcessingModuleImpl::SetInputFrameResampleMode(VideoFrameResampling resamplingMode)
 {
-    CriticalSectionScoped cs(_mutex);
+    CriticalSectionScoped cs(&_mutex);
     _framePreProcessor.SetInputFrameResampleMode(resamplingMode);
 }
 
 WebRtc_Word32
 VideoProcessingModuleImpl::SetMaxFrameRate(WebRtc_UWord32 maxFrameRate)
 {
-    CriticalSectionScoped cs(_mutex);
+    CriticalSectionScoped cs(&_mutex);
     return _framePreProcessor.SetMaxFrameRate(maxFrameRate);
 
 }
@@ -288,7 +288,7 @@
 WebRtc_Word32
 VideoProcessingModuleImpl::SetTargetResolution(WebRtc_UWord32 width, WebRtc_UWord32 height, WebRtc_UWord32 frameRate)
 {
-    CriticalSectionScoped cs(_mutex);
+    CriticalSectionScoped cs(&_mutex);
     return _framePreProcessor.SetTargetResolution(width, height, frameRate);
 }
 
@@ -296,7 +296,7 @@
 WebRtc_UWord32
 VideoProcessingModuleImpl::DecimatedFrameRate()
 {
-    CriticalSectionScoped cs(_mutex);
+    CriticalSectionScoped cs(&_mutex);
     return  _framePreProcessor.DecimatedFrameRate();
 }
 
@@ -304,28 +304,28 @@
 WebRtc_UWord32
 VideoProcessingModuleImpl::DecimatedWidth() const
 {
-    CriticalSectionScoped cs(_mutex);
+    CriticalSectionScoped cs(&_mutex);
     return _framePreProcessor.DecimatedWidth();
 }
 
 WebRtc_UWord32
 VideoProcessingModuleImpl::DecimatedHeight() const
 {
-    CriticalSectionScoped cs(_mutex);
+    CriticalSectionScoped cs(&_mutex);
     return _framePreProcessor.DecimatedHeight();
 }
 
 WebRtc_Word32
 VideoProcessingModuleImpl::PreprocessFrame(const VideoFrame *frame, VideoFrame **processedFrame)
 {
-    CriticalSectionScoped mutex(_mutex);
+    CriticalSectionScoped mutex(&_mutex);
     return _framePreProcessor.PreprocessFrame(frame, processedFrame);
 }
 
 VideoContentMetrics*
 VideoProcessingModuleImpl::ContentMetrics() const
 {
-    CriticalSectionScoped mutex(_mutex);
+    CriticalSectionScoped mutex(&_mutex);
     return _framePreProcessor.ContentMetrics();
 }
 
@@ -333,7 +333,7 @@
 void
 VideoProcessingModuleImpl::EnableContentAnalysis(bool enable)
 {
-    CriticalSectionScoped mutex(_mutex);
+    CriticalSectionScoped mutex(&_mutex);
     _framePreProcessor.EnableContentAnalysis(enable);
 }
 
diff --git a/modules/video_render/main/source/incoming_video_stream.cc b/modules/video_render/main/source/incoming_video_stream.cc
index 0a29482..637d607 100644
--- a/modules/video_render/main/source/incoming_video_stream.cc
+++ b/modules/video_render/main/source/incoming_video_stream.cc
@@ -183,7 +183,7 @@
                  "%s(%d) for stream %d", __FUNCTION__, delay_ms, stream_id_);
     return -1;
   }
-  CriticalSectionScoped cs(buffer_critsect_);
+  CriticalSectionScoped cs(&buffer_critsect_);
   return render_buffers_.SetRenderDelay(delay_ms);
 }
 
diff --git a/modules/video_render/main/source/video_render_impl.cc b/modules/video_render/main/source/video_render_impl.cc
index 6c273a8..a162ef6 100644
--- a/modules/video_render/main/source/video_render_impl.cc
+++ b/modules/video_render/main/source/video_render_impl.cc
@@ -847,7 +847,7 @@
 
 WebRtc_Word32 ModuleVideoRenderImpl::SetExpectedRenderDelay(
     WebRtc_UWord32 stream_id, WebRtc_Word32 delay_ms) {
-  CriticalSectionScoped cs(_moduleCrit);
+  CriticalSectionScoped cs(&_moduleCrit);
 
   if (!_ptrRenderer) {
     WEBRTC_TRACE(kTraceError, kTraceVideoRenderer, _id,
diff --git a/system_wrappers/interface/critical_section_wrapper.h b/system_wrappers/interface/critical_section_wrapper.h
index cfec9ae..a3a1134 100644
--- a/system_wrappers/interface/critical_section_wrapper.h
+++ b/system_wrappers/interface/critical_section_wrapper.h
@@ -38,15 +38,6 @@
 class CriticalSectionScoped
 {
 public:
-    // Deprecated, don't add more users of this constructor.
-    // TODO(mflodman) Remove this version of the constructor when no one is
-    // using it any longer.
-    explicit CriticalSectionScoped(CriticalSectionWrapper& critsec)
-        : _ptrCritSec(&critsec)
-    {
-        _ptrCritSec->Enter();
-    }
-
     explicit CriticalSectionScoped(CriticalSectionWrapper* critsec)
         : _ptrCritSec(critsec)
     {
diff --git a/video_engine/test/libvietest/helpers/vie_file_capture_device.cc b/video_engine/test/libvietest/helpers/vie_file_capture_device.cc
index 5d6abfa..db39520 100644
--- a/video_engine/test/libvietest/helpers/vie_file_capture_device.cc
+++ b/video_engine/test/libvietest/helpers/vie_file_capture_device.cc
@@ -52,7 +52,7 @@
 bool ViEFileCaptureDevice::OpenI420File(const std::string& path,
                                         int width,
                                         int height) {
-  webrtc::CriticalSectionScoped cs(*mutex_);
+  webrtc::CriticalSectionScoped cs(mutex_);
   assert(input_file_ == NULL);
 
   input_file_ = std::fopen(path.c_str(), "rb");
@@ -68,7 +68,7 @@
 
 void ViEFileCaptureDevice::ReadFileFor(uint64_t time_slice_ms,
                                        uint32_t max_fps) {
-  webrtc::CriticalSectionScoped cs(*mutex_);
+  webrtc::CriticalSectionScoped cs(mutex_);
   assert(input_file_ != NULL);
 
   unsigned char* frame_buffer = new unsigned char[frame_length_];
@@ -98,7 +98,7 @@
 }
 
 void ViEFileCaptureDevice::CloseFile() {
-  webrtc::CriticalSectionScoped cs(*mutex_);
+  webrtc::CriticalSectionScoped cs(mutex_);
   assert(input_file_ != NULL);
 
   std::fclose(input_file_);
diff --git a/video_engine/test/libvietest/testbed/tb_external_transport.cc b/video_engine/test/libvietest/testbed/tb_external_transport.cc
index 83de07e..c383848 100644
--- a/video_engine/test/libvietest/testbed/tb_external_transport.cc
+++ b/video_engine/test/libvietest/testbed/tb_external_transport.cc
@@ -267,27 +267,27 @@
 
 WebRtc_Word32 TbExternalTransport::SetPacketLoss(WebRtc_Word32 lossRate)
 {
-    webrtc::CriticalSectionScoped cs(_statCrit);
+    webrtc::CriticalSectionScoped cs(&_statCrit);
     _lossRate = lossRate;
     return 0;
 }
 
 void TbExternalTransport::SetNetworkDelay(WebRtc_Word64 delayMs)
 {
-    webrtc::CriticalSectionScoped cs(_crit);
+    webrtc::CriticalSectionScoped cs(&_crit);
     _networkDelayMs = delayMs;
 }
 
 void TbExternalTransport::SetSSRCFilter(WebRtc_UWord32 ssrc)
 {
-    webrtc::CriticalSectionScoped cs(_crit);
+    webrtc::CriticalSectionScoped cs(&_crit);
     _filterSSRC = true;
     _SSRC = ssrc;
 }
 
 void TbExternalTransport::ClearStats()
 {
-    webrtc::CriticalSectionScoped cs(_statCrit);
+    webrtc::CriticalSectionScoped cs(&_statCrit);
     _rtpCount = 0;
     _dropCount = 0;
     _rtcpCount = 0;
@@ -297,7 +297,7 @@
                                    WebRtc_Word32& numDroppedPackets,
                                    WebRtc_Word32& numRtcpPackets)
 {
-    webrtc::CriticalSectionScoped cs(_statCrit);
+    webrtc::CriticalSectionScoped cs(&_statCrit);
     numRtpPackets = _rtpCount;
     numDroppedPackets = _dropCount;
     numRtcpPackets = _rtcpCount;
@@ -305,25 +305,25 @@
 
 void TbExternalTransport::EnableSSRCCheck()
 {
-    webrtc::CriticalSectionScoped cs(_statCrit);
+    webrtc::CriticalSectionScoped cs(&_statCrit);
     _checkSSRC = true;
 }
 
 unsigned int TbExternalTransport::ReceivedSSRC()
 {
-    webrtc::CriticalSectionScoped cs(_statCrit);
+    webrtc::CriticalSectionScoped cs(&_statCrit);
     return _lastSSRC;
 }
 
 void TbExternalTransport::EnableSequenceNumberCheck()
 {
-    webrtc::CriticalSectionScoped cs(_statCrit);
+    webrtc::CriticalSectionScoped cs(&_statCrit);
     _checkSequenceNumber = true;
 }
 
 unsigned short TbExternalTransport::GetFirstSequenceNumber()
 {
-    webrtc::CriticalSectionScoped cs(_statCrit);
+    webrtc::CriticalSectionScoped cs(&_statCrit);
     return _firstSequenceNumber;
 }
 
@@ -371,7 +371,7 @@
         {
             unsigned int ssrc = 0;
             {
-                webrtc::CriticalSectionScoped cs(_statCrit);
+                webrtc::CriticalSectionScoped cs(&_statCrit);
                 ssrc = ((packet->packetBuffer[8]) << 24);
                 ssrc += (packet->packetBuffer[9] << 16);
                 ssrc += (packet->packetBuffer[10] << 8);
diff --git a/video_engine/vie_channel_manager.cc b/video_engine/vie_channel_manager.cc
index ad18138..a6b17eb 100644
--- a/video_engine/vie_channel_manager.cc
+++ b/video_engine/vie_channel_manager.cc
@@ -82,7 +82,7 @@
 }
 
 int ViEChannelManager::CreateChannel(int* channel_id) {
-  CriticalSectionScoped cs(*channel_id_critsect_);
+  CriticalSectionScoped cs(channel_id_critsect_);
 
   // Get a new channel id.
   int new_channel_id = FreeChannelId();
@@ -137,7 +137,7 @@
 int ViEChannelManager::CreateChannel(int* channel_id,
                                      int original_channel,
                                      bool sender) {
-  CriticalSectionScoped cs(*channel_id_critsect_);
+  CriticalSectionScoped cs(channel_id_critsect_);
 
   ChannelGroup* channel_group = FindGroup(original_channel);
   if (!channel_group) {
@@ -207,7 +207,7 @@
     ViEManagerWriteScoped wl(this);
 
     // Protect the maps.
-    CriticalSectionScoped cs(*channel_id_critsect_);
+    CriticalSectionScoped cs(channel_id_critsect_);
 
     ChannelMap::iterator c_it = channel_map_.find(channel_id);
     if (c_it == channel_map_.end()) {
@@ -281,7 +281,7 @@
   // Write lock to make sure no one is using the channel.
   ViEManagerWriteScoped wl(this);
 
-  CriticalSectionScoped cs(*channel_id_critsect_);
+  CriticalSectionScoped cs(channel_id_critsect_);
 
   VoEVideoSync* sync_interface = NULL;
   if (voice_engine) {
@@ -309,7 +309,7 @@
 
 int ViEChannelManager::ConnectVoiceChannel(int channel_id,
                                            int audio_channel_id) {
-  CriticalSectionScoped cs(*channel_id_critsect_);
+  CriticalSectionScoped cs(channel_id_critsect_);
   if (!voice_sync_interface_) {
     WEBRTC_TRACE(kTraceError, kTraceVideo, ViEId(engine_id_, channel_id),
                  "No VoE set");
@@ -323,7 +323,7 @@
 }
 
 int ViEChannelManager::DisconnectVoiceChannel(int channel_id) {
-  CriticalSectionScoped cs(*channel_id_critsect_);
+  CriticalSectionScoped cs(channel_id_critsect_);
   ViEChannel* channel = ViEChannelPtr(channel_id);
   if (channel) {
     channel->SetVoiceChannel(-1, NULL);
@@ -333,13 +333,13 @@
 }
 
 VoiceEngine* ViEChannelManager::GetVoiceEngine() {
-  CriticalSectionScoped cs(*channel_id_critsect_);
+  CriticalSectionScoped cs(channel_id_critsect_);
   return voice_engine_;
 }
 
 bool ViEChannelManager::SetRembStatus(int channel_id, bool sender,
                                       bool receiver) {
-  CriticalSectionScoped cs(*channel_id_critsect_);
+  CriticalSectionScoped cs(channel_id_critsect_);
   ChannelGroup* group = FindGroup(channel_id);
   if (!group) {
     return false;
@@ -355,7 +355,7 @@
 
 bool ViEChannelManager::SetBandwidthEstimationMode(
     BandwidthEstimationMode mode) {
-  CriticalSectionScoped cs(*channel_id_critsect_);
+  CriticalSectionScoped cs(channel_id_critsect_);
   if (channel_groups_.size() > 0) {
     return false;
   }
@@ -375,7 +375,7 @@
 
 void ViEChannelManager::UpdateSsrcs(int channel_id,
                                     const std::list<unsigned int>& ssrcs) {
-  CriticalSectionScoped cs(*channel_id_critsect_);
+  CriticalSectionScoped cs(channel_id_critsect_);
   ChannelGroup* channel_group =  FindGroup(channel_id);
   if (channel_group == NULL) {
     return;
@@ -435,7 +435,7 @@
 }
 
 ViEChannel* ViEChannelManager::ViEChannelPtr(int channel_id) const {
-  CriticalSectionScoped cs(*channel_id_critsect_);
+  CriticalSectionScoped cs(channel_id_critsect_);
   ChannelMap::const_iterator it = channel_map_.find(channel_id);
   if (it == channel_map_.end()) {
     WEBRTC_TRACE(kTraceError, kTraceVideo, ViEId(engine_id_),
@@ -446,7 +446,7 @@
 }
 
 ViEEncoder* ViEChannelManager::ViEEncoderPtr(int video_channel_id) const {
-  CriticalSectionScoped cs(*channel_id_critsect_);
+  CriticalSectionScoped cs(channel_id_critsect_);
   EncoderMap::const_iterator it = vie_encoder_map_.find(video_channel_id);
   if (it == vie_encoder_map_.end()) {
     return NULL;
@@ -470,7 +470,7 @@
 }
 
 void ViEChannelManager::ReturnChannelId(int channel_id) {
-  CriticalSectionScoped cs(*channel_id_critsect_);
+  CriticalSectionScoped cs(channel_id_critsect_);
   assert(channel_id < kViEMaxNumberOfChannels + kViEChannelIdBase &&
          channel_id >= kViEChannelIdBase);
   free_channel_ids_[channel_id - kViEChannelIdBase] = true;
@@ -487,7 +487,7 @@
 }
 
 bool ViEChannelManager::ChannelUsingViEEncoder(int channel_id) const {
-  CriticalSectionScoped cs(*channel_id_critsect_);
+  CriticalSectionScoped cs(channel_id_critsect_);
   EncoderMap::const_iterator orig_it = vie_encoder_map_.find(channel_id);
   if (orig_it == vie_encoder_map_.end()) {
     // No ViEEncoder for this channel.
@@ -510,7 +510,7 @@
 
 void ViEChannelManager::ChannelsUsingViEEncoder(int channel_id,
                                                 ChannelList* channels) const {
-  CriticalSectionScoped cs(*channel_id_critsect_);
+  CriticalSectionScoped cs(channel_id_critsect_);
   EncoderMap::const_iterator orig_it = vie_encoder_map_.find(channel_id);
 
   for (ChannelMap::const_iterator c_it = channel_map_.begin();
diff --git a/video_engine/vie_file_player.cc b/video_engine/vie_file_player.cc
index 1f01cad..e7e45b9 100644
--- a/video_engine/vie_file_player.cc
+++ b/video_engine/vie_file_player.cc
@@ -289,7 +289,7 @@
 
 int ViEFilePlayer::Read(void* buf, int len) {
   // Protect from simultaneous reading from multiple channels.
-  CriticalSectionScoped lock(*audio_cs_);
+  CriticalSectionScoped lock(audio_cs_);
   if (NeedsAudioFromFile(buf)) {
     // We will run the VoE in 16KHz.
     if (file_player_->Get10msAudioFromFile(decoded_audio_,
@@ -336,19 +336,19 @@
                "%s: file_id %d", __FUNCTION__, id_);
   file_player_->StopPlayingFile();
 
-  CriticalSectionScoped lock(*feedback_cs_);
+  CriticalSectionScoped lock(feedback_cs_);
   if (observer_) {
     observer_->PlayFileEnded(id_);
   }
 }
 
 bool ViEFilePlayer::IsObserverRegistered() {
-  CriticalSectionScoped lock(*feedback_cs_);
+  CriticalSectionScoped lock(feedback_cs_);
   return observer_ != NULL;
 }
 
 int ViEFilePlayer::RegisterObserver(ViEFileObserver* observer) {
-  CriticalSectionScoped lock(*feedback_cs_);
+  CriticalSectionScoped lock(feedback_cs_);
   if (observer_) {
     return -1;
   }
@@ -357,7 +357,7 @@
 }
 
 int ViEFilePlayer::DeRegisterObserver() {
-  CriticalSectionScoped lock(*feedback_cs_);
+  CriticalSectionScoped lock(feedback_cs_);
   observer_ = NULL;
   return 0;
 }
@@ -383,7 +383,7 @@
   }
   audio_channels_sending_.insert(audio_channel);
 
-  CriticalSectionScoped lock(*audio_cs_);
+  CriticalSectionScoped lock(audio_cs_);
   audio_clients_++;
   return 0;
 }
@@ -410,7 +410,7 @@
                  audio_channel);
   }
   audio_channels_sending_.erase(audio_channel);
-  CriticalSectionScoped lock(*audio_cs_);
+  CriticalSectionScoped lock(audio_cs_);
   audio_clients_--;
   assert(audio_clients_ >= 0);
   return 0;
@@ -433,7 +433,7 @@
     return -1;
   }
 
-  CriticalSectionScoped lock(*audio_cs_);
+  CriticalSectionScoped lock(audio_cs_);
   local_audio_channel_ = audio_channel;
   audio_clients_++;
   return 0;
@@ -452,7 +452,7 @@
     return -1;
   }
 
-  CriticalSectionScoped lock(*audio_cs_);
+  CriticalSectionScoped lock(audio_cs_);
   local_audio_channel_ = -1;
   audio_clients_--;
   return 0;
diff --git a/video_engine/vie_file_recorder.cc b/video_engine/vie_file_recorder.cc
index 6f377c4..cdb0d50 100644
--- a/video_engine/vie_file_recorder.cc
+++ b/video_engine/vie_file_recorder.cc
@@ -43,7 +43,7 @@
                                     const CodecInst& audio_codec_inst,
                                     VoiceEngine* voe_ptr,
                                     const FileFormats file_format) {
-  CriticalSectionScoped lock(*recorder_cs_);
+  CriticalSectionScoped lock(recorder_cs_);
 
   if (file_recorder_) {
     WEBRTC_TRACE(kTraceError, kTraceVideo, instance_id_,
@@ -138,7 +138,7 @@
                    "audio");
     }
   }
-  CriticalSectionScoped lock(*recorder_cs_);
+  CriticalSectionScoped lock(recorder_cs_);
   if (voe_file_interface_) {
     voe_file_interface_->Release();
     voe_file_interface_ = NULL;
@@ -160,27 +160,27 @@
 }
 
 void ViEFileRecorder::SetFrameDelay(int frame_delay) {
-  CriticalSectionScoped lock(*recorder_cs_);
+  CriticalSectionScoped lock(recorder_cs_);
   frame_delay_ = frame_delay;
 }
 
 bool ViEFileRecorder::RecordingStarted() {
-  CriticalSectionScoped lock(*recorder_cs_);
+  CriticalSectionScoped lock(recorder_cs_);
   return file_recorder_ && file_recorder_->IsRecording();
 }
 
 bool ViEFileRecorder::FirstFrameRecorded() {
-  CriticalSectionScoped lock(*recorder_cs_);
+  CriticalSectionScoped lock(recorder_cs_);
   return is_first_frame_recorded_;
 }
 
 bool ViEFileRecorder::IsRecordingFileFormat(const FileFormats file_format) {
-  CriticalSectionScoped lock(*recorder_cs_);
+  CriticalSectionScoped lock(recorder_cs_);
   return (file_recorder_->RecordingFileFormat() == file_format) ? true : false;
 }
 
 void ViEFileRecorder::RecordVideoFrame(const VideoFrame& video_frame) {
-  CriticalSectionScoped lock(*recorder_cs_);
+  CriticalSectionScoped lock(recorder_cs_);
 
   if (file_recorder_ && file_recorder_->IsRecording()) {
     if (!IsRecordingFileFormat(kFileFormatAviFile))
@@ -221,7 +221,7 @@
                           AudioFrame::kUndefined,
                           AudioFrame::kVadUnknown);
 
-  CriticalSectionScoped lock(*recorder_cs_);
+  CriticalSectionScoped lock(recorder_cs_);
   if (file_recorder_ && file_recorder_->IsRecording()) {
     TickTime tick_time = TickTime::Now();
     file_recorder_->RecordAudioToFile(audio_frame, &tick_time);