| 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 "media/base/key_systems.h" | 5 #include "media/base/key_systems.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/containers/hash_tables.h" | 9 #include "base/containers/hash_tables.h" |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/strings/string_util.h" | 13 #include "base/strings/string_util.h" |
| 14 #include "base/threading/thread_checker.h" | 14 #include "base/threading/thread_checker.h" |
| 15 #include "base/time/time.h" | 15 #include "base/time/time.h" |
| 16 #include "build/build_config.h" | 16 #include "build/build_config.h" |
| 17 #include "media/base/key_system_info.h" | 17 #include "media/base/key_system_info.h" |
| 18 #include "media/base/media_client.h" | 18 #include "media/base/media_client.h" |
| 19 #include "media/cdm/key_system_names.h" | 19 #include "media/cdm/key_system_names.h" |
| 20 #include "media/media_features.h" |
| 20 #include "third_party/widevine/cdm/widevine_cdm_common.h" | 21 #include "third_party/widevine/cdm/widevine_cdm_common.h" |
| 21 | 22 |
| 22 namespace media { | 23 namespace media { |
| 23 | 24 |
| 24 const char kClearKeyKeySystem[] = "org.w3.clearkey"; | 25 const char kClearKeyKeySystem[] = "org.w3.clearkey"; |
| 25 | 26 |
| 26 // These names are used by UMA. Do not change them! | 27 // These names are used by UMA. Do not change them! |
| 27 const char kClearKeyKeySystemNameForUMA[] = "ClearKey"; | 28 const char kClearKeyKeySystemNameForUMA[] = "ClearKey"; |
| 28 const char kUnknownKeySystemNameForUMA[] = "Unknown"; | 29 const char kUnknownKeySystemNameForUMA[] = "Unknown"; |
| 29 | 30 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 46 | 47 |
| 47 // Mapping between codec names and enum values. | 48 // Mapping between codec names and enum values. |
| 48 static const NamedCodec kCodecStrings[] = { | 49 static const NamedCodec kCodecStrings[] = { |
| 49 {"opus", EME_CODEC_WEBM_OPUS}, // Opus. | 50 {"opus", EME_CODEC_WEBM_OPUS}, // Opus. |
| 50 {"vorbis", EME_CODEC_WEBM_VORBIS}, // Vorbis. | 51 {"vorbis", EME_CODEC_WEBM_VORBIS}, // Vorbis. |
| 51 {"vp8", EME_CODEC_WEBM_VP8}, // VP8. | 52 {"vp8", EME_CODEC_WEBM_VP8}, // VP8. |
| 52 {"vp8.0", EME_CODEC_WEBM_VP8}, // VP8. | 53 {"vp8.0", EME_CODEC_WEBM_VP8}, // VP8. |
| 53 {"vp9", EME_CODEC_WEBM_VP9}, // VP9. | 54 {"vp9", EME_CODEC_WEBM_VP9}, // VP9. |
| 54 {"vp9.0", EME_CODEC_WEBM_VP9}, // VP9. | 55 {"vp9.0", EME_CODEC_WEBM_VP9}, // VP9. |
| 55 #if defined(USE_PROPRIETARY_CODECS) | 56 #if defined(USE_PROPRIETARY_CODECS) |
| 57 #if BUILDFLAG(ENABLE_MP4_VP9_DEMUXING) |
| 58 {"vp09", EME_CODEC_MP4_VP9}, // VP9 in MP4. |
| 59 #endif |
| 56 {"mp4a", EME_CODEC_MP4_AAC}, // AAC. | 60 {"mp4a", EME_CODEC_MP4_AAC}, // AAC. |
| 57 {"avc1", EME_CODEC_MP4_AVC1}, // AVC1. | 61 {"avc1", EME_CODEC_MP4_AVC1}, // AVC1. |
| 58 {"avc3", EME_CODEC_MP4_AVC1} // AVC3. | 62 {"avc3", EME_CODEC_MP4_AVC1} // AVC3. |
| 59 #endif // defined(USE_PROPRIETARY_CODECS) | 63 #endif // defined(USE_PROPRIETARY_CODECS) |
| 60 }; | 64 }; |
| 61 | 65 |
| 62 static EmeRobustness ConvertRobustness(const std::string& robustness) { | 66 static EmeRobustness ConvertRobustness(const std::string& robustness) { |
| 63 if (robustness.empty()) | 67 if (robustness.empty()) |
| 64 return EmeRobustness::EMPTY; | 68 return EmeRobustness::EMPTY; |
| 65 if (robustness == "SW_SECURE_CRYPTO") | 69 if (robustness == "SW_SECURE_CRYPTO") |
| (...skipping 708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 774 uint32_t mask) { | 778 uint32_t mask) { |
| 775 KeySystemsImpl::GetInstance()->AddCodecMask(media_type, codec, mask); | 779 KeySystemsImpl::GetInstance()->AddCodecMask(media_type, codec, mask); |
| 776 } | 780 } |
| 777 | 781 |
| 778 MEDIA_EXPORT void AddMimeTypeCodecMask(const std::string& mime_type, | 782 MEDIA_EXPORT void AddMimeTypeCodecMask(const std::string& mime_type, |
| 779 uint32_t mask) { | 783 uint32_t mask) { |
| 780 KeySystemsImpl::GetInstance()->AddMimeTypeCodecMask(mime_type, mask); | 784 KeySystemsImpl::GetInstance()->AddMimeTypeCodecMask(mime_type, mask); |
| 781 } | 785 } |
| 782 | 786 |
| 783 } // namespace media | 787 } // namespace media |
| OLD | NEW |