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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/base/video_codecs.h" 5 #include "media/base/video_codecs.h"
6 6
7 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
8 8
9 namespace media { 9 namespace media {
10 10
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 EXPECT_TRUE( 141 EXPECT_TRUE(
142 ParseHEVCCodecId("hvc1.1.6.L0.FF.FF.FF.FF.FF.FF", &profile, &level_idc)); 142 ParseHEVCCodecId("hvc1.1.6.L0.FF.FF.FF.FF.FF.FF", &profile, &level_idc));
143 EXPECT_FALSE(ParseHEVCCodecId("hvc1.1.6.L0.FF.FF.FF.FF.FF.FF.0", &profile, 143 EXPECT_FALSE(ParseHEVCCodecId("hvc1.1.6.L0.FF.FF.FF.FF.FF.FF.0", &profile,
144 &level_idc)); 144 &level_idc));
145 EXPECT_FALSE(ParseHEVCCodecId("hvc1.1.6.L0.100", &profile, &level_idc)); 145 EXPECT_FALSE(ParseHEVCCodecId("hvc1.1.6.L0.100", &profile, &level_idc));
146 EXPECT_FALSE(ParseHEVCCodecId("hvc1.1.6.L0.1FF", &profile, &level_idc)); 146 EXPECT_FALSE(ParseHEVCCodecId("hvc1.1.6.L0.1FF", &profile, &level_idc));
147 EXPECT_FALSE(ParseHEVCCodecId("hvc1.1.6.L0.-1", &profile, &level_idc)); 147 EXPECT_FALSE(ParseHEVCCodecId("hvc1.1.6.L0.-1", &profile, &level_idc));
148 } 148 }
149 #endif 149 #endif
150 150
151 #if BUILDFLAG(ENABLE_DOLBY_VISION_DEMUXING)
152 TEST(ParseDolbyVisionCodecIdTest, InvalidDolbyVisionCodecIds) {
153 VideoCodecProfile profile = VIDEO_CODEC_PROFILE_UNKNOWN;
154 uint8_t level_id = 0;
155
156 EXPECT_TRUE(ParseDolbyVisionCodecId("dvav.05.07", &profile, &level_id));
157 EXPECT_EQ(profile, DOLBYVISION_PROFILE5);
158 EXPECT_EQ(level_id, 7);
159 EXPECT_TRUE(ParseDolbyVisionCodecId("dva1.05.07", &profile, &level_id));
160 EXPECT_EQ(profile, DOLBYVISION_PROFILE5);
161 EXPECT_EQ(level_id, 7);
162 EXPECT_TRUE(ParseDolbyVisionCodecId("dvhe.05.07", &profile, &level_id));
163 EXPECT_EQ(profile, DOLBYVISION_PROFILE5);
164 EXPECT_EQ(level_id, 7);
165 EXPECT_TRUE(ParseDolbyVisionCodecId("dvh1.05.07", &profile, &level_id));
166 EXPECT_EQ(profile, DOLBYVISION_PROFILE5);
167 EXPECT_EQ(level_id, 7);
168
169 // Profiles 1, 2, 3 and 6 are deprecated.
170 EXPECT_FALSE(ParseDolbyVisionCodecId("dvh1.01.07", &profile, &level_id));
171 EXPECT_FALSE(ParseDolbyVisionCodecId("dvh1.02.07", &profile, &level_id));
172 EXPECT_FALSE(ParseDolbyVisionCodecId("dvh1.03.07", &profile, &level_id));
173 EXPECT_FALSE(ParseDolbyVisionCodecId("dvh1.06.07", &profile, &level_id));
174
175 // Codec string leading 0 in profile or level are not supported.
176 EXPECT_FALSE(ParseDolbyVisionCodecId("dvav", &profile, &level_id));
177 EXPECT_FALSE(ParseDolbyVisionCodecId("dvav.", &profile, &level_id));
178 EXPECT_FALSE(ParseDolbyVisionCodecId("dvav..", &profile, &level_id));
179 EXPECT_FALSE(ParseDolbyVisionCodecId("dvav...", &profile, &level_id));
180 EXPECT_FALSE(ParseDolbyVisionCodecId("dvav....", &profile, &level_id));
181 EXPECT_FALSE(ParseDolbyVisionCodecId("dvav.5", &profile, &level_id));
182 EXPECT_FALSE(ParseDolbyVisionCodecId("dvav.5.", &profile, &level_id));
183 EXPECT_FALSE(ParseDolbyVisionCodecId("dvav.5..", &profile, &level_id));
184 EXPECT_FALSE(ParseDolbyVisionCodecId("dvav.5...", &profile, &level_id));
185 EXPECT_FALSE(ParseDolbyVisionCodecId("dvav.5.7", &profile, &level_id));
186 EXPECT_FALSE(ParseDolbyVisionCodecId("dvav.5.7.", &profile, &level_id));
187 EXPECT_FALSE(ParseDolbyVisionCodecId("dvav.5.7..", &profile, &level_id));
188 EXPECT_FALSE(ParseDolbyVisionCodecId("dvav.5.7...", &profile, &level_id));
189 EXPECT_FALSE(ParseDolbyVisionCodecId("dvav..5", &profile, &level_id));
190 }
191 #endif
192
151 } // namespace media 193 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698