Bug 1318965 - Allow GMPs to specify that they use the Widevine adapter, use it for clearkey. r?cpearce draft
authorChris Pearce <cpearce@mozilla.com>
Mon, 21 Nov 2016 11:41:21 +1300
changeset 452073 2f9b09cb8e15a29d9698a0b2512fc007ec654a3d
parent 451656 7083c0d30e75fc102c715887af9faec933e936f8
child 452074 47bccc70263d7c945b4ef30d7357dc3f40387d76
push id39320
push userbmo:jharris@mozilla.com
push dateWed, 21 Dec 2016 05:00:07 +0000
reviewerscpearce
bugs1318965
milestone53.0a1
Bug 1318965 - Allow GMPs to specify that they use the Widevine adapter, use it for clearkey. r?cpearce MozReview-Commit-ID: FrcZTijk36e
dom/media/gmp/GMPParent.cpp
media/gmp-clearkey/0.1/clearkey.info.in
--- 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