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 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
532 uma_container_->retransmit_byte_counter_.ProcessAndStopPause(); | 532 uma_container_->retransmit_byte_counter_.ProcessAndStopPause(); |
533 uma_container_->fec_byte_counter_.ProcessAndStopPause(); | 533 uma_container_->fec_byte_counter_.ProcessAndStopPause(); |
534 } | 534 } |
535 } | 535 } |
536 | 536 |
537 VideoSendStream::Stats SendStatisticsProxy::GetStats() { | 537 VideoSendStream::Stats SendStatisticsProxy::GetStats() { |
538 rtc::CritScope lock(&crit_); | 538 rtc::CritScope lock(&crit_); |
539 PurgeOldStats(); | 539 PurgeOldStats(); |
540 stats_.input_frame_rate = | 540 stats_.input_frame_rate = |
541 round(uma_container_->input_frame_rate_tracker_.ComputeRate()); | 541 round(uma_container_->input_frame_rate_tracker_.ComputeRate()); |
| 542 stats_.content_type = |
| 543 content_type_ == VideoEncoderConfig::ContentType::kRealtimeVideo |
| 544 ? VideoContentType::UNSPECIFIED |
| 545 : VideoContentType::SCREENSHARE; |
542 return stats_; | 546 return stats_; |
543 } | 547 } |
544 | 548 |
545 void SendStatisticsProxy::PurgeOldStats() { | 549 void SendStatisticsProxy::PurgeOldStats() { |
546 int64_t old_stats_ms = clock_->TimeInMilliseconds() - kStatsTimeoutMs; | 550 int64_t old_stats_ms = clock_->TimeInMilliseconds() - kStatsTimeoutMs; |
547 for (std::map<uint32_t, VideoSendStream::StreamStats>::iterator it = | 551 for (std::map<uint32_t, VideoSendStream::StreamStats>::iterator it = |
548 stats_.substreams.begin(); | 552 stats_.substreams.begin(); |
549 it != stats_.substreams.end(); ++it) { | 553 it != stats_.substreams.end(); ++it) { |
550 uint32_t ssrc = it->first; | 554 uint32_t ssrc = it->first; |
551 if (update_times_[ssrc].resolution_update_ms <= old_stats_ms) { | 555 if (update_times_[ssrc].resolution_update_ms <= old_stats_ms) { |
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
931 } | 935 } |
932 | 936 |
933 int SendStatisticsProxy::BoolSampleCounter::Fraction( | 937 int SendStatisticsProxy::BoolSampleCounter::Fraction( |
934 int64_t min_required_samples, | 938 int64_t min_required_samples, |
935 float multiplier) const { | 939 float multiplier) const { |
936 if (num_samples < min_required_samples || num_samples == 0) | 940 if (num_samples < min_required_samples || num_samples == 0) |
937 return -1; | 941 return -1; |
938 return static_cast<int>((sum * multiplier / num_samples) + 0.5f); | 942 return static_cast<int>((sum * multiplier / num_samples) + 0.5f); |
939 } | 943 } |
940 } // namespace webrtc | 944 } // namespace webrtc |
OLD | NEW |