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

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: Change fps type to float 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
« no previous file with comments | « webrtc/common_video/h264/profile_level_id.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 491fda14aaf89fb80be630dcfef5d357832948df..1b3c51b75a556bd6fc734889347306a44288fcb0 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)));
« no previous file with comments | « 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