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 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
507 kSequenceNumbers[0])), | 507 kSequenceNumbers[0])), |
508 AllOf(Field(&RTCPReportBlock::sourceSSRC, kReceiverMainSsrc), | 508 AllOf(Field(&RTCPReportBlock::sourceSSRC, kReceiverMainSsrc), |
509 Field(&RTCPReportBlock::remoteSSRC, kSenderSsrc2), | 509 Field(&RTCPReportBlock::remoteSSRC, kSenderSsrc2), |
510 Field(&RTCPReportBlock::fractionLost, kFracLost[1]), | 510 Field(&RTCPReportBlock::fractionLost, kFracLost[1]), |
511 Field(&RTCPReportBlock::cumulativeLost, kCumLost[1]), | 511 Field(&RTCPReportBlock::cumulativeLost, kCumLost[1]), |
512 Field(&RTCPReportBlock::extendedHighSeqNum, | 512 Field(&RTCPReportBlock::extendedHighSeqNum, |
513 kSequenceNumbers[1])))); | 513 kSequenceNumbers[1])))); |
514 } | 514 } |
515 | 515 |
516 TEST_F(RtcpReceiverTest, GetRtt) { | 516 TEST_F(RtcpReceiverTest, GetRtt) { |
| 517 const uint32_t kSentCompactNtp = 0x1234; |
| 518 const uint32_t kDelayCompactNtp = 0x222; |
517 // No report block received. | 519 // No report block received. |
518 EXPECT_EQ( | 520 EXPECT_EQ( |
519 -1, rtcp_receiver_.RTT(kSenderSsrc, nullptr, nullptr, nullptr, nullptr)); | 521 -1, rtcp_receiver_.RTT(kSenderSsrc, nullptr, nullptr, nullptr, nullptr)); |
520 | 522 |
521 rtcp::ReportBlock rb; | 523 rtcp::ReportBlock rb; |
522 rb.SetMediaSsrc(kReceiverMainSsrc); | 524 rb.SetMediaSsrc(kReceiverMainSsrc); |
| 525 rb.SetLastSr(kSentCompactNtp); |
| 526 rb.SetDelayLastSr(kDelayCompactNtp); |
523 | 527 |
524 rtcp::ReceiverReport rr; | 528 rtcp::ReceiverReport rr; |
525 rr.SetSenderSsrc(kSenderSsrc); | 529 rr.SetSenderSsrc(kSenderSsrc); |
526 rr.AddReportBlock(rb); | 530 rr.AddReportBlock(rb); |
527 int64_t now = system_clock_.TimeInMilliseconds(); | 531 int64_t now = system_clock_.TimeInMilliseconds(); |
528 | 532 |
529 EXPECT_CALL(rtp_rtcp_impl_, OnReceivedRtcpReportBlocks(_)); | 533 EXPECT_CALL(rtp_rtcp_impl_, OnReceivedRtcpReportBlocks(_)); |
530 EXPECT_CALL(bandwidth_observer_, OnReceivedRtcpReceiverReport(_, _, _)); | 534 EXPECT_CALL(bandwidth_observer_, OnReceivedRtcpReceiverReport(_, _, _)); |
531 InjectRtcpPacket(rr); | 535 InjectRtcpPacket(rr); |
532 | 536 |
(...skipping 728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1261 TEST_F(RtcpReceiverTest, ForceSenderReport) { | 1265 TEST_F(RtcpReceiverTest, ForceSenderReport) { |
1262 rtcp::RapidResyncRequest rr; | 1266 rtcp::RapidResyncRequest rr; |
1263 rr.SetSenderSsrc(kSenderSsrc); | 1267 rr.SetSenderSsrc(kSenderSsrc); |
1264 rr.SetMediaSsrc(kReceiverMainSsrc); | 1268 rr.SetMediaSsrc(kReceiverMainSsrc); |
1265 | 1269 |
1266 EXPECT_CALL(rtp_rtcp_impl_, OnRequestSendReport()); | 1270 EXPECT_CALL(rtp_rtcp_impl_, OnRequestSendReport()); |
1267 InjectRtcpPacket(rr); | 1271 InjectRtcpPacket(rr); |
1268 } | 1272 } |
1269 | 1273 |
1270 } // namespace webrtc | 1274 } // namespace webrtc |
OLD | NEW |