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.
5 #ifndef CONTENT_RENDERER_MEDIA_CRYPTO_KEY_SYSTEMS_H_
6 #define CONTENT_RENDERER_MEDIA_CRYPTO_KEY_SYSTEMS_H_
11 #include "base/memory/scoped_ptr.h"
12 #include "content/common/content_export.h"
20 // Returns whether |key_system| is a real supported key system that can be
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
26 CONTENT_EXPORT bool IsConcreteSupportedKeySystem(
27 const WebKit::WebString& key_system);
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);
35 // Returns a name for |key_system| suitable to UMA logging.
36 CONTENT_EXPORT std::string KeySystemNameForUMA(
37 const WebKit::WebString& key_system);
39 // Returns whether AesDecryptor can be used for the given |concrete_key_system|.
40 CONTENT_EXPORT bool CanUseAesDecryptor(const std::string& concrete_key_system);
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);
53 } // namespace content
55 #endif // CONTENT_RENDERER_MEDIA_CRYPTO_KEY_SYSTEMS_H_