- add sources.
[platform/framework/web/crosswalk.git] / src / content / renderer / media / crypto / key_systems.h
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
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_RENDERER_MEDIA_CRYPTO_KEY_SYSTEMS_H_
6 #define CONTENT_RENDERER_MEDIA_CRYPTO_KEY_SYSTEMS_H_
7
8 #include <string>
9 #include <vector>
10
11 #include "base/memory/scoped_ptr.h"
12 #include "content/common/content_export.h"
13
14 namespace WebKit {
15 class WebString;
16 }
17
18 namespace content {
19
20 // Returns whether |key_system| is a real supported key system that can be
21 // instantiated.
22 // Abstract parent |key_system| strings will return false.
23 // Call IsSupportedKeySystemWithMediaMimeType() to determine whether a
24 // |key_system| supports a specific type of media or to check parent key
25 // systems.
26 CONTENT_EXPORT bool IsConcreteSupportedKeySystem(
27     const WebKit::WebString& key_system);
28
29 // Returns whether |key_sytem| supports the specified media type and codec(s).
30 CONTENT_EXPORT bool IsSupportedKeySystemWithMediaMimeType(
31     const std::string& mime_type,
32     const std::vector<std::string>& codecs,
33     const std::string& key_system);
34
35 // Returns a name for |key_system| suitable to UMA logging.
36 CONTENT_EXPORT std::string KeySystemNameForUMA(
37     const WebKit::WebString& key_system);
38
39 // Returns whether AesDecryptor can be used for the given |concrete_key_system|.
40 CONTENT_EXPORT bool CanUseAesDecryptor(const std::string& concrete_key_system);
41
42 #if defined(ENABLE_PEPPER_CDMS)
43 // Returns the Pepper MIME type for |concrete_key_system|.
44 // Returns empty string if |concrete_key_system| is unknown or not Pepper-based.
45 CONTENT_EXPORT std::string GetPepperType(
46     const std::string& concrete_key_system);
47 #elif defined(OS_ANDROID)
48 // Convert |concrete_key_system| to 16-byte Android UUID.
49 CONTENT_EXPORT std::vector<uint8> GetUUID(
50     const std::string& concrete_key_system);
51 #endif
52
53 }  // namespace content
54
55 #endif  // CONTENT_RENDERER_MEDIA_CRYPTO_KEY_SYSTEMS_H_