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

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: Return rtc::Optional<Level> instead 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 8237b20c2bb7da6fb31852430cce9d658f2282a8..dd9f82917ca92941e1aa3bec9b71717409664b09 100644
--- a/webrtc/common_video/h264/profile_level_id_unittest.cc
+++ b/webrtc/common_video/h264/profile_level_id_unittest.cc
@@ -70,6 +70,19 @@ 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));
+ EXPECT_FALSE(SupportedLevel(1280 * 720, 5));
+ EXPECT_FALSE(SupportedLevel(183 * 137, 30));
hta-webrtc 2016/11/03 14:04:32 Please add a comment as to why these resolution/fr
magjed_webrtc 2016/11/03 14:53:39 Done.
+}
+
TEST(H264ProfileLevelId, TestToString) {
EXPECT_EQ("42e01f", ProfileLevelIdToString(ProfileLevelId(
kProfileConstrainedBaseline, kLevel3_1)));
« webrtc/common_video/h264/profile_level_id.cc ('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