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