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

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

Issue 2368983002: Replace RtcpReceiveTimeInfo with rtcp::ReceiveTimeInfo (Closed)
Patch Set: Rebase 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 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 if (RTCPArrivalTimeSecs) { 244 if (RTCPArrivalTimeSecs) {
245 *RTCPArrivalTimeSecs = _lastReceivedSRNTPsecs; 245 *RTCPArrivalTimeSecs = _lastReceivedSRNTPsecs;
246 } 246 }
247 if (rtcp_timestamp) { 247 if (rtcp_timestamp) {
248 *rtcp_timestamp = _remoteSenderInfo.RTPtimeStamp; 248 *rtcp_timestamp = _remoteSenderInfo.RTPtimeStamp;
249 } 249 }
250 return true; 250 return true;
251 } 251 }
252 252
253 bool RTCPReceiver::LastReceivedXrReferenceTimeInfo( 253 bool RTCPReceiver::LastReceivedXrReferenceTimeInfo(
254 RtcpReceiveTimeInfo* info) const { 254 rtcp::ReceiveTimeInfo* info) const {
255 assert(info); 255 assert(info);
256 rtc::CritScope lock(&_criticalSectionRTCPReceiver); 256 rtc::CritScope lock(&_criticalSectionRTCPReceiver);
257 if (_lastReceivedXRNTPsecs == 0 && _lastReceivedXRNTPfrac == 0) { 257 if (_lastReceivedXRNTPsecs == 0 && _lastReceivedXRNTPfrac == 0) {
258 return false; 258 return false;
259 } 259 }
260 260
261 info->sourceSSRC = _remoteXRReceiveTimeInfo.sourceSSRC; 261 info->ssrc = remote_time_info_.ssrc;
262 info->lastRR = _remoteXRReceiveTimeInfo.lastRR; 262 info->last_rr = remote_time_info_.last_rr;
263 263
264 // Get the delay since last received report (RFC 3611). 264 // Get the delay since last received report (RFC 3611).
265 uint32_t receive_time = 265 uint32_t receive_time =
266 RTCPUtility::MidNtp(_lastReceivedXRNTPsecs, _lastReceivedXRNTPfrac); 266 RTCPUtility::MidNtp(_lastReceivedXRNTPsecs, _lastReceivedXRNTPfrac);
267 267
268 uint32_t ntp_sec = 0; 268 uint32_t ntp_sec = 0;
269 uint32_t ntp_frac = 0; 269 uint32_t ntp_frac = 0;
270 _clock->CurrentNtp(ntp_sec, ntp_frac); 270 _clock->CurrentNtp(ntp_sec, ntp_frac);
271 uint32_t now = RTCPUtility::MidNtp(ntp_sec, ntp_frac); 271 uint32_t now = RTCPUtility::MidNtp(ntp_sec, ntp_frac);
272 272
273 info->delaySinceLastRR = now - receive_time; 273 info->delay_since_last_rr = now - receive_time;
274 return true; 274 return true;
275 } 275 }
276 276
277 int32_t RTCPReceiver::SenderInfoReceived(RTCPSenderInfo* senderInfo) const { 277 int32_t RTCPReceiver::SenderInfoReceived(RTCPSenderInfo* senderInfo) const {
278 assert(senderInfo); 278 assert(senderInfo);
279 rtc::CritScope lock(&_criticalSectionRTCPReceiver); 279 rtc::CritScope lock(&_criticalSectionRTCPReceiver);
280 if (_lastReceivedSRNTPsecs == 0) { 280 if (_lastReceivedSRNTPsecs == 0) {
281 return -1; 281 return -1;
282 } 282 }
283 memcpy(senderInfo, &(_remoteSenderInfo), sizeof(RTCPSenderInfo)); 283 memcpy(senderInfo, &(_remoteSenderInfo), sizeof(RTCPSenderInfo));
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after
802 802
803 for (const rtcp::Dlrr& dlrr : xr.dlrrs()) { 803 for (const rtcp::Dlrr& dlrr : xr.dlrrs()) {
804 for (const rtcp::ReceiveTimeInfo& time_info : dlrr.sub_blocks()) 804 for (const rtcp::ReceiveTimeInfo& time_info : dlrr.sub_blocks())
805 HandleXrDlrrReportBlock(time_info); 805 HandleXrDlrrReportBlock(time_info);
806 } 806 }
807 } 807 }
808 808
809 void RTCPReceiver::HandleXrReceiveReferenceTime( 809 void RTCPReceiver::HandleXrReceiveReferenceTime(
810 uint32_t sender_ssrc, 810 uint32_t sender_ssrc,
811 const rtcp::Rrtr& rrtr) { 811 const rtcp::Rrtr& rrtr) {
812 _remoteXRReceiveTimeInfo.sourceSSRC = sender_ssrc; 812 remote_time_info_.ssrc = sender_ssrc;
813 _remoteXRReceiveTimeInfo.lastRR = CompactNtp(rrtr.ntp()); 813 remote_time_info_.last_rr = CompactNtp(rrtr.ntp());
814 _clock->CurrentNtp(_lastReceivedXRNTPsecs, _lastReceivedXRNTPfrac); 814 _clock->CurrentNtp(_lastReceivedXRNTPsecs, _lastReceivedXRNTPfrac);
815 } 815 }
816 816
817 void RTCPReceiver::HandleXrDlrrReportBlock(const rtcp::ReceiveTimeInfo& rti) { 817 void RTCPReceiver::HandleXrDlrrReportBlock(const rtcp::ReceiveTimeInfo& rti) {
818 if (registered_ssrcs_.count(rti.ssrc) == 0) // Not to us. 818 if (registered_ssrcs_.count(rti.ssrc) == 0) // Not to us.
819 return; 819 return;
820 820
821 // Caller should explicitly enable rtt calculation using extended reports. 821 // Caller should explicitly enable rtt calculation using extended reports.
822 if (!xr_rrtr_status_) 822 if (!xr_rrtr_status_)
823 return; 823 return;
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
1158 1158
1159 for (const auto& kv : _receivedInfoMap) { 1159 for (const auto& kv : _receivedInfoMap) {
1160 RTCPReceiveInformation* receive_info = kv.second; 1160 RTCPReceiveInformation* receive_info = kv.second;
1161 RTC_DCHECK(receive_info); 1161 RTC_DCHECK(receive_info);
1162 receive_info->GetTmmbrSet(now_ms, &candidates); 1162 receive_info->GetTmmbrSet(now_ms, &candidates);
1163 } 1163 }
1164 return candidates; 1164 return candidates;
1165 } 1165 }
1166 1166
1167 } // namespace webrtc 1167 } // 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