Winapi 激活媒体解码器时拒绝访问

Winapi 激活媒体解码器时拒绝访问,winapi,ms-media-foundation,dxva,Winapi,Ms Media Foundation,Dxva,我正在尝试编写一个程序,使用IMFTransform来解码HEVC视频。我能够创建一个imf转换解码器,用MF_MT_MAJOR_TYPE=MFMediaType_Video和MF_MT_SUBTYPE=MFVideoFormat_HEVC调用SetInputType,但当我用MFVideoFormat_NV12调用SetOutputType时,我找到了MF_E_attributenofn 最终我决定尝试从MicrosoftStore安装“HEVC视频扩展”,但现在我的代码在IMFActivat

我正在尝试编写一个程序,使用IMFTransform来解码HEVC视频。我能够创建一个imf转换解码器,用MF_MT_MAJOR_TYPE=MFMediaType_Video和MF_MT_SUBTYPE=MFVideoFormat_HEVC调用SetInputType,但当我用MFVideoFormat_NV12调用SetOutputType时,我找到了MF_E_attributenofn

最终我决定尝试从MicrosoftStore安装“HEVC视频扩展”,但现在我的代码在IMFActivate::ActivateObject失败,并返回错误E_ACCESSDENIED

// WindowsProject6.cpp : Defines the entry point for the application.
//

#include <iostream>
#include <initguid.h>
#include <mfapi.h>
#include <mftransform.h>
#include <combaseapi.h>
#include <d3d11.h>
#include <optional>
#include <Mferror.h>

int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
                     _In_opt_ HINSTANCE hPrevInstance,
                     _In_ LPWSTR    lpCmdLine,
                     _In_ int       nCmdShow)
{
    UNREFERENCED_PARAMETER(hPrevInstance);
    UNREFERENCED_PARAMETER(lpCmdLine);

    MFT_REGISTER_TYPE_INFO inputInfo{ MFMediaType_Video , MFVideoFormat_HEVC };
    MFT_REGISTER_TYPE_INFO outputInfo{ MFMediaType_Video , MFVideoFormat_NV12 };
    //CLSID* clsIds;
    //unsigned int numClsIds = 255;
    IMFActivate** activates;
    unsigned int numActivates = 255;

    CoInitialize(NULL);

    //auto result2 = MFTEnum(MFT_CATEGORY_VIDEO_DECODER, 0, &inputInfo, nullptr, nullptr, &clsIds, &numClsIds);
    auto result = MFTEnumEx(MFT_CATEGORY_VIDEO_DECODER, MFT_ENUM_FLAG_SYNCMFT, &inputInfo, nullptr, &activates, &numActivates);
    if (result != S_OK) {
      std::cout << "MFTEnum failed" << std::endl;
      std::terminate();
    }

    std::cout << numActivates << std::endl;

    if (!numActivates) {
      std::cout << "No HEVC decoders found" << std::endl;
      std::terminate();
    }

    IMFTransform* decoder;
    result = activates[0]->ActivateObject(IID_PPV_ARGS(&decoder));
    if (result != S_OK) {
      std::cout << "ActivateObject failed" << std::endl;
      std::terminate();
    }
}

这似乎表明问题在于我不是在编写UWP应用程序,而是在编写Win32桌面程序。我的目标是最终扩展现有的Win32程序,使UWP不再是一个选项。另外,在安装HEVC扩展之前,我没有遇到这个错误

更新:


我在我拥有的另一台计算机上运行了我的程序,在那里它运行得很好。“该流程没有软件包标识”也出现在那里,但似乎没有问题。

Microsoft应用商店中有一个关于该产品的“支持”链接。关于这个问题,你联系过供应商吗?在哪里?我正在Microsoft商店中查看“HEVC视频扩展”,但找不到它。在桌面形状因子上,它是右下角的顶部链接。我在“发布者信息”下找到了“HEVC视频扩展支持”,但它只带我到建议社区支持的页面,来自Microsoft或windows帮助应用程序的付费支持。是否必须尝试打包你的应用程序?即使您不打算使用Microsoft store。
 info:Windows::Services::Store::StoreContextFactory::GetDefault() invoked. (CV:JU3c8WzRMkqe8jy+.2)  [Windows::Services::Store::StoreContextFactory::GetDefault]
'WindowsProject5.exe' (Win32): Loaded 'C:\Windows\System32\OneCoreUAPCommonProxyStub.dll'. 
 info:StoreContextServer::Initialize: packageFullName = , productStoreId = , isLicensed = false, isAppContainer = false [Windows::Services::Store::Internal::StoreContextServer::Initialize]
 info:Windows::Services::Store::StoreContext::AcquireStoreLicenseForOptionalPackageAsync invoked. (CV:JU3c8WzRMkqe8jy+.2.3) [Windows::Services::Store::StoreContext::AcquireStoreLicenseForOptionalPackageAsync]
ERROR:  (0x80070057)    [ClientProcessUtils::GetCallingAppPackageFamilyName]
'WindowsProject5.exe' (Win32): Loaded 'C:\Windows\System32\usermgrcli.dll'. 
ERROR:  (0x80070057)    [ClientProcessUtils::GetCallingAppPackageFamilyName]
'WindowsProject5.exe' (Win32): Loaded 'C:\Windows\System32\AppContracts.dll'. 
'WindowsProject5.exe' (Win32): Loaded 'C:\Windows\System32\UserMgrProxy.dll'. 
'WindowsProject5.exe' (Win32): Loaded 'C:\Windows\System32\Windows.Shell.ServiceHostBuilder.dll'. 
'WindowsProject5.exe' (Win32): Loaded 'C:\Windows\System32\OnDemandBrokerClient.dll'. 
onecoreuap\base\appmodel\appcontracts\lib\odbexecutor.cpp(115)\AppContracts.dll!00007FFEA083664B: (caller: 00007FFEA07E4A35) ReturnHr(1) tid(3dbc) 80073D54 The process has no package identity.
    CallContext:[\AppServiceBackgroundTask]