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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 } | 50 } |
51 PayloadUnion payload_specific; | 51 PayloadUnion payload_specific; |
52 if (!rtp_payload_registry_->GetPayloadSpecifics(header.payloadType, | 52 if (!rtp_payload_registry_->GetPayloadSpecifics(header.payloadType, |
53 &payload_specific)) { | 53 &payload_specific)) { |
54 return false; | 54 return false; |
55 } | 55 } |
56 const uint8_t* payload = data + header.headerLength; | 56 const uint8_t* payload = data + header.headerLength; |
57 RTC_CHECK_GE(len, header.headerLength); | 57 RTC_CHECK_GE(len, header.headerLength); |
58 const size_t payload_length = len - header.headerLength; | 58 const size_t payload_length = len - header.headerLength; |
59 receive_statistics_->IncomingPacket(header, len, false); | 59 receive_statistics_->IncomingPacket(header, len, false); |
60 if (!rtp_receiver_->IncomingRtpPacket(header, payload, payload_length, | 60 return rtp_receiver_->IncomingRtpPacket(header, payload, payload_length, |
61 payload_specific, true)) { | 61 payload_specific, true); |
62 return false; | |
63 } | |
64 return true; | |
65 } | 62 } |
66 | 63 |
67 bool LoopBackTransport::SendRtcp(const uint8_t* data, size_t len) { | 64 bool LoopBackTransport::SendRtcp(const uint8_t* data, size_t len) { |
68 if (rtp_rtcp_module_->IncomingRtcpPacket((const uint8_t*)data, len) < 0) { | 65 if (rtp_rtcp_module_->IncomingRtcpPacket((const uint8_t*)data, len) < 0) { |
69 return false; | 66 return false; |
70 } | 67 } |
71 return true; | 68 return true; |
72 } | 69 } |
73 | 70 |
74 int32_t TestRtpReceiver::OnReceivedPayloadData( | 71 int32_t TestRtpReceiver::OnReceivedPayloadData( |
(...skipping 23 matching lines...) Expand all Loading... |
98 | 95 |
99 void SetUp() override { | 96 void SetUp() override { |
100 RtpRtcp::Configuration configuration; | 97 RtpRtcp::Configuration configuration; |
101 configuration.audio = true; | 98 configuration.audio = true; |
102 configuration.clock = &fake_clock_; | 99 configuration.clock = &fake_clock_; |
103 configuration.outgoing_transport = &null_transport_; | 100 configuration.outgoing_transport = &null_transport_; |
104 configuration.retransmission_rate_limiter = &retransmission_rate_limiter_; | 101 configuration.retransmission_rate_limiter = &retransmission_rate_limiter_; |
105 module_.reset(RtpRtcp::CreateRtpRtcp(configuration)); | 102 module_.reset(RtpRtcp::CreateRtpRtcp(configuration)); |
106 module_->SetSSRC(initial_ssrc); | 103 module_->SetSSRC(initial_ssrc); |
107 rtp_payload_registry_.reset(new RTPPayloadRegistry()); | 104 rtp_payload_registry_.reset(new RTPPayloadRegistry()); |
108 rtp_receiver_.reset(RtpReceiver::CreateAudioReceiver( | |
109 &fake_clock_, NULL, NULL, rtp_payload_registry_.get())); | |
110 } | 105 } |
111 | 106 |
112 std::unique_ptr<RTPPayloadRegistry> rtp_payload_registry_; | 107 std::unique_ptr<RTPPayloadRegistry> rtp_payload_registry_; |
113 std::unique_ptr<RtpReceiver> rtp_receiver_; | |
114 std::unique_ptr<RtpRtcp> module_; | 108 std::unique_ptr<RtpRtcp> module_; |
115 uint32_t test_ssrc_; | 109 uint32_t test_ssrc_; |
116 uint32_t test_timestamp_; | 110 uint32_t test_timestamp_; |
117 uint16_t test_sequence_number_; | 111 uint16_t test_sequence_number_; |
118 std::vector<uint32_t> test_csrcs_; | 112 std::vector<uint32_t> test_csrcs_; |
119 SimulatedClock fake_clock_; | 113 SimulatedClock fake_clock_; |
120 test::NullTransport null_transport_; | 114 test::NullTransport null_transport_; |
121 RateLimiter retransmission_rate_limiter_; | 115 RateLimiter retransmission_rate_limiter_; |
122 }; | 116 }; |
123 | 117 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 rtx_header.payloadType = kRtxPayloadType; | 175 rtx_header.payloadType = kRtxPayloadType; |
182 EXPECT_TRUE(rtp_payload_registry_->IsRtx(rtx_header)); | 176 EXPECT_TRUE(rtp_payload_registry_->IsRtx(rtx_header)); |
183 rtx_header.ssrc = 0; | 177 rtx_header.ssrc = 0; |
184 EXPECT_FALSE(rtp_payload_registry_->IsRtx(rtx_header)); | 178 EXPECT_FALSE(rtp_payload_registry_->IsRtx(rtx_header)); |
185 rtx_header.ssrc = kRtxSsrc; | 179 rtx_header.ssrc = kRtxSsrc; |
186 rtx_header.payloadType = 0; | 180 rtx_header.payloadType = 0; |
187 EXPECT_TRUE(rtp_payload_registry_->IsRtx(rtx_header)); | 181 EXPECT_TRUE(rtp_payload_registry_->IsRtx(rtx_header)); |
188 } | 182 } |
189 | 183 |
190 } // namespace webrtc | 184 } // namespace webrtc |
OLD | NEW |