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 450150 538e1e0b0a6affcf5999bdc9a5a979f1181177ff
parent 447934 d8f63b2935af0915a6a24b3ea8e27d9a09f66416
child 450151 3798ddf9c7931b3bf736c629a9b73aac644bc18f
child 450163 08dee5815ed05c06bc1c1ad1e7052f10ce9e9977
child 450181 b31bd4e1b4937770f420059efee69f658646b7f7
push id38764
push userbmo:jharris@mozilla.com
push dateFri, 16 Dec 2016 02:13:54 +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