summaryrefslogtreecommitdiff
path: root/chromium/media/base/key_system_properties.h
blob: 72f59f8fa299d30e52f742f4fc10d4fb3360a344 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef MEDIA_BASE_KEY_SYSTEM_PROPERTIES_H_
#define MEDIA_BASE_KEY_SYSTEM_PROPERTIES_H_

#include <string>

#include "build/build_config.h"
#include "media/base/decrypt_config.h"
#include "media/base/eme_constants.h"
#include "media/base/media_export.h"

namespace media {

// Provides an interface for querying the properties of a registered key system.
class MEDIA_EXPORT KeySystemProperties {
 public:
  virtual ~KeySystemProperties() {}

  // Gets the name of this key system.
  virtual std::string GetKeySystemName() const = 0;

  // Returns whether |init_data_type| is supported by this key system.
  virtual bool IsSupportedInitDataType(
      EmeInitDataType init_data_type) const = 0;

  // Returns the configuration rule for supporting |encryption_scheme|.
  virtual EmeConfigRule GetEncryptionSchemeConfigRule(
      EncryptionMode encryption_scheme) const = 0;

  // Returns the codecs supported by this key system.
  virtual SupportedCodecs GetSupportedCodecs() const = 0;

  // Returns the codecs with hardware-secure support in this key system.
  virtual SupportedCodecs GetSupportedHwSecureCodecs() const;

  // Returns the configuration rule for supporting a robustness requirement.
  virtual EmeConfigRule GetRobustnessConfigRule(
      EmeMediaType media_type,
      const std::string& requested_robustness) const = 0;

  // Returns the support this key system provides for persistent-license
  // sessions.
  virtual EmeSessionTypeSupport GetPersistentLicenseSessionSupport() const = 0;

  // Returns the support this key system provides for persistent-usage-record
  // sessions.
  virtual EmeSessionTypeSupport GetPersistentUsageRecordSessionSupport()
      const = 0;

  // Returns the support this key system provides for persistent state.
  virtual EmeFeatureSupport GetPersistentStateSupport() const = 0;

  // Returns the support this key system provides for distinctive identifiers.
  virtual EmeFeatureSupport GetDistinctiveIdentifierSupport() const = 0;

  // Returns whether AesDecryptor can be used for this key system.
  virtual bool UseAesDecryptor() const;
};

}  // namespace media

#endif  // MEDIA_BASE_KEY_SYSTEM_PROPERTIES_H_