Bug 1143278 - Use a different CLSID to instantiate the H264 decoder MFT in gmp-clearkey, as Win 7 Enterprise N requires that. r=edwin, a=sledru
authorChris Pearce <cpearce@mozilla.com>
Mon, 13 Apr 2015 13:39:53 +1200
changeset 258472 dfce472edd1e
parent 258471 5779893b39a5
child 258473 3beb9cbddb3f
push id4676
push userryanvm@gmail.com
push date2015-04-15 02:06 +0000
treeherdermozilla-beta@91df81e2edac [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersedwin, sledru
bugs1143278
milestone38.0
Bug 1143278 - Use a different CLSID to instantiate the H264 decoder MFT in gmp-clearkey, as Win 7 Enterprise N requires that. r=edwin, a=sledru
media/gmp-clearkey/0.1/WMFH264Decoder.cpp
media/gmp-clearkey/0.1/WMFUtils.cpp
media/gmp-clearkey/0.1/WMFUtils.h
--- a/media/gmp-clearkey/0.1/WMFH264Decoder.cpp
+++ b/media/gmp-clearkey/0.1/WMFH264Decoder.cpp
@@ -33,16 +33,23 @@ WMFH264Decoder::~WMFH264Decoder()
 HRESULT
 WMFH264Decoder::Init()
 {
   HRESULT hr;
 
   hr = CreateMFT(__uuidof(CMSH264DecoderMFT),
                  "msmpeg2vdec.dll",
                  mDecoder);
+  if (FAILED(hr)) {
+    // Windows 7 Enterprise Server N (which is what Mozilla's mochitests run
+    // on) need a different CLSID to instantiate the H.264 decoder.
+    hr = CreateMFT(CLSID_CMSH264DecMFT,
+                   "msmpeg2vdec.dll",
+                   mDecoder);
+  }
   ENSURE(SUCCEEDED(hr), hr);
 
   hr = SetDecoderInputType();
   ENSURE(SUCCEEDED(hr), hr);
 
   hr = SetDecoderOutputType();
   ENSURE(SUCCEEDED(hr), hr);
 
--- a/media/gmp-clearkey/0.1/WMFUtils.cpp
+++ b/media/gmp-clearkey/0.1/WMFUtils.cpp
@@ -35,16 +35,18 @@ void LOG(const char* format, ...)
 }
 
 #ifdef WMF_MUST_DEFINE_AAC_MFT_CLSID
 // Some SDK versions don't define the AAC decoder CLSID.
 // {32D186A7-218F-4C75-8876-DD77273A8999}
 DEFINE_GUID(CLSID_CMSAACDecMFT, 0x32D186A7, 0x218F, 0x4C75, 0x88, 0x76, 0xDD, 0x77, 0x27, 0x3A, 0x89, 0x99);
 #endif
 
+DEFINE_GUID(CLSID_CMSH264DecMFT, 0x62CE7E72, 0x4C71, 0x4d20, 0xB1, 0x5D, 0x45, 0x28, 0x31, 0xA8, 0x7D, 0x9D);
+
 namespace wmf {
 
 
 #define MFPLAT_FUNC(_func) \
   decltype(::_func)* _func;
 #include "WMFSymbols.h"
 #undef MFPLAT_FUNC
 
--- a/media/gmp-clearkey/0.1/WMFUtils.h
+++ b/media/gmp-clearkey/0.1/WMFUtils.h
@@ -37,16 +37,18 @@ void LOG(const char* format, ...);
 #define SAMPLE_LOG(...)
 #endif
 
 #ifndef CLSID_CMSAACDecMFT
 #define WMF_MUST_DEFINE_AAC_MFT_CLSID
 extern "C" const CLSID CLSID_CMSAACDecMFT;
 #endif
 
+extern "C" const CLSID CLSID_CMSH264DecMFT;
+
 namespace wmf {
 
 // Reimplementation of CComPtr to reduce dependence on system
 // shared libraries.
 template<class T>
 class CComPtr {
 public:
   CComPtr(CComPtr&& aOther) : mPtr(aOther.Detach()) { }