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

Side by Side Diff: webrtc/video/receive_statistics_proxy.cc

Issue 1315413002: Wire up currently-received video codec to stats. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 void ReceiveStatisticsProxy::OnReceiveRatesUpdated(uint32_t bitRate, 146 void ReceiveStatisticsProxy::OnReceiveRatesUpdated(uint32_t bitRate,
147 uint32_t frameRate) { 147 uint32_t frameRate) {
148 } 148 }
149 149
150 void ReceiveStatisticsProxy::OnFrameCountsUpdated( 150 void ReceiveStatisticsProxy::OnFrameCountsUpdated(
151 const FrameCounts& frame_counts) { 151 const FrameCounts& frame_counts) {
152 rtc::CritScope lock(&crit_); 152 rtc::CritScope lock(&crit_);
153 stats_.frame_counts = frame_counts; 153 stats_.frame_counts = frame_counts;
154 } 154 }
155 155
156 void ReceiveStatisticsProxy::OnIncomingPayloadType(
157 int payload_type) {
158 rtc::CritScope lock(&crit_);
159 stats_.current_payload_type = payload_type;
160 }
161
156 void ReceiveStatisticsProxy::OnDiscardedPacketsUpdated(int discarded_packets) { 162 void ReceiveStatisticsProxy::OnDiscardedPacketsUpdated(int discarded_packets) {
157 rtc::CritScope lock(&crit_); 163 rtc::CritScope lock(&crit_);
158 stats_.discarded_packets = discarded_packets; 164 stats_.discarded_packets = discarded_packets;
159 } 165 }
160 166
161 void ReceiveStatisticsProxy::SampleCounter::Add(int sample) { 167 void ReceiveStatisticsProxy::SampleCounter::Add(int sample) {
162 sum += sample; 168 sum += sample;
163 ++num_samples; 169 ++num_samples;
164 } 170 }
165 171
166 int ReceiveStatisticsProxy::SampleCounter::Avg(int min_required_samples) const { 172 int ReceiveStatisticsProxy::SampleCounter::Avg(int min_required_samples) const {
167 if (num_samples < min_required_samples || num_samples == 0) 173 if (num_samples < min_required_samples || num_samples == 0)
168 return -1; 174 return -1;
169 return sum / num_samples; 175 return sum / num_samples;
170 } 176 }
171 177
172 } // namespace webrtc 178 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698