On 6/15/20 4:41 AM, Sergio Gómez Del Real wrote:
- /* register a converter to test source -> mft -> sink */
- hr = CoRegisterClassObject(&test_conv_clsid, (IUnknown*)&ClassFactoryConv, CLSCTX_INPROC_SERVER, REGCLS_MULTIPLEUSE, ®);
- ok(hr == S_OK, "Failed to register class object, hr %#x.\n");
- typeinfo.guidMajorType = MFMediaType_Audio;
- typeinfo.guidSubtype = MFAudioFormat_ZZZ;
- hr = MFTRegisterLocalByCLSID(&test_conv_clsid, &MFT_CATEGORY_AUDIO_DECODER, str, MFT_ENUM_FLAG_ASYNCMFT, 1, &typeinfo, 1, &typeinfo);
- ok(hr == S_OK, "Failed to register mft, hr %#x.\n");
With MFTRegisterLocal() you won't need to register class object. I don't think ASYNCMFT is essential here, right? We don't currently support async transforms anywhere, so it's better to use default flags.
- hr = MFTUnregister(test_conv_clsid);
- ok(hr == S_OK, "Failed to unregister mft, hr %#x.\n");
- hr = CoRevokeClassObject(reg);
- ok(hr == S_OK, "Failed to unregister class object, hr %#x.\n");
MFTUnregister() is used for globally registered transforms.