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

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

Issue 2421193003: Implement framesEncoded stat in video send ssrc stats. (Closed)
Patch Set: Change type of stat int -> uint32_t. Created 4 years, 2 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 425 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « webrtc/media/engine/webrtcvideoengine2_unittest.cc ('k') | webrtc/video/send_statistics_proxy_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698