OLD | NEW |
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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 | 182 |
183 rtc::CritScope lock(&crit_); | 183 rtc::CritScope lock(&crit_); |
184 VideoSendStream::StreamStats* stats = GetStatsEntry(ssrc); | 184 VideoSendStream::StreamStats* stats = GetStatsEntry(ssrc); |
185 if (stats == nullptr) | 185 if (stats == nullptr) |
186 return; | 186 return; |
187 | 187 |
188 stats->width = encoded_image._encodedWidth; | 188 stats->width = encoded_image._encodedWidth; |
189 stats->height = encoded_image._encodedHeight; | 189 stats->height = encoded_image._encodedHeight; |
190 update_times_[ssrc].resolution_update_ms = clock_->TimeInMilliseconds(); | 190 update_times_[ssrc].resolution_update_ms = clock_->TimeInMilliseconds(); |
191 | 191 |
192 key_frame_counter_.Add(encoded_image._frameType == kKeyFrame); | 192 key_frame_counter_.Add(encoded_image._frameType == kVideoFrameKey); |
193 | 193 |
194 if (encoded_image.adapt_reason_.quality_resolution_downscales != -1) { | 194 if (encoded_image.adapt_reason_.quality_resolution_downscales != -1) { |
195 bool downscaled = | 195 bool downscaled = |
196 encoded_image.adapt_reason_.quality_resolution_downscales > 0; | 196 encoded_image.adapt_reason_.quality_resolution_downscales > 0; |
197 quality_limited_frame_counter_.Add(downscaled); | 197 quality_limited_frame_counter_.Add(downscaled); |
198 if (downscaled) { | 198 if (downscaled) { |
199 quality_downscales_counter_.Add( | 199 quality_downscales_counter_.Add( |
200 encoded_image.adapt_reason_.quality_resolution_downscales); | 200 encoded_image.adapt_reason_.quality_resolution_downscales); |
201 } | 201 } |
202 } | 202 } |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 } | 337 } |
338 | 338 |
339 int SendStatisticsProxy::BoolSampleCounter::Fraction( | 339 int SendStatisticsProxy::BoolSampleCounter::Fraction( |
340 int min_required_samples, float multiplier) const { | 340 int min_required_samples, float multiplier) const { |
341 if (num_samples < min_required_samples || num_samples == 0) | 341 if (num_samples < min_required_samples || num_samples == 0) |
342 return -1; | 342 return -1; |
343 return static_cast<int>((sum * multiplier / num_samples) + 0.5f); | 343 return static_cast<int>((sum * multiplier / num_samples) + 0.5f); |
344 } | 344 } |
345 | 345 |
346 } // namespace webrtc | 346 } // namespace webrtc |
OLD | NEW |