Source release 15.2.0
This commit is contained in:
@@ -21,7 +21,8 @@ using video_widevine::WidevinePsshData_EntitledKey;
|
||||
// Holds all content and operator session keys for a session.
|
||||
class LicenseKeys {
|
||||
public:
|
||||
LicenseKeys() {}
|
||||
LicenseKeys(CdmSecurityLevel security_level)
|
||||
: security_level_(security_level) {}
|
||||
virtual ~LicenseKeys() { Clear(); }
|
||||
|
||||
virtual bool Empty() { return key_statuses_.empty(); }
|
||||
@@ -54,6 +55,9 @@ class LicenseKeys {
|
||||
// to the key, returns true.
|
||||
virtual bool MeetsConstraints(const KeyId& key_id);
|
||||
|
||||
// Indicates whether specified key can be used for the sessions security level
|
||||
virtual bool MeetsSecurityLevelConstraints(const KeyId& key_id);
|
||||
|
||||
// Applies a resolution and/or hdcp change to each key, updating their
|
||||
// useability under their constraints.
|
||||
virtual void ApplyConstraints(uint32_t new_resolution,
|
||||
@@ -67,10 +71,15 @@ class LicenseKeys {
|
||||
virtual void SetEntitledKeys(
|
||||
const std::vector<WidevinePsshData_EntitledKey>& keys);
|
||||
|
||||
// For test use: Sets the OEMCrypto security level
|
||||
virtual void SetSecurityLevelForTest(CdmSecurityLevel security_level) {
|
||||
security_level_ = security_level;
|
||||
}
|
||||
|
||||
private:
|
||||
typedef ::video_widevine::License::KeyContainer KeyContainer;
|
||||
typedef std::map<wvcdm::KeyId, LicenseKeyStatus*>::const_iterator
|
||||
LicenseKeyStatusIterator;
|
||||
using KeyContainer = ::video_widevine::License::KeyContainer;
|
||||
using LicenseKeyStatusIterator =
|
||||
std::map<wvcdm::KeyId, LicenseKeyStatus*>::const_iterator;
|
||||
|
||||
void Clear();
|
||||
|
||||
@@ -83,6 +92,8 @@ class LicenseKeys {
|
||||
// key status from |key_statuses_| when using entitlement key licensing.
|
||||
std::map<KeyId, KeyId> content_keyid_to_entitlement_key_id_;
|
||||
|
||||
CdmSecurityLevel security_level_;
|
||||
|
||||
CORE_DISALLOW_COPY_AND_ASSIGN(LicenseKeys);
|
||||
};
|
||||
|
||||
@@ -114,25 +125,30 @@ class LicenseKeyStatus {
|
||||
// Note: this will return true until the first call to ApplyConstraints().
|
||||
virtual bool MeetsConstraints() const { return meets_constraints_; }
|
||||
|
||||
// Indicates whether a key can be used for a given security level
|
||||
virtual bool MeetsSecurityLevelConstraints() const {
|
||||
return meets_security_level_constraints_;
|
||||
}
|
||||
|
||||
// Applies the given changes in resolution or HDCP settings.
|
||||
virtual void ApplyConstraints(uint32_t new_resolution,
|
||||
CryptoSession::HdcpCapability new_hdcp_level);
|
||||
|
||||
protected:
|
||||
typedef ::video_widevine::License::KeyContainer KeyContainer;
|
||||
typedef KeyContainer::OperatorSessionKeyPermissions
|
||||
OperatorSessionKeyPermissions;
|
||||
typedef KeyContainer::OutputProtection OutputProtection;
|
||||
typedef KeyContainer::VideoResolutionConstraint VideoResolutionConstraint;
|
||||
typedef ::google::protobuf::RepeatedPtrField<VideoResolutionConstraint>
|
||||
ConstraintList;
|
||||
using KeyContainer = ::video_widevine::License::KeyContainer;
|
||||
using OperatorSessionKeyPermissions =
|
||||
KeyContainer::OperatorSessionKeyPermissions;
|
||||
using OutputProtection = KeyContainer::OutputProtection;
|
||||
using VideoResolutionConstraint = KeyContainer::VideoResolutionConstraint;
|
||||
using ConstraintList =
|
||||
::google::protobuf::RepeatedPtrField<VideoResolutionConstraint>;
|
||||
|
||||
LicenseKeyStatus(const KeyContainer& key);
|
||||
LicenseKeyStatus(const KeyContainer& key, const CdmSecurityLevel level);
|
||||
|
||||
virtual ~LicenseKeyStatus() {}
|
||||
|
||||
private:
|
||||
void ParseContentKey(const KeyContainer& key);
|
||||
void ParseContentKey(const KeyContainer& key, CdmSecurityLevel level);
|
||||
void ParseOperatorSessionKey(const KeyContainer& key);
|
||||
|
||||
bool HasConstraints() { return is_content_key_ && constraints_.size() != 0; }
|
||||
@@ -142,6 +158,7 @@ class LicenseKeyStatus {
|
||||
bool is_content_key_;
|
||||
CdmKeyStatus key_status_;
|
||||
bool meets_constraints_;
|
||||
bool meets_security_level_constraints_;
|
||||
CdmKeyAllowedUsage allowed_usage_;
|
||||
CryptoSession::HdcpCapability default_hdcp_level_;
|
||||
ConstraintList constraints_;
|
||||
|
||||
Reference in New Issue
Block a user