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 12 matching lines...) Expand all Loading... |
23 rtp_rtcp_module_ = rtp_rtcp_module; | 23 rtp_rtcp_module_ = rtp_rtcp_module; |
24 rtp_payload_registry_ = payload_registry; | 24 rtp_payload_registry_ = payload_registry; |
25 rtp_receiver_ = receiver; | 25 rtp_receiver_ = receiver; |
26 receive_statistics_ = receive_statistics; | 26 receive_statistics_ = receive_statistics; |
27 } | 27 } |
28 | 28 |
29 void LoopBackTransport::DropEveryNthPacket(int n) { | 29 void LoopBackTransport::DropEveryNthPacket(int n) { |
30 packet_loss_ = n; | 30 packet_loss_ = n; |
31 } | 31 } |
32 | 32 |
33 bool LoopBackTransport::SendRtp(const uint8_t* data, size_t len) { | 33 bool LoopBackTransport::SendRtp(const uint8_t* data, |
| 34 size_t len, |
| 35 const PacketOptions& options) { |
34 count_++; | 36 count_++; |
35 if (packet_loss_ > 0) { | 37 if (packet_loss_ > 0) { |
36 if ((count_ % packet_loss_) == 0) { | 38 if ((count_ % packet_loss_) == 0) { |
37 return true; | 39 return true; |
38 } | 40 } |
39 } | 41 } |
40 RTPHeader header; | 42 RTPHeader header; |
41 rtc::scoped_ptr<RtpHeaderParser> parser(RtpHeaderParser::Create()); | 43 rtc::scoped_ptr<RtpHeaderParser> parser(RtpHeaderParser::Create()); |
42 if (!parser->Parse(static_cast<const uint8_t*>(data), len, &header)) { | 44 if (!parser->Parse(static_cast<const uint8_t*>(data), len, &header)) { |
43 return false; | 45 return false; |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 RTPHeader rtx_header; | 177 RTPHeader rtx_header; |
176 rtx_header.ssrc = kRtxSsrc; | 178 rtx_header.ssrc = kRtxSsrc; |
177 rtx_header.payloadType = kRtxPayloadType; | 179 rtx_header.payloadType = kRtxPayloadType; |
178 EXPECT_TRUE(rtp_payload_registry_->IsRtx(rtx_header)); | 180 EXPECT_TRUE(rtp_payload_registry_->IsRtx(rtx_header)); |
179 rtx_header.ssrc = 0; | 181 rtx_header.ssrc = 0; |
180 EXPECT_FALSE(rtp_payload_registry_->IsRtx(rtx_header)); | 182 EXPECT_FALSE(rtp_payload_registry_->IsRtx(rtx_header)); |
181 rtx_header.ssrc = kRtxSsrc; | 183 rtx_header.ssrc = kRtxSsrc; |
182 rtx_header.payloadType = 0; | 184 rtx_header.payloadType = 0; |
183 EXPECT_TRUE(rtp_payload_registry_->IsRtx(rtx_header)); | 185 EXPECT_TRUE(rtp_payload_registry_->IsRtx(rtx_header)); |
184 } | 186 } |
OLD | NEW |