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
|