Bug 1318965 - Allow GMPs to specify that they use the Widevine adapter, use it for clearkey. r?cpearce
MozReview-Commit-ID: FrcZTijk36e
--- a/dom/media/gmp/GMPParent.cpp
+++ b/dom/media/gmp/GMPParent.cpp
@@ -846,16 +846,20 @@ GMPParent::ReadGMPInfoFile(nsIFile* aFil
return GenericPromise::CreateAndReject(NS_ERROR_FAILURE, __func__);
}
#ifdef XP_WIN
// "Libraries" field is optional.
ReadInfoField(parser, NS_LITERAL_CSTRING("libraries"), mLibs);
#endif
+ nsAutoCString adapter;
+ ReadInfoField(parser, NS_LITERAL_CSTRING("adapter"), adapter);
+ mAdapter = NS_ConvertUTF8toUTF16(adapter);
+
nsTArray<nsCString> apiTokens;
SplitAt(", ", apis, apiTokens);
for (nsCString api : apiTokens) {
int32_t tagsStart = api.FindChar('[');
if (tagsStart == 0) {
// Not allowed to be the first character.
// API name must be at least one character.
continue;
--- a/media/gmp-clearkey/0.1/clearkey.info.in
+++ b/media/gmp-clearkey/0.1/clearkey.info.in
@@ -3,8 +3,9 @@ Description: ClearKey Gecko Media Plugin
Version: 1
#ifdef ENABLE_WMF
APIs: eme-decrypt-v9[org.w3.clearkey], decode-video[h264:org.w3.clearkey]
Libraries: dxva2.dll, d3d9.dll, msmpeg2vdec.dll, msmpeg2adec.dll, MSAudDecMFT.dll, evr.dll, mfheaacdec.dll, mfh264dec.dll, mfplat.dll
#else
APIs: eme-decrypt-v9[org.w3.clearkey]
Libraries:
#endif
+Adapter: widevine