OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
451 | 451 |
452 // |report_block.source_ssrc()| is the SSRC identifier of the source to | 452 // |report_block.source_ssrc()| is the SSRC identifier of the source to |
453 // which the information in this reception report block pertains. | 453 // which the information in this reception report block pertains. |
454 | 454 |
455 // Filter out all report blocks that are not for us. | 455 // Filter out all report blocks that are not for us. |
456 if (registered_ssrcs_.count(report_block.source_ssrc()) == 0) | 456 if (registered_ssrcs_.count(report_block.source_ssrc()) == 0) |
457 return; | 457 return; |
458 | 458 |
459 ReportBlockWithRtt* report_block_info = | 459 ReportBlockWithRtt* report_block_info = |
460 &received_report_blocks_[report_block.source_ssrc()][remote_ssrc]; | 460 &received_report_blocks_[report_block.source_ssrc()][remote_ssrc]; |
461 report_block_info->report_block.remoteSSRC = remote_ssrc; | 461 report_block_info->report_block.sender_ssrc = remote_ssrc; |
462 report_block_info->report_block.sourceSSRC = report_block.source_ssrc(); | 462 report_block_info->report_block.source_ssrc = report_block.source_ssrc(); |
463 report_block_info->report_block.fractionLost = report_block.fraction_lost(); | 463 report_block_info->report_block.fraction_lost = report_block.fraction_lost(); |
464 report_block_info->report_block.cumulativeLost = | 464 report_block_info->report_block.packets_lost = report_block.cumulative_lost(); |
465 report_block.cumulative_lost(); | |
466 if (report_block.extended_high_seq_num() > | 465 if (report_block.extended_high_seq_num() > |
467 report_block_info->report_block.extendedHighSeqNum) { | 466 report_block_info->report_block.extended_highest_sequence_number) { |
468 // We have successfully delivered new RTP packets to the remote side after | 467 // We have successfully delivered new RTP packets to the remote side after |
469 // the last RR was sent from the remote side. | 468 // the last RR was sent from the remote side. |
470 last_increased_sequence_number_ms_ = clock_->TimeInMilliseconds(); | 469 last_increased_sequence_number_ms_ = clock_->TimeInMilliseconds(); |
471 } | 470 } |
472 report_block_info->report_block.extendedHighSeqNum = | 471 report_block_info->report_block.extended_highest_sequence_number = |
473 report_block.extended_high_seq_num(); | 472 report_block.extended_high_seq_num(); |
474 report_block_info->report_block.jitter = report_block.jitter(); | 473 report_block_info->report_block.jitter = report_block.jitter(); |
475 report_block_info->report_block.delaySinceLastSR = | 474 report_block_info->report_block.delay_since_last_sender_report = |
476 report_block.delay_since_last_sr(); | 475 report_block.delay_since_last_sr(); |
477 report_block_info->report_block.lastSR = report_block.last_sr(); | 476 report_block_info->report_block.last_sender_report_timestamp = |
| 477 report_block.last_sr(); |
478 | 478 |
479 int64_t rtt_ms = 0; | 479 int64_t rtt_ms = 0; |
480 uint32_t send_time_ntp = report_block.last_sr(); | 480 uint32_t send_time_ntp = report_block.last_sr(); |
481 // RFC3550, section 6.4.1, LSR field discription states: | 481 // RFC3550, section 6.4.1, LSR field discription states: |
482 // If no SR has been received yet, the field is set to zero. | 482 // If no SR has been received yet, the field is set to zero. |
483 // Receiver rtp_rtcp module is not expected to calculate rtt using | 483 // Receiver rtp_rtcp module is not expected to calculate rtt using |
484 // Sender Reports even if it accidentally can. | 484 // Sender Reports even if it accidentally can. |
485 if (!receiver_only_ && send_time_ntp != 0) { | 485 if (!receiver_only_ && send_time_ntp != 0) { |
486 uint32_t delay_ntp = report_block.delay_since_last_sr(); | 486 uint32_t delay_ntp = report_block.delay_since_last_sr(); |
487 // Local NTP time. | 487 // Local NTP time. |
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
985 packet_information.target_bitrate_allocation) { | 985 packet_information.target_bitrate_allocation) { |
986 bitrate_allocation_observer_->OnBitrateAllocationUpdated( | 986 bitrate_allocation_observer_->OnBitrateAllocationUpdated( |
987 *packet_information.target_bitrate_allocation); | 987 *packet_information.target_bitrate_allocation); |
988 } | 988 } |
989 | 989 |
990 if (!receiver_only_) { | 990 if (!receiver_only_) { |
991 rtc::CritScope cs(&feedbacks_lock_); | 991 rtc::CritScope cs(&feedbacks_lock_); |
992 if (stats_callback_) { | 992 if (stats_callback_) { |
993 for (const auto& report_block : packet_information.report_blocks) { | 993 for (const auto& report_block : packet_information.report_blocks) { |
994 RtcpStatistics stats; | 994 RtcpStatistics stats; |
995 stats.packets_lost = report_block.cumulativeLost; | 995 stats.packets_lost = report_block.packets_lost; |
996 stats.extended_highest_sequence_number = | 996 stats.extended_highest_sequence_number = |
997 report_block.extendedHighSeqNum; | 997 report_block.extended_highest_sequence_number; |
998 stats.fraction_lost = report_block.fractionLost; | 998 stats.fraction_lost = report_block.fraction_lost; |
999 stats.jitter = report_block.jitter; | 999 stats.jitter = report_block.jitter; |
1000 | 1000 |
1001 stats_callback_->StatisticsUpdated(stats, report_block.sourceSSRC); | 1001 stats_callback_->StatisticsUpdated(stats, report_block.source_ssrc); |
1002 } | 1002 } |
1003 } | 1003 } |
1004 } | 1004 } |
1005 } | 1005 } |
1006 | 1006 |
1007 int32_t RTCPReceiver::CNAME(uint32_t remoteSSRC, | 1007 int32_t RTCPReceiver::CNAME(uint32_t remoteSSRC, |
1008 char cName[RTCP_CNAME_SIZE]) const { | 1008 char cName[RTCP_CNAME_SIZE]) const { |
1009 RTC_DCHECK(cName); | 1009 RTC_DCHECK(cName); |
1010 | 1010 |
1011 rtc::CritScope lock(&rtcp_receiver_lock_); | 1011 rtc::CritScope lock(&rtcp_receiver_lock_); |
(...skipping 22 matching lines...) Expand all Loading... |
1034 } else { | 1034 } else { |
1035 candidates.push_back(it->second.tmmbr_item); | 1035 candidates.push_back(it->second.tmmbr_item); |
1036 ++it; | 1036 ++it; |
1037 } | 1037 } |
1038 } | 1038 } |
1039 } | 1039 } |
1040 return candidates; | 1040 return candidates; |
1041 } | 1041 } |
1042 | 1042 |
1043 } // namespace webrtc | 1043 } // namespace webrtc |
OLD | NEW |