diff options
author | ddorwin@chromium.org <ddorwin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-18 05:22:08 +0000 |
---|---|---|
committer | ddorwin@chromium.org <ddorwin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-18 05:22:08 +0000 |
commit | 23efc4c787b09c7f089e85359a34a03ca3ec7fe1 (patch) | |
tree | ec7102f398d5085e3b5b5fc9ef6449afd0374ec9 | |
parent | f61b3be7be76ebb500ede6e2e0ef7bd6e03f8d25 (diff) | |
download | chromium_src-23efc4c787b09c7f089e85359a34a03ca3ec7fe1.zip chromium_src-23efc4c787b09c7f089e85359a34a03ca3ec7fe1.tar.gz chromium_src-23efc4c787b09c7f089e85359a34a03ca3ec7fe1.tar.bz2 |
Restore affirmative responses for "audio/mp4" when avc1 is supported (re-land r241165).
This case was broken by r221932/r222995.
BUG=329065
TEST=Updated browser_tests.
Review URL: https://codereview.chromium.org/117763002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@241498 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/media/encrypted_media_istypesupported_browsertest.cc | 11 | ||||
-rw-r--r-- | chrome/renderer/media/chrome_key_systems.cc | 17 |
2 files changed, 18 insertions, 10 deletions
diff --git a/chrome/browser/media/encrypted_media_istypesupported_browsertest.cc b/chrome/browser/media/encrypted_media_istypesupported_browsertest.cc index 9571aa7..748089d 100644 --- a/chrome/browser/media/encrypted_media_istypesupported_browsertest.cc +++ b/chrome/browser/media/encrypted_media_istypesupported_browsertest.cc @@ -45,6 +45,7 @@ #define EXPECT_WV EXPECT_TRUE #if defined(WIDEVINE_CDM_AVC1_SUPPORT_AVAILABLE) +#define EXPECT_WVMP4 EXPECT_TRUE #define EXPECT_WVAVC1 EXPECT_TRUE #if defined(WIDEVINE_CDM_AAC_SUPPORT_AVAILABLE) #define EXPECT_WVAVC1AAC EXPECT_TRUE @@ -52,6 +53,7 @@ #define EXPECT_WVAVC1AAC EXPECT_FALSE #endif // defined(WIDEVINE_CDM_AAC_SUPPORT_AVAILABLE) #else // !defined(WIDEVINE_CDM_AVC1_SUPPORT_AVAILABLE) +#define EXPECT_WVMP4 EXPECT_FALSE #define EXPECT_WVAVC1 EXPECT_FALSE #define EXPECT_WVAVC1AAC EXPECT_FALSE #endif // defined(WIDEVINE_CDM_AVC1_SUPPORT_AVAILABLE) @@ -64,6 +66,7 @@ #else // defined(WIDEVINE_CDM_AVAILABLE) && !defined(WIDEVINE_CDM_IS_COMPONENT) #define EXPECT_WV EXPECT_FALSE +#define EXPECT_WVMP4 EXPECT_FALSE #define EXPECT_WVAVC1 EXPECT_FALSE #define EXPECT_WVAVC1AAC EXPECT_FALSE #define EXPECT_WVAAC EXPECT_FALSE @@ -814,7 +817,7 @@ IN_PROC_BROWSER_TEST_F(EncryptedMediaIsTypeSupportedWidevineTest, IN_PROC_BROWSER_TEST_F(EncryptedMediaIsTypeSupportedWidevineTest, IsSupportedKeySystemWithMediaMimeType_Widevine_MP4) { // Valid video types. - EXPECT_WVAVC1(IsSupportedKeySystemWithMediaMimeType( + EXPECT_WVMP4(IsSupportedKeySystemWithMediaMimeType( "video/mp4", no_codecs(), kWidevineAlpha)); EXPECT_WVAVC1(IsSupportedKeySystemWithMediaMimeType( "video/mp4", avc1_codec(), kWidevineAlpha)); @@ -826,7 +829,7 @@ IN_PROC_BROWSER_TEST_F(EncryptedMediaIsTypeSupportedWidevineTest, "video/mp4", aac_codec(), kWidevineAlpha)); // Valid video types - parent key system. - EXPECT_WVAVC1(IsSupportedKeySystemWithMediaMimeType( + EXPECT_WVMP4(IsSupportedKeySystemWithMediaMimeType( "video/mp4", no_codecs(), kWidevine)); EXPECT_WVAVC1(IsSupportedKeySystemWithMediaMimeType( "video/mp4", avc1_codec(), kWidevine)); @@ -856,13 +859,13 @@ IN_PROC_BROWSER_TEST_F(EncryptedMediaIsTypeSupportedWidevineTest, "video/mp4", mixed_codecs(), kWidevineAlpha)); // Valid audio types. - EXPECT_WVAAC(IsSupportedKeySystemWithMediaMimeType( + EXPECT_WVMP4(IsSupportedKeySystemWithMediaMimeType( "audio/mp4", no_codecs(), kWidevineAlpha)); EXPECT_WVAAC(IsSupportedKeySystemWithMediaMimeType( "audio/mp4", aac_codec(), kWidevineAlpha)); // Valid audio types - parent key system. - EXPECT_WVAAC(IsSupportedKeySystemWithMediaMimeType( + EXPECT_WVMP4(IsSupportedKeySystemWithMediaMimeType( "audio/mp4", no_codecs(), kWidevine)); EXPECT_WVAAC(IsSupportedKeySystemWithMediaMimeType( "audio/mp4", aac_codec(), kWidevine)); diff --git a/chrome/renderer/media/chrome_key_systems.cc b/chrome/renderer/media/chrome_key_systems.cc index 0af0a1a..2b4ba65 100644 --- a/chrome/renderer/media/chrome_key_systems.cc +++ b/chrome/renderer/media/chrome_key_systems.cc @@ -123,6 +123,7 @@ enum SupportedCodecMasks { #if defined(USE_PROPRIETARY_CODECS) MP4_AAC = 1 << 1, MP4_AVC1 = 1 << 2, + MP4_CODECS = (MP4_AAC | MP4_AVC1), #endif // defined(USE_PROPRIETARY_CODECS) }; @@ -184,12 +185,16 @@ static void AddWidevineWithCodecs( } #if defined(USE_PROPRIETARY_CODECS) - if (supported_codecs & MP4_AAC) - info.supported_types.push_back(std::make_pair(kAudioMp4, kMp4a)); - - if (supported_codecs & MP4_AVC1) { - const char* video_codecs = - (supported_codecs & MP4_AAC) ? kMp4aAvc1Avc3 : kAvc1Avc3; + if (supported_codecs & MP4_CODECS) { + // MP4 container is supported for audio and video if any codec is supported. + bool is_aac_supported = (supported_codecs & MP4_AAC) != NO_CODECS; + bool is_avc1_supported = (supported_codecs & MP4_AVC1) != NO_CODECS; + const char* video_codecs = is_avc1_supported ? + (is_aac_supported ? kMp4aAvc1Avc3 : kAvc1Avc3) : + ""; + const char* audio_codecs = is_aac_supported ? kMp4a : ""; + + info.supported_types.push_back(std::make_pair(kAudioMp4, audio_codecs)); info.supported_types.push_back(std::make_pair(kVideoMp4, video_codecs)); } #endif // defined(USE_PROPRIETARY_CODECS) |