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