OLD | NEW |
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 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 void VCMJitterBuffer::UpdateHistograms() { | 278 void VCMJitterBuffer::UpdateHistograms() { |
279 if (num_packets_ <= 0 || !running_) { | 279 if (num_packets_ <= 0 || !running_) { |
280 return; | 280 return; |
281 } | 281 } |
282 int64_t elapsed_sec = | 282 int64_t elapsed_sec = |
283 (clock_->TimeInMilliseconds() - time_first_packet_ms_) / 1000; | 283 (clock_->TimeInMilliseconds() - time_first_packet_ms_) / 1000; |
284 if (elapsed_sec < metrics::kMinRunTimeInSeconds) { | 284 if (elapsed_sec < metrics::kMinRunTimeInSeconds) { |
285 return; | 285 return; |
286 } | 286 } |
287 | 287 |
288 RTC_LOGGED_HISTOGRAM_PERCENTAGE("WebRTC.Video.DiscardedPacketsInPercent", | 288 RTC_HISTOGRAM_PERCENTAGE("WebRTC.Video.DiscardedPacketsInPercent", |
289 num_discarded_packets_ * 100 / num_packets_); | 289 num_discarded_packets_ * 100 / num_packets_); |
290 RTC_LOGGED_HISTOGRAM_PERCENTAGE("WebRTC.Video.DuplicatedPacketsInPercent", | 290 RTC_HISTOGRAM_PERCENTAGE("WebRTC.Video.DuplicatedPacketsInPercent", |
291 num_duplicated_packets_ * 100 / num_packets_); | 291 num_duplicated_packets_ * 100 / num_packets_); |
292 | 292 |
293 int total_frames = | 293 int total_frames = |
294 receive_statistics_.key_frames + receive_statistics_.delta_frames; | 294 receive_statistics_.key_frames + receive_statistics_.delta_frames; |
295 if (total_frames > 0) { | 295 if (total_frames > 0) { |
296 RTC_LOGGED_HISTOGRAM_COUNTS_100( | 296 RTC_HISTOGRAM_COUNTS_100( |
297 "WebRTC.Video.CompleteFramesReceivedPerSecond", | 297 "WebRTC.Video.CompleteFramesReceivedPerSecond", |
298 static_cast<int>((total_frames / elapsed_sec) + 0.5f)); | 298 static_cast<int>((total_frames / elapsed_sec) + 0.5f)); |
299 RTC_LOGGED_HISTOGRAM_COUNTS_1000( | 299 RTC_HISTOGRAM_COUNTS_1000( |
300 "WebRTC.Video.KeyFramesReceivedInPermille", | 300 "WebRTC.Video.KeyFramesReceivedInPermille", |
301 static_cast<int>( | 301 static_cast<int>( |
302 (receive_statistics_.key_frames * 1000.0f / total_frames) + 0.5f)); | 302 (receive_statistics_.key_frames * 1000.0f / total_frames) + 0.5f)); |
303 } | 303 } |
304 } | 304 } |
305 | 305 |
306 void VCMJitterBuffer::Start() { | 306 void VCMJitterBuffer::Start() { |
307 CriticalSectionScoped cs(crit_sect_); | 307 CriticalSectionScoped cs(crit_sect_); |
308 running_ = true; | 308 running_ = true; |
309 incoming_frame_count_ = 0; | 309 incoming_frame_count_ = 0; |
(...skipping 991 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1301 } | 1301 } |
1302 return true; | 1302 return true; |
1303 } | 1303 } |
1304 | 1304 |
1305 void VCMJitterBuffer::RecycleFrameBuffer(VCMFrameBuffer* frame) { | 1305 void VCMJitterBuffer::RecycleFrameBuffer(VCMFrameBuffer* frame) { |
1306 frame->Reset(); | 1306 frame->Reset(); |
1307 free_frames_.push_back(frame); | 1307 free_frames_.push_back(frame); |
1308 } | 1308 } |
1309 | 1309 |
1310 } // namespace webrtc | 1310 } // namespace webrtc |
OLD | NEW |