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
--- 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;
}