Index: webrtc/modules/rtp_rtcp/source/rtp_sender_unittest.cc |
diff --git a/webrtc/modules/rtp_rtcp/source/rtp_sender_unittest.cc b/webrtc/modules/rtp_rtcp/source/rtp_sender_unittest.cc |
index 41b52a200c8c5fa95c1b575ee60827f862df1627..13109185ea414bbf6498f716e17278b297ae9b20 100644 |
--- a/webrtc/modules/rtp_rtcp/source/rtp_sender_unittest.cc |
+++ b/webrtc/modules/rtp_rtcp/source/rtp_sender_unittest.cc |
@@ -1692,4 +1692,26 @@ TEST_F(RtpSenderVideoTest, SendVideoWithCVO) { |
transport_.sent_packets_[1]->size(), true, &map, kSeqNum + 1, |
hdr.rotation); |
} |
+ |
+// Make sure rotation is parsed correctly when the Camera (C) and Flip (F) bits |
+// are set in the CVO byte. |
+TEST_F(RtpSenderVideoTest, SendVideoWithCameraAndFlipCVO) { |
+ // Test extracting rotation when Camera (C) and Flip (F) bits are zero. |
+ EXPECT_EQ(kVideoRotation_0, ConvertCVOByteToVideoRotation(0)); |
+ EXPECT_EQ(kVideoRotation_90, ConvertCVOByteToVideoRotation(1)); |
+ EXPECT_EQ(kVideoRotation_180, ConvertCVOByteToVideoRotation(2)); |
+ EXPECT_EQ(kVideoRotation_270, ConvertCVOByteToVideoRotation(3)); |
+ // Test extracting rotation when Camera (C) and Flip (F) bits are set. |
+ const int flip_bit = 1 << 2; |
+ const int camera_bit = 1 << 3; |
+ EXPECT_EQ(kVideoRotation_0, |
+ ConvertCVOByteToVideoRotation(flip_bit | camera_bit | 0)); |
+ EXPECT_EQ(kVideoRotation_90, |
+ ConvertCVOByteToVideoRotation(flip_bit | camera_bit | 1)); |
+ EXPECT_EQ(kVideoRotation_180, |
+ ConvertCVOByteToVideoRotation(flip_bit | camera_bit | 2)); |
+ EXPECT_EQ(kVideoRotation_270, |
+ ConvertCVOByteToVideoRotation(flip_bit | camera_bit | 3)); |
+} |
+ |
} // namespace webrtc |