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 13 matching lines...) Expand all Loading... |
24 | 24 |
25 using namespace webrtc; | 25 using namespace webrtc; |
26 | 26 |
27 | 27 |
28 class TestTransport : public Transport { | 28 class TestTransport : public Transport { |
29 public: | 29 public: |
30 TestTransport(RTCPReceiver* rtcp_receiver) : | 30 TestTransport(RTCPReceiver* rtcp_receiver) : |
31 rtcp_receiver_(rtcp_receiver) { | 31 rtcp_receiver_(rtcp_receiver) { |
32 } | 32 } |
33 | 33 |
34 int SendPacket(const void* /*data*/, size_t /*len*/) override { return -1; } | 34 bool SendRtp(const uint8_t* /*data*/, size_t /*len*/) override { |
35 int SendRTCPPacket(const void* packet, size_t packetLength) override { | 35 return false; |
| 36 } |
| 37 bool SendRtcp(const uint8_t* packet, size_t packetLength) override { |
36 RTCPUtility::RTCPParserV2 rtcpParser((uint8_t*)packet, | 38 RTCPUtility::RTCPParserV2 rtcpParser((uint8_t*)packet, |
37 packetLength, | 39 packetLength, |
38 true); // Allow non-compound RTCP | 40 true); // Allow non-compound RTCP |
39 | 41 |
40 EXPECT_TRUE(rtcpParser.IsValid()); | 42 EXPECT_TRUE(rtcpParser.IsValid()); |
41 RTCPHelp::RTCPPacketInformation rtcpPacketInformation; | 43 RTCPHelp::RTCPPacketInformation rtcpPacketInformation; |
42 EXPECT_EQ(0, rtcp_receiver_->IncomingRTCPPacket(rtcpPacketInformation, | 44 EXPECT_EQ(0, rtcp_receiver_->IncomingRTCPPacket(rtcpPacketInformation, |
43 &rtcpParser)); | 45 &rtcpParser)); |
44 | 46 |
45 EXPECT_EQ((uint32_t)kRtcpRemb, | 47 EXPECT_EQ((uint32_t)kRtcpRemb, |
46 rtcpPacketInformation.rtcpPacketTypeFlags & kRtcpRemb); | 48 rtcpPacketInformation.rtcpPacketTypeFlags & kRtcpRemb); |
47 EXPECT_EQ((uint32_t)1234, | 49 EXPECT_EQ((uint32_t)1234, |
48 rtcpPacketInformation.receiverEstimatedMaxBitrate); | 50 rtcpPacketInformation.receiverEstimatedMaxBitrate); |
49 return static_cast<int>(packetLength); | 51 return true; |
50 } | 52 } |
51 private: | 53 private: |
52 RTCPReceiver* rtcp_receiver_; | 54 RTCPReceiver* rtcp_receiver_; |
53 }; | 55 }; |
54 | 56 |
55 | 57 |
56 class RtcpFormatRembTest : public ::testing::Test { | 58 class RtcpFormatRembTest : public ::testing::Test { |
57 protected: | 59 protected: |
58 RtcpFormatRembTest() | 60 RtcpFormatRembTest() |
59 : over_use_detector_options_(), | 61 : over_use_detector_options_(), |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 | 124 |
123 TEST_F(RtcpFormatRembTest, TestCompund) { | 125 TEST_F(RtcpFormatRembTest, TestCompund) { |
124 uint32_t SSRCs[2] = {456789, 98765}; | 126 uint32_t SSRCs[2] = {456789, 98765}; |
125 rtcp_sender_->SetRTCPStatus(kRtcpCompound); | 127 rtcp_sender_->SetRTCPStatus(kRtcpCompound); |
126 rtcp_sender_->SetREMBData(1234, std::vector<uint32_t>(SSRCs, SSRCs + 2)); | 128 rtcp_sender_->SetREMBData(1234, std::vector<uint32_t>(SSRCs, SSRCs + 2)); |
127 RTCPSender::FeedbackState feedback_state = | 129 RTCPSender::FeedbackState feedback_state = |
128 dummy_rtp_rtcp_impl_->GetFeedbackState(); | 130 dummy_rtp_rtcp_impl_->GetFeedbackState(); |
129 EXPECT_EQ(0, rtcp_sender_->SendRTCP(feedback_state, kRtcpRemb)); | 131 EXPECT_EQ(0, rtcp_sender_->SendRTCP(feedback_state, kRtcpRemb)); |
130 } | 132 } |
131 } // namespace | 133 } // namespace |
OLD | NEW |