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 1674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1685 VerifyCVOPacket( | 1685 VerifyCVOPacket( |
1686 reinterpret_cast<uint8_t*>(transport_.sent_packets_[0]->data()), | 1686 reinterpret_cast<uint8_t*>(transport_.sent_packets_[0]->data()), |
1687 transport_.sent_packets_[0]->size(), true, &map, kSeqNum, hdr.rotation); | 1687 transport_.sent_packets_[0]->size(), true, &map, kSeqNum, hdr.rotation); |
1688 | 1688 |
1689 // Verify that this packet does have CVO byte. | 1689 // Verify that this packet does have CVO byte. |
1690 VerifyCVOPacket( | 1690 VerifyCVOPacket( |
1691 reinterpret_cast<uint8_t*>(transport_.sent_packets_[1]->data()), | 1691 reinterpret_cast<uint8_t*>(transport_.sent_packets_[1]->data()), |
1692 transport_.sent_packets_[1]->size(), true, &map, kSeqNum + 1, | 1692 transport_.sent_packets_[1]->size(), true, &map, kSeqNum + 1, |
1693 hdr.rotation); | 1693 hdr.rotation); |
1694 } | 1694 } |
| 1695 |
| 1696 // Make sure rotation is parsed correctly when the Camera (C) and Flip (F) bits |
| 1697 // are set in the CVO byte. |
| 1698 TEST_F(RtpSenderVideoTest, SendVideoWithCameraAndFlipCVO) { |
| 1699 // Test extracting rotation when Camera (C) and Flip (F) bits are zero. |
| 1700 EXPECT_EQ(kVideoRotation_0, ConvertCVOByteToVideoRotation(0)); |
| 1701 EXPECT_EQ(kVideoRotation_90, ConvertCVOByteToVideoRotation(1)); |
| 1702 EXPECT_EQ(kVideoRotation_180, ConvertCVOByteToVideoRotation(2)); |
| 1703 EXPECT_EQ(kVideoRotation_270, ConvertCVOByteToVideoRotation(3)); |
| 1704 // Test extracting rotation when Camera (C) and Flip (F) bits are set. |
| 1705 const int flip_bit = 1 << 2; |
| 1706 const int camera_bit = 1 << 3; |
| 1707 EXPECT_EQ(kVideoRotation_0, |
| 1708 ConvertCVOByteToVideoRotation(flip_bit | camera_bit | 0)); |
| 1709 EXPECT_EQ(kVideoRotation_90, |
| 1710 ConvertCVOByteToVideoRotation(flip_bit | camera_bit | 1)); |
| 1711 EXPECT_EQ(kVideoRotation_180, |
| 1712 ConvertCVOByteToVideoRotation(flip_bit | camera_bit | 2)); |
| 1713 EXPECT_EQ(kVideoRotation_270, |
| 1714 ConvertCVOByteToVideoRotation(flip_bit | camera_bit | 3)); |
| 1715 } |
| 1716 |
1695 } // namespace webrtc | 1717 } // namespace webrtc |
OLD | NEW |