"Class not registered" 在 Windows 上加载视频处理器 MFT 时 7

"Class not registered" when loading the Video Processor MFT on Windows 7

我有以下 COM 调用:

IMFTransform* pMFT = NULL;
HRESULT hr = CoCreateInstance(CLSID_VideoProcessorMFT, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&pMFT));

在我的开发机器上,对 CoCreateInstance 的调用成功。 但是,当我在我的旧 Windows 7 机器上部署它时, 对 CoCreateInstance 的调用失败, 我不知道为什么。 这是我显示错误的方式:

_com_error err(hr);
LPCTSTR hrErrMsg = err.ErrorMessage();
WCHAR msg[MAX_PATH];
StringCbPrintf(msg, sizeof(msg), L"HRESULT=0x%X, %s", errContext, hrErr, hrErrMsg);
MessageBox(hwnd, msg, L"Error", MB_ICONERROR);

这是我在该消息框中收到的错误:

HRESULT=0x80040154, Class not registered

the Video Processor MFT 的 COM class 未注册。 我看到 CLSID_VideoProcessorMFT 定义为:

EXTERN_GUID(CLSID_VideoProcessorMFT, 0x88753b26, 0x5b24, 0x49bd, 0xb2, 0xe7, 0xc, 0x44, 0x5c, 0x78, 0xc9, 0x82);

这是伪装的 GUID 88753B26-5B24-49bd-B2E7-0C445C78C982。 我知道 COM classes 是在 Windows 注册表中注册的,其密钥包含此 GUID。 在我的开发机器上使用注册表编辑器,我可以看到密钥:

HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{88753B26-5B24-49bd-B2E7-0C445C78C982}

并且此键的 "Default" 值为 %SystemRoot%\System32\msvproc.dll, 参考文件路径 C:\Windows\System32\msvproc.dll, 确实存在。

在我的旧 Windows 7 机器上,注册表中的这个键值不存在 -- 正如预期的那样,给出 "Class not registered" 错误。 C:\Windows\System32\msvproc.dll 处没有文件。 但这就是线索变冷的地方。 我不知道应该在注册表中注册 class 什么, 以及为什么它没有 运行 在我的旧 Windows 7 机器上。

可能的结论:

以下哪个是正确的结论?是否可以在 Windows 7 上加载视频处理器 MFT?如果是,怎么办?

即使older documentation for Video Processor MFT does not mention availability restrictions, they can still be assumed from related content:

Requirements

Minimum supported client: Windows 8 Release Preview

Minimum supported server: Windows Server 2012

针对早期版本 Windows 的应用程序可能会使用 other DSPs,例如颜色控制变换 DSP 和颜色转换器 DSP。这些 were/are 虽然没有 GPU 加速。

视频处理器 MFT 的优势在于它支持使用 Microsoft Direct3D 11 的 GPU 加速视频处理。

(这是对@SimonMourier 非常有帮助的评论的扩展,对于未来的读者来说,因为它对我来说是全新的。)

我相信 CLSID_VideoProcessorMFT 可用如下:

  • 对于 "Windows Desktop Applications" 在 >= Windows 8.1
  • 对于 "Windows Store Applications" 在 >= Windows 10
  • 对于 "Windows Phone Applications" 在 >= Windows 10

头文件 mfidl.h 记录了引入了特定 COM class 的 Windows 版本。按照 CLSID_VideoProcessorMFT 的定义,我发现:

#if (WINVER >= _WIN32_WINNT_WINTHRESHOLD) 
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
// ...
EXTERN_GUID(CLSID_VideoProcessorMFT, 0x88753b26, 0x5b24, 0x49bd, 0xb2, 0xe7, 0xc, 0x44, 0x5c, 0x78, 0xc9, 0x82);
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */
#endif // (WINVER >= _WIN32_WINNT_WINTHRESHOLD) 
// ...
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
#if (WINVER >= _WIN32_WINNT_WINBLUE) 
#if (WINVER < _WIN32_WINNT_WINTHRESHOLD) 
EXTERN_GUID(CLSID_VideoProcessorMFT, 0x88753b26, 0x5b24, 0x49bd, 0xb2, 0xe7, 0xc, 0x44, 0x5c, 0x78, 0xc9, 0x82);
#endif // (WINVER < _WIN32_WINNT_WINTHRESHOLD) 
#endif // (WINVER >= _WIN32_WINNT_WINBLUE) 
// ...
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */

通过跟踪和解码所有这些宏,我得到了上面的可用性列表。