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

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

Issue 2534093003: Calculate JitterBufferDelayInMs in the new jitter buffer. (Closed)
Patch Set: Feedback fix. Created 4 years 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
« no previous file with comments | « webrtc/modules/video_coding/frame_buffer2.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
11 #include "webrtc/video/receive_statistics_proxy.h" 11 #include "webrtc/video/receive_statistics_proxy.h"
12 12
13 #include <cmath> 13 #include <cmath>
14 14
15 #include "webrtc/base/checks.h" 15 #include "webrtc/base/checks.h"
16 #include "webrtc/modules/video_coding/include/video_codec_interface.h" 16 #include "webrtc/modules/video_coding/include/video_codec_interface.h"
17 #include "webrtc/system_wrappers/include/clock.h" 17 #include "webrtc/system_wrappers/include/clock.h"
18 #include "webrtc/system_wrappers/include/field_trial.h"
18 #include "webrtc/system_wrappers/include/metrics.h" 19 #include "webrtc/system_wrappers/include/metrics.h"
19 20
20 namespace webrtc { 21 namespace webrtc {
21 namespace { 22 namespace {
22 // Periodic time interval for processing samples for |freq_offset_counter_|. 23 // Periodic time interval for processing samples for |freq_offset_counter_|.
23 const int64_t kFreqOffsetProcessIntervalMs = 40000; 24 const int64_t kFreqOffsetProcessIntervalMs = 40000;
24 } // namespace 25 } // namespace
25 26
26 ReceiveStatisticsProxy::ReceiveStatisticsProxy( 27 ReceiveStatisticsProxy::ReceiveStatisticsProxy(
27 const VideoReceiveStream::Config* config, 28 const VideoReceiveStream::Config* config,
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 if (qp != -1) 86 if (qp != -1)
86 RTC_HISTOGRAM_COUNTS_200("WebRTC.Video.Decoded.Vp8.Qp", qp); 87 RTC_HISTOGRAM_COUNTS_200("WebRTC.Video.Decoded.Vp8.Qp", qp);
87 88
88 // TODO(asapersson): DecoderTiming() is call periodically (each 1000ms) and 89 // TODO(asapersson): DecoderTiming() is call periodically (each 1000ms) and
89 // not per frame. Change decode time to include every frame. 90 // not per frame. Change decode time to include every frame.
90 const int kMinRequiredDecodeSamples = 5; 91 const int kMinRequiredDecodeSamples = 5;
91 int decode_ms = decode_time_counter_.Avg(kMinRequiredDecodeSamples); 92 int decode_ms = decode_time_counter_.Avg(kMinRequiredDecodeSamples);
92 if (decode_ms != -1) 93 if (decode_ms != -1)
93 RTC_HISTOGRAM_COUNTS_1000("WebRTC.Video.DecodeTimeInMs", decode_ms); 94 RTC_HISTOGRAM_COUNTS_1000("WebRTC.Video.DecodeTimeInMs", decode_ms);
94 95
95 int jb_delay_ms = jitter_buffer_delay_counter_.Avg(kMinRequiredDecodeSamples); 96 if (field_trial::FindFullName("WebRTC-NewVideoJitterBuffer") !=
96 if (jb_delay_ms != -1) { 97 "Enabled") {
97 RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.JitterBufferDelayInMs", 98 int jb_delay_ms =
98 jb_delay_ms); 99 jitter_buffer_delay_counter_.Avg(kMinRequiredDecodeSamples);
100 if (jb_delay_ms != -1) {
101 RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.JitterBufferDelayInMs",
102 jb_delay_ms);
103 }
99 } 104 }
100 int target_delay_ms = target_delay_counter_.Avg(kMinRequiredDecodeSamples); 105 int target_delay_ms = target_delay_counter_.Avg(kMinRequiredDecodeSamples);
101 if (target_delay_ms != -1) { 106 if (target_delay_ms != -1) {
102 RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.TargetDelayInMs", target_delay_ms); 107 RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.TargetDelayInMs", target_delay_ms);
103 } 108 }
104 int current_delay_ms = current_delay_counter_.Avg(kMinRequiredDecodeSamples); 109 int current_delay_ms = current_delay_counter_.Avg(kMinRequiredDecodeSamples);
105 if (current_delay_ms != -1) { 110 if (current_delay_ms != -1) {
106 RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.CurrentDelayInMs", 111 RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.CurrentDelayInMs",
107 current_delay_ms); 112 current_delay_ms);
108 } 113 }
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 ++num_samples; 339 ++num_samples;
335 } 340 }
336 341
337 int ReceiveStatisticsProxy::SampleCounter::Avg(int min_required_samples) const { 342 int ReceiveStatisticsProxy::SampleCounter::Avg(int min_required_samples) const {
338 if (num_samples < min_required_samples || num_samples == 0) 343 if (num_samples < min_required_samples || num_samples == 0)
339 return -1; 344 return -1;
340 return sum / num_samples; 345 return sum / num_samples;
341 } 346 }
342 347
343 } // namespace webrtc 348 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/video_coding/frame_buffer2.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698