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 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 | 318 |
319 webrtc::RtcEventLog* event_log_; | 319 webrtc::RtcEventLog* event_log_; |
320 | 320 |
321 // The following members are only accessed (exclusively) from one thread and | 321 // The following members are only accessed (exclusively) from one thread and |
322 // from the destructor, and therefore doesn't need any explicit | 322 // from the destructor, and therefore doesn't need any explicit |
323 // synchronization. | 323 // synchronization. |
324 RateCounter received_bytes_per_second_counter_; | 324 RateCounter received_bytes_per_second_counter_; |
325 RateCounter received_audio_bytes_per_second_counter_; | 325 RateCounter received_audio_bytes_per_second_counter_; |
326 RateCounter received_video_bytes_per_second_counter_; | 326 RateCounter received_video_bytes_per_second_counter_; |
327 RateCounter received_rtcp_bytes_per_second_counter_; | 327 RateCounter received_rtcp_bytes_per_second_counter_; |
| 328 rtc::Optional<int64_t> first_received_rtp_audio_ms_; |
| 329 rtc::Optional<int64_t> last_received_rtp_audio_ms_; |
| 330 rtc::Optional<int64_t> first_received_rtp_video_ms_; |
| 331 rtc::Optional<int64_t> last_received_rtp_video_ms_; |
328 | 332 |
329 // TODO(holmer): Remove this lock once BitrateController no longer calls | 333 // TODO(holmer): Remove this lock once BitrateController no longer calls |
330 // OnNetworkChanged from multiple threads. | 334 // OnNetworkChanged from multiple threads. |
331 rtc::CriticalSection bitrate_crit_; | 335 rtc::CriticalSection bitrate_crit_; |
332 uint32_t min_allocated_send_bitrate_bps_ GUARDED_BY(&bitrate_crit_); | 336 uint32_t min_allocated_send_bitrate_bps_ GUARDED_BY(&bitrate_crit_); |
333 uint32_t configured_max_padding_bitrate_bps_ GUARDED_BY(&bitrate_crit_); | 337 uint32_t configured_max_padding_bitrate_bps_ GUARDED_BY(&bitrate_crit_); |
334 AvgCounter estimated_send_bitrate_kbps_counter_ GUARDED_BY(&bitrate_crit_); | 338 AvgCounter estimated_send_bitrate_kbps_counter_ GUARDED_BY(&bitrate_crit_); |
335 AvgCounter pacer_bitrate_kbps_counter_ GUARDED_BY(&bitrate_crit_); | 339 AvgCounter pacer_bitrate_kbps_counter_ GUARDED_BY(&bitrate_crit_); |
336 | 340 |
337 std::map<std::string, rtc::NetworkRoute> network_routes_; | 341 std::map<std::string, rtc::NetworkRoute> network_routes_; |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
523 pacer_bitrate_kbps_counter_.ProcessAndGetStats(); | 527 pacer_bitrate_kbps_counter_.ProcessAndGetStats(); |
524 if (pacer_bitrate_stats.num_samples > kMinRequiredPeriodicSamples) { | 528 if (pacer_bitrate_stats.num_samples > kMinRequiredPeriodicSamples) { |
525 RTC_HISTOGRAM_COUNTS_100000("WebRTC.Call.PacerBitrateInKbps", | 529 RTC_HISTOGRAM_COUNTS_100000("WebRTC.Call.PacerBitrateInKbps", |
526 pacer_bitrate_stats.average); | 530 pacer_bitrate_stats.average); |
527 LOG(LS_INFO) << "WebRTC.Call.PacerBitrateInKbps, " | 531 LOG(LS_INFO) << "WebRTC.Call.PacerBitrateInKbps, " |
528 << pacer_bitrate_stats.ToString(); | 532 << pacer_bitrate_stats.ToString(); |
529 } | 533 } |
530 } | 534 } |
531 | 535 |
532 void Call::UpdateReceiveHistograms() { | 536 void Call::UpdateReceiveHistograms() { |
| 537 if (first_received_rtp_audio_ms_) { |
| 538 RTC_HISTOGRAM_COUNTS_100000( |
| 539 "WebRTC.Call.TimeReceivingAudioRtpPacketsInSeconds", |
| 540 (*last_received_rtp_audio_ms_ - *first_received_rtp_audio_ms_) / 1000); |
| 541 } |
| 542 if (first_received_rtp_video_ms_) { |
| 543 RTC_HISTOGRAM_COUNTS_100000( |
| 544 "WebRTC.Call.TimeReceivingVideoRtpPacketsInSeconds", |
| 545 (*last_received_rtp_video_ms_ - *first_received_rtp_video_ms_) / 1000); |
| 546 } |
533 const int kMinRequiredPeriodicSamples = 5; | 547 const int kMinRequiredPeriodicSamples = 5; |
534 AggregatedStats video_bytes_per_sec = | 548 AggregatedStats video_bytes_per_sec = |
535 received_video_bytes_per_second_counter_.GetStats(); | 549 received_video_bytes_per_second_counter_.GetStats(); |
536 if (video_bytes_per_sec.num_samples > kMinRequiredPeriodicSamples) { | 550 if (video_bytes_per_sec.num_samples > kMinRequiredPeriodicSamples) { |
537 RTC_HISTOGRAM_COUNTS_100000("WebRTC.Call.VideoBitrateReceivedInKbps", | 551 RTC_HISTOGRAM_COUNTS_100000("WebRTC.Call.VideoBitrateReceivedInKbps", |
538 video_bytes_per_sec.average * 8 / 1000); | 552 video_bytes_per_sec.average * 8 / 1000); |
539 LOG(LS_INFO) << "WebRTC.Call.VideoBitrateReceivedInBps, " | 553 LOG(LS_INFO) << "WebRTC.Call.VideoBitrateReceivedInBps, " |
540 << video_bytes_per_sec.ToStringWithMultiplier(8); | 554 << video_bytes_per_sec.ToStringWithMultiplier(8); |
541 } | 555 } |
542 AggregatedStats audio_bytes_per_sec = | 556 AggregatedStats audio_bytes_per_sec = |
(...skipping 767 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1310 } | 1324 } |
1311 parsed_packet->IdentifyExtensions(it->second.extensions); | 1325 parsed_packet->IdentifyExtensions(it->second.extensions); |
1312 | 1326 |
1313 NotifyBweOfReceivedPacket(*parsed_packet, media_type); | 1327 NotifyBweOfReceivedPacket(*parsed_packet, media_type); |
1314 | 1328 |
1315 if (media_type == MediaType::AUDIO) { | 1329 if (media_type == MediaType::AUDIO) { |
1316 if (audio_receiver_controller_.OnRtpPacket(*parsed_packet)) { | 1330 if (audio_receiver_controller_.OnRtpPacket(*parsed_packet)) { |
1317 received_bytes_per_second_counter_.Add(static_cast<int>(length)); | 1331 received_bytes_per_second_counter_.Add(static_cast<int>(length)); |
1318 received_audio_bytes_per_second_counter_.Add(static_cast<int>(length)); | 1332 received_audio_bytes_per_second_counter_.Add(static_cast<int>(length)); |
1319 event_log_->LogRtpHeader(kIncomingPacket, packet, length); | 1333 event_log_->LogRtpHeader(kIncomingPacket, packet, length); |
| 1334 const int64_t arrival_time_ms = parsed_packet->arrival_time_ms(); |
| 1335 if (!first_received_rtp_audio_ms_) { |
| 1336 first_received_rtp_audio_ms_.emplace(arrival_time_ms); |
| 1337 } |
| 1338 last_received_rtp_audio_ms_.emplace(arrival_time_ms); |
1320 return DELIVERY_OK; | 1339 return DELIVERY_OK; |
1321 } | 1340 } |
1322 } else if (media_type == MediaType::VIDEO) { | 1341 } else if (media_type == MediaType::VIDEO) { |
1323 if (video_receiver_controller_.OnRtpPacket(*parsed_packet)) { | 1342 if (video_receiver_controller_.OnRtpPacket(*parsed_packet)) { |
1324 received_bytes_per_second_counter_.Add(static_cast<int>(length)); | 1343 received_bytes_per_second_counter_.Add(static_cast<int>(length)); |
1325 received_video_bytes_per_second_counter_.Add(static_cast<int>(length)); | 1344 received_video_bytes_per_second_counter_.Add(static_cast<int>(length)); |
1326 event_log_->LogRtpHeader(kIncomingPacket, packet, length); | 1345 event_log_->LogRtpHeader(kIncomingPacket, packet, length); |
| 1346 const int64_t arrival_time_ms = parsed_packet->arrival_time_ms(); |
| 1347 if (!first_received_rtp_video_ms_) { |
| 1348 first_received_rtp_video_ms_.emplace(arrival_time_ms); |
| 1349 } |
| 1350 last_received_rtp_video_ms_.emplace(arrival_time_ms); |
1327 return DELIVERY_OK; | 1351 return DELIVERY_OK; |
1328 } | 1352 } |
1329 } | 1353 } |
1330 return DELIVERY_UNKNOWN_SSRC; | 1354 return DELIVERY_UNKNOWN_SSRC; |
1331 } | 1355 } |
1332 | 1356 |
1333 PacketReceiver::DeliveryStatus Call::DeliverPacket( | 1357 PacketReceiver::DeliveryStatus Call::DeliverPacket( |
1334 MediaType media_type, | 1358 MediaType media_type, |
1335 const uint8_t* packet, | 1359 const uint8_t* packet, |
1336 size_t length, | 1360 size_t length, |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1383 (use_send_side_bwe && header.extension.hasTransportSequenceNumber)) { | 1407 (use_send_side_bwe && header.extension.hasTransportSequenceNumber)) { |
1384 receive_side_cc_.OnReceivedPacket( | 1408 receive_side_cc_.OnReceivedPacket( |
1385 packet.arrival_time_ms(), packet.payload_size() + packet.padding_size(), | 1409 packet.arrival_time_ms(), packet.payload_size() + packet.padding_size(), |
1386 header); | 1410 header); |
1387 } | 1411 } |
1388 } | 1412 } |
1389 | 1413 |
1390 } // namespace internal | 1414 } // namespace internal |
1391 | 1415 |
1392 } // namespace webrtc | 1416 } // namespace webrtc |
OLD | NEW |