OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/renderer/media/crypto/key_systems_info.h" | 5 #include "content/renderer/media/crypto/key_systems_info.h" |
6 #include "third_party/WebKit/public/platform/WebString.h" | 6 #include "third_party/WebKit/public/platform/WebString.h" |
7 | 7 |
8 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. | 8 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. |
9 | 9 |
10 // The following must be after widevine_cdm_version.h. | 10 // The following must be after widevine_cdm_version.h. |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 static inline bool IsWidevine(const std::string& key_system) { | 55 static inline bool IsWidevine(const std::string& key_system) { |
56 return key_system == kWidevineKeySystem || | 56 return key_system == kWidevineKeySystem || |
57 key_system == kWidevineBaseKeySystem; | 57 key_system == kWidevineBaseKeySystem; |
58 } | 58 } |
59 #endif // defined(WIDEVINE_CDM_AVAILABLE) | 59 #endif // defined(WIDEVINE_CDM_AVAILABLE) |
60 | 60 |
61 const MediaFormatAndKeySystem kSupportedFormatKeySystemCombinations[] = { | 61 const MediaFormatAndKeySystem kSupportedFormatKeySystemCombinations[] = { |
62 // Clear Key. | 62 // Clear Key. |
63 { "video/webm", "vorbis,vp8,vp8.0", kClearKeyKeySystem }, | 63 { "video/webm", "vorbis,vp8,vp8.0", kClearKeyKeySystem }, |
64 { "audio/webm", "vorbis", kClearKeyKeySystem }, | 64 { "audio/webm", "vorbis", kClearKeyKeySystem }, |
65 #if defined(GOOGLE_CHROME_BUILD) || defined(USE_PROPRIETARY_CODECS) | 65 #if defined(USE_PROPRIETARY_CODECS) |
66 { "video/mp4", "avc1,mp4a", kClearKeyKeySystem }, | 66 { "video/mp4", "avc1,mp4a", kClearKeyKeySystem }, |
67 { "audio/mp4", "mp4a", kClearKeyKeySystem }, | 67 { "audio/mp4", "mp4a", kClearKeyKeySystem }, |
68 #endif | 68 #endif |
69 | 69 |
70 // External Clear Key (used for testing). | 70 // External Clear Key (used for testing). |
71 { "video/webm", "vorbis,vp8,vp8.0", kExternalClearKeyKeySystem }, | 71 { "video/webm", "vorbis,vp8,vp8.0", kExternalClearKeyKeySystem }, |
72 { "audio/webm", "vorbis", kExternalClearKeyKeySystem }, | 72 { "audio/webm", "vorbis", kExternalClearKeyKeySystem }, |
73 #if defined(GOOGLE_CHROME_BUILD) || defined(USE_PROPRIETARY_CODECS) | 73 #if defined(USE_PROPRIETARY_CODECS) |
74 { "video/mp4", "avc1,mp4a", kExternalClearKeyKeySystem }, | 74 { "video/mp4", "avc1,mp4a", kExternalClearKeyKeySystem }, |
75 { "audio/mp4", "mp4a", kExternalClearKeyKeySystem }, | 75 { "audio/mp4", "mp4a", kExternalClearKeyKeySystem }, |
76 #endif | 76 #endif |
77 | 77 |
78 #if defined(WIDEVINE_CDM_AVAILABLE) | 78 #if defined(WIDEVINE_CDM_AVAILABLE) |
79 // Widevine. | 79 // Widevine. |
80 { "video/webm", "vorbis,vp8,vp8.0", kWidevineKeySystem }, | 80 { "video/webm", "vorbis,vp8,vp8.0", kWidevineKeySystem }, |
81 { "audio/webm", "vorbis", kWidevineKeySystem }, | 81 { "audio/webm", "vorbis", kWidevineKeySystem }, |
82 { "video/webm", "vorbis,vp8,vp8.0", kWidevineBaseKeySystem }, | 82 { "video/webm", "vorbis,vp8,vp8.0", kWidevineBaseKeySystem }, |
83 { "audio/webm", "vorbis", kWidevineBaseKeySystem }, | 83 { "audio/webm", "vorbis", kWidevineBaseKeySystem }, |
84 #if defined(GOOGLE_CHROME_BUILD) || defined(USE_PROPRIETARY_CODECS) | 84 #if defined(USE_PROPRIETARY_CODECS) |
85 #if defined(WIDEVINE_CDM_CENC_SUPPORT_AVAILABLE) | 85 #if defined(WIDEVINE_CDM_CENC_SUPPORT_AVAILABLE) |
86 { "video/mp4", kWidevineVideoMp4Codecs, kWidevineKeySystem }, | 86 { "video/mp4", kWidevineVideoMp4Codecs, kWidevineKeySystem }, |
87 { "video/mp4", kWidevineVideoMp4Codecs, kWidevineBaseKeySystem }, | 87 { "video/mp4", kWidevineVideoMp4Codecs, kWidevineBaseKeySystem }, |
88 { "audio/mp4", kWidevineAudioMp4Codecs, kWidevineKeySystem }, | 88 { "audio/mp4", kWidevineAudioMp4Codecs, kWidevineKeySystem }, |
89 { "audio/mp4", kWidevineAudioMp4Codecs, kWidevineBaseKeySystem }, | 89 { "audio/mp4", kWidevineAudioMp4Codecs, kWidevineBaseKeySystem }, |
90 #endif // defined(WIDEVINE_CDM_CENC_SUPPORT_AVAILABLE) | 90 #endif // defined(WIDEVINE_CDM_CENC_SUPPORT_AVAILABLE) |
91 #endif // defined(GOOGLE_CHROME_BUILD) || defined(USE_PROPRIETARY_CODECS) | 91 #endif // defined(USE_PROPRIETARY_CODECS) |
92 #endif // WIDEVINE_CDM_AVAILABLE | 92 #endif // WIDEVINE_CDM_AVAILABLE |
93 }; | 93 }; |
94 | 94 |
95 const int kNumSupportedFormatKeySystemCombinations = | 95 const int kNumSupportedFormatKeySystemCombinations = |
96 arraysize(kSupportedFormatKeySystemCombinations); | 96 arraysize(kSupportedFormatKeySystemCombinations); |
97 | 97 |
98 #if defined(ENABLE_PEPPER_CDMS) | 98 #if defined(ENABLE_PEPPER_CDMS) |
99 const KeySystemPepperTypePair kKeySystemToPepperTypeMapping[] = { | 99 const KeySystemPepperTypePair kKeySystemToPepperTypeMapping[] = { |
100 { kExternalClearKeyKeySystem, "application/x-ppapi-clearkey-cdm"}, | 100 { kExternalClearKeyKeySystem, "application/x-ppapi-clearkey-cdm"}, |
101 #if defined(WIDEVINE_CDM_AVAILABLE) | 101 #if defined(WIDEVINE_CDM_AVAILABLE) |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 return "Widevine"; | 153 return "Widevine"; |
154 #endif // WIDEVINE_CDM_AVAILABLE | 154 #endif // WIDEVINE_CDM_AVAILABLE |
155 return "Unknown"; | 155 return "Unknown"; |
156 } | 156 } |
157 | 157 |
158 bool CanUseBuiltInAesDecryptor(const std::string& key_system) { | 158 bool CanUseBuiltInAesDecryptor(const std::string& key_system) { |
159 return key_system == kClearKeyKeySystem; | 159 return key_system == kClearKeyKeySystem; |
160 } | 160 } |
161 | 161 |
162 } // namespace content | 162 } // namespace content |
OLD | NEW |