| 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 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 524 const uint16_t kList[] = {0, 1, 16}; | 524 const uint16_t kList[] = {0, 1, 16}; |
| 525 const int32_t kListLength = sizeof(kList) / sizeof(kList[0]); | 525 const int32_t kListLength = sizeof(kList) / sizeof(kList[0]); |
| 526 EXPECT_EQ(0, rtcp_sender_->SendRTCP(feedback_state(), kRtcpNack, kListLength, | 526 EXPECT_EQ(0, rtcp_sender_->SendRTCP(feedback_state(), kRtcpNack, kListLength, |
| 527 kList)); | 527 kList)); |
| 528 EXPECT_EQ(1, parser()->nack()->num_packets()); | 528 EXPECT_EQ(1, parser()->nack()->num_packets()); |
| 529 EXPECT_EQ(kSenderSsrc, parser()->nack()->sender_ssrc()); | 529 EXPECT_EQ(kSenderSsrc, parser()->nack()->sender_ssrc()); |
| 530 EXPECT_EQ(kRemoteSsrc, parser()->nack()->media_ssrc()); | 530 EXPECT_EQ(kRemoteSsrc, parser()->nack()->media_ssrc()); |
| 531 EXPECT_THAT(parser()->nack()->packet_ids(), ElementsAre(0, 1, 16)); | 531 EXPECT_THAT(parser()->nack()->packet_ids(), ElementsAre(0, 1, 16)); |
| 532 } | 532 } |
| 533 | 533 |
| 534 TEST_F(RtcpSenderTest, RembStatus) { |
| 535 EXPECT_FALSE(rtcp_sender_->REMB()); |
| 536 rtcp_sender_->SetREMBStatus(true); |
| 537 EXPECT_TRUE(rtcp_sender_->REMB()); |
| 538 rtcp_sender_->SetREMBStatus(false); |
| 539 EXPECT_FALSE(rtcp_sender_->REMB()); |
| 540 } |
| 541 |
| 534 TEST_F(RtcpSenderTest, SendRemb) { | 542 TEST_F(RtcpSenderTest, SendRemb) { |
| 535 const uint64_t kBitrate = 261011; | 543 const uint64_t kBitrate = 261011; |
| 536 std::vector<uint32_t> ssrcs; | 544 std::vector<uint32_t> ssrcs; |
| 537 ssrcs.push_back(kRemoteSsrc); | 545 ssrcs.push_back(kRemoteSsrc); |
| 538 ssrcs.push_back(kRemoteSsrc + 1); | 546 ssrcs.push_back(kRemoteSsrc + 1); |
| 539 rtcp_sender_->SetRTCPStatus(RtcpMode::kReducedSize); | 547 rtcp_sender_->SetRTCPStatus(RtcpMode::kReducedSize); |
| 540 rtcp_sender_->SetREMBData(kBitrate, ssrcs); | 548 rtcp_sender_->SetREMBData(kBitrate, ssrcs); |
| 541 EXPECT_EQ(0, rtcp_sender_->SendRTCP(feedback_state(), kRtcpRemb)); | 549 EXPECT_EQ(0, rtcp_sender_->SendRTCP(feedback_state(), kRtcpRemb)); |
| 542 EXPECT_EQ(1, parser()->remb()->num_packets()); | 550 EXPECT_EQ(1, parser()->remb()->num_packets()); |
| 543 EXPECT_EQ(kSenderSsrc, parser()->remb()->sender_ssrc()); | 551 EXPECT_EQ(kSenderSsrc, parser()->remb()->sender_ssrc()); |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 809 rtcp_sender_->SetLastRtpTime(kRtpTimestamp, clock_.TimeInMilliseconds()); | 817 rtcp_sender_->SetLastRtpTime(kRtpTimestamp, clock_.TimeInMilliseconds()); |
| 810 | 818 |
| 811 // Set up XR VoIP metric to be included with BYE | 819 // Set up XR VoIP metric to be included with BYE |
| 812 rtcp_sender_->SetRTCPStatus(RtcpMode::kCompound); | 820 rtcp_sender_->SetRTCPStatus(RtcpMode::kCompound); |
| 813 RTCPVoIPMetric metric; | 821 RTCPVoIPMetric metric; |
| 814 EXPECT_EQ(0, rtcp_sender_->SetRTCPVoIPMetrics(&metric)); | 822 EXPECT_EQ(0, rtcp_sender_->SetRTCPVoIPMetrics(&metric)); |
| 815 EXPECT_EQ(0, rtcp_sender_->SendRTCP(feedback_state(), kRtcpBye)); | 823 EXPECT_EQ(0, rtcp_sender_->SendRTCP(feedback_state(), kRtcpBye)); |
| 816 } | 824 } |
| 817 | 825 |
| 818 } // namespace webrtc | 826 } // namespace webrtc |
| OLD | NEW |