Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(697)

Unified Diff: webrtc/modules/rtp_rtcp/source/rtp_sender_unittest.cc

Issue 2280703002: Ignore Camera and Flip bits in CVO when parsing video rotation (Closed)
Patch Set: Update unittests Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtp_receiver_video.cc ('k') | webrtc/modules/rtp_rtcp/source/rtp_utility.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 e11bf1ee5ae53ef0999ea4bd08a674ce199a8451..b9f061a9d3af7739a2240b67efa56d34da878a3d 100644
--- a/webrtc/modules/rtp_rtcp/source/rtp_sender_unittest.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtp_sender_unittest.cc
@@ -262,8 +262,7 @@ class RtpSenderVideoTest : public RtpSenderTest {
EXPECT_EQ(rtp_sender_->SSRC(), rtp_header.ssrc);
EXPECT_EQ(0, rtp_header.numCSRCs);
EXPECT_EQ(0U, rtp_header.paddingLength);
- EXPECT_EQ(ConvertVideoRotationToCVOByte(rotation),
- rtp_header.extension.videoRotation);
+ EXPECT_EQ(rotation, rtp_header.extension.videoRotation);
}
};
@@ -577,8 +576,7 @@ TEST_F(RtpSenderTestWithoutPacer, BuildRTPPacketWithVideoRotation_MarkerBit) {
VerifyRTPHeaderCommon(rtp_header);
EXPECT_EQ(length, rtp_header.headerLength);
EXPECT_TRUE(rtp_header.extension.hasVideoRotation);
- EXPECT_EQ(ConvertVideoRotationToCVOByte(kRotation),
- rtp_header.extension.videoRotation);
+ EXPECT_EQ(kRotation, rtp_header.extension.videoRotation);
}
// Test CVO header extension is not set when marker bit is false.
@@ -1691,4 +1689,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
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtp_receiver_video.cc ('k') | webrtc/modules/rtp_rtcp/source/rtp_utility.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698