How to get a topology node's friendly name?

I am writing an application that needs to reveal the details of a topology.

Q:How can I get the friendly names of File/URL Sources, MFTs and a Media Sink(Renderer).
eg: Enhanced Video Renderer to Video Media Sink - everything like what shows in graphedit.exe in direct show.

There seems to be no direct member functions of IMFTopologyNode to display friendly names and I've tried to get the attribute by using IMFAttributes, however, I couldn't find appropriate GUIDs to accomplish this. And I couldn't find any function call like IBaseFilter::QueryFilterInfo used in DirectShow.



Answer this question

How to get a topology node's friendly name?

  • SuzMSDN

    Yup, I did use that "whenever possible" qualifier on purpose :-)

    I bet you're looking at the decryptor node. In a protected-playback topology, this would be the node between the source node and the decoder. The decoder should have a CLSID associated with it. The reason for this is simply that decoders are picked up through the MFTEnum process, which trolls the registry key HKEY_CURRENT_ROOT\MediaFoundation\Transforms for an appropriate-looking decoder, and the CLSID is right there. Decryptor MFTs, on the other hand, are provided by the Input Trust Authority (ITA), and that ITA gets to determine entirely how this object is created; in other words, it may not even have a CLSID for all you know.

    We don't, unfortunately, have a standard attribute to tag a decrypter as such. Best I can offer is to check for the case where the upstream node is handling protected content.

    As for how to prevent the decryptor from being loaded, well, I don't see why you'd want to. I suppose you could just build your topologies entirely by hand (i.e. not use MF's default topology loader), and then you'd know exactly which MFTs you're putting in, but that doesn't seem worth it.

    And you can pretty much assume that the MF topology loader is going to pull in only MFTs that are necessary for this topology to work.

    Hope that all helps...



  • Wing Lee

    Hi Becky,

    Thank you very much for your prompt reply. It helped me a lot.

    I noticed that you wrote "whenever possible they will be tagged with the MF_TOPONODE_TRANSFORM_OBECTID"
    After I tried in my application, I found actually some MFTs have no Object ID in my topology to playback a protected WMV file and thus I cannot get these MFTs detailed information, including Name,Input/Output type, etc.

    Here I would like to ask several more questions:
    1. How can I know the features of these MFTs that have no CLSID
    2. How can I prevent such unknown MFTs from being loaded
    3. How can I know which MFTs are necessary when building a full topology

    It seems to me that the Topology in MF is a mystery now.

    Best regards,

    James


  • Valst

    I got exact 2 nodes that have no CLSIDs. I guess they are decrypters for Audio stream and Video stream.

    Thank you very much for your replys. They are very helpful.

    James.


  • TimStspry

    Hi James,

    Unfortunately, MF topology nodes don't have friendly names.

    Now it happens that in MF, it's the application who puts into place all of the source and sink nodes, and possibly some of the MFT nodes as well. Therefore, since the application knows what kind of node it wants (like a video renderer), it could tag the node with a custom attribute with a friendly name it can later refer to. As for nodes inserted by the topology loader in MF, whenever possible they will be tagged with the MF_TOPONODE_TRANSFORM_OBECTID, whose value will be the CLSID for the MFT (from which you could look up a friendly name). I know that isn't quite as easy as just querying for a friendly name, but I hope that helps.



  • How to get a topology node's friendly name?