| 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 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 436 rtc::CritScope lock(&crit_); | 436 rtc::CritScope lock(&crit_); |
| 437 stats_.target_media_bitrate_bps = bitrate_bps; | 437 stats_.target_media_bitrate_bps = bitrate_bps; |
| 438 } | 438 } |
| 439 | 439 |
| 440 void SendStatisticsProxy::OnSendEncodedImage( | 440 void SendStatisticsProxy::OnSendEncodedImage( |
| 441 const EncodedImage& encoded_image, | 441 const EncodedImage& encoded_image, |
| 442 const CodecSpecificInfo* codec_info) { | 442 const CodecSpecificInfo* codec_info) { |
| 443 size_t simulcast_idx = 0; | 443 size_t simulcast_idx = 0; |
| 444 | 444 |
| 445 rtc::CritScope lock(&crit_); | 445 rtc::CritScope lock(&crit_); |
| 446 ++stats_.frames_encoded; |
| 446 if (codec_info) { | 447 if (codec_info) { |
| 447 if (codec_info->codecType == kVideoCodecVP8) { | 448 if (codec_info->codecType == kVideoCodecVP8) { |
| 448 simulcast_idx = codec_info->codecSpecific.VP8.simulcastIdx; | 449 simulcast_idx = codec_info->codecSpecific.VP8.simulcastIdx; |
| 449 } else if (codec_info->codecType == kVideoCodecGeneric) { | 450 } else if (codec_info->codecType == kVideoCodecGeneric) { |
| 450 simulcast_idx = codec_info->codecSpecific.generic.simulcast_idx; | 451 simulcast_idx = codec_info->codecSpecific.generic.simulcast_idx; |
| 451 } | 452 } |
| 452 if (codec_info->codec_name) { | 453 if (codec_info->codec_name) { |
| 453 stats_.encoder_implementation_name = codec_info->codec_name; | 454 stats_.encoder_implementation_name = codec_info->codec_name; |
| 454 } | 455 } |
| 455 } | 456 } |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 644 return Fraction(min_required_samples, 1000.0f); | 645 return Fraction(min_required_samples, 1000.0f); |
| 645 } | 646 } |
| 646 | 647 |
| 647 int SendStatisticsProxy::BoolSampleCounter::Fraction( | 648 int SendStatisticsProxy::BoolSampleCounter::Fraction( |
| 648 int min_required_samples, float multiplier) const { | 649 int min_required_samples, float multiplier) const { |
| 649 if (num_samples < min_required_samples || num_samples == 0) | 650 if (num_samples < min_required_samples || num_samples == 0) |
| 650 return -1; | 651 return -1; |
| 651 return static_cast<int>((sum * multiplier / num_samples) + 0.5f); | 652 return static_cast<int>((sum * multiplier / num_samples) + 0.5f); |
| 652 } | 653 } |
| 653 } // namespace webrtc | 654 } // namespace webrtc |
| OLD | NEW |