enum.patch (1114B)
1 diff --git a/content_decryption_module.h b/content_decryption_module.h 2 --- a/content_decryption_module.h 3 +++ b/content_decryption_module.h 4 @@ -18,6 +18,8 @@ typedef __int64 int64_t; 5 #include <stdint.h> 6 #endif 7 8 +#include "mozilla/DefineEnum.h" 9 + 10 // The version number must be rolled when the exported functions are updated! 11 // If the CDM and the adapter use different versions of these functions, the 12 // adapter will fail to load or crash! 13 @@ -75,15 +77,15 @@ CDM_API const char* GetCdmVersion(); 14 15 namespace cdm { 16 17 -enum Status : uint32_t { 18 - kSuccess = 0, 19 +MOZ_DEFINE_ENUM_WITH_BASE_AND_TOSTRING(Status, uint32_t, ( 20 + kSuccess, 21 kNeedMoreData, // Decoder needs more data to produce a decoded frame/sample. 22 kNoKey, // The required decryption key is not available. 23 kInitializationError, // Initialization error. 24 kDecryptError, // Decryption failed. 25 kDecodeError, // Error decoding audio or video. 26 kDeferredInitialization // Decoder is not ready for initialization. 27 -}; 28 +)); 29 CHECK_TYPE(Status, 4, 4); 30 31 // Exceptions used by the CDM to reject promises.