diff --git a/dom/media/gmp/widevine-adapter/content_decryption_module.h b/dom/media/gmp/widevine-adapter/content_decryption_module.h --- a/dom/media/gmp/widevine-adapter/content_decryption_module.h +++ b/dom/media/gmp/widevine-adapter/content_decryption_module.h @@ -16,12 +16,10 @@ typedef __int64 int64_t; #else #include #endif -#include "mozilla/DefineEnum.h" - // The version number must be rolled when the exported functions are updated! // If the CDM and the adapter use different versions of these functions, the // adapter will fail to load or crash! #define CDM_MODULE_VERSION 4 @@ -75,19 +73,19 @@ } // extern "C" namespace cdm { -MOZ_DEFINE_ENUM_WITH_BASE_AND_TOSTRING(Status, uint32_t, ( - kSuccess, +enum Status : uint32_t { + kSuccess = 0, kNeedMoreData, // Decoder needs more data to produce a decoded frame/sample. kNoKey, // The required decryption key is not available. kInitializationError, // Initialization error. kDecryptError, // Decryption failed. kDecodeError, // Error decoding audio or video. kDeferredInitialization // Decoder is not ready for initialization. -)); +}; CHECK_TYPE(Status, 4, 4); // Exceptions used by the CDM to reject promises. // https://w3c.github.io/encrypted-media/#exceptions enum Exception : uint32_t { @@ -364,10 +362,27 @@ kStatusPending = 5, kReleased = 6 }; CHECK_TYPE(KeyStatus, 4, 4); +// The current status of the associated key. The valid types are defined in the +// spec: https://w3c.github.io/encrypted-media/#dom-mediakeystatus +// Note: For forward compatibility, Host implementations must gracefully handle +// unexpected (new) enum values, e.g. no-op. This is used by the CDM Interfaces +// starting from CDM_12. +enum KeyStatus_2 : uint32_t { + kUsable = 0, + kInternalError = 1, + kExpired = 2, + kOutputRestricted = 3, + kOutputDownscaled = 4, + kStatusPending = 5, + kReleased = 6, + kUsableInFuture = 7 +}; +CHECK_TYPE(KeyStatus_2, 4, 4); + // Used when passing arrays of key information. Does not own the referenced // data. |system_code| is an additional error code for unusable keys and // should be 0 when |status| == kUsable. struct KeyInformation { const uint8_t* key_id; @@ -375,10 +390,21 @@ KeyStatus status; uint32_t system_code; }; CHECK_TYPE(KeyInformation, 16, 24); +// Used when passing arrays of key information. Does not own the referenced +// data. |system_code| is an additional error code for unusable keys and +// should be 0 when |status| == kUsable. Used by CDM12 and beyond. +struct KeyInformation_2 { + const uint8_t* key_id; + uint32_t key_id_size; + KeyStatus_2 status; + uint32_t system_code; +}; +CHECK_TYPE(KeyInformation_2, 16, 24); + // Supported output protection methods for use with EnableOutputProtection() and // returned by OnQueryOutputProtectionStatus(). enum OutputProtectionMethods : uint32_t { kProtectionNone = 0, kProtectionHDCP = 1 << 0 @@ -409,12 +435,11 @@ // The type of session to create. The valid types are defined in the spec: // https://w3c.github.io/encrypted-media/#dom-mediakeysessiontype enum SessionType : uint32_t { kTemporary = 0, - kPersistentLicense = 1, - kPersistentUsageRecord = 2 + kPersistentLicense = 1 }; CHECK_TYPE(SessionType, 4, 4); // The type of the message event. The valid types are defined in the spec: // https://w3c.github.io/encrypted-media/#dom-mediakeymessagetype @@ -1623,11 +1648,11 @@ virtual void OnInitialized(bool success) = 0; // Called by the CDM when a key status is available in response to // GetStatusForPolicy(). virtual void OnResolveKeyStatusPromise(uint32_t promise_id, - KeyStatus key_status) = 0; + KeyStatus_2 key_status) = 0; // Called by the CDM when a session is created or loaded and the value for the // MediaKeySession's sessionId attribute is available (|session_id|). // This must be called before OnSessionMessage() or // OnSessionKeysChange() is called for the same session. |session_id_size| @@ -1668,11 +1693,11 @@ // current status. |keys_info_count| is the number of entries in |keys_info|. // Size parameter for |session_id| should not include null termination. virtual void OnSessionKeysChange(const char* session_id, uint32_t session_id_size, bool has_additional_usable_key, - const KeyInformation* keys_info, + const KeyInformation_2* keys_info, uint32_t keys_info_count) = 0; // Called by the CDM when there has been a change in the expiration time for // session |session_id|. This can happen as the result of an Update() call // or some other event. If this happens as a result of a call to Update(), diff --git a/dom/media/gmp/widevine-adapter/moz.yaml b/dom/media/gmp/widevine-adapter/moz.yaml --- a/dom/media/gmp/widevine-adapter/moz.yaml +++ b/dom/media/gmp/widevine-adapter/moz.yaml @@ -10,13 +10,13 @@ url: "https://chromium.googlesource.com/chromium/cdm" license: BSD-3-Clause license-file: OWNERS - release: 06395a2863cb1ebdb47617a995b73f95c14fe120 (Thu Dec 26 19:52:02 2024). + release: 61466e6bb3462e4fc16a1dbf65af0b2d5338980a (Wed Jan 29 19:25:28 2025). - revision: 06395a2863cb1ebdb47617a995b73f95c14fe120 + revision: 61466e6bb3462e4fc16a1dbf65af0b2d5338980a updatebot: maintainer-phab: aosmond maintainer-bz: aosmond@mozilla.com tasks: