MFT_MESSAGE_SET_D3D_MANAGER  
Author Message
Fei-tian





PostPosted: Media Foundation Development, MFT_MESSAGE_SET_D3D_MANAGER Top

Hi, all:

How can I get MFT_MESSAGE_SET_D3D_MANAGER from ProcessMessage in a MFT
And where to assign MF_TOPONODE_D3DAWARE and MF_SA_D3D_AWARE attributes

BTW, is it possible a MediaSource to get the D3DManager interface

Thanks

Fei-tian




Audio and Video Development3  
 
 
Becky Weiss - MSFT





PostPosted: Media Foundation Development, MFT_MESSAGE_SET_D3D_MANAGER Top

Here's how that works:

When you're using the MF Media Session's topology-loading functionality (i.e. IMFMediaSession::SetTopology without the NORESOLUTION flag), the support for this D3D negotiation is limited to the case where the decoder is D3D-aware and is directly upstream of the D3D-aware sink (i.e. the Enhanced Video Renderer (EVR)). In this case, the decoder MFT has the MF_SA_D3D_AWARE attribute set, and Media Foundation takes care of sending it the MFT_MESSAGE_SET_D3D_MANAGER message. Once that's done, MF sets the MF_TOPONODE_D3DAWARE attribute on the topology node for that decoder MFT, which tells the processing pipeline that allocation has already been negotiated at this node.

I presume from your question, however, that you are trying to set up a topology with some other D3D-aware MFT node. If I'm right about that, then you'll need to do your own topology resolution, or at least the D3D part of it. You can either just resolve the topology yourself, or (probably easier), use the MF-provided IMFTopoLoader (do MFCreateTopoLoader) to resolve the topology, and then do your D3D steps:

* Do an IMFGetService::GetService on the Stream Sink object from the output node for MR_VIDEO_ACCELERATION_SERVICE, with the IID_IDirect3DDeviceManager9 IID.

* Send your D3D-aware MFT a GetMessage with the MFT_MESSAGE_SET_D3D_MANAGER message

* Mark that MFT node (not the MFT itself) with MF_TOPONODE_D3DAWARE.

After you do that, you'll want to do IMFMediaSession::SetTopology with the MFSESSION_SETTOPOLOGY_NORESOLUTION flag to indicate that you have already resolved the topology.

Good luck!

Becky



 
 
Fei-tian





PostPosted: Media Foundation Development, MFT_MESSAGE_SET_D3D_MANAGER Top

Hello,

where does the MF_SA_D3D_AWARE attribute set
TopologyNode Stream Activiate MFT

Thanks.

MJ



 
 
Becky Weiss - MSFT





PostPosted: Media Foundation Development, MFT_MESSAGE_SET_D3D_MANAGER Top

On the MFT (i.e. on the IMFAttributes from IMFTransform::GetAttributes).

Like I said, though, setting this attribute on the MFT's attributes store will get the MF topology loader to do what you want automatically only in the case where this MFT is a decoder and it is directly upstream of the sink. Any other D3D combinations, you'll need to do at least the D3D-setup part of the topology loader's work yourself.

Becky



 
 
MF Newbie





PostPosted: Media Foundation Development, MFT_MESSAGE_SET_D3D_MANAGER Top

I have same issue here...

IMFTransform::GetAttributes is NEVER called on my transform.
I don't know what's wrong.
I tried to set MF_SA_XXX on all IMFAttributes interfaces I can touch
in IMFTransform but still this message is never passed.