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 1427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1438 sizeof(kPayloadData) + kGenericHeaderLength + | 1438 sizeof(kPayloadData) + kGenericHeaderLength + |
1439 kRtpOverheadBytesPerPacket, | 1439 kRtpOverheadBytesPerPacket, |
1440 PacketInfo::kNotAProbe)) | 1440 PacketInfo::kNotAProbe)) |
1441 .Times(1); | 1441 .Times(1); |
1442 EXPECT_CALL(mock_overhead_observer, | 1442 EXPECT_CALL(mock_overhead_observer, |
1443 OnOverheadChanged(kRtpOverheadBytesPerPacket)) | 1443 OnOverheadChanged(kRtpOverheadBytesPerPacket)) |
1444 .Times(1); | 1444 .Times(1); |
1445 SendGenericPayload(); | 1445 SendGenericPayload(); |
1446 } | 1446 } |
1447 | 1447 |
| 1448 TEST_F(RtpSenderTest, SendAudioPadding) { |
| 1449 MockTransport transport; |
| 1450 const bool kEnableAudio = true; |
| 1451 rtp_sender_.reset(new RTPSender( |
| 1452 kEnableAudio, &fake_clock_, &transport, &mock_paced_sender_, nullptr, |
| 1453 nullptr, nullptr, nullptr, nullptr, nullptr, &mock_rtc_event_log_, |
| 1454 nullptr, &retransmission_rate_limiter_, nullptr)); |
| 1455 rtp_sender_->SetSendPayloadType(kPayload); |
| 1456 rtp_sender_->SetSequenceNumber(kSeqNum); |
| 1457 rtp_sender_->SetTimestampOffset(0); |
| 1458 rtp_sender_->SetSSRC(kSsrc); |
| 1459 |
| 1460 const size_t kPaddingSize = 59; |
| 1461 EXPECT_CALL(transport, SendRtp(_, kPaddingSize + kRtpHeaderSize, _)) |
| 1462 .WillOnce(testing::Return(true)); |
| 1463 EXPECT_EQ(kPaddingSize, rtp_sender_->TimeToSendPadding( |
| 1464 kPaddingSize, PacketInfo::kNotAProbe)); |
| 1465 |
| 1466 // Requested padding size is too small, will send a larger one. |
| 1467 const size_t kMinPaddingSize = 50; |
| 1468 EXPECT_CALL(transport, SendRtp(_, kMinPaddingSize + kRtpHeaderSize, _)) |
| 1469 .WillOnce(testing::Return(true)); |
| 1470 EXPECT_EQ(kMinPaddingSize, rtp_sender_->TimeToSendPadding( |
| 1471 kMinPaddingSize - 5, PacketInfo::kNotAProbe)); |
| 1472 } |
1448 } // namespace webrtc | 1473 } // namespace webrtc |
OLD | NEW |