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

Unified Diff: webrtc/common_video/h264/profile_level_id_unittest.cc

Issue 2470133002: Add function for getting supported H264 level from max resolution and fps (Closed)
Patch Set: Improve comments. Created 4 years, 1 month 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
Index: webrtc/common_video/h264/profile_level_id_unittest.cc
diff --git a/webrtc/common_video/h264/profile_level_id_unittest.cc b/webrtc/common_video/h264/profile_level_id_unittest.cc
index 8bc50689d98479ae7566318939df1ffd34029b1c..3a15bb7b5c43966f032ec2074a9e5e9a416817c8 100644
--- a/webrtc/common_video/h264/profile_level_id_unittest.cc
+++ b/webrtc/common_video/h264/profile_level_id_unittest.cc
@@ -70,6 +70,21 @@ TEST(H264ProfileLevelId, TestParsingConstrainedHigh) {
EXPECT_EQ(kProfileConstrainedHigh, ParseProfileLevelId("640c1f")->profile);
}
+TEST(H264ProfileLevelId, TestSupportedLevel) {
+ EXPECT_EQ(kLevel2_1, *SupportedLevel(640 * 480, 25));
+ EXPECT_EQ(kLevel3_1, *SupportedLevel(1280 * 720, 30));
+ EXPECT_EQ(kLevel4_2, *SupportedLevel(1920 * 1280, 60));
+}
+
+// Test supported level below level 1 requirements.
+TEST(H264ProfileLevelId, TestSupportedLevelInvalid) {
+ EXPECT_FALSE(SupportedLevel(0, 0));
+ // All levels support fps > 5.
+ EXPECT_FALSE(SupportedLevel(1280 * 720, 5));
+ // All levels support frame sizes > 183 * 137.
+ EXPECT_FALSE(SupportedLevel(183 * 137, 30));
+}
+
TEST(H264ProfileLevelId, TestToString) {
EXPECT_EQ("42e01f", *ProfileLevelIdToString(ProfileLevelId(
kProfileConstrainedBaseline, kLevel3_1)));
« webrtc/common_video/h264/profile_level_id.h ('K') | « webrtc/common_video/h264/profile_level_id.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698