Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1082)

Side by Side Diff: webrtc/modules/rtp_rtcp/source/rtcp_receiver.cc

Issue 3005633002: Revert of Verify sender ssrc when receiving rtcp target bitrate (Closed)
Patch Set: Created 3 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 670 matching lines...) Expand 10 before | Expand all | Expand 10 after
681 ++num_skipped_packets_; 681 ++num_skipped_packets_;
682 return; 682 return;
683 } 683 }
684 684
685 if (xr.rrtr()) 685 if (xr.rrtr())
686 HandleXrReceiveReferenceTime(xr.sender_ssrc(), *xr.rrtr()); 686 HandleXrReceiveReferenceTime(xr.sender_ssrc(), *xr.rrtr());
687 687
688 for (const rtcp::ReceiveTimeInfo& time_info : xr.dlrr().sub_blocks()) 688 for (const rtcp::ReceiveTimeInfo& time_info : xr.dlrr().sub_blocks())
689 HandleXrDlrrReportBlock(time_info); 689 HandleXrDlrrReportBlock(time_info);
690 690
691 if (xr.target_bitrate()) { 691 if (xr.target_bitrate())
692 HandleXrTargetBitrate(xr.sender_ssrc(), *xr.target_bitrate(), 692 HandleXrTargetBitrate(*xr.target_bitrate(), packet_information);
693 packet_information);
694 }
695 } 693 }
696 694
697 void RTCPReceiver::HandleXrReceiveReferenceTime(uint32_t sender_ssrc, 695 void RTCPReceiver::HandleXrReceiveReferenceTime(uint32_t sender_ssrc,
698 const rtcp::Rrtr& rrtr) { 696 const rtcp::Rrtr& rrtr) {
699 remote_time_info_.ssrc = sender_ssrc; 697 remote_time_info_.ssrc = sender_ssrc;
700 remote_time_info_.last_rr = CompactNtp(rrtr.ntp()); 698 remote_time_info_.last_rr = CompactNtp(rrtr.ntp());
701 last_received_xr_ntp_ = clock_->CurrentNtpTime(); 699 last_received_xr_ntp_ = clock_->CurrentNtpTime();
702 } 700 }
703 701
704 void RTCPReceiver::HandleXrDlrrReportBlock(const rtcp::ReceiveTimeInfo& rti) { 702 void RTCPReceiver::HandleXrDlrrReportBlock(const rtcp::ReceiveTimeInfo& rti) {
(...skipping 12 matching lines...) Expand all
717 return; 715 return;
718 716
719 uint32_t delay_ntp = rti.delay_since_last_rr; 717 uint32_t delay_ntp = rti.delay_since_last_rr;
720 uint32_t now_ntp = CompactNtp(clock_->CurrentNtpTime()); 718 uint32_t now_ntp = CompactNtp(clock_->CurrentNtpTime());
721 719
722 uint32_t rtt_ntp = now_ntp - delay_ntp - send_time_ntp; 720 uint32_t rtt_ntp = now_ntp - delay_ntp - send_time_ntp;
723 xr_rr_rtt_ms_ = CompactNtpRttToMs(rtt_ntp); 721 xr_rr_rtt_ms_ = CompactNtpRttToMs(rtt_ntp);
724 } 722 }
725 723
726 void RTCPReceiver::HandleXrTargetBitrate( 724 void RTCPReceiver::HandleXrTargetBitrate(
727 uint32_t ssrc,
728 const rtcp::TargetBitrate& target_bitrate, 725 const rtcp::TargetBitrate& target_bitrate,
729 PacketInformation* packet_information) { 726 PacketInformation* packet_information) {
730 if (ssrc != remote_ssrc_) {
731 return; // Not for us.
732 }
733
734 BitrateAllocation bitrate_allocation; 727 BitrateAllocation bitrate_allocation;
735 for (const auto& item : target_bitrate.GetTargetBitrates()) { 728 for (const auto& item : target_bitrate.GetTargetBitrates()) {
736 if (item.spatial_layer >= kMaxSpatialLayers || 729 if (item.spatial_layer >= kMaxSpatialLayers ||
737 item.temporal_layer >= kMaxTemporalStreams) { 730 item.temporal_layer >= kMaxTemporalStreams) {
738 LOG(LS_WARNING) 731 LOG(LS_WARNING)
739 << "Invalid layer in XR target bitrate pack: spatial index " 732 << "Invalid layer in XR target bitrate pack: spatial index "
740 << item.spatial_layer << ", temporal index " << item.temporal_layer 733 << item.spatial_layer << ", temporal index " << item.temporal_layer
741 << ", dropping."; 734 << ", dropping.";
742 } else { 735 } else {
743 bitrate_allocation.SetBitrate(item.spatial_layer, item.temporal_layer, 736 bitrate_allocation.SetBitrate(item.spatial_layer, item.temporal_layer,
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
1041 } else { 1034 } else {
1042 candidates.push_back(it->second.tmmbr_item); 1035 candidates.push_back(it->second.tmmbr_item);
1043 ++it; 1036 ++it;
1044 } 1037 }
1045 } 1038 }
1046 } 1039 }
1047 return candidates; 1040 return candidates;
1048 } 1041 }
1049 1042
1050 } // namespace webrtc 1043 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtcp_receiver.h ('k') | webrtc/modules/rtp_rtcp/source/rtcp_receiver_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698