| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/strings/string_split.h" | 8 #include "base/strings/string_split.h" |
| 9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 case MimeUtil::VP8: | 329 case MimeUtil::VP8: |
| 330 EXPECT_TRUE(result); | 330 EXPECT_TRUE(result); |
| 331 break; | 331 break; |
| 332 | 332 |
| 333 // The remaining codecs depend on the platform version. | 333 // The remaining codecs depend on the platform version. |
| 334 case MimeUtil::OPUS: | 334 case MimeUtil::OPUS: |
| 335 EXPECT_EQ(info.supports_opus, result); | 335 EXPECT_EQ(info.supports_opus, result); |
| 336 break; | 336 break; |
| 337 | 337 |
| 338 case MimeUtil::VP9: | 338 case MimeUtil::VP9: |
| 339 EXPECT_EQ(info.supports_vp9, result); | 339 // MediaPlayer only supports VP9 in WebM. |
| 340 EXPECT_FALSE(result); |
| 340 break; | 341 break; |
| 341 | 342 |
| 342 case MimeUtil::HEVC_MAIN: | 343 case MimeUtil::HEVC_MAIN: |
| 343 EXPECT_EQ(HasHevcSupport(), result); | 344 EXPECT_EQ(HasHevcSupport(), result); |
| 344 break; | 345 break; |
| 345 } | 346 } |
| 346 }); | 347 }); |
| 348 |
| 349 // Verify vp9 support in WebM. |
| 350 RunCodecSupportTest( |
| 351 states_to_vary, test_states, |
| 352 [](const MimeUtil::PlatformInfo& info, MimeUtil::Codec codec) { |
| 353 const bool result = MimeUtil::IsCodecSupportedOnPlatform( |
| 354 codec, "video/webm", true, info); |
| 355 if (codec == MimeUtil::VP9) |
| 356 EXPECT_EQ(info.supports_vp9, result); |
| 357 }); |
| 347 } | 358 } |
| 348 | 359 |
| 349 TEST(IsCodecSupportedOnPlatformTest, ClearCodecBehaviorWithUnifiedPipeline) { | 360 TEST(IsCodecSupportedOnPlatformTest, ClearCodecBehaviorWithUnifiedPipeline) { |
| 350 // Vary all parameters except |is_unified_media_pipeline_enabled|. | 361 // Vary all parameters except |is_unified_media_pipeline_enabled|. |
| 351 MimeUtil::PlatformInfo states_to_vary = VaryAllFields(); | 362 MimeUtil::PlatformInfo states_to_vary = VaryAllFields(); |
| 352 states_to_vary.is_unified_media_pipeline_enabled = false; | 363 states_to_vary.is_unified_media_pipeline_enabled = false; |
| 353 | 364 |
| 354 // Enable the unified pipeline. | 365 // Enable the unified pipeline. |
| 355 MimeUtil::PlatformInfo test_states; | 366 MimeUtil::PlatformInfo test_states; |
| 356 test_states.is_unified_media_pipeline_enabled = true; | 367 test_states.is_unified_media_pipeline_enabled = true; |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 states_to_vary, test_states, | 417 states_to_vary, test_states, |
| 407 [](const MimeUtil::PlatformInfo& info, MimeUtil::Codec codec) { | 418 [](const MimeUtil::PlatformInfo& info, MimeUtil::Codec codec) { |
| 408 EXPECT_EQ(info.is_unified_media_pipeline_enabled, | 419 EXPECT_EQ(info.is_unified_media_pipeline_enabled, |
| 409 MimeUtil::IsCodecSupportedOnPlatform( | 420 MimeUtil::IsCodecSupportedOnPlatform( |
| 410 MimeUtil::OPUS, "audio/ogg", false, info)); | 421 MimeUtil::OPUS, "audio/ogg", false, info)); |
| 411 }); | 422 }); |
| 412 } | 423 } |
| 413 | 424 |
| 414 } // namespace internal | 425 } // namespace internal |
| 415 } // namespace media | 426 } // namespace media |
| OLD | NEW |