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

Unified Diff: media/base/video_codecs_unittest.cc

Issue 2640113004: Introduce Dolby Vision video codec and Demuxer support (Closed)
Patch Set: fix CQ failure Created 3 years, 10 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
Index: media/base/video_codecs_unittest.cc
diff --git a/media/base/video_codecs_unittest.cc b/media/base/video_codecs_unittest.cc
index 7a78bc5a9b1251841dacb8398bc8abf827a2771b..98b4365d11beafc4b8366277165df6fe811ef0e3 100644
--- a/media/base/video_codecs_unittest.cc
+++ b/media/base/video_codecs_unittest.cc
@@ -148,4 +148,46 @@ TEST(ParseHEVCCodecIdTest, InvalidHEVCCodecIds) {
}
#endif
+#if BUILDFLAG(ENABLE_DOLBY_VISION_DEMUXING)
+TEST(ParseDolbyVisionCodecIdTest, InvalidDolbyVisionCodecIds) {
+ VideoCodecProfile profile = VIDEO_CODEC_PROFILE_UNKNOWN;
+ uint8_t level_id = 0;
+
+ EXPECT_TRUE(ParseDolbyVisionCodecId("dvav.05.07", &profile, &level_id));
+ EXPECT_EQ(profile, DOLBYVISION_PROFILE5);
+ EXPECT_EQ(level_id, 7);
+ EXPECT_TRUE(ParseDolbyVisionCodecId("dva1.05.07", &profile, &level_id));
+ EXPECT_EQ(profile, DOLBYVISION_PROFILE5);
+ EXPECT_EQ(level_id, 7);
+ EXPECT_TRUE(ParseDolbyVisionCodecId("dvhe.05.07", &profile, &level_id));
+ EXPECT_EQ(profile, DOLBYVISION_PROFILE5);
+ EXPECT_EQ(level_id, 7);
+ EXPECT_TRUE(ParseDolbyVisionCodecId("dvh1.05.07", &profile, &level_id));
+ EXPECT_EQ(profile, DOLBYVISION_PROFILE5);
+ EXPECT_EQ(level_id, 7);
+
+ // Profiles 1, 2, 3 and 6 are deprecated.
+ EXPECT_FALSE(ParseDolbyVisionCodecId("dvh1.01.07", &profile, &level_id));
+ EXPECT_FALSE(ParseDolbyVisionCodecId("dvh1.02.07", &profile, &level_id));
+ EXPECT_FALSE(ParseDolbyVisionCodecId("dvh1.03.07", &profile, &level_id));
+ EXPECT_FALSE(ParseDolbyVisionCodecId("dvh1.06.07", &profile, &level_id));
+
+ // Codec string leading 0 in profile or level are not supported.
+ EXPECT_FALSE(ParseDolbyVisionCodecId("dvav", &profile, &level_id));
+ EXPECT_FALSE(ParseDolbyVisionCodecId("dvav.", &profile, &level_id));
+ EXPECT_FALSE(ParseDolbyVisionCodecId("dvav..", &profile, &level_id));
+ EXPECT_FALSE(ParseDolbyVisionCodecId("dvav...", &profile, &level_id));
+ EXPECT_FALSE(ParseDolbyVisionCodecId("dvav....", &profile, &level_id));
+ EXPECT_FALSE(ParseDolbyVisionCodecId("dvav.5", &profile, &level_id));
+ EXPECT_FALSE(ParseDolbyVisionCodecId("dvav.5.", &profile, &level_id));
+ EXPECT_FALSE(ParseDolbyVisionCodecId("dvav.5..", &profile, &level_id));
+ EXPECT_FALSE(ParseDolbyVisionCodecId("dvav.5...", &profile, &level_id));
+ EXPECT_FALSE(ParseDolbyVisionCodecId("dvav.5.7", &profile, &level_id));
+ EXPECT_FALSE(ParseDolbyVisionCodecId("dvav.5.7.", &profile, &level_id));
+ EXPECT_FALSE(ParseDolbyVisionCodecId("dvav.5.7..", &profile, &level_id));
+ EXPECT_FALSE(ParseDolbyVisionCodecId("dvav.5.7...", &profile, &level_id));
+ EXPECT_FALSE(ParseDolbyVisionCodecId("dvav..5", &profile, &level_id));
+}
+#endif
+
} // namespace media

Powered by Google App Engine
This is Rietveld 408576698