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

Unified Diff: webrtc/video/receive_statistics_proxy.cc

Issue 2682073003: Revert Make the new jitter buffer the default jitter buffer. (Closed)
Patch Set: Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/video/receive_statistics_proxy.h ('k') | webrtc/video/receive_statistics_proxy_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/video/receive_statistics_proxy.cc
diff --git a/webrtc/video/receive_statistics_proxy.cc b/webrtc/video/receive_statistics_proxy.cc
index 6fe85745c3bb72974253b527e1804530269b262e..ba9184a2d4a7a7d2c8c9ed8800d185a8d49716f4 100644
--- a/webrtc/video/receive_statistics_proxy.cc
+++ b/webrtc/video/receive_statistics_proxy.cc
@@ -10,9 +10,7 @@
#include "webrtc/video/receive_statistics_proxy.h"
-#include <algorithm>
#include <cmath>
-#include <utility>
#include "webrtc/base/checks.h"
#include "webrtc/base/logging.h"
@@ -42,9 +40,6 @@ const int kLowQpThresholdVp8 = 60;
const int kHighQpThresholdVp8 = 70;
const int kLowVarianceThreshold = 1;
const int kHighVarianceThreshold = 2;
-
-// How large window we use to calculate the framerate/bitrate.
-const int kRateStatisticsWindowSizeMs = 1000;
} // namespace
ReceiveStatisticsProxy::ReceiveStatisticsProxy(
@@ -74,9 +69,7 @@ ReceiveStatisticsProxy::ReceiveStatisticsProxy(
render_fps_tracker_(100, 10u),
render_pixel_tracker_(100, 10u),
freq_offset_counter_(clock, nullptr, kFreqOffsetProcessIntervalMs),
- first_report_block_time_ms_(-1),
- avg_rtt_ms_(0),
- frame_window_accumulated_bytes_(0) {
+ first_report_block_time_ms_(-1) {
stats_.ssrc = config_.rtp.remote_ssrc;
// TODO(brandtr): Replace |rtx_stats_| with a single instance of
// StreamDataCounters.
@@ -131,17 +124,6 @@ void ReceiveStatisticsProxy::UpdateHistograms() {
<< freq_offset_stats.ToString();
}
- if (stats_.frame_counts.key_frames > 0 ||
- stats_.frame_counts.delta_frames > 0) {
- float num_key_frames = stats_.frame_counts.key_frames;
- float num_total_frames =
- stats_.frame_counts.key_frames + stats_.frame_counts.delta_frames;
- int key_frames_permille =
- (num_key_frames * 1000.0f / num_total_frames + 0.5f);
- RTC_HISTOGRAM_COUNTS_1000("WebRTC.Video.KeyFramesReceivedInPermille",
- key_frames_permille);
- }
-
int qp = qp_counters_.vp8.Avg(kMinRequiredSamples);
if (qp != -1)
RTC_HISTOGRAM_COUNTS_200("WebRTC.Video.Decoded.Vp8.Qp", qp);
@@ -153,12 +135,15 @@ void ReceiveStatisticsProxy::UpdateHistograms() {
if (decode_ms != -1)
RTC_HISTOGRAM_COUNTS_1000("WebRTC.Video.DecodeTimeInMs", decode_ms);
- int jb_delay_ms = jitter_buffer_delay_counter_.Avg(kMinRequiredDecodeSamples);
- if (jb_delay_ms != -1) {
- RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.JitterBufferDelayInMs",
- jb_delay_ms);
+ if (field_trial::FindFullName("WebRTC-NewVideoJitterBuffer") !=
+ "Enabled") {
+ int jb_delay_ms =
+ jitter_buffer_delay_counter_.Avg(kMinRequiredDecodeSamples);
+ if (jb_delay_ms != -1) {
+ RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.JitterBufferDelayInMs",
+ jb_delay_ms);
+ }
}
-
int target_delay_ms = target_delay_counter_.Avg(kMinRequiredDecodeSamples);
if (target_delay_ms != -1) {
RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.TargetDelayInMs", target_delay_ms);
@@ -315,25 +300,8 @@ void ReceiveStatisticsProxy::QualitySample() {
}
}
-void ReceiveStatisticsProxy::UpdateFrameAndBitrate(int64_t now_ms) const {
- int64_t old_frames_ms = now_ms - kRateStatisticsWindowSizeMs;
- while (!frame_window_.empty() &&
- frame_window_.begin()->first < old_frames_ms) {
- frame_window_accumulated_bytes_ -= frame_window_.begin()->second;
- frame_window_.erase(frame_window_.begin());
- }
-
- size_t framerate =
- (frame_window_.size() * 1000 + 500) / kRateStatisticsWindowSizeMs;
- size_t bitrate_bps =
- frame_window_accumulated_bytes_ * 8000 / kRateStatisticsWindowSizeMs;
- stats_.network_frame_rate = static_cast<int>(framerate);
- stats_.total_bitrate_bps = static_cast<int>(bitrate_bps);
-}
-
VideoReceiveStream::Stats ReceiveStatisticsProxy::GetStats() const {
rtc::CritScope lock(&crit_);
- UpdateFrameAndBitrate(clock_->TimeInMilliseconds());
return stats_;
}
@@ -352,16 +320,18 @@ void ReceiveStatisticsProxy::OnIncomingRate(unsigned int framerate,
rtc::CritScope lock(&crit_);
if (stats_.rtp_stats.first_packet_time_ms != -1)
QualitySample();
+ stats_.network_frame_rate = framerate;
+ stats_.total_bitrate_bps = bitrate_bps;
}
-void ReceiveStatisticsProxy::OnFrameBufferTimingsUpdated(
- int decode_ms,
- int max_decode_ms,
- int current_delay_ms,
- int target_delay_ms,
- int jitter_buffer_ms,
- int min_playout_delay_ms,
- int render_delay_ms) {
+void ReceiveStatisticsProxy::OnDecoderTiming(int decode_ms,
+ int max_decode_ms,
+ int current_delay_ms,
+ int target_delay_ms,
+ int jitter_buffer_ms,
+ int min_playout_delay_ms,
+ int render_delay_ms,
+ int64_t rtt_ms) {
rtc::CritScope lock(&crit_);
stats_.decode_ms = decode_ms;
stats_.max_decode_ms = max_decode_ms;
@@ -376,7 +346,7 @@ void ReceiveStatisticsProxy::OnFrameBufferTimingsUpdated(
current_delay_counter_.Add(current_delay_ms);
// Network delay (rtt/2) + target_delay_ms (jitter delay + decode time +
// render delay).
- delay_counter_.Add(target_delay_ms + avg_rtt_ms_ / 2);
+ delay_counter_.Add(target_delay_ms + rtt_ms / 2);
}
void ReceiveStatisticsProxy::RtcpPacketTypesCounterUpdated(
@@ -481,20 +451,6 @@ void ReceiveStatisticsProxy::OnReceiveRatesUpdated(uint32_t bitRate,
uint32_t frameRate) {
}
-void ReceiveStatisticsProxy::OnCompleteFrame(bool is_keyframe,
- size_t size_bytes) {
- rtc::CritScope lock(&crit_);
- if (is_keyframe)
- ++stats_.frame_counts.key_frames;
- else
- ++stats_.frame_counts.delta_frames;
-
- int64_t now_ms = clock_->TimeInMilliseconds();
- frame_window_accumulated_bytes_ += size_bytes;
- frame_window_.insert(std::make_pair(now_ms, size_bytes));
- UpdateFrameAndBitrate(now_ms);
-}
-
void ReceiveStatisticsProxy::OnFrameCountsUpdated(
const FrameCounts& frame_counts) {
rtc::CritScope lock(&crit_);
@@ -536,10 +492,4 @@ void ReceiveStatisticsProxy::SampleCounter::Reset() {
sum = 0;
}
-void ReceiveStatisticsProxy::OnRttUpdate(int64_t avg_rtt_ms,
- int64_t max_rtt_ms) {
- rtc::CritScope lock(&crit_);
- avg_rtt_ms_ = avg_rtt_ms;
-}
-
} // namespace webrtc
« no previous file with comments | « webrtc/video/receive_statistics_proxy.h ('k') | webrtc/video/receive_statistics_proxy_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698