| 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.h" | 5 #include "content/renderer/media/crypto/key_systems.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 const char kVorbis[] = "vorbis"; | 29 const char kVorbis[] = "vorbis"; |
| 30 const char kVorbisVP8[] = "vorbis,vp8,vp8.0"; | 30 const char kVorbisVP8[] = "vorbis,vp8,vp8.0"; |
| 31 | 31 |
| 32 #if defined(USE_PROPRIETARY_CODECS) | 32 #if defined(USE_PROPRIETARY_CODECS) |
| 33 const char kAudioMp4[] = "audio/mp4"; | 33 const char kAudioMp4[] = "audio/mp4"; |
| 34 const char kVideoMp4[] = "video/mp4"; | 34 const char kVideoMp4[] = "video/mp4"; |
| 35 const char kMp4a[] = "mp4a"; | 35 const char kMp4a[] = "mp4a"; |
| 36 const char kMp4aAvc1Avc3[] = "mp4a,avc1,avc3"; | 36 const char kMp4aAvc1Avc3[] = "mp4a,avc1,avc3"; |
| 37 #endif // defined(USE_PROPRIETARY_CODECS) | 37 #endif // defined(USE_PROPRIETARY_CODECS) |
| 38 | 38 |
| 39 #if !defined(GOOGLE_TV) | |
| 40 inline std::string KeySystemNameForUMAInternal( | 39 inline std::string KeySystemNameForUMAInternal( |
| 41 const blink::WebString& key_system) { | 40 const blink::WebString& key_system) { |
| 42 if (key_system == kClearKeyKeySystem) | 41 if (key_system == kClearKeyKeySystem) |
| 43 return "ClearKey"; | 42 return "ClearKey"; |
| 44 #if defined(WIDEVINE_CDM_AVAILABLE) | 43 #if defined(WIDEVINE_CDM_AVAILABLE) |
| 45 if (key_system == kWidevineKeySystem) | 44 if (key_system == kWidevineKeySystem) |
| 46 return "Widevine"; | 45 return "Widevine"; |
| 47 #endif // WIDEVINE_CDM_AVAILABLE | 46 #endif // WIDEVINE_CDM_AVAILABLE |
| 48 return "Unknown"; | 47 return "Unknown"; |
| 49 } | 48 } |
| 50 #else | |
| 51 // Declares the function, which is defined in another file. | |
| 52 std::string KeySystemNameForUMAInternal(const blink::WebString& key_system); | |
| 53 #endif // !defined(GOOGLE_TV) | |
| 54 | 49 |
| 55 // Convert a WebString to ASCII, falling back on an empty string in the case | 50 // Convert a WebString to ASCII, falling back on an empty string in the case |
| 56 // of a non-ASCII string. | 51 // of a non-ASCII string. |
| 57 static std::string ToASCIIOrEmpty(const blink::WebString& string) { | 52 static std::string ToASCIIOrEmpty(const blink::WebString& string) { |
| 58 return IsStringASCII(string) ? UTF16ToASCII(string) : std::string(); | 53 return IsStringASCII(string) ? UTF16ToASCII(string) : std::string(); |
| 59 } | 54 } |
| 60 | 55 |
| 61 static void AddClearKey(std::vector<KeySystemInfo>* concrete_key_systems) { | 56 static void AddClearKey(std::vector<KeySystemInfo>* concrete_key_systems) { |
| 62 KeySystemInfo info(kClearKeyKeySystem); | 57 KeySystemInfo info(kClearKeyKeySystem); |
| 63 | 58 |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 std::string GetPepperType(const std::string& concrete_key_system) { | 381 std::string GetPepperType(const std::string& concrete_key_system) { |
| 387 return KeySystems::GetInstance().GetPepperType(concrete_key_system); | 382 return KeySystems::GetInstance().GetPepperType(concrete_key_system); |
| 388 } | 383 } |
| 389 #elif defined(OS_ANDROID) | 384 #elif defined(OS_ANDROID) |
| 390 std::vector<uint8> GetUUID(const std::string& concrete_key_system) { | 385 std::vector<uint8> GetUUID(const std::string& concrete_key_system) { |
| 391 return KeySystems::GetInstance().GetUUID(concrete_key_system); | 386 return KeySystems::GetInstance().GetUUID(concrete_key_system); |
| 392 } | 387 } |
| 393 #endif | 388 #endif |
| 394 | 389 |
| 395 } // namespace content | 390 } // namespace content |
| OLD | NEW |