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

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

Issue 2378113002: Allow max 1 block per type in RTCP Extended Reports (Closed)
Patch Set: use operator==(T, Optional<T>) for slightly cleaner tests Created 4 years, 2 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 668 matching lines...) Expand 10 before | Expand all | Expand 10 after
679 } 679 }
680 680
681 void RTCPReceiver::HandleXr(const CommonHeader& rtcp_block, 681 void RTCPReceiver::HandleXr(const CommonHeader& rtcp_block,
682 PacketInformation* packet_information) { 682 PacketInformation* packet_information) {
683 rtcp::ExtendedReports xr; 683 rtcp::ExtendedReports xr;
684 if (!xr.Parse(rtcp_block)) { 684 if (!xr.Parse(rtcp_block)) {
685 ++num_skipped_packets_; 685 ++num_skipped_packets_;
686 return; 686 return;
687 } 687 }
688 688
689 for (const rtcp::Rrtr& rrtr : xr.rrtrs()) 689 if (xr.rrtr())
690 HandleXrReceiveReferenceTime(xr.sender_ssrc(), rrtr); 690 HandleXrReceiveReferenceTime(xr.sender_ssrc(), *xr.rrtr());
691 691
692 for (const rtcp::Dlrr& dlrr : xr.dlrrs()) { 692 for (const rtcp::ReceiveTimeInfo& time_info : xr.dlrr().sub_blocks())
693 for (const rtcp::ReceiveTimeInfo& time_info : dlrr.sub_blocks()) 693 HandleXrDlrrReportBlock(time_info);
694 HandleXrDlrrReportBlock(time_info);
695 }
696 } 694 }
697 695
698 void RTCPReceiver::HandleXrReceiveReferenceTime( 696 void RTCPReceiver::HandleXrReceiveReferenceTime(
699 uint32_t sender_ssrc, 697 uint32_t sender_ssrc,
700 const rtcp::Rrtr& rrtr) { 698 const rtcp::Rrtr& rrtr) {
701 remote_time_info_.ssrc = sender_ssrc; 699 remote_time_info_.ssrc = sender_ssrc;
702 remote_time_info_.last_rr = CompactNtp(rrtr.ntp()); 700 remote_time_info_.last_rr = CompactNtp(rrtr.ntp());
703 last_received_xr_ntp_.SetCurrent(*_clock); 701 last_received_xr_ntp_.SetCurrent(*_clock);
704 } 702 }
705 703
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
1053 } else { 1051 } else {
1054 candidates.push_back(it->second.tmmbr_item); 1052 candidates.push_back(it->second.tmmbr_item);
1055 ++it; 1053 ++it;
1056 } 1054 }
1057 } 1055 }
1058 } 1056 }
1059 return candidates; 1057 return candidates;
1060 } 1058 }
1061 1059
1062 } // namespace webrtc 1060 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698