Home | History | Annotate | Download | only in crypto
      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 blink {
     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 blink::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 blink::WebString& key_system);
     38 CONTENT_EXPORT std::string KeySystemNameForUMA(const std::string& key_system);
     39 
     40 // Returns whether AesDecryptor can be used for the given |concrete_key_system|.
     41 CONTENT_EXPORT bool CanUseAesDecryptor(const std::string& concrete_key_system);
     42 
     43 #if defined(ENABLE_PEPPER_CDMS)
     44 // Returns the Pepper MIME type for |concrete_key_system|.
     45 // Returns empty string if |concrete_key_system| is unknown or not Pepper-based.
     46 CONTENT_EXPORT std::string GetPepperType(
     47     const std::string& concrete_key_system);
     48 #elif defined(OS_ANDROID)
     49 // Convert |concrete_key_system| to 16-byte Android UUID.
     50 CONTENT_EXPORT std::vector<uint8> GetUUID(
     51     const std::string& concrete_key_system);
     52 #endif
     53 
     54 }  // namespace content
     55 
     56 #endif  // CONTENT_RENDERER_MEDIA_CRYPTO_KEY_SYSTEMS_H_
     57