OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "webkit/media/crypto/key_systems.h" | 5 #include "webkit/media/crypto/key_systems.h" |
6 | 6 |
7 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebCString.h
" | 7 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebCString.h
" |
8 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" | 8 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" |
9 | 9 |
10 namespace webkit_media { | 10 namespace webkit_media { |
(...skipping 30 matching lines...) Expand all Loading... |
41 { "video/webm", "vorbis", kExternalClearKeyKeySystem }, | 41 { "video/webm", "vorbis", kExternalClearKeyKeySystem }, |
42 { "video/webm", "vp8", kExternalClearKeyKeySystem }, | 42 { "video/webm", "vp8", kExternalClearKeyKeySystem }, |
43 { "video/webm", "vp8.0", kExternalClearKeyKeySystem }, | 43 { "video/webm", "vp8.0", kExternalClearKeyKeySystem }, |
44 { "audio/webm", "vorbis", kExternalClearKeyKeySystem }, | 44 { "audio/webm", "vorbis", kExternalClearKeyKeySystem }, |
45 { "video/webm", "", kExternalClearKeyKeySystem }, | 45 { "video/webm", "", kExternalClearKeyKeySystem }, |
46 { "audio/webm", "", kExternalClearKeyKeySystem } | 46 { "audio/webm", "", kExternalClearKeyKeySystem } |
47 }; | 47 }; |
48 | 48 |
49 static const KeySystemPluginTypePair key_system_to_plugin_type_mapping[] = { | 49 static const KeySystemPluginTypePair key_system_to_plugin_type_mapping[] = { |
50 // TODO(xhwang): Update this with the real plugin name. | 50 // TODO(xhwang): Update this with the real plugin name. |
51 { kExternalClearKeyKeySystem, "application/x-ppapi-example" } | 51 { kExternalClearKeyKeySystem, "application/x-ppapi-content-encryption" } |
52 }; | 52 }; |
53 | 53 |
54 static bool IsSupportedKeySystemWithContainerAndCodec( | 54 static bool IsSupportedKeySystemWithContainerAndCodec( |
55 const std::string& mime_type, | 55 const std::string& mime_type, |
56 const std::string& codec, | 56 const std::string& codec, |
57 const std::string& key_system) { | 57 const std::string& key_system) { |
58 for (size_t i = 0; | 58 for (size_t i = 0; |
59 i < arraysize(supported_format_key_system_combinations); | 59 i < arraysize(supported_format_key_system_combinations); |
60 ++i) { | 60 ++i) { |
61 const MediaFormatAndKeySystem& combination = | 61 const MediaFormatAndKeySystem& combination = |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 std::string GetPluginType(const std::string& key_system) { | 97 std::string GetPluginType(const std::string& key_system) { |
98 for (size_t i = 0; i < arraysize(key_system_to_plugin_type_mapping); ++i) { | 98 for (size_t i = 0; i < arraysize(key_system_to_plugin_type_mapping); ++i) { |
99 if (key_system_to_plugin_type_mapping[i].key_system == key_system) | 99 if (key_system_to_plugin_type_mapping[i].key_system == key_system) |
100 return key_system_to_plugin_type_mapping[i].plugin_type; | 100 return key_system_to_plugin_type_mapping[i].plugin_type; |
101 } | 101 } |
102 | 102 |
103 return std::string(); | 103 return std::string(); |
104 } | 104 } |
105 | 105 |
106 } // namespace webkit_media | 106 } // namespace webkit_media |
OLD | NEW |