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

Side by Side Diff: media/base/video_codecs_unittest.cc

Issue 2640113004: Introduce Dolby Vision video codec and Demuxer support (Closed)
Patch Set: fix build break on Android Created 3 years, 9 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
« no previous file with comments | « media/base/video_codecs.cc ('k') | media/base/video_decoder_config.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // Codec dvav/dva1 should only contain profile 0.
157 EXPECT_TRUE(ParseDolbyVisionCodecId("dvav.00.07", &profile, &level_id));
158 EXPECT_EQ(profile, DOLBYVISION_PROFILE0);
159 EXPECT_EQ(level_id, 7);
160 EXPECT_TRUE(ParseDolbyVisionCodecId("dva1.00.07", &profile, &level_id));
161 EXPECT_EQ(profile, DOLBYVISION_PROFILE0);
162 EXPECT_EQ(level_id, 7);
163 EXPECT_FALSE(ParseDolbyVisionCodecId("dvav.04.07", &profile, &level_id));
164 EXPECT_FALSE(ParseDolbyVisionCodecId("dva1.04.07", &profile, &level_id));
165 EXPECT_FALSE(ParseDolbyVisionCodecId("dvav.05.07", &profile, &level_id));
166 EXPECT_FALSE(ParseDolbyVisionCodecId("dva1.05.07", &profile, &level_id));
167 EXPECT_FALSE(ParseDolbyVisionCodecId("dvav.07.07", &profile, &level_id));
168 EXPECT_FALSE(ParseDolbyVisionCodecId("dva1.07.07", &profile, &level_id));
169
170 #if BUILDFLAG(ENABLE_HEVC_DEMUXING)
171 // Codec dvhe/dvh1 should only contain profile 4, 5, and 7.
172 EXPECT_TRUE(ParseDolbyVisionCodecId("dvhe.04.07", &profile, &level_id));
173 EXPECT_EQ(profile, DOLBYVISION_PROFILE4);
174 EXPECT_EQ(level_id, 7);
175 EXPECT_TRUE(ParseDolbyVisionCodecId("dvhe.05.07", &profile, &level_id));
176 EXPECT_EQ(profile, DOLBYVISION_PROFILE5);
177 EXPECT_EQ(level_id, 7);
178 EXPECT_TRUE(ParseDolbyVisionCodecId("dvh1.05.07", &profile, &level_id));
179 EXPECT_EQ(profile, DOLBYVISION_PROFILE5);
180 EXPECT_EQ(level_id, 7);
181 EXPECT_TRUE(ParseDolbyVisionCodecId("dvhe.07.07", &profile, &level_id));
182 EXPECT_EQ(profile, DOLBYVISION_PROFILE7);
183 EXPECT_EQ(level_id, 7);
184 EXPECT_FALSE(ParseDolbyVisionCodecId("dvhe.00.07", &profile, &level_id));
185 EXPECT_FALSE(ParseDolbyVisionCodecId("dvh1.00.07", &profile, &level_id));
186
187 // Profiles 1, 2, 3 and 6 are deprecated.
188 EXPECT_FALSE(ParseDolbyVisionCodecId("dvav.01.07", &profile, &level_id));
189 EXPECT_FALSE(ParseDolbyVisionCodecId("dvhe.02.07", &profile, &level_id));
190 EXPECT_FALSE(ParseDolbyVisionCodecId("dvhe.03.07", &profile, &level_id));
191 EXPECT_FALSE(ParseDolbyVisionCodecId("dvhe.06.07", &profile, &level_id));
192
193 // Level should be numbers between 1 and 9.
194 EXPECT_FALSE(ParseDolbyVisionCodecId("dvhe.04.00", &profile, &level_id));
195 EXPECT_FALSE(ParseDolbyVisionCodecId("dvhe.04.10", &profile, &level_id));
196 EXPECT_FALSE(ParseDolbyVisionCodecId("dvhe.04.20", &profile, &level_id));
197 EXPECT_FALSE(ParseDolbyVisionCodecId("dvhe.04.99", &profile, &level_id));
198
199 // Valid codec string is <FourCC>.<two digits profile>.<two digits level>.
200 EXPECT_FALSE(ParseDolbyVisionCodecId("dvhe", &profile, &level_id));
201 EXPECT_FALSE(ParseDolbyVisionCodecId("dvhe.", &profile, &level_id));
202 EXPECT_FALSE(ParseDolbyVisionCodecId("dvhe..", &profile, &level_id));
203 EXPECT_FALSE(ParseDolbyVisionCodecId("dvhe...", &profile, &level_id));
204 EXPECT_FALSE(ParseDolbyVisionCodecId("dvhe....", &profile, &level_id));
205 EXPECT_FALSE(ParseDolbyVisionCodecId("dvhe.5", &profile, &level_id));
206 EXPECT_FALSE(ParseDolbyVisionCodecId("dvhe.5.", &profile, &level_id));
207 EXPECT_FALSE(ParseDolbyVisionCodecId("dvhe.5..", &profile, &level_id));
208 EXPECT_FALSE(ParseDolbyVisionCodecId("dvhe.5...", &profile, &level_id));
209 EXPECT_FALSE(ParseDolbyVisionCodecId("dvhe.5.7", &profile, &level_id));
210 EXPECT_FALSE(ParseDolbyVisionCodecId("dvhe.5.7.", &profile, &level_id));
211 EXPECT_FALSE(ParseDolbyVisionCodecId("dvhe.5.7..", &profile, &level_id));
212 EXPECT_FALSE(ParseDolbyVisionCodecId("dvhe.5.7...", &profile, &level_id));
213 EXPECT_FALSE(ParseDolbyVisionCodecId("dvhe..5", &profile, &level_id));
214 #endif
215 }
216 #endif
217
151 } // namespace media 218 } // namespace media
OLDNEW
« no previous file with comments | « media/base/video_codecs.cc ('k') | media/base/video_decoder_config.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698