Bug 1143278 - Support IYUV and I420 in gmp-clearkey on Windows, as Win 7 Enterprise N's H.264 decoder doesn't output I420. r=edwin, a=sledru
authorChris Pearce <cpearce@mozilla.com>
Mon, 13 Apr 2015 13:39:56 +1200
changeset 258473 3beb9cbddb3f
parent 258472 dfce472edd1e
child 258474 f5d0342230c0
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 - Support IYUV and I420 in gmp-clearkey on Windows, as Win 7 Enterprise N's H.264 decoder doesn't output I420. r=edwin, a=sledru
media/gmp-clearkey/0.1/WMFH264Decoder.cpp
--- a/media/gmp-clearkey/0.1/WMFH264Decoder.cpp
+++ b/media/gmp-clearkey/0.1/WMFH264Decoder.cpp
@@ -153,17 +153,20 @@ WMFH264Decoder::SetDecoderOutputType()
 
   UINT32 typeIndex = 0;
   while (type = nullptr, SUCCEEDED(mDecoder->GetOutputAvailableType(0, typeIndex++, &type))) {
     GUID subtype;
     hr = type->GetGUID(MF_MT_SUBTYPE, &subtype);
     if (FAILED(hr)) {
       continue;
     }
-    if (subtype == MFVideoFormat_I420) {
+    if (subtype == MFVideoFormat_I420 || subtype == MFVideoFormat_IYUV) {
+      // On Windows 7 Enterprise N the MFT reports it reports IYUV instead
+      // of I420. Other Windows' report I420. The formats are the same, so
+      // support both.
       hr = mDecoder->SetOutputType(0, type, 0);
       ENSURE(SUCCEEDED(hr), hr);
 
       hr = ConfigureVideoFrameGeometry(type);
       ENSURE(SUCCEEDED(hr), hr);
 
       return S_OK;
     }