| 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 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 if (num_bitrate_updates_ == 0 || first_packet_sent_ms_ == -1) | 245 if (num_bitrate_updates_ == 0 || first_packet_sent_ms_ == -1) |
| 246 return; | 246 return; |
| 247 int64_t elapsed_sec = | 247 int64_t elapsed_sec = |
| 248 (clock_->TimeInMilliseconds() - first_packet_sent_ms_) / 1000; | 248 (clock_->TimeInMilliseconds() - first_packet_sent_ms_) / 1000; |
| 249 if (elapsed_sec < metrics::kMinRunTimeInSeconds) | 249 if (elapsed_sec < metrics::kMinRunTimeInSeconds) |
| 250 return; | 250 return; |
| 251 int send_bitrate_kbps = | 251 int send_bitrate_kbps = |
| 252 estimated_send_bitrate_sum_kbits_ / num_bitrate_updates_; | 252 estimated_send_bitrate_sum_kbits_ / num_bitrate_updates_; |
| 253 int pacer_bitrate_kbps = pacer_bitrate_sum_kbits_ / num_bitrate_updates_; | 253 int pacer_bitrate_kbps = pacer_bitrate_sum_kbits_ / num_bitrate_updates_; |
| 254 if (send_bitrate_kbps > 0) { | 254 if (send_bitrate_kbps > 0) { |
| 255 RTC_HISTOGRAM_COUNTS_SPARSE_100000("WebRTC.Call.EstimatedSendBitrateInKbps", | 255 RTC_HISTOGRAM_COUNTS_100000("WebRTC.Call.EstimatedSendBitrateInKbps", |
| 256 send_bitrate_kbps); | 256 send_bitrate_kbps); |
| 257 } | 257 } |
| 258 if (pacer_bitrate_kbps > 0) { | 258 if (pacer_bitrate_kbps > 0) { |
| 259 RTC_HISTOGRAM_COUNTS_SPARSE_100000("WebRTC.Call.PacerBitrateInKbps", | 259 RTC_HISTOGRAM_COUNTS_100000("WebRTC.Call.PacerBitrateInKbps", |
| 260 pacer_bitrate_kbps); | 260 pacer_bitrate_kbps); |
| 261 } | 261 } |
| 262 } | 262 } |
| 263 | 263 |
| 264 void Call::UpdateReceiveHistograms() { | 264 void Call::UpdateReceiveHistograms() { |
| 265 if (first_rtp_packet_received_ms_ == -1) | 265 if (first_rtp_packet_received_ms_ == -1) |
| 266 return; | 266 return; |
| 267 int64_t elapsed_sec = | 267 int64_t elapsed_sec = |
| 268 (last_rtp_packet_received_ms_ - first_rtp_packet_received_ms_) / 1000; | 268 (last_rtp_packet_received_ms_ - first_rtp_packet_received_ms_) / 1000; |
| 269 if (elapsed_sec < metrics::kMinRunTimeInSeconds) | 269 if (elapsed_sec < metrics::kMinRunTimeInSeconds) |
| 270 return; | 270 return; |
| 271 int audio_bitrate_kbps = received_audio_bytes_ * 8 / elapsed_sec / 1000; | 271 int audio_bitrate_kbps = received_audio_bytes_ * 8 / elapsed_sec / 1000; |
| 272 int video_bitrate_kbps = received_video_bytes_ * 8 / elapsed_sec / 1000; | 272 int video_bitrate_kbps = received_video_bytes_ * 8 / elapsed_sec / 1000; |
| 273 int rtcp_bitrate_bps = received_rtcp_bytes_ * 8 / elapsed_sec; | 273 int rtcp_bitrate_bps = received_rtcp_bytes_ * 8 / elapsed_sec; |
| 274 if (video_bitrate_kbps > 0) { | 274 if (video_bitrate_kbps > 0) { |
| 275 RTC_HISTOGRAM_COUNTS_SPARSE_100000("WebRTC.Call.VideoBitrateReceivedInKbps", | 275 RTC_HISTOGRAM_COUNTS_100000("WebRTC.Call.VideoBitrateReceivedInKbps", |
| 276 video_bitrate_kbps); | 276 video_bitrate_kbps); |
| 277 } | 277 } |
| 278 if (audio_bitrate_kbps > 0) { | 278 if (audio_bitrate_kbps > 0) { |
| 279 RTC_HISTOGRAM_COUNTS_SPARSE_100000("WebRTC.Call.AudioBitrateReceivedInKbps", | 279 RTC_HISTOGRAM_COUNTS_100000("WebRTC.Call.AudioBitrateReceivedInKbps", |
| 280 audio_bitrate_kbps); | 280 audio_bitrate_kbps); |
| 281 } | 281 } |
| 282 if (rtcp_bitrate_bps > 0) { | 282 if (rtcp_bitrate_bps > 0) { |
| 283 RTC_HISTOGRAM_COUNTS_SPARSE_100000("WebRTC.Call.RtcpBitrateReceivedInBps", | 283 RTC_HISTOGRAM_COUNTS_100000("WebRTC.Call.RtcpBitrateReceivedInBps", |
| 284 rtcp_bitrate_bps); | 284 rtcp_bitrate_bps); |
| 285 } | 285 } |
| 286 RTC_HISTOGRAM_COUNTS_SPARSE_100000( | 286 RTC_HISTOGRAM_COUNTS_100000( |
| 287 "WebRTC.Call.BitrateReceivedInKbps", | 287 "WebRTC.Call.BitrateReceivedInKbps", |
| 288 audio_bitrate_kbps + video_bitrate_kbps + rtcp_bitrate_bps / 1000); | 288 audio_bitrate_kbps + video_bitrate_kbps + rtcp_bitrate_bps / 1000); |
| 289 } | 289 } |
| 290 | 290 |
| 291 PacketReceiver* Call::Receiver() { | 291 PacketReceiver* Call::Receiver() { |
| 292 // TODO(solenberg): Some test cases in EndToEndTest use this from a different | 292 // TODO(solenberg): Some test cases in EndToEndTest use this from a different |
| 293 // thread. Re-enable once that is fixed. | 293 // thread. Re-enable once that is fixed. |
| 294 // RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread()); | 294 // RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread()); |
| 295 return this; | 295 return this; |
| 296 } | 296 } |
| (...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 737 // thread. Then this check can be enabled. | 737 // thread. Then this check can be enabled. |
| 738 // RTC_DCHECK(!configuration_thread_checker_.CalledOnValidThread()); | 738 // RTC_DCHECK(!configuration_thread_checker_.CalledOnValidThread()); |
| 739 if (RtpHeaderParser::IsRtcp(packet, length)) | 739 if (RtpHeaderParser::IsRtcp(packet, length)) |
| 740 return DeliverRtcp(media_type, packet, length); | 740 return DeliverRtcp(media_type, packet, length); |
| 741 | 741 |
| 742 return DeliverRtp(media_type, packet, length, packet_time); | 742 return DeliverRtp(media_type, packet, length, packet_time); |
| 743 } | 743 } |
| 744 | 744 |
| 745 } // namespace internal | 745 } // namespace internal |
| 746 } // namespace webrtc | 746 } // namespace webrtc |
| OLD | NEW |