| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 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 562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 573 packetizer0.SetPayloadData(kFrame, sizeof(kFrame), kNoFragmentation), | 573 packetizer0.SetPayloadData(kFrame, sizeof(kFrame), kNoFragmentation), |
| 574 kMinNumberOfPackets); | 574 kMinNumberOfPackets); |
| 575 ASSERT_TRUE(packetizer0.NextPacket(&packet)); | 575 ASSERT_TRUE(packetizer0.NextPacket(&packet)); |
| 576 EXPECT_FALSE(packet.Marker()); | 576 EXPECT_FALSE(packet.Marker()); |
| 577 ASSERT_TRUE(packetizer0.NextPacket(&packet)); | 577 ASSERT_TRUE(packetizer0.NextPacket(&packet)); |
| 578 EXPECT_FALSE(packet.Marker()); | 578 EXPECT_FALSE(packet.Marker()); |
| 579 ASSERT_TRUE(packetizer0.NextPacket(&packet)); | 579 ASSERT_TRUE(packetizer0.NextPacket(&packet)); |
| 580 EXPECT_TRUE(packet.Marker()); | 580 EXPECT_TRUE(packet.Marker()); |
| 581 } | 581 } |
| 582 | 582 |
| 583 TEST_F(RtpPacketizerVp9Test, TestBaseLayerProtectionAndStorageType) { | |
| 584 const size_t kFrameSize = 10; | |
| 585 const size_t kPacketSize = 12; | |
| 586 | |
| 587 // I:0, P:0, L:1, F:1, B:1, E:1, V:0 (2hdr + 10 payload) | |
| 588 // L: T:0, U:0, S:0, D:0 | |
| 589 expected_.flexible_mode = true; | |
| 590 expected_.temporal_idx = 0; | |
| 591 Init(kFrameSize, kPacketSize); | |
| 592 EXPECT_EQ(kProtectedPacket, packetizer_->GetProtectionType()); | |
| 593 EXPECT_EQ(kAllowRetransmission, | |
| 594 packetizer_->GetStorageType(kRetransmitBaseLayer)); | |
| 595 EXPECT_EQ(kDontRetransmit, packetizer_->GetStorageType(kRetransmitOff)); | |
| 596 } | |
| 597 | |
| 598 TEST_F(RtpPacketizerVp9Test, TestHigherLayerProtectionAndStorageType) { | |
| 599 const size_t kFrameSize = 10; | |
| 600 const size_t kPacketSize = 12; | |
| 601 | |
| 602 // I:0, P:0, L:1, F:1, B:1, E:1, V:0 (2hdr + 10 payload) | |
| 603 // L: T:1, U:0, S:0, D:0 | |
| 604 expected_.flexible_mode = true; | |
| 605 expected_.temporal_idx = 1; | |
| 606 Init(kFrameSize, kPacketSize); | |
| 607 EXPECT_EQ(kUnprotectedPacket, packetizer_->GetProtectionType()); | |
| 608 EXPECT_EQ(kDontRetransmit, packetizer_->GetStorageType(kRetransmitBaseLayer)); | |
| 609 EXPECT_EQ(kAllowRetransmission, | |
| 610 packetizer_->GetStorageType(kRetransmitHigherLayers)); | |
| 611 } | |
| 612 | |
| 613 | |
| 614 class RtpDepacketizerVp9Test : public ::testing::Test { | 583 class RtpDepacketizerVp9Test : public ::testing::Test { |
| 615 protected: | 584 protected: |
| 616 RtpDepacketizerVp9Test() | 585 RtpDepacketizerVp9Test() |
| 617 : depacketizer_(new RtpDepacketizerVp9()) {} | 586 : depacketizer_(new RtpDepacketizerVp9()) {} |
| 618 | 587 |
| 619 virtual void SetUp() { | 588 virtual void SetUp() { |
| 620 expected_.InitRTPVideoHeaderVP9(); | 589 expected_.InitRTPVideoHeaderVP9(); |
| 621 } | 590 } |
| 622 | 591 |
| 623 RTPVideoHeaderVP9 expected_; | 592 RTPVideoHeaderVP9 expected_; |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 833 } | 802 } |
| 834 | 803 |
| 835 TEST_F(RtpDepacketizerVp9Test, ParseFailsForTooShortBufferToFitPayload) { | 804 TEST_F(RtpDepacketizerVp9Test, ParseFailsForTooShortBufferToFitPayload) { |
| 836 const uint8_t kHeaderLength = 1; | 805 const uint8_t kHeaderLength = 1; |
| 837 uint8_t packet[kHeaderLength] = {0}; | 806 uint8_t packet[kHeaderLength] = {0}; |
| 838 RtpDepacketizer::ParsedPayload parsed; | 807 RtpDepacketizer::ParsedPayload parsed; |
| 839 EXPECT_FALSE(depacketizer_->Parse(&parsed, packet, sizeof(packet))); | 808 EXPECT_FALSE(depacketizer_->Parse(&parsed, packet, sizeof(packet))); |
| 840 } | 809 } |
| 841 | 810 |
| 842 } // namespace webrtc | 811 } // namespace webrtc |
| OLD | NEW |