blob: 1f31b9f7735b867af04573230c0f432b51fcf104 [file] [log] [blame]
halliwell8f42dd52016-04-29 16:06:331// Copyright 2016 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 COMPONENTS_CDM_RENDERER_WIDEVINE_KEY_SYSTEM_PROPERTIES_H_
6#define COMPONENTS_CDM_RENDERER_WIDEVINE_KEY_SYSTEM_PROPERTIES_H_
7
John Rummell6d57d9f62018-05-16 21:12:298#include <string>
9#include <vector>
10
11#include "base/containers/flat_set.h"
halliwell8f42dd52016-04-29 16:06:3312#include "media/base/key_system_properties.h"
halliwell8f42dd52016-04-29 16:06:3313
14namespace cdm {
15
16// Implementation of KeySystemProperties for Widevine key system.
17class WidevineKeySystemProperties : public media::KeySystemProperties {
18 public:
halliwell98237dc2016-06-01 02:10:5019 // Robustness values understood by the Widevine key system.
20 // Note: GetRobustnessConfigRule is dependent on the order of these.
21 enum class Robustness {
22 INVALID,
23 EMPTY,
24 SW_SECURE_CRYPTO,
25 SW_SECURE_DECODE,
26 HW_SECURE_CRYPTO,
27 HW_SECURE_DECODE,
28 HW_SECURE_ALL,
29 };
30
halliwell8f42dd52016-04-29 16:06:3331 WidevineKeySystemProperties(
John Rummell6d57d9f62018-05-16 21:12:2932 base::flat_set<media::EncryptionMode> supported_encryption_schemes,
halliwell8f42dd52016-04-29 16:06:3333 media::SupportedCodecs supported_codecs,
Xiaohan Wang648b4322018-06-12 21:52:2834 media::SupportedCodecs supported_hw_secure_codecs,
halliwell98237dc2016-06-01 02:10:5035 Robustness max_audio_robustness,
36 Robustness max_video_robustness,
halliwell8f42dd52016-04-29 16:06:3337 media::EmeSessionTypeSupport persistent_license_support,
38 media::EmeSessionTypeSupport persistent_release_message_support,
39 media::EmeFeatureSupport persistent_state_support,
40 media::EmeFeatureSupport distinctive_identifier_support);
John Rummell6d57d9f62018-05-16 21:12:2941 ~WidevineKeySystemProperties() override;
halliwell8f42dd52016-04-29 16:06:3342
43 std::string GetKeySystemName() const override;
44 bool IsSupportedInitDataType(
45 media::EmeInitDataType init_data_type) const override;
John Rummell6d57d9f62018-05-16 21:12:2946 bool IsEncryptionSchemeSupported(
47 media::EncryptionMode encryption_scheme) const override;
halliwell8f42dd52016-04-29 16:06:3348
49 media::SupportedCodecs GetSupportedCodecs() const override;
Xiaohan Wang648b4322018-06-12 21:52:2850 media::SupportedCodecs GetSupportedHwSecureCodecs() const override;
halliwell8f42dd52016-04-29 16:06:3351
52 media::EmeConfigRule GetRobustnessConfigRule(
53 media::EmeMediaType media_type,
54 const std::string& requested_robustness) const override;
55 media::EmeSessionTypeSupport GetPersistentLicenseSessionSupport()
56 const override;
57 media::EmeSessionTypeSupport GetPersistentReleaseMessageSessionSupport()
58 const override;
59 media::EmeFeatureSupport GetPersistentStateSupport() const override;
60 media::EmeFeatureSupport GetDistinctiveIdentifierSupport() const override;
61
halliwell8f42dd52016-04-29 16:06:3362 private:
John Rummell6d57d9f62018-05-16 21:12:2963 const base::flat_set<media::EncryptionMode> supported_encryption_schemes_;
halliwell8f42dd52016-04-29 16:06:3364 const media::SupportedCodecs supported_codecs_;
Xiaohan Wang648b4322018-06-12 21:52:2865 const media::SupportedCodecs supported_hw_secure_codecs_;
halliwell98237dc2016-06-01 02:10:5066 const Robustness max_audio_robustness_;
67 const Robustness max_video_robustness_;
halliwell8f42dd52016-04-29 16:06:3368 const media::EmeSessionTypeSupport persistent_license_support_;
69 const media::EmeSessionTypeSupport persistent_release_message_support_;
70 const media::EmeFeatureSupport persistent_state_support_;
71 const media::EmeFeatureSupport distinctive_identifier_support_;
72};
73
74} // namespace cdm
75
76#endif // COMPONENTS_CDM_RENDERER_WIDEVINE_KEY_SYSTEM_PROPERTIES_H_