Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / third_party / webrtc / video / send_statistics_proxy.cc
index 1cd4e26..c9bd05c 100644 (file)
@@ -20,33 +20,34 @@ SendStatisticsProxy::SendStatisticsProxy(
     const VideoSendStream::Config& config,
     SendStatisticsProxy::StatsProvider* stats_provider)
     : config_(config),
-      lock_(CriticalSectionWrapper::CreateCriticalSection()),
-      stats_provider_(stats_provider) {}
+      stats_provider_(stats_provider),
+      crit_(CriticalSectionWrapper::CreateCriticalSection()) {
+}
 
 SendStatisticsProxy::~SendStatisticsProxy() {}
 
 void SendStatisticsProxy::OutgoingRate(const int video_channel,
                                        const unsigned int framerate,
                                        const unsigned int bitrate) {
-  CriticalSectionScoped cs(lock_.get());
+  CriticalSectionScoped lock(crit_.get());
   stats_.encode_frame_rate = framerate;
 }
 
 void SendStatisticsProxy::SuspendChange(int video_channel, bool is_suspended) {
-  CriticalSectionScoped cs(lock_.get());
+  CriticalSectionScoped lock(crit_.get());
   stats_.suspended = is_suspended;
 }
 
 void SendStatisticsProxy::CapturedFrameRate(const int capture_id,
                                             const unsigned char frame_rate) {
-  CriticalSectionScoped cs(lock_.get());
+  CriticalSectionScoped lock(crit_.get());
   stats_.input_frame_rate = frame_rate;
 }
 
 VideoSendStream::Stats SendStatisticsProxy::GetStats() const {
   VideoSendStream::Stats stats;
   {
-    CriticalSectionScoped cs(lock_.get());
+    CriticalSectionScoped lock(crit_.get());
     stats = stats_;
   }
   stats_provider_->GetSendSideDelay(&stats);
@@ -68,7 +69,7 @@ StreamStats* SendStatisticsProxy::GetStatsEntry(uint32_t ssrc) {
 
 void SendStatisticsProxy::StatisticsUpdated(const RtcpStatistics& statistics,
                                             uint32_t ssrc) {
-  CriticalSectionScoped cs(lock_.get());
+  CriticalSectionScoped lock(crit_.get());
   StreamStats* stats = GetStatsEntry(ssrc);
   if (stats == NULL)
     return;
@@ -79,7 +80,7 @@ void SendStatisticsProxy::StatisticsUpdated(const RtcpStatistics& statistics,
 void SendStatisticsProxy::DataCountersUpdated(
     const StreamDataCounters& counters,
     uint32_t ssrc) {
-  CriticalSectionScoped cs(lock_.get());
+  CriticalSectionScoped lock(crit_.get());
   StreamStats* stats = GetStatsEntry(ssrc);
   if (stats == NULL)
     return;
@@ -89,7 +90,7 @@ void SendStatisticsProxy::DataCountersUpdated(
 
 void SendStatisticsProxy::Notify(const BitrateStatistics& bitrate,
                                  uint32_t ssrc) {
-  CriticalSectionScoped cs(lock_.get());
+  CriticalSectionScoped lock(crit_.get());
   StreamStats* stats = GetStatsEntry(ssrc);
   if (stats == NULL)
     return;
@@ -100,7 +101,7 @@ void SendStatisticsProxy::Notify(const BitrateStatistics& bitrate,
 void SendStatisticsProxy::FrameCountUpdated(FrameType frame_type,
                                             uint32_t frame_count,
                                             const unsigned int ssrc) {
-  CriticalSectionScoped cs(lock_.get());
+  CriticalSectionScoped lock(crit_.get());
   StreamStats* stats = GetStatsEntry(ssrc);
   if (stats == NULL)
     return;