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,10 +16,12 @@ 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 @@ -73,19 +75,19 @@ } // extern "C" namespace cdm { -enum Status : uint32_t { - kSuccess = 0, +MOZ_DEFINE_ENUM_WITH_BASE_AND_TOSTRING(Status, uint32_t, ( + kSuccess, 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 {