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