我在哪里可以获得IID_IDirect3DDeviceManager9接口? [英] where do I get the IID_IDirect3DDeviceManager9 interface?

查看:92
本文介绍了我在哪里可以获得IID_IDirect3DDeviceManager9接口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


你能告诉我让IDirect3DDeviceManager9接口使用DXVA设置视频解码器的步骤吗?


I使用MFTEnumEx方法获取H.264视频的视频解码器变换接口(IMFTransform)。 之后,我尝试从此IMFTransform接口获取属性并检查MF_SA_D3D_AWARE设置。



IMFAttributes * pAttributes = NULL ; $
hr = decoder-> GetAttributes(& pAttributes);

if(MFGetAttributeUINT32(pAttributes,MF_SA_D3D_AWARE,false))

  ;  hr = pAttributes-> SetUINT32(CODECAPI_AVDecVideoAcceleration_H264,TRUE);




作为进一步的步骤,我想我需要IID_IDirect3DDeviceManager9接口。这是正确的,我从哪里获得IID_IDirect3DDeviceManager9接口?在其他示例中,在我看来,ProcessMessage调用将设置这样的接口。但我
还没有将IMFTransform接口子类化。这是否需要建立DXVA解码器?  



IDirect3DDeviceManager9 * manager = nullptr;


HRESULT hr = decoder-> ProcessMessage(MFT_MESSAGE_SET_D3D_MANAGER ,

       reinterpret_cast< ULONG_PTR>(经理));


hr = decoder-> QueryInterface(IID_IDirect3DDeviceManager9,(void **)& manager);


最后一次调用失败并返回代码,不支持此类接口。



最好的问候


saoirse

解决方案

您好


在播放中( ) ;渲染) 场景您可以从EVR获得设备管理器。如果您使用的是自定义接收器/渲染器,那么您就是负责在该自定义类中创建设备和管理器的人。


在录制(编码) 场景您是负责创建设备和管理器的人。编码有两种方式:


1。在自定义源中创建设备和管理器,并实施IMFGetService。构建拓扑时,请调用MFGetService以启动设备管理器。减去这一点是Media Sessions Topoloader不知道在源节点上使用MFGetService
,它只知道在输出节点(如EVR)上使用它。这意味着你必须构建一个"完整拓扑"。手工。


2。您可以在应用中创建设备和管理器,然后在涉及的每个转换上设置管理器。如果涉及您的自定义来源,您必须实施IMFMediaSourceEx并调用SetD3DManager。


-



"将解码器添加到拓扑"
示例向您展示如何使用"FindDeviceManager"检索设备管理器功能。如在播放场景中所述,您将在输出节点(EVR)上找到管理器。在编码方案
中,如果您的Source是自定义编写的,并且是Direct3D设备的代理,您可以在源节点上找到它。如果您没有直接从Direct3D进行编码,但想要在编码方案中使用它(DXVA),那么您必须使用选项2,我的意思是
以上(在您的应用中创建设备和管理器,然后在每个涉及的转换上设置它。)


问候,


Francis











$ b

Hi,

could you tell me the steps to get the IDirect3DDeviceManager9 interface to setup the video decoder using DXVA?

I use the MFTEnumEx method to get the video decoder transform interface (IMFTransform) for H.264 videos.  After that I try to get the attributes from this IMFTransform interface and check the MF_SA_D3D_AWARE setting.

IMFAttributes* pAttributes = NULL;
hr = decoder->GetAttributes (&pAttributes);
if (MFGetAttributeUINT32 (pAttributes, MF_SA_D3D_AWARE, false))
   hr = pAttributes->SetUINT32 (CODECAPI_AVDecVideoAcceleration_H264, TRUE);


As a further step, I think I need the IID_IDirect3DDeviceManager9 interface. Is this correct and where do I get the IID_IDirect3DDeviceManager9 interface? In other examples, it seems to me that the ProcessMessage call will setup such an interface. But I have not subclassed the IMFTransform interface. Is this necessary to establish a DXVA decoder?  

IDirect3DDeviceManager9* manager = nullptr;

HRESULT hr = decoder->ProcessMessage (MFT_MESSAGE_SET_D3D_MANAGER,
        reinterpret_cast<ULONG_PTR>(manager));

hr = decoder->QueryInterface (IID_IDirect3DDeviceManager9, (void **)&manager);

The last call fails with the return code, that no such interface is supported.

best regards

saoirse

解决方案

Hi

In a Playback ( Rendering ) Scenario you get the Device Manager from the EVR. If you are using a custom Sink/Renderer, then you are the one responsible for creating the Device and the Manager inside that custom class.

In a Recording ( Encoding ) Scenario you are the one responsible for creating the Device and the Manager. There are 2 ways for Encoding :

1. Create Device and Manager inside a Custom Source and implement IMFGetService. When you build a topology call MFGetService to get your hands on the Device Manager. The minus of this is that the Media Sessions Topoloader has no idea of using MFGetService on Source nodes, it only knows about using it on Output nodes ( like an EVR ). That means you have to build a "Full Topology" by hand.

2. You can create Device and Manager in your App and then set the Manager on every Transform involved. If a Custom Source of yours is involved you have to implement IMFMediaSourceEx and call SetD3DManager.

-

The "Adding a Decoder to a Topology" example shows you how to retrieve the Device Manager using the "FindDeviceManager" function. As said in a Playback Scenario you will find the Manager on the Output node ( EVR ). In an Encoding Scenario you would find it on the Source node, if your Source is custom written and a Proxy to a Direct3D Device. If you are not encoding from Direct3D directly but want to use it ( DXVA ) in between in an Encoding Scenario, then you have to take Option 2 i meantioned above ( Create the Device and the Manager in your app and then set it on every Transform involved ).

Regards,

Francis










这篇关于我在哪里可以获得IID_IDirect3DDeviceManager9接口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆