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

Side by Side Diff: webrtc/modules/video_coding/jitter_buffer.cc

Issue 1788783002: Add macros for ability to log samples that are added to histograms (RTC_LOGGED_*). (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 9 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) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 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 #include "webrtc/modules/video_coding/jitter_buffer.h" 10 #include "webrtc/modules/video_coding/jitter_buffer.h"
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 void VCMJitterBuffer::UpdateHistograms() { 294 void VCMJitterBuffer::UpdateHistograms() {
295 if (num_packets_ <= 0 || !running_) { 295 if (num_packets_ <= 0 || !running_) {
296 return; 296 return;
297 } 297 }
298 int64_t elapsed_sec = 298 int64_t elapsed_sec =
299 (clock_->TimeInMilliseconds() - time_first_packet_ms_) / 1000; 299 (clock_->TimeInMilliseconds() - time_first_packet_ms_) / 1000;
300 if (elapsed_sec < metrics::kMinRunTimeInSeconds) { 300 if (elapsed_sec < metrics::kMinRunTimeInSeconds) {
301 return; 301 return;
302 } 302 }
303 303
304 RTC_HISTOGRAM_PERCENTAGE("WebRTC.Video.DiscardedPacketsInPercent", 304 RTC_LOGGED_HISTOGRAM_PERCENTAGE("WebRTC.Video.DiscardedPacketsInPercent",
305 num_discarded_packets_ * 100 / num_packets_); 305 num_discarded_packets_ * 100 / num_packets_);
306 RTC_HISTOGRAM_PERCENTAGE("WebRTC.Video.DuplicatedPacketsInPercent", 306 RTC_LOGGED_HISTOGRAM_PERCENTAGE("WebRTC.Video.DuplicatedPacketsInPercent",
307 num_duplicated_packets_ * 100 / num_packets_); 307 num_duplicated_packets_ * 100 / num_packets_);
308 308
309 int total_frames = 309 int total_frames =
310 receive_statistics_.key_frames + receive_statistics_.delta_frames; 310 receive_statistics_.key_frames + receive_statistics_.delta_frames;
311 if (total_frames > 0) { 311 if (total_frames > 0) {
312 RTC_HISTOGRAM_COUNTS_100( 312 RTC_LOGGED_HISTOGRAM_COUNTS_100(
313 "WebRTC.Video.CompleteFramesReceivedPerSecond", 313 "WebRTC.Video.CompleteFramesReceivedPerSecond",
314 static_cast<int>((total_frames / elapsed_sec) + 0.5f)); 314 static_cast<int>((total_frames / elapsed_sec) + 0.5f));
315 RTC_HISTOGRAM_COUNTS_1000( 315 RTC_LOGGED_HISTOGRAM_COUNTS_1000(
316 "WebRTC.Video.KeyFramesReceivedInPermille", 316 "WebRTC.Video.KeyFramesReceivedInPermille",
317 static_cast<int>( 317 static_cast<int>(
318 (receive_statistics_.key_frames * 1000.0f / total_frames) + 0.5f)); 318 (receive_statistics_.key_frames * 1000.0f / total_frames) + 0.5f));
319 } 319 }
320 } 320 }
321 321
322 void VCMJitterBuffer::Start() { 322 void VCMJitterBuffer::Start() {
323 CriticalSectionScoped cs(crit_sect_); 323 CriticalSectionScoped cs(crit_sect_);
324 running_ = true; 324 running_ = true;
325 incoming_frame_count_ = 0; 325 incoming_frame_count_ = 0;
(...skipping 1061 matching lines...) Expand 10 before | Expand all | Expand 10 after
1387 if (nack_module_) 1387 if (nack_module_)
1388 return nack_module_->TimeUntilNextProcess(); 1388 return nack_module_->TimeUntilNextProcess();
1389 return std::numeric_limits<int64_t>::max(); 1389 return std::numeric_limits<int64_t>::max();
1390 } 1390 }
1391 1391
1392 void VCMJitterBuffer::Process() { 1392 void VCMJitterBuffer::Process() {
1393 if (nack_module_) 1393 if (nack_module_)
1394 nack_module_->Process(); 1394 nack_module_->Process();
1395 } 1395 }
1396 } // namespace webrtc 1396 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/video_coding/codecs/vp8/screenshare_layers.cc ('k') | webrtc/modules/video_coding/timing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698