首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >"dxvaeapi.h“错误

"dxvaeapi.h“错误
EN

Stack Overflow用户
提问于 2011-05-26 20:45:36
回答 2查看 583关注 0票数 0

我写了一个小代码来找到Direct3D设备管理器,

代码语言:javascript
复制
HRESULT FindDeviceManager(
IMFTopology *pTopology,         // Topology to search.
IUnknown **ppDeviceManager,     // Receives a pointer to the device manager.
IMFTopologyNode **ppNode        // Receives a pointer to the node.
)
{
HRESULT hr = S_OK;
WORD cNodes = 0;
BOOL bFound = FALSE;

IMFTopologyNode *pNode = NULL;
IUnknown *pNodeObject = NULL;
IDirect3DDeviceManager9 *pD3DManager = NULL;

// Search all of the nodes in the topology.

hr = pTopology->GetNodeCount(&cNodes);

if (FAILED(hr))
{
    return hr;
}

for (WORD i = 0; i < cNodes; i++)
{
    // For each of the following calls, failure just means we 
    // did not find the node we're looking for, so keep looking. 

    hr = pTopology->GetNode(i, &pNode);

    // Get the node's object pointer.
    if (SUCCEEDED(hr))
    {
        hr = pNode->GetObject(&pNodeObject);
    }

    // Query the node object for the device manager service.
    if (SUCCEEDED(hr))
    {
        hr = MFGetService(
            pNodeObject, 
            MR_VIDEO_ACCELERATION_SERVICE, 
            IID_PPV_ARGS(&pD3DManager)
            );
    }

    if (SUCCEEDED(hr))
    {
        // Found the right node. Return the pointers to the caller.
        *ppDeviceManager = (IUnknown *)pD3DManager;
        (*ppDeviceManager)->AddRef();

        *ppNode = pNode;
        (*ppNode)->AddRef();

        bFound = TRUE;
        break;
    }

    SafeRelease(&pNodeObject);
    SafeRelease(&pD3DManager);
    SafeRelease(&pNode);

} // End of for loop.

SafeRelease(&pNodeObject);
SafeRelease(&pD3DManager);
SafeRelease(&pNode);

return bFound ? S_OK : E_FAIL;
}

在编译上面的代码时,我得到了以下错误:

代码语言:javascript
复制
 1>c:\program files\microsoft sdks\windows\v7.1\include\dxva2api.h(404) : error C4430: 
 missing type specifier - int assumed. Note: C++ does not support default-int

我查看了第404行的dxva2api.h,

代码语言:javascript
复制
 typedef struct _DXVA2_VideoProcessorCaps
 {
  UINT DeviceCaps;
  D3DPOOL InputPool;  //--> this is line number 404.

参数D3DPOOL在“d3d9tyes.h”中定义,但不包括在"dxva2api.h“中。我尝试修改dxva2api.h,但操作失败。如何解决这个问题?有什么建议吗?

提前谢谢你,

Sri

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2011-05-26 21:23:46

是否包含标题"d3d9.h“?

他们也看到了这一点.http://msdn.microsoft.com/en-us/library/ff552897%28v=vs.85%29.aspx

票数 0
EN

Stack Overflow用户

发布于 2012-12-19 08:47:02

对于MR_VIDEO_ACCELERATION_SERVICE,您需要包含evr.h并链接到strmiids.lib。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/6138685

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档