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 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
433 | 433 |
434 rtp_sender_->SetSendingMediaStatus(false); | 434 rtp_sender_->SetSendingMediaStatus(false); |
435 EXPECT_FALSE(rtp_sender_->AssignSequenceNumber(packet.get())); | 435 EXPECT_FALSE(rtp_sender_->AssignSequenceNumber(packet.get())); |
436 } | 436 } |
437 | 437 |
438 TEST_F(RtpSenderTestWithoutPacer, AssignSequenceNumberMayAllowPadding) { | 438 TEST_F(RtpSenderTestWithoutPacer, AssignSequenceNumberMayAllowPadding) { |
439 constexpr size_t kPaddingSize = 100; | 439 constexpr size_t kPaddingSize = 100; |
440 auto packet = rtp_sender_->AllocatePacket(); | 440 auto packet = rtp_sender_->AllocatePacket(); |
441 ASSERT_TRUE(packet); | 441 ASSERT_TRUE(packet); |
442 | 442 |
443 ASSERT_FALSE(rtp_sender_->SendPadData(kPaddingSize, false, 0, 0, -1)); | 443 ASSERT_FALSE(rtp_sender_->TimeToSendPadding(kPaddingSize, -1)); |
444 packet->SetMarker(false); | 444 packet->SetMarker(false); |
445 ASSERT_TRUE(rtp_sender_->AssignSequenceNumber(packet.get())); | 445 ASSERT_TRUE(rtp_sender_->AssignSequenceNumber(packet.get())); |
446 // Packet without marker bit doesn't allow padding. | 446 // Packet without marker bit doesn't allow padding. |
447 EXPECT_FALSE(rtp_sender_->SendPadData(kPaddingSize, false, 0, 0, -1)); | 447 EXPECT_FALSE(rtp_sender_->TimeToSendPadding(kPaddingSize, -1)); |
448 | 448 |
449 packet->SetMarker(true); | 449 packet->SetMarker(true); |
450 ASSERT_TRUE(rtp_sender_->AssignSequenceNumber(packet.get())); | 450 ASSERT_TRUE(rtp_sender_->AssignSequenceNumber(packet.get())); |
451 // Packet with marker bit allows send padding. | 451 // Packet with marker bit allows send padding. |
452 EXPECT_TRUE(rtp_sender_->SendPadData(kPaddingSize, false, 0, 0, -1)); | 452 EXPECT_TRUE(rtp_sender_->TimeToSendPadding(kPaddingSize, -1)); |
453 } | 453 } |
454 | 454 |
455 TEST_F(RtpSenderTestWithoutPacer, AssignSequenceNumberSetPaddingTimestamps) { | 455 TEST_F(RtpSenderTestWithoutPacer, AssignSequenceNumberSetPaddingTimestamps) { |
456 constexpr size_t kPaddingSize = 100; | 456 constexpr size_t kPaddingSize = 100; |
457 auto packet = rtp_sender_->AllocatePacket(); | 457 auto packet = rtp_sender_->AllocatePacket(); |
458 ASSERT_TRUE(packet); | 458 ASSERT_TRUE(packet); |
459 packet->SetMarker(true); | 459 packet->SetMarker(true); |
460 packet->SetTimestamp(kTimestamp); | 460 packet->SetTimestamp(kTimestamp); |
461 | 461 |
462 ASSERT_TRUE(rtp_sender_->AssignSequenceNumber(packet.get())); | 462 ASSERT_TRUE(rtp_sender_->AssignSequenceNumber(packet.get())); |
463 ASSERT_TRUE(rtp_sender_->SendPadData(kPaddingSize, false, 0, 0, -1)); | 463 ASSERT_TRUE(rtp_sender_->TimeToSendPadding(kPaddingSize, -1)); |
464 | 464 |
465 ASSERT_EQ(1u, transport_.sent_packets_.size()); | 465 ASSERT_EQ(1u, transport_.sent_packets_.size()); |
466 // Parse the padding packet and verify its timestamp. | 466 // Parse the padding packet and verify its timestamp. |
467 RtpPacketToSend padding_packet(nullptr); | 467 RtpPacketToSend padding_packet(nullptr); |
468 ASSERT_TRUE(padding_packet.Parse(transport_.sent_packets_[0]->data(), | 468 ASSERT_TRUE(padding_packet.Parse(transport_.sent_packets_[0]->data(), |
469 transport_.sent_packets_[0]->size())); | 469 transport_.sent_packets_[0]->size())); |
470 EXPECT_EQ(kTimestamp, padding_packet.Timestamp()); | 470 EXPECT_EQ(kTimestamp, padding_packet.Timestamp()); |
471 } | 471 } |
472 | 472 |
473 TEST_F(RtpSenderTestWithoutPacer, BuildRTPPacket) { | 473 TEST_F(RtpSenderTestWithoutPacer, BuildRTPPacket) { |
(...skipping 1330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1804 ConvertCVOByteToVideoRotation(flip_bit | camera_bit | 0)); | 1804 ConvertCVOByteToVideoRotation(flip_bit | camera_bit | 0)); |
1805 EXPECT_EQ(kVideoRotation_90, | 1805 EXPECT_EQ(kVideoRotation_90, |
1806 ConvertCVOByteToVideoRotation(flip_bit | camera_bit | 1)); | 1806 ConvertCVOByteToVideoRotation(flip_bit | camera_bit | 1)); |
1807 EXPECT_EQ(kVideoRotation_180, | 1807 EXPECT_EQ(kVideoRotation_180, |
1808 ConvertCVOByteToVideoRotation(flip_bit | camera_bit | 2)); | 1808 ConvertCVOByteToVideoRotation(flip_bit | camera_bit | 2)); |
1809 EXPECT_EQ(kVideoRotation_270, | 1809 EXPECT_EQ(kVideoRotation_270, |
1810 ConvertCVOByteToVideoRotation(flip_bit | camera_bit | 3)); | 1810 ConvertCVOByteToVideoRotation(flip_bit | camera_bit | 3)); |
1811 } | 1811 } |
1812 | 1812 |
1813 } // namespace webrtc | 1813 } // namespace webrtc |
OLD | NEW |