| 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 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 int64_t elapsed_sec = | 339 int64_t elapsed_sec = |
| 340 (clock_->TimeInMilliseconds() - first_packet_sent_ms_) / 1000; | 340 (clock_->TimeInMilliseconds() - first_packet_sent_ms_) / 1000; |
| 341 if (elapsed_sec < metrics::kMinRunTimeInSeconds) | 341 if (elapsed_sec < metrics::kMinRunTimeInSeconds) |
| 342 return; | 342 return; |
| 343 const int kMinRequiredPeriodicSamples = 5; | 343 const int kMinRequiredPeriodicSamples = 5; |
| 344 AggregatedStats send_bitrate_stats = | 344 AggregatedStats send_bitrate_stats = |
| 345 estimated_send_bitrate_kbps_counter_.ProcessAndGetStats(); | 345 estimated_send_bitrate_kbps_counter_.ProcessAndGetStats(); |
| 346 if (send_bitrate_stats.num_samples > kMinRequiredPeriodicSamples) { | 346 if (send_bitrate_stats.num_samples > kMinRequiredPeriodicSamples) { |
| 347 RTC_HISTOGRAM_COUNTS_100000("WebRTC.Call.EstimatedSendBitrateInKbps", | 347 RTC_HISTOGRAM_COUNTS_100000("WebRTC.Call.EstimatedSendBitrateInKbps", |
| 348 send_bitrate_stats.average); | 348 send_bitrate_stats.average); |
| 349 LOG(LS_INFO) << "WebRTC.Call.EstimatedSendBitrateInKbps, " |
| 350 << send_bitrate_stats.ToString(); |
| 349 } | 351 } |
| 350 AggregatedStats pacer_bitrate_stats = | 352 AggregatedStats pacer_bitrate_stats = |
| 351 pacer_bitrate_kbps_counter_.ProcessAndGetStats(); | 353 pacer_bitrate_kbps_counter_.ProcessAndGetStats(); |
| 352 if (pacer_bitrate_stats.num_samples > kMinRequiredPeriodicSamples) { | 354 if (pacer_bitrate_stats.num_samples > kMinRequiredPeriodicSamples) { |
| 353 RTC_HISTOGRAM_COUNTS_100000("WebRTC.Call.PacerBitrateInKbps", | 355 RTC_HISTOGRAM_COUNTS_100000("WebRTC.Call.PacerBitrateInKbps", |
| 354 pacer_bitrate_stats.average); | 356 pacer_bitrate_stats.average); |
| 357 LOG(LS_INFO) << "WebRTC.Call.PacerBitrateInKbps, " |
| 358 << pacer_bitrate_stats.ToString(); |
| 355 } | 359 } |
| 356 } | 360 } |
| 357 | 361 |
| 358 void Call::UpdateReceiveHistograms() { | 362 void Call::UpdateReceiveHistograms() { |
| 359 const int kMinRequiredPeriodicSamples = 5; | 363 const int kMinRequiredPeriodicSamples = 5; |
| 360 AggregatedStats video_bytes_per_sec = | 364 AggregatedStats video_bytes_per_sec = |
| 361 received_video_bytes_per_second_counter_.GetStats(); | 365 received_video_bytes_per_second_counter_.GetStats(); |
| 362 if (video_bytes_per_sec.num_samples > kMinRequiredPeriodicSamples) { | 366 if (video_bytes_per_sec.num_samples > kMinRequiredPeriodicSamples) { |
| 363 RTC_HISTOGRAM_COUNTS_100000("WebRTC.Call.VideoBitrateReceivedInKbps", | 367 RTC_HISTOGRAM_COUNTS_100000("WebRTC.Call.VideoBitrateReceivedInKbps", |
| 364 video_bytes_per_sec.average * 8 / 1000); | 368 video_bytes_per_sec.average * 8 / 1000); |
| 369 LOG(LS_INFO) << "WebRTC.Call.VideoBitrateReceivedInKbps, " |
| 370 << video_bytes_per_sec.ToString(); |
| 365 } | 371 } |
| 366 AggregatedStats audio_bytes_per_sec = | 372 AggregatedStats audio_bytes_per_sec = |
| 367 received_audio_bytes_per_second_counter_.GetStats(); | 373 received_audio_bytes_per_second_counter_.GetStats(); |
| 368 if (audio_bytes_per_sec.num_samples > kMinRequiredPeriodicSamples) { | 374 if (audio_bytes_per_sec.num_samples > kMinRequiredPeriodicSamples) { |
| 369 RTC_HISTOGRAM_COUNTS_100000("WebRTC.Call.AudioBitrateReceivedInKbps", | 375 RTC_HISTOGRAM_COUNTS_100000("WebRTC.Call.AudioBitrateReceivedInKbps", |
| 370 audio_bytes_per_sec.average * 8 / 1000); | 376 audio_bytes_per_sec.average * 8 / 1000); |
| 377 LOG(LS_INFO) << "WebRTC.Call.AudioBitrateReceivedInKbps, " |
| 378 << audio_bytes_per_sec.ToString(); |
| 371 } | 379 } |
| 372 AggregatedStats rtcp_bytes_per_sec = | 380 AggregatedStats rtcp_bytes_per_sec = |
| 373 received_rtcp_bytes_per_second_counter_.GetStats(); | 381 received_rtcp_bytes_per_second_counter_.GetStats(); |
| 374 if (rtcp_bytes_per_sec.num_samples > kMinRequiredPeriodicSamples) { | 382 if (rtcp_bytes_per_sec.num_samples > kMinRequiredPeriodicSamples) { |
| 375 RTC_HISTOGRAM_COUNTS_100000("WebRTC.Call.RtcpBitrateReceivedInBps", | 383 RTC_HISTOGRAM_COUNTS_100000("WebRTC.Call.RtcpBitrateReceivedInBps", |
| 376 rtcp_bytes_per_sec.average * 8); | 384 rtcp_bytes_per_sec.average * 8); |
| 385 LOG(LS_INFO) << "WebRTC.Call.RtcpBitrateReceivedInBps, " |
| 386 << rtcp_bytes_per_sec.ToString(); |
| 377 } | 387 } |
| 378 AggregatedStats recv_bytes_per_sec = | 388 AggregatedStats recv_bytes_per_sec = |
| 379 received_bytes_per_second_counter_.GetStats(); | 389 received_bytes_per_second_counter_.GetStats(); |
| 380 if (recv_bytes_per_sec.num_samples > kMinRequiredPeriodicSamples) { | 390 if (recv_bytes_per_sec.num_samples > kMinRequiredPeriodicSamples) { |
| 381 RTC_HISTOGRAM_COUNTS_100000("WebRTC.Call.BitrateReceivedInKbps", | 391 RTC_HISTOGRAM_COUNTS_100000("WebRTC.Call.BitrateReceivedInKbps", |
| 382 recv_bytes_per_sec.average * 8 / 1000); | 392 recv_bytes_per_sec.average * 8 / 1000); |
| 393 LOG(LS_INFO) << "WebRTC.Call.BitrateReceivedInKbps, " |
| 394 << recv_bytes_per_sec.ToString(); |
| 383 } | 395 } |
| 384 } | 396 } |
| 385 | 397 |
| 386 PacketReceiver* Call::Receiver() { | 398 PacketReceiver* Call::Receiver() { |
| 387 // TODO(solenberg): Some test cases in EndToEndTest use this from a different | 399 // TODO(solenberg): Some test cases in EndToEndTest use this from a different |
| 388 // thread. Re-enable once that is fixed. | 400 // thread. Re-enable once that is fixed. |
| 389 // RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread()); | 401 // RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread()); |
| 390 return this; | 402 return this; |
| 391 } | 403 } |
| 392 | 404 |
| (...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1037 uint32_t ssrc = ByteReader<uint32_t>::ReadBigEndian(&packet[8]); | 1049 uint32_t ssrc = ByteReader<uint32_t>::ReadBigEndian(&packet[8]); |
| 1038 ReadLockScoped read_lock(*receive_crit_); | 1050 ReadLockScoped read_lock(*receive_crit_); |
| 1039 auto it = video_receive_ssrcs_.find(ssrc); | 1051 auto it = video_receive_ssrcs_.find(ssrc); |
| 1040 if (it == video_receive_ssrcs_.end()) | 1052 if (it == video_receive_ssrcs_.end()) |
| 1041 return false; | 1053 return false; |
| 1042 return it->second->OnRecoveredPacket(packet, length); | 1054 return it->second->OnRecoveredPacket(packet, length); |
| 1043 } | 1055 } |
| 1044 | 1056 |
| 1045 } // namespace internal | 1057 } // namespace internal |
| 1046 } // namespace webrtc | 1058 } // namespace webrtc |
| OLD | NEW |